Index: trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 30201)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 30214)
@@ -1158,8 +1158,6 @@
                 {
                     DDRAW_CAPS *pCaps = (DDRAW_CAPS*)pData->pData;
-                    pCaps->Caps |= DDRAW_CAPS_COLORKEY
-                            | DDRAW_CAPS2_DYNAMICTEXTURES
-                            | DDRAW_CAPS2_FLIPNOVSYNC
-                            ;
+                    pCaps->Caps |= DDRAW_CAPS_COLORKEY;
+                    pCaps->Caps2 |= DDRAW_CAPS2_FLIPNOVSYNC;
                 }
 #endif
@@ -1242,5 +1240,5 @@
         case D3DDDICAPS_GETD3D3CAPS:
             Assert(!VBOXDISPMODE_IS_3D(pAdapter));
-            Assert(pData->DataSize >= sizeof (D3DHAL_GLOBALDRIVERDATA));
+            Assert(pData->DataSize == sizeof (D3DHAL_GLOBALDRIVERDATA));
             if (pData->DataSize >= sizeof (D3DHAL_GLOBALDRIVERDATA))
             {
@@ -1255,11 +1253,13 @@
                 pCaps->hwCaps.dcmColorModel = D3DCOLOR_RGB;
                 pCaps->hwCaps.dwDevCaps = D3DDEVCAPS_CANRENDERAFTERFLIP
-                        | D3DDEVCAPS_DRAWPRIMTLVERTEX
+//                        | D3DDEVCAPS_DRAWPRIMTLVERTEX
                         | D3DDEVCAPS_EXECUTESYSTEMMEMORY
-                        | D3DDEVCAPS_FLOATTLVERTEX
+                        | D3DDEVCAPS_EXECUTEVIDEOMEMORY
+//                        | D3DDEVCAPS_FLOATTLVERTEX
                         | D3DDEVCAPS_HWRASTERIZATION
-                        | D3DDEVCAPS_HWTRANSFORMANDLIGHT
-                        | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY
-                        | D3DDEVCAPS_TEXTUREVIDEOMEMORY;
+//                        | D3DDEVCAPS_HWTRANSFORMANDLIGHT
+//                        | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY
+//                        | D3DDEVCAPS_TEXTUREVIDEOMEMORY
+                        ;
                 pCaps->hwCaps.dtcTransformCaps.dwSize = sizeof (D3DTRANSFORMCAPS);
                 pCaps->hwCaps.dtcTransformCaps.dwCaps = 0;
@@ -1298,6 +1298,6 @@
                 pCaps->hwCaps.dpcTriCaps.dwStippleWidth = 0;
                 pCaps->hwCaps.dpcTriCaps.dwStippleHeight = 0;
-                pCaps->hwCaps.dwDeviceRenderBitDepth = 0;
-                pCaps->hwCaps.dwDeviceZBufferBitDepth = DDBD_8 | DDBD_16 | DDBD_24 | DDBD_32;
+                pCaps->hwCaps.dwDeviceRenderBitDepth = DDBD_8 | DDBD_16 | DDBD_24 | DDBD_32;
+                pCaps->hwCaps.dwDeviceZBufferBitDepth = 0;
                 pCaps->hwCaps.dwMaxBufferSize = 0;
                 pCaps->hwCaps.dwMaxVertexCount = 0;
@@ -1306,6 +1306,6 @@
                 pCaps->dwNumVertices = 0;
                 pCaps->dwNumClipVertices = 0;
-                pCaps->dwNumTextureFormats = pAdapter->cSurfDescs;
-                pCaps->lpTextureFormats = pAdapter->paSurfDescs;
+                pCaps->dwNumTextureFormats = 0;//pAdapter->cSurfDescs;
+                pCaps->lpTextureFormats = NULL;//pAdapter->paSurfDescs;
             }
             else
@@ -1314,7 +1314,11 @@
         case D3DDDICAPS_GETD3D7CAPS:
             Assert(!VBOXDISPMODE_IS_3D(pAdapter));
-            Assert(pData->DataSize >= sizeof (D3DHAL_D3DEXTENDEDCAPS));
+            Assert(pData->DataSize == sizeof (D3DHAL_D3DEXTENDEDCAPS));
             if (pData->DataSize >= sizeof (D3DHAL_D3DEXTENDEDCAPS))
+            {
                 memset(pData->pData, 0, sizeof (D3DHAL_D3DEXTENDEDCAPS));
+                D3DHAL_D3DEXTENDEDCAPS *pCaps = (D3DHAL_D3DEXTENDEDCAPS*)pData->pData;
+                pCaps->dwSize = sizeof (D3DHAL_D3DEXTENDEDCAPS);
+            }
             else
                 hr = E_INVALIDARG;
@@ -1397,9 +1401,15 @@
             *((uint32_t*)pData->pData) = 0;
             break;
+        case D3DDDICAPS_GETVIDEOPROCESSORCAPS:
+        case D3DDDICAPS_GETEXTENSIONGUIDCOUNT:
+        case D3DDDICAPS_GETDECODEGUIDCOUNT:
+        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
+            if (pData->pData && pData->DataSize)
+                memset(pData->pData, 0, pData->DataSize);
+            break;
         case D3DDDICAPS_GETMULTISAMPLEQUALITYLEVELS:
         case D3DDDICAPS_GETD3D5CAPS:
         case D3DDDICAPS_GETD3D6CAPS:
         case D3DDDICAPS_GETD3D8CAPS:
-        case D3DDDICAPS_GETDECODEGUIDCOUNT:
         case D3DDDICAPS_GETDECODEGUIDS:
         case D3DDDICAPS_GETDECODERTFORMATCOUNT:
@@ -1409,5 +1419,4 @@
         case D3DDDICAPS_GETDECODECONFIGURATIONCOUNT:
         case D3DDDICAPS_GETDECODECONFIGURATIONS:
-        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
         case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
         case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
@@ -1415,8 +1424,6 @@
         case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
         case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
-        case D3DDDICAPS_GETVIDEOPROCESSORCAPS:
         case D3DDDICAPS_GETPROCAMPRANGE:
         case D3DDDICAPS_FILTERPROPERTYRANGE:
-        case D3DDDICAPS_GETEXTENSIONGUIDCOUNT:
         case D3DDDICAPS_GETEXTENSIONGUIDS:
         case D3DDDICAPS_GETEXTENSIONCAPS:
@@ -2371,5 +2378,5 @@
 
 
-        hr = pDevice->RtCallbacks.pfnLockCb(hDevice, &LockData);
+        hr = pDevice->RtCallbacks.pfnLockCb(pDevice->hDevice, &LockData);
         Assert(hr == S_OK || (hr == D3DERR_WASSTILLDRAWING && pData->Flags.DoNotWait));
         if (hr == S_OK)
@@ -2392,5 +2399,5 @@
             else
             {
-                AssertBreakpoint();
+                offset = 0;
             }
 
@@ -2510,5 +2517,5 @@
         UnlockData.hAllocation = pRc->aAllocations[pData->SubResourceIndex].hAllocation;
 
-        hr = pDevice->RtCallbacks.pfnUnlockCb(hDevice, &UnlockData.Unlock);
+        hr = pDevice->RtCallbacks.pfnUnlockCb(pDevice->hDevice, &UnlockData.Unlock);
         Assert(hr == S_OK);
     }
@@ -3105,11 +3112,15 @@
     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     Assert(pDevice);
-    Assert(pDevice->pDevice9If);
-    HRESULT hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */
-            NULL, /* CONST RECT * pDestRect */
-            NULL, /* HWND hDestWindowOverride */
-            NULL /*CONST RGNDATA * pDirtyRegion */
-            );
-    Assert(hr == S_OK);
+    HRESULT hr = S_OK;
+    if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
+    {
+        Assert(pDevice->pDevice9If);
+        hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */
+                NULL, /* CONST RECT * pDestRect */
+                NULL, /* HWND hDestWindowOverride */
+                NULL /*CONST RGNDATA * pDirtyRegion */
+                );
+        Assert(hr == S_OK);
+    }
     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
     return hr;
