Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 33836)
@@ -108,4 +108,8 @@
 # include <stdio.h>
 #endif
+
+#define VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc) (((pRc)->cAllocations)/6)
+#define VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, idx) ((D3DCUBEMAP_FACES)(D3DCUBEMAP_FACE_POSITIVE_X+(idx)/VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc)))
+#define VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, idx) ((idx)%VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc))
 
 #define VBOXDISP_WITH_WINE_BB_WORKAROUND
@@ -1618,4 +1622,19 @@
             Assert(pD3DIfTex);
             hr = pD3DIfTex->GetSurfaceLevel(iAlloc, &pSurfaceLevel);
+            Assert(hr == S_OK);
+            if (hr == S_OK)
+            {
+                *ppSurf = pSurfaceLevel;
+            }
+            break;
+        }
+        case VBOXDISP_D3DIFTYPE_CUBE_TEXTURE:
+        {
+            Assert(0);
+            IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
+            IDirect3DSurface9 *pSurfaceLevel;
+            Assert(pD3DIfCubeTex);
+            hr = pD3DIfCubeTex->GetCubeMapSurface(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc), 
+                                                  VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc), &pSurfaceLevel);
             Assert(hr == S_OK);
             if (hr == S_OK)
@@ -3410,22 +3429,31 @@
     PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)hTexture;
 //    Assert(pRc);
-    IDirect3DTexture9 *pD3DIfTex;
+    IDirect3DBaseTexture9 *pD3DIfTex;
     if (pRc)
     {
-        Assert(pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE);
-        pD3DIfTex = (IDirect3DTexture9*)pRc->aAllocations[0].pD3DIf;
+        if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE)
+        {
+            pD3DIfTex = (IDirect3DTexture9*)pRc->aAllocations[0].pD3DIf;
 #ifdef DEBUG_misha
-        bool bDo = false;
-
-        if (bDo)
-        {
+            bool bDo = false;
+
+            if (bDo)
+            {
             vboxVDbgDumpSurfData((pDevice, "SetTexture:\n", pRc, 0 /* alloc index*/, NULL, NULL, "\n"));
-        }
-#endif
+            }
+#endif
+        }
+        else if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE)
+        {
+            pD3DIfTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
+        }
+        else
+        {
+            Assert(0);
+        }
     }
     else
         pD3DIfTex = NULL;
 
-//    Assert(pD3DIfTex);
     HRESULT hr = pDevice9If->SetTexture(Stage, pD3DIfTex);
     Assert(hr == S_OK);
@@ -4113,6 +4141,10 @@
                 && pData->SrcRect.bottom - pData->SrcRect.top == pSrcRc->aAllocations[0].SurfDesc.height)
     {
-        IDirect3DTexture9 *pD3DIfSrcTex = (IDirect3DTexture9*)pSrcRc->aAllocations[0].pD3DIf;
-        IDirect3DTexture9 *pD3DIfDstTex = (IDirect3DTexture9*)pDstRc->aAllocations[0].pD3DIf;
+        Assert(pSrcRc->aAllocations[0].enmD3DIfType==VBOXDISP_D3DIFTYPE_TEXTURE
+               || pSrcRc->aAllocations[0].enmD3DIfType==VBOXDISP_D3DIFTYPE_CUBE_TEXTURE);
+        Assert(pDstRc->aAllocations[0].enmD3DIfType==VBOXDISP_D3DIFTYPE_TEXTURE
+               || pDstRc->aAllocations[0].enmD3DIfType==VBOXDISP_D3DIFTYPE_CUBE_TEXTURE);
+        IDirect3DBaseTexture9 *pD3DIfSrcTex = (IDirect3DBaseTexture9*)pSrcRc->aAllocations[0].pD3DIf;
+        IDirect3DBaseTexture9 *pD3DIfDstTex = (IDirect3DBaseTexture9*)pDstRc->aAllocations[0].pD3DIf;
         Assert(pD3DIfSrcTex);
         Assert(pD3DIfDstTex);
@@ -4418,5 +4450,6 @@
 //        Assert(pRc != pScreen->pRenderTargetRc || pScreen->iRenderTargetFrontBuf != pData->SubResourceIndex);
 
-        if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE)
+        if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
+            || pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE)
         {
             PVBOXWDDMDISP_ALLOCATION pTexAlloc = &pRc->aAllocations[0];
@@ -4424,5 +4457,6 @@
             PVBOXWDDMDISP_ALLOCATION pLockAlloc = &pRc->aAllocations[pData->SubResourceIndex];
             IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pTexAlloc->pD3DIf;
-            Assert(pD3DIfTex);
+            IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pTexAlloc->pD3DIf;
+            Assert(pTexAlloc->pD3DIf);
             RECT *pRect = NULL;
             bool bNeedResynch = false;
@@ -4439,8 +4473,19 @@
             if (!pLockAlloc->LockInfo.cLocks)
             {
-                hr = pD3DIfTex->LockRect(pData->SubResourceIndex,
-                        &pLockAlloc->LockInfo.LockedRect,
-                        pRect,
-                        vboxDDI2D3DLockFlags(pData->Flags));
+                if (pTexAlloc->enmD3DIfType==VBOXDISP_D3DIFTYPE_TEXTURE)
+                {
+                    hr = pD3DIfTex->LockRect(pData->SubResourceIndex,
+                            &pLockAlloc->LockInfo.LockedRect,
+                            pRect,
+                            vboxDDI2D3DLockFlags(pData->Flags));
+                }
+                else /*VBOXDISP_D3DIFTYPE_CUBE_TEXTURE*/
+                {
+                    hr = pD3DIfCubeTex->LockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, pData->SubResourceIndex),
+                            VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, pData->SubResourceIndex),
+                            &pLockAlloc->LockInfo.LockedRect,
+                            pRect,
+                            vboxDDI2D3DLockFlags(pData->Flags));
+                }
                 Assert(hr == S_OK);
                 if (hr == S_OK)
@@ -4488,12 +4533,31 @@
                         (pLockAlloc->LockInfo.fFlags.ReadOnly && !pData->Flags.ReadOnly))
                 {
-                    hr = pD3DIfTex->UnlockRect(pData->SubResourceIndex);
+                    if (pTexAlloc->enmD3DIfType==VBOXDISP_D3DIFTYPE_TEXTURE)
+                    {
+                        hr = pD3DIfTex->UnlockRect(pData->SubResourceIndex);
+                    }
+                    else /*VBOXDISP_D3DIFTYPE_CUBE_TEXTURE*/
+                    {
+                        hr = pD3DIfCubeTex->UnlockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, pData->SubResourceIndex),
+                                VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, pData->SubResourceIndex));
+                    }
                     Assert(hr == S_OK);
                     if (hr == S_OK)
                     {
-                        hr = pD3DIfTex->LockRect(pData->SubResourceIndex,
-                                &pLockAlloc->LockInfo.LockedRect,
-                                pRect,
-                                vboxDDI2D3DLockFlags(pData->Flags));
+                        if (pTexAlloc->enmD3DIfType==VBOXDISP_D3DIFTYPE_TEXTURE)
+                        {
+                            hr = pD3DIfTex->LockRect(pData->SubResourceIndex,
+                                    &pLockAlloc->LockInfo.LockedRect,
+                                    pRect,
+                                    vboxDDI2D3DLockFlags(pData->Flags));
+                        }
+                        else /*VBOXDISP_D3DIFTYPE_CUBE_TEXTURE*/
+                        {
+                            hr = pD3DIfCubeTex->LockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, pData->SubResourceIndex),
+                                    VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, pData->SubResourceIndex),
+                                    &pLockAlloc->LockInfo.LockedRect,
+                                    pRect,
+                                    vboxDDI2D3DLockFlags(pData->Flags));
+                        }
                         Assert(hr == S_OK);
                         pLockAlloc->LockInfo.fFlags.ReadOnly = 0;
@@ -4811,5 +4875,6 @@
     if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
     {
-        if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE)
+        if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
+            || pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE)
         {
             Assert(pData->SubResourceIndex < pRc->cAllocations);
@@ -4823,6 +4888,5 @@
                 PVBOXWDDMDISP_ALLOCATION pTexAlloc = &pRc->aAllocations[0];
 //                Assert(!pLockAlloc->LockInfo.cLocks);
-                IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pTexAlloc->pD3DIf;
-                Assert(pD3DIfTex);
+                Assert(pTexAlloc->pD3DIf);
                 /* this is a sysmem texture, update  */
 #if 0
@@ -4834,5 +4898,15 @@
                 }
 #endif
-                hr = pD3DIfTex->UnlockRect(pData->SubResourceIndex);
+                if (pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE)
+                {
+                    IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pTexAlloc->pD3DIf;
+                    hr = pD3DIfTex->UnlockRect(pData->SubResourceIndex);
+                }
+                else
+                {
+                    IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pTexAlloc->pD3DIf;
+                    hr = pD3DIfCubeTex->UnlockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, pData->SubResourceIndex),
+                            VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, pData->SubResourceIndex));
+                }
                 Assert(hr == S_OK);
             }
@@ -5229,17 +5303,19 @@
                 IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
 
+                if (!pResource->Flags.CubeMap)
+                {
 #ifdef DEBUG
-                {
-                    uint32_t tstW = pResource->pSurfList[0].Width;
-                    uint32_t tstH = pResource->pSurfList[0].Height;
-                    for (UINT i = 1; i < pResource->SurfCount; ++i)
                     {
-                        tstW /= 2;
-                        tstH /= 2;
-                        CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[i];
-                        Assert((pSurf->Width == tstW) || (!tstW && (pSurf->Width==1)));
-                        Assert((pSurf->Height == tstH) || (!tstH && (pSurf->Height==1)));
+                        uint32_t tstW = pResource->pSurfList[0].Width;
+                        uint32_t tstH = pResource->pSurfList[0].Height;
+                        for (UINT i = 1; i < pResource->SurfCount; ++i)
+                        {
+                            tstW /= 2;
+                            tstH /= 2;
+                            CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[i];
+                            Assert((pSurf->Width == tstW) || (!tstW && (pSurf->Width==1)));
+                            Assert((pSurf->Height == tstH) || (!tstH && (pSurf->Height==1)));
+                        }
                     }
-                }
 #endif
 
@@ -5247,90 +5323,129 @@
 //                    bIssueCreateResource = true;
 
-                PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
-                CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[0];
-                IDirect3DTexture9 *pD3DIfTex;
-                HANDLE hSharedHandle = NULL;
-                if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM)
-                {
-                    Assert(pSurf->pSysMem);
-                    Assert(pSurf->SysMemPitch);
-                    UINT bpp = vboxWddmCalcBitsPerPixel(pResource->Format);
-                    Assert(bpp);
-                    if (bpp)
+                    PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
+                    CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[0];
+                    IDirect3DTexture9 *pD3DIfTex;
+                    HANDLE hSharedHandle = NULL;
+                    if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM)
                     {
-                        pAllocation->D3DWidth = ((pSurf->SysMemPitch << 3) / bpp);
-                        if ((pSurf->SysMemPitch << 3) % bpp)
+                        Assert(pSurf->pSysMem);
+                        Assert(pSurf->SysMemPitch);
+                        UINT bpp = vboxWddmCalcBitsPerPixel(pResource->Format);
+                        Assert(bpp);
+                        if (bpp)
                         {
-                            Assert(0);
-                            ++pAllocation->D3DWidth;
+                            pAllocation->D3DWidth = ((pSurf->SysMemPitch << 3) / bpp);
+                            if ((pSurf->SysMemPitch << 3) % bpp)
+                            {
+                                Assert(0);
+                                ++pAllocation->D3DWidth;
+                            }
+                            Assert(pAllocation->D3DWidth >= pSurf->Width);
                         }
-                        Assert(pAllocation->D3DWidth >= pSurf->Width);
                     }
-                }
 #if 0
-                hr = pDevice9If->CreateTexture(pSurf->Width,
-                                            pAllocation->D3DWidth,
-                                            pResource->SurfCount,
-                                            vboxDDI2D3DUsage(pResource->Flags),
-                                            vboxDDI2D3DFormat(pResource->Format),
-                                            vboxDDI2D3DPool(pResource->Pool),
-                                            &pD3DIfTex,
-                                            NULL /* HANDLE* pSharedHandle */
-                                            );
+                    hr = pDevice9If->CreateTexture(pSurf->Width,
+                                                pAllocation->D3DWidth,
+                                                pResource->SurfCount,
+                                                vboxDDI2D3DUsage(pResource->Flags),
+                                                vboxDDI2D3DFormat(pResource->Format),
+                                                vboxDDI2D3DPool(pResource->Pool),
+                                                &pD3DIfTex,
+                                                NULL /* HANDLE* pSharedHandle */
+                                                );
 #else
-                hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice9If,
-                                            pAllocation->D3DWidth,
-                                            pSurf->Height,
-                                            pResource->SurfCount,
-                                            vboxDDI2D3DUsage(pResource->Flags),
-                                            vboxDDI2D3DFormat(pResource->Format),
-                                            vboxDDI2D3DPool(pResource->Pool),
-                                            &pD3DIfTex,
-                                            pResource->Flags.SharedResource ? &hSharedHandle : NULL,
-                                            pResource->Pool == D3DDDIPOOL_SYSTEMMEM ? pRc->aAllocations[0].pvMem : NULL);
-#endif
-                Assert(hr == S_OK);
-                if (hr == S_OK)
-                {
-                    Assert(pD3DIfTex);
-                    pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE;
-                    pAllocation->pD3DIf = pD3DIfTex;
-                    Assert(!!(pResource->Flags.SharedResource) == !!(hSharedHandle));
-                    pAllocation->hSharedHandle = hSharedHandle;
+                    hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice9If,
+                                                pAllocation->D3DWidth,
+                                                pSurf->Height,
+                                                pResource->SurfCount,
+                                                vboxDDI2D3DUsage(pResource->Flags),
+                                                vboxDDI2D3DFormat(pResource->Format),
+                                                vboxDDI2D3DPool(pResource->Pool),
+                                                &pD3DIfTex,
+                                                pResource->Flags.SharedResource ? &hSharedHandle : NULL,
+                                                pResource->Pool == D3DDDIPOOL_SYSTEMMEM ? pRc->aAllocations[0].pvMem : NULL);
+#endif
+                    Assert(hr == S_OK);
+                    if (hr == S_OK)
+                    {
+                        Assert(pD3DIfTex);
+                        pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE;
+                        pAllocation->pD3DIf = pD3DIfTex;
+                        Assert(!!(pResource->Flags.SharedResource) == !!(hSharedHandle));
+                        pAllocation->hSharedHandle = hSharedHandle;
 #if 0
-                    if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM)
+                        if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM)
+                        {
+                            for (UINT i = 0; i < pResource->SurfCount; ++i)
+                            {
+                                D3DLOCKED_RECT lockInfo;
+                                PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
+                                Assert(pAllocation->pvMem);
+                                hr = pD3DIfTex->LockRect(i, &lockInfo, NULL, D3DLOCK_DISCARD);
+                                Assert(hr == S_OK);
+                                if (hr == S_OK)
+                                {
+                                    vboxWddmLockUnlockMemSynch(pAllocation, &lockInfo, NULL, true /*bool bToLockInfo*/);
+                                    HRESULT tmpHr = pD3DIfTex->UnlockRect(i);
+                                    Assert(tmpHr == S_OK);
+                                }
+                                else
+                                {
+                                    pD3DIfTex->Release();
+                                    break;
+                                }
+                            }
+                        }
+#endif
+                    }
+#ifdef DEBUG
+                    else
                     {
                         for (UINT i = 0; i < pResource->SurfCount; ++i)
                         {
-                            D3DLOCKED_RECT lockInfo;
                             PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
-                            Assert(pAllocation->pvMem);
-                            hr = pD3DIfTex->LockRect(i, &lockInfo, NULL, D3DLOCK_DISCARD);
-                            Assert(hr == S_OK);
-                            if (hr == S_OK)
-                            {
-                                vboxWddmLockUnlockMemSynch(pAllocation, &lockInfo, NULL, true /*bool bToLockInfo*/);
-                                HRESULT tmpHr = pD3DIfTex->UnlockRect(i);
-                                Assert(tmpHr == S_OK);
-                            }
-                            else
-                            {
-                                pD3DIfTex->Release();
-                                break;
-                            }
+                            Assert(!pAllocation->pvMem);
                         }
                     }
 #endif
                 }
-#ifdef DEBUG
-                else
-                {
-                    for (UINT i = 0; i < pResource->SurfCount; ++i)
+                else /*pResource->Flags.CubeMap*/
+                {
+                    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
+
+                    PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
+                    CONST D3DDDI_SURFACEINFO* pSurf = &pResource->pSurfList[0];
+                    IDirect3DCubeTexture9 *pD3DIfCubeTex;
+                    HANDLE hSharedHandle = NULL;
+
+                    if ( (pAllocation->SurfDesc.width!=pAllocation->SurfDesc.height)
+                         || (pResource->SurfCount%6!=0))
                     {
-                        PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
-                        Assert(!pAllocation->pvMem);
+                        Assert(0);
+                        hr = E_INVALIDARG;
+                    }
+                    else
+                    {
+                        hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateCubeTexture((IDirect3DDevice9Ex *)pDevice9If,
+                                                pAllocation->SurfDesc.width,
+                                                VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc),
+                                                vboxDDI2D3DUsage(pResource->Flags),
+                                                vboxDDI2D3DFormat(pResource->Format),
+                                                vboxDDI2D3DPool(pResource->Pool),
+                                                &pD3DIfCubeTex,
+                                                pResource->Flags.SharedResource ? &hSharedHandle : NULL,
+                                                pResource->Pool == D3DDDIPOOL_SYSTEMMEM ? pRc->aAllocations[0].pvMem : NULL);
+                    }
+
+                    Assert(hr == S_OK);
+                    if (hr == S_OK)
+                    {
+                        Assert(pD3DIfCubeTex);
+                        pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_CUBE_TEXTURE;
+                        pAllocation->pD3DIf = pD3DIfCubeTex;
+                        Assert(!!(pResource->Flags.SharedResource) == !!(hSharedHandle));
+                        pAllocation->hSharedHandle = hSharedHandle;
                     }
                 }
-#endif
             }
             else if (pResource->Flags.RenderTarget)
@@ -6301,4 +6416,13 @@
             break;
         }
+        case VBOXDISP_D3DIFTYPE_CUBE_TEXTURE:
+        {
+            IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
+            Assert(pD3DIfCubeTex);
+            hr = pD3DIfCubeTex->LockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc),
+                    VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc), pLockedRect, pRect, fLockFlags);
+            Assert(hr == S_OK);
+            break;
+        }
         default:
             Assert(0);
@@ -6307,4 +6431,5 @@
     return hr;
 }
+
 static HRESULT vboxWddmUnlockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc)
 {
@@ -6326,4 +6451,13 @@
             Assert(pD3DIfTex);
             hr = pD3DIfTex->UnlockRect(iAlloc);
+            Assert(hr == S_OK);
+            break;
+        }
+        case VBOXDISP_D3DIFTYPE_CUBE_TEXTURE:
+        {
+            IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
+            Assert(pD3DIfCubeTex);
+            hr = pD3DIfCubeTex->UnlockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc),
+                    VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc));
             Assert(hr == S_OK);
             break;
@@ -6509,6 +6643,6 @@
             && (pSrcRc->RcDesc.fFlags.Texture || pSrcRc->RcDesc.fFlags.Value == 0))
     {
-        IDirect3DTexture9 *pD3DIfSrcTex = (IDirect3DTexture9*)pSrcAlloc->pD3DIf;
-        IDirect3DTexture9 *pD3DIfDstTex = (IDirect3DTexture9*)pDstAlloc->pD3DIf;
+        IDirect3DBaseTexture9 *pD3DIfSrcTex = (IDirect3DBaseTexture9*)pSrcAlloc->pD3DIf;
+        IDirect3DBaseTexture9 *pD3DIfDstTex = (IDirect3DBaseTexture9*)pDstAlloc->pD3DIf;
         Assert(pD3DIfSrcTex);
         Assert(pD3DIfDstTex);
@@ -7424,26 +7558,60 @@
                     IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
                     PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
-                    IDirect3DTexture9 *pD3DIfTex;
                     HANDLE hSharedHandle = pAllocation->hSharedHandle;
                     Assert(pAllocation->hSharedHandle);
 
-                    hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice9If,
-                                                pAllocation->SurfDesc.width,
-                                                pAllocation->SurfDesc.height,
-                                                pRc->cAllocations,
-                                                vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
-                                                vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
-                                                vboxDDI2D3DPool(pRc->RcDesc.enmPool),
-                                                &pD3DIfTex,
-                                                &hSharedHandle,
-                                                NULL);
-                    Assert(hr == S_OK);
-                    if (hr == S_OK)
+                    if (!pRc->RcDesc.fFlags.CubeMap)
                     {
-                        Assert(pD3DIfTex);
-                        pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE;
-                        pAllocation->pD3DIf = pD3DIfTex;
-                        Assert(pAllocation->hSharedHandle == hSharedHandle);
-                        Assert(pAllocation->hSharedHandle);
+                        IDirect3DTexture9 *pD3DIfTex;
+                        hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateTexture((IDirect3DDevice9Ex *)pDevice9If,
+                                                    pAllocation->SurfDesc.width,
+                                                    pAllocation->SurfDesc.height,
+                                                    pRc->cAllocations,
+                                                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
+                                                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
+                                                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
+                                                    &pD3DIfTex,
+                                                    &hSharedHandle,
+                                                    NULL);
+                        Assert(hr == S_OK);
+                        if (hr == S_OK)
+                        {
+                            Assert(pD3DIfTex);
+                            pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_TEXTURE;
+                            pAllocation->pD3DIf = pD3DIfTex;
+                            Assert(pAllocation->hSharedHandle == hSharedHandle);
+                            Assert(pAllocation->hSharedHandle);
+                        }
+                    }
+                    else
+                    {
+                        IDirect3DCubeTexture9 *pD3DIfCubeTex;
+
+                        if ( (pAllocation->SurfDesc.width!=pAllocation->SurfDesc.height)
+                             || (pRc->cAllocations%6!=0))
+                        {
+                            Assert(0);
+                            hr = E_INVALIDARG;
+                        }
+
+                        hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9CreateCubeTexture((IDirect3DDevice9Ex *)pDevice9If,
+                                                    pAllocation->SurfDesc.width,
+                                                    VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc),
+                                                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
+                                                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
+                                                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
+                                                    &pD3DIfCubeTex,
+                                                    &hSharedHandle,
+                                                    NULL);
+                        Assert(hr == S_OK);
+                        if (hr == S_OK)
+                        {
+                            Assert(pD3DIfCubeTex);
+                            pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_CUBE_TEXTURE;
+                            pAllocation->pD3DIf = pD3DIfCubeTex;
+                            Assert(pAllocation->hSharedHandle == hSharedHandle);
+                            Assert(pAllocation->hSharedHandle);
+                        }
+
                     }
                 }
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h	(revision 33836)
@@ -208,4 +208,5 @@
     VBOXDISP_D3DIFTYPE_SURFACE,
     VBOXDISP_D3DIFTYPE_TEXTURE,
+    VBOXDISP_D3DIFTYPE_CUBE_TEXTURE,
     VBOXDISP_D3DIFTYPE_VERTEXBUFFER,
     VBOXDISP_D3DIFTYPE_INDEXBUFFER
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.cpp	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.cpp	(revision 33836)
@@ -39,13 +39,18 @@
             if (pD3D->pfnVBoxWineExD3DDev9CreateTexture)
             {
-                pD3D->pfnVBoxWineExD3DDev9Flush = (PFNVBOXWINEEXD3DDEV9_FLUSH)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9Flush");
-                Assert(pD3D->pfnVBoxWineExD3DDev9Flush);
-                if (pD3D->pfnVBoxWineExD3DDev9Flush)
+                pD3D->pfnVBoxWineExD3DDev9CreateCubeTexture = (PFNVBOXWINEEXD3DDEV9_CREATECUBETEXTURE)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9CreateCubeTexture");
+                Assert(pD3D->pfnVBoxWineExD3DDev9CreateCubeTexture);
+                if (pD3D->pfnVBoxWineExD3DDev9CreateCubeTexture)
                 {
-                    pD3D->pfnVBoxWineExD3DDev9Update = (PFNVBOXWINEEXD3DDEV9_UPDATE)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9Update");
-                    Assert(pD3D->pfnVBoxWineExD3DDev9Update);
-                    if (pD3D->pfnVBoxWineExD3DDev9Update)
+                    pD3D->pfnVBoxWineExD3DDev9Flush = (PFNVBOXWINEEXD3DDEV9_FLUSH)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9Flush");
+                    Assert(pD3D->pfnVBoxWineExD3DDev9Flush);
+                    if (pD3D->pfnVBoxWineExD3DDev9Flush)
                     {
-                        return S_OK;
+                        pD3D->pfnVBoxWineExD3DDev9Update = (PFNVBOXWINEEXD3DDEV9_UPDATE)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9Update");
+                        Assert(pD3D->pfnVBoxWineExD3DDev9Update);
+                        if (pD3D->pfnVBoxWineExD3DDev9Update)
+                        {
+                            return S_OK;
+                        }
                     }
                 }
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DIf.h	(revision 33836)
@@ -34,4 +34,6 @@
 
     PFNVBOXWINEEXD3DDEV9_CREATETEXTURE pfnVBoxWineExD3DDev9CreateTexture;
+
+    PFNVBOXWINEEXD3DDEV9_CREATECUBETEXTURE pfnVBoxWineExD3DDev9CreateCubeTexture;
 
     PFNVBOXWINEEXD3DDEV9_FLUSH pfnVBoxWineExD3DDev9Flush;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/cubetexture.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/cubetexture.c	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/cubetexture.c	(revision 33836)
@@ -401,5 +401,10 @@
 
 HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Impl *device,
-        UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
+        UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        )
 {
     HRESULT hr;
@@ -409,7 +414,14 @@
 
     wined3d_mutex_lock();
+#ifdef VBOX_WITH_WDDM
+    hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage,
+            wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
+            (IUnknown *)texture, &d3d9_cubetexture_wined3d_parent_ops, 
+            shared_handle, pvClientMem);
+#else
     hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage,
             wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
             (IUnknown *)texture, &d3d9_cubetexture_wined3d_parent_ops);
+#endif
     wined3d_mutex_unlock();
     if (FAILED(hr))
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h	(revision 33836)
@@ -414,5 +414,10 @@
 
 HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Impl *device,
-        UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
+        UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        ) DECLSPEC_HIDDEN;
 
 /* ----------------- */
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9wddm.def
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9wddm.def	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9wddm.def	(revision 33836)
@@ -1,4 +1,2 @@
-; File generated automatically from ../../../dlls/d3d9/d3d9.spec; do not edit!
-
 LIBRARY VBoxD3D9wddm.dll
 
@@ -17,3 +15,4 @@
   VBoxWineExD3DDev9Flush
   VBoxWineExD3DDev9CreateTexture
+  VBoxWineExD3DDev9CreateCubeTexture
   VBoxWineExD3DDev9Update
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c	(revision 33836)
@@ -809,4 +809,38 @@
 }
 
+VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9CreateCubeTexture(IDirect3DDevice9Ex *iface,
+            UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format,
+            D3DPOOL pool, IDirect3DCubeTexture9 **texture, HANDLE *shared_handle,
+            void *pvClientMem) /* <- extension arg to pass in the client memory buffer,
+                                *    applicable ONLY for SYSMEM textures */
+{
+    IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
+    IDirect3DCubeTexture9Impl *object;
+    HRESULT hr;
+
+    TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n",
+            iface, edge_length, levels, usage, format, pool, texture, shared_handle);
+
+    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
+    if (!object)
+    {
+        ERR("Failed to allocate cube texture memory.\n");
+        return D3DERR_OUTOFVIDEOMEMORY;
+    }
+
+    hr = cubetexture_init(object, This, edge_length, levels, usage, format, pool, shared_handle, pvClientMem);
+    if (FAILED(hr))
+    {
+        WARN("Failed to initialize cube texture, hr %#x.\n", hr);
+        HeapFree(GetProcessHeap(), 0, object);
+        return hr;
+    }
+
+    TRACE("Created cube texture %p.\n", object);
+    *texture = (IDirect3DCubeTexture9 *)object;
+
+    return D3D_OK;
+}
+
 #endif
 
@@ -886,4 +920,8 @@
         IDirect3DCubeTexture9 **texture, HANDLE *shared_handle)
 {
+#ifdef VBOX_WITH_WDDM
+    return VBoxWineExD3DDev9CreateCubeTexture(iface, edge_length, levels, usage, format,
+            pool, texture, shared_handle, NULL);
+#else
     IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
     IDirect3DCubeTexture9Impl *object;
@@ -912,4 +950,5 @@
 
     return D3D_OK;
+#endif
 }
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h	(revision 33836)
@@ -7446,5 +7446,10 @@
         IWineD3DCubeTexture **texture,
         IUnknown *parent,
-        const struct wined3d_parent_ops *parent_ops);
+        const struct wined3d_parent_ops *parent_ops
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        );
 
     HRESULT (STDMETHODCALLTYPE *CreateQuery)(
@@ -8116,5 +8121,9 @@
 #define IWineD3DDevice_CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops)
 #define IWineD3DDevice_CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops) (This)->lpVtbl->CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops)
+#ifdef VBOX_WITH_WDDM
+#define IWineD3DDevice_CreateCubeTexture(This,edge_length,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem) (This)->lpVtbl->CreateCubeTexture(This,edge_length,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem)
+#else
 #define IWineD3DDevice_CreateCubeTexture(This,edge_length,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateCubeTexture(This,edge_length,levels,usage,format,pool,texture,parent,parent_ops)
+#endif
 #define IWineD3DDevice_CreateQuery(This,type,query,parent) (This)->lpVtbl->CreateQuery(This,type,query,parent)
 #define IWineD3DDevice_CreateSwapChain(This,present_parameters,swapchain,parent,surface_type) (This)->lpVtbl->CreateSwapChain(This,present_parameters,swapchain,parent,surface_type)
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/VBoxWineEx.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/VBoxWineEx.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/VBoxWineEx.h	(revision 33836)
@@ -28,4 +28,10 @@
 typedef FNVBOXWINEEXD3DDEV9_CREATETEXTURE *PFNVBOXWINEEXD3DDEV9_CREATETEXTURE;
 
+typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_CREATECUBETEXTURE(IDirect3DDevice9Ex *iface,
+            UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, 
+            D3DPOOL pool, IDirect3DCubeTexture9 **texture, HANDLE *shared_handle,
+            void *pvClientMem);
+typedef FNVBOXWINEEXD3DDEV9_CREATECUBETEXTURE *PFNVBOXWINEEXD3DDEV9_CREATECUBETEXTURE;
+
 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_FLUSH(IDirect3DDevice9Ex *iface);
 typedef FNVBOXWINEEXD3DDEV9_FLUSH *PFNVBOXWINEEXD3DDEV9_FLUSH;
@@ -44,4 +50,10 @@
                                  *    applicable ONLY for SYSMEM textures */
 
+VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9CreateCubeTexture(IDirect3DDevice9Ex *iface,
+            UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format,
+            D3DPOOL pool, IDirect3DCubeTexture9 **texture, HANDLE *shared_handle,
+            void *pvClientMem); /* <- extension arg to pass in the client memory buffer,
+                                 *    applicable ONLY for SYSMEM textures */
+
 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Flush(IDirect3DDevice9Ex *iface); /* perform glFlush */
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c	(revision 33836)
@@ -440,5 +440,10 @@
 HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
         IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool,
-        IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
+        IUnknown *parent, const struct wined3d_parent_ops *parent_ops
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        )
 {
     const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -491,6 +496,5 @@
             device, 0, usage, format_desc, pool, parent, parent_ops
 #ifdef VBOX_WITH_WDDM
-        , NULL
-        , NULL
+            , shared_handle, pvClientMem
 #endif
             );
@@ -543,5 +547,5 @@
             hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,
                     format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]
-                    , NULL, NULL /* <- no need this info here */
+                    , NULL, pvClientMem
                 );
 #else
@@ -566,4 +570,52 @@
     texture->baseTexture.internal_preload = cubetexture_internal_preload;
 
+#ifdef VBOX_WITH_WDDM
+    if (VBOXSHRC_IS_SHARED(texture))
+    {
+        Assert(shared_handle);
+        VBOXSHRC_SET_INITIALIZED(texture);
+        for (i = 0; i < texture->baseTexture.levels; ++i)
+        {
+            for (j = 0; j < 6; ++j)
+            {
+                VBOXSHRC_COPY_SHAREDATA((IWineD3DSurfaceImpl*)texture->surfaces[j][i], texture);
+            }
+        }
+#ifdef DEBUG
+        for (i = 0; i < texture->baseTexture.levels; ++i)
+        {
+            for (j = 0; j < 6; ++j)
+            {
+                Assert(!((IWineD3DSurfaceImpl*)texture->surfaces[j][i])->texture_name);
+            }
+        }
+#endif
+        IWineD3DSurface_LoadLocation(texture->surfaces[0][0], SFLAG_INTEXTURE, NULL);
+        if (!VBOXSHRC_IS_SHARED_OPENED(texture))
+        {
+            Assert(!(*shared_handle));
+            *shared_handle = VBOXSHRC_GET_SHAREHANDLE(texture);
+        }
+        else
+        {
+            Assert(*shared_handle);
+            Assert(*shared_handle == VBOXSHRC_GET_SHAREHANDLE(texture));
+        }
+#ifdef DEBUG
+        for (i = 0; i < texture->baseTexture.levels; ++i)
+        {
+            for (j = 0; j < 6; ++j)
+            {
+                Assert((*shared_handle) == ((IWineD3DSurfaceImpl*)texture->surfaces[j][i])->texture_name);
+            }
+        }
+#endif
+    }
+    else
+    {
+        Assert(!shared_handle);
+    }
+#endif
+
     return WINED3D_OK;
 }
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c	(revision 33836)
@@ -991,5 +991,10 @@
 static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength, UINT Levels,
         DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DCubeTexture **ppCubeTexture,
-        IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
+        IUnknown *parent, const struct wined3d_parent_ops *parent_ops
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        )
 {
     IWineD3DDeviceImpl      *This = (IWineD3DDeviceImpl *)iface;
@@ -1005,5 +1010,11 @@
     }
 
-    hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent, parent_ops);
+    hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent, parent_ops
+#ifdef VBOX_WITH_WDDM
+            , shared_handle
+            , pvClientMem
+#endif
+        );
+
     if (FAILED(hr))
     {
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h	(revision 33835)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h	(revision 33836)
@@ -1997,5 +1997,10 @@
 HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
         IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool,
-        IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
+        IUnknown *parent, const struct wined3d_parent_ops *parent_ops
+#ifdef VBOX_WITH_WDDM
+        , HANDLE *shared_handle
+        , void *pvClientMem
+#endif
+        ) DECLSPEC_HIDDEN;
 
 typedef struct _WINED3DVOLUMET_DESC
