Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
22 Views

How to handle GUID_ZPixelFormats in graphics card driver with Direct3D DirectDraw and DXVA under XDDM

Hi all:

I'm developing a virtual graphics card driver under XDDM.

I have finished the DirectDraw part of the driver, and i can see the DirectDraw is enabled in dxdiag.

Now i'm developing the D3D part, but when i handle GUID_ZPixelFormats in DdGetDriverInfo,  DirectDraw is disabled !

Does anyone know how to handle GUID_ZPixelFormats in DdGetDriverInfo ?

My code:

void DdInitZPixelFormats(PDD_GETDRIVERINFODATA lpGetDriverInfo)
{
    static const DDPIXELFORMAT g_zfmts[] =
    {
        {
            sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0,
            { 16 }, { 0 }, { 0x0000ffff }, { 0x00000000 }, { 0x00000000 }
        },
        {
            sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0,
            { 32 }, { 0 }, { 0x00ffffff }, { 0x00000000 }, { 0x00000000 }
        },
    };
    DWORD num = sizeof(g_zfmts) / sizeof(DDPIXELFORMAT);
    DWORD size = sizeof(g_zfmts);
    UINT8 *buf = (UINT8 *)lpGetDriverInfo->lpvData;
    memcpy(buf, g_zfmts, min(lpGetDriverInfo->dwExpectedSize, sizeof(g_zfmts)));
    lpGetDriverInfo->dwActualSize = size;
    lpGetDriverInfo->ddRVal = DD_OK;
}

0 Kudos
0 Replies