Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp	(revision 50940)
@@ -571,5 +571,9 @@
             HANDLE hSharedHandle = pAllocation->hSharedHandle;
             IDirect3DSurface9* pD3D9Surf;
-            if ((pDevice->pAdapter->u32VBox3DCaps & CR_VBOX_CAP_TEX_PRESENT) || pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
+            if (
+#ifdef VBOX_WITH_CROGL
+                    (pDevice->pAdapter->u32VBox3DCaps & CR_VBOX_CAP_TEX_PRESENT) ||
+#endif
+                    pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
             {
                 hr = pDevice9If->CreateRenderTarget(pAllocation->SurfDesc.width,
@@ -825,5 +829,9 @@
     VBOXWINEEX_D3DPRESENT_PARAMETERS Params;
     VBoxD3DIfFillPresentParams(&Params.Base, &Rc, 2);
+#ifdef VBOX_WITH_CRHGSMI
     Params.pHgsmi = &pDevice->Uhgsmi.BasePrivate.Base;
+#else
+    Params.pHgsmi = NULL;
+#endif
     DWORD fFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
     PVBOXWDDMDISP_ADAPTER pAdapter = pDevice->pAdapter;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.cpp	(revision 50940)
@@ -23,5 +23,7 @@
 #include <iprt/list.h>
 
+#ifdef VBOX_WITH_CROGL
 #include <cr_protocol.h>
+#endif
 
 typedef struct VBOXDISPCM_SESSION
@@ -121,6 +123,12 @@
     {
         Info.enmType = VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D;
+#ifdef VBOX_WITH_CROGL
         Info.crVersionMajor = CR_PROTOCOL_VERSION_MAJOR;
         Info.crVersionMinor = CR_PROTOCOL_VERSION_MINOR;
+#else
+        WARN(("not expected"));
+        Info.crVersionMajor = 0;
+        Info.crVersionMinor = 0;
+#endif
         fIsCrContext = TRUE;
     }
@@ -166,8 +174,10 @@
         if (fIsCrContext)
         {
+#ifdef VBOX_WITH_CRHGSMI
             if (pDevice->pAdapter->u32VBox3DCaps & CR_VBOX_CAP_CMDVBVA)
                 vboxUhgsmiD3DInit(&pDevice->Uhgsmi, pDevice);
             else
                 vboxUhgsmiD3DEscInit(&pDevice->Uhgsmi, pDevice);
+#endif
         }
     }
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 50940)
@@ -1479,5 +1479,9 @@
             if (!pDevice->pDevice9If)
             {
+#ifdef VBOX_WITH_CRHGSMI
                 Params.pHgsmi = &pDevice->Uhgsmi.BasePrivate.Base;
+#else
+                Params.pHgsmi = NULL;
+#endif
                 hr = pAdapter->D3D.pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, fFlags, &Params.Base, &pDevice9If);
                 Assert(hr == S_OK);
@@ -4691,4 +4695,5 @@
         }
 #endif
+#ifdef VBOX_WITH_CROGL
         if (pAdapter->u32VBox3DCaps & CR_VBOX_CAP_TEX_PRESENT)
         {
@@ -4709,4 +4714,5 @@
         }
         else
+#endif
         {
             pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9FlushToHost((IDirect3DDevice9Ex*)pDevice->pDevice9If);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h	(revision 50940)
@@ -204,5 +204,7 @@
     D3DVIEWPORT9 ViewPort;
     VBOXWDDMDISP_CONTEXT DefaultContext;
+#ifdef VBOX_WITH_CRHGSMI
     VBOXUHGSMI_PRIVATE_D3D Uhgsmi;
+#endif
 
     /* no lock is needed for this since we're guaranteed the per-device calls are not reentrant */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DCmn.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DCmn.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DCmn.h	(revision 50940)
@@ -44,5 +44,7 @@
 #include "VBoxD3DIf.h"
 #endif
+#ifdef VBOX_WITH_CROGL
 #include <cr_protocol.h>
+#endif
 
 # ifdef VBOXWDDMDISP
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMp.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMp.cpp	(revision 50939)
+++ 	(revision )
@@ -1,296 +1,0 @@
-/* $Id$ */
-
-/** @file
- * VBoxVideo Display D3D User mode dll
- */
-
-/*
- * Copyright (C) 2011-2012 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxDispD3DCmn.h"
-#include "VBoxDispMp.h"
-#if 0
-#include <iprt/assert.h>
-
-typedef struct VBOXVIDEOCM_ITERATOR
-{
-    PVBOXVIDEOCM_CMD_HDR pCur;
-    uint32_t cbRemain;
-} VBOXVIDEOCM_ITERATOR, *PVBOXVIDEOCM_ITERATOR;
-
-typedef struct VBOXDISPMP
-{
-    CRITICAL_SECTION CritSect;
-    PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pEscapeCmd;
-    uint32_t cbEscapeCmd;
-    VBOXVIDEOCM_ITERATOR Iterator;
-} VBOXDISPMP, *PVBOXDISPMP;
-
-DECLINLINE(void) vboxVideoCmIterInit(PVBOXVIDEOCM_ITERATOR pIter, PVBOXVIDEOCM_CMD_HDR pStart, uint32_t cbCmds)
-{
-    pIter->pCur = pStart;
-    pIter->cbRemain= cbCmds;
-}
-
-DECLINLINE(PVBOXVIDEOCM_CMD_HDR) vboxVideoCmIterNext(PVBOXVIDEOCM_ITERATOR pIter)
-{
-    if (pIter->cbRemain)
-    {
-        PVBOXVIDEOCM_CMD_HDR pCur = pIter->pCur;
-        Assert(pIter->cbRemain  >= pIter->pCur->cbCmd);
-        pIter->cbRemain -= pIter->pCur->cbCmd;
-        pIter->pCur = (PVBOXVIDEOCM_CMD_HDR)(((uint8_t*)pIter->pCur) + pIter->pCur->cbCmd);
-        return pCur;
-    }
-    return NULL;
-}
-
-DECLINLINE(VOID) vboxVideoCmIterCopyToBack(PVBOXVIDEOCM_ITERATOR pIter, PVBOXVIDEOCM_CMD_HDR pCur)
-{
-    memcpy((((uint8_t*)pIter->pCur) + pIter->cbRemain), pCur, pCur->cbCmd);
-    pIter->cbRemain += pCur->cbCmd;
-}
-
-DECLINLINE(bool) vboxVideoCmIterHasNext(PVBOXVIDEOCM_ITERATOR pIter)
-{
-    return !!(pIter->cbRemain);
-}
-
-static VBOXDISPMP g_VBoxDispMp;
-
-DECLCALLBACK(HRESULT) vboxDispMpEnableEvents()
-{
-    EnterCriticalSection(&g_VBoxDispMp.CritSect);
-    g_VBoxDispMp.pEscapeCmd = NULL;
-    g_VBoxDispMp.cbEscapeCmd = 0;
-    vboxVideoCmIterInit(&g_VBoxDispMp.Iterator, NULL, 0);
-    LeaveCriticalSection(&g_VBoxDispMp.CritSect);
-    return S_OK;
-}
-
-
-DECLCALLBACK(HRESULT) vboxDispMpDisableEvents()
-{
-    EnterCriticalSection(&g_VBoxDispMp.CritSect);
-    if (g_VBoxDispMp.pEscapeCmd)
-    {
-        RTMemFree(g_VBoxDispMp.pEscapeCmd);
-        g_VBoxDispMp.pEscapeCmd = NULL;
-    }
-    LeaveCriticalSection(&g_VBoxDispMp.CritSect);
-    return S_OK;
-}
-
-#define VBOXDISPMP_BUF_INITSIZE 4000
-#define VBOXDISPMP_BUF_INCREASE 4096
-#define VBOXDISPMP_BUF_MAXSIZE  ((4096*4096)-96)
-
-DECLCALLBACK(HRESULT) vboxDispMpGetRegions(PVBOXDISPMP_REGIONS pRegions, DWORD dwMilliseconds)
-{
-    HRESULT hr = S_OK;
-    EnterCriticalSection(&g_VBoxDispMp.CritSect);
-    PVBOXVIDEOCM_CMD_HDR pHdr = vboxVideoCmIterNext(&g_VBoxDispMp.Iterator);
-    if (!pHdr)
-    {
-        if (!g_VBoxDispMp.pEscapeCmd)
-        {
-            g_VBoxDispMp.pEscapeCmd = (PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD)RTMemAlloc(VBOXDISPMP_BUF_INITSIZE);
-            Assert(g_VBoxDispMp.pEscapeCmd);
-            if (g_VBoxDispMp.pEscapeCmd)
-                g_VBoxDispMp.cbEscapeCmd = VBOXDISPMP_BUF_INITSIZE;
-            else
-            {
-                LeaveCriticalSection(&g_VBoxDispMp.CritSect);
-                return E_OUTOFMEMORY;
-            }
-        }
-
-        do
-        {
-            hr =  vboxDispCmCmdGet(g_VBoxDispMp.pEscapeCmd, g_VBoxDispMp.cbEscapeCmd, dwMilliseconds);
-            Assert(hr == S_OK || (dwMilliseconds != INFINITE && hr == WAIT_TIMEOUT));
-            if (hr == S_OK)
-            {
-                if (g_VBoxDispMp.pEscapeCmd->Hdr.cbCmdsReturned)
-                {
-                    pHdr = (PVBOXVIDEOCM_CMD_HDR)(((uint8_t*)g_VBoxDispMp.pEscapeCmd) + sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD));
-                    vboxVideoCmIterInit(&g_VBoxDispMp.Iterator, pHdr, g_VBoxDispMp.pEscapeCmd->Hdr.cbCmdsReturned);
-                    pHdr = vboxVideoCmIterNext(&g_VBoxDispMp.Iterator);
-                    Assert(pHdr);
-                    break;
-                }
-                else
-                {
-                    Assert(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds);
-                    Assert(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingFirstCmd);
-                    RTMemFree(g_VBoxDispMp.pEscapeCmd);
-                    uint32_t newSize = RT_MAX(g_VBoxDispMp.cbEscapeCmd + VBOXDISPMP_BUF_INCREASE, g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingFirstCmd);
-                    if (newSize < VBOXDISPMP_BUF_MAXSIZE)
-                        newSize = RT_MAX(newSize, RT_MIN(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds, VBOXDISPMP_BUF_MAXSIZE));
-                    Assert(g_VBoxDispMp.cbEscapeCmd < newSize);
-                    g_VBoxDispMp.pEscapeCmd = (PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD)RTMemAlloc(newSize);
-                    Assert(g_VBoxDispMp.pEscapeCmd);
-                    if (g_VBoxDispMp.pEscapeCmd)
-                        g_VBoxDispMp.cbEscapeCmd = newSize;
-                    else
-                    {
-                        g_VBoxDispMp.pEscapeCmd = NULL;
-                        g_VBoxDispMp.cbEscapeCmd = 0;
-                        hr = E_OUTOFMEMORY;
-                        break;
-                    }
-                }
-            }
-            else
-                break;
-        } while (1);
-    }
-
-    if (hr == S_OK)
-    {
-        Assert(pHdr);
-        VBOXWDDMDISP_CONTEXT *pContext = (VBOXWDDMDISP_CONTEXT*)pHdr->u64UmData;
-        PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)(((uint8_t*)pHdr) + sizeof (VBOXVIDEOCM_CMD_HDR));
-        PVBOXWDDMDISP_SWAPCHAIN pSwapchain = (PVBOXWDDMDISP_SWAPCHAIN)pCmdInternal->hSwapchainUm;
-        /* the miniport driver should ensure all swapchain-involved commands are completed before swapchain termination,
-         * so we should have it always valid here */
-        Assert(pSwapchain);
-        Assert(pSwapchain->hWnd);
-        pRegions->hWnd = pSwapchain->hWnd;
-        pRegions->pRegions = &pCmdInternal->Cmd;
-    }
-    LeaveCriticalSection(&g_VBoxDispMp.CritSect);
-    return hr;
-}
-
-static DECLCALLBACK(void) vboxDispMpLog(LPCSTR pszMsg)
-{
-    vboxDispCmLog(pszMsg);
-}
-
-VBOXDISPMP_DECL(HRESULT) VBoxDispMpGetCallbacks(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks)
-{
-    Assert(u32Version == VBOXDISPMP_VERSION);
-    if (u32Version != VBOXDISPMP_VERSION)
-        return E_INVALIDARG;
-
-    pCallbacks->pfnEnableEvents = vboxDispMpEnableEvents;
-    pCallbacks->pfnDisableEvents = vboxDispMpDisableEvents;
-    pCallbacks->pfnGetRegions = vboxDispMpGetRegions;
-    return S_OK;
-}
-
-HRESULT vboxDispMpInternalInit()
-{
-    memset(&g_VBoxDispMp, 0, sizeof (g_VBoxDispMp));
-    InitializeCriticalSection(&g_VBoxDispMp.CritSect);
-    return S_OK;
-}
-
-HRESULT vboxDispMpInternalTerm()
-{
-    vboxDispMpDisableEvents();
-    DeleteCriticalSection(&g_VBoxDispMp.CritSect);
-    return S_OK;
-}
-
-HRESULT vboxDispMpInternalCancel(VBOXWDDMDISP_CONTEXT *pContext, PVBOXWDDMDISP_SWAPCHAIN pSwapchain)
-{
-    HRESULT hr = S_OK;
-    EnterCriticalSection(&g_VBoxDispMp.CritSect);
-    do
-    {
-        /* the pEscapeCmd is used as an indicator to whether the events capturing is active */
-        if (!g_VBoxDispMp.pEscapeCmd)
-            break;
-
-        /* copy the iterator data to restore it back later */
-        VBOXVIDEOCM_ITERATOR IterCopy = g_VBoxDispMp.Iterator;
-
-        /* first check if we have matching elements */
-        PVBOXVIDEOCM_CMD_HDR pHdr;
-        bool fHasMatch = false;
-        while (pHdr = vboxVideoCmIterNext(&g_VBoxDispMp.Iterator))
-        {
-            VBOXWDDMDISP_CONTEXT *pCurContext = (VBOXWDDMDISP_CONTEXT*)pHdr->u64UmData;
-            if (pCurContext != pContext)
-                continue;
-
-            if (!pSwapchain)
-            {
-                fHasMatch = true;
-                break;
-            }
-
-            PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)(((uint8_t*)pHdr) + sizeof (VBOXVIDEOCM_CMD_HDR));
-            PVBOXWDDMDISP_SWAPCHAIN pCurSwapchain = (PVBOXWDDMDISP_SWAPCHAIN)pCmdInternal->hSwapchainUm;
-            if (pCurSwapchain != pSwapchain)
-                continue;
-
-            fHasMatch = true;
-            break;
-        }
-
-        /* restore the iterator */
-        g_VBoxDispMp.Iterator = IterCopy;
-
-        if (!fHasMatch)
-            break;
-
-        /* there are elements to remove */
-        PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pEscapeCmd = (PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD)RTMemAlloc(g_VBoxDispMp.cbEscapeCmd);
-        if (!pEscapeCmd)
-        {
-            WARN(("no memory"));
-            hr = E_OUTOFMEMORY;
-            break;
-        }
-        /* copy the header data */
-        *pEscapeCmd = *g_VBoxDispMp.pEscapeCmd;
-        /* now copy the command data filtering out the canceled commands */
-        pHdr = (PVBOXVIDEOCM_CMD_HDR)(((uint8_t*)pEscapeCmd) + sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD));
-        vboxVideoCmIterInit(&g_VBoxDispMp.Iterator, pHdr, 0);
-        while (pHdr = vboxVideoCmIterNext(&IterCopy))
-        {
-            VBOXWDDMDISP_CONTEXT *pCurContext = (VBOXWDDMDISP_CONTEXT*)pHdr->u64UmData;
-            if (pCurContext != pContext)
-            {
-                vboxVideoCmIterCopyToBack(&g_VBoxDispMp.Iterator, pHdr);
-                continue;
-            }
-
-            if (!pSwapchain)
-            {
-                /* match, just continue */
-                continue;
-            }
-
-            PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)(((uint8_t*)pHdr) + sizeof (VBOXVIDEOCM_CMD_HDR));
-            PVBOXWDDMDISP_SWAPCHAIN pCurSwapchain = (PVBOXWDDMDISP_SWAPCHAIN)pCmdInternal->hSwapchainUm;
-            if (pCurSwapchain != pSwapchain)
-            {
-                vboxVideoCmIterCopyToBack(&g_VBoxDispMp.Iterator, pHdr);
-                continue;
-            }
-            /* match, just continue */
-        }
-
-        Assert(g_VBoxDispMp.pEscapeCmd);
-        RTMemFree(g_VBoxDispMp.pEscapeCmd);
-        Assert(pEscapeCmd);
-        g_VBoxDispMp.pEscapeCmd = pEscapeCmd;
-    } while (0);
-
-    LeaveCriticalSection(&g_VBoxDispMp.CritSect);
-    return hr;
-}
-#endif /* 0 */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMp.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispMp.h	(revision 50939)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* $Id$ */
-
-/** @file
- * VBoxVideo Display external interface
- */
-
-/*
- * Copyright (C) 2010-2012 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef ___VBoxDispMp_h___
-#define ___VBoxDispMp_h___
-
-#include <windows.h>
-#include <d3d9types.h>
-#include <D3dumddi.h>
-#include <d3dhal.h>
-#include "../../common/wddm/VBoxMPIf.h"
-
-#if 0
-typedef struct VBOXDISPMP_REGIONS
-{
-    HWND hWnd;
-    PVBOXVIDEOCM_CMD_RECTS pRegions;
-} VBOXDISPMP_REGIONS, *PVBOXDISPMP_REGIONS;
-
-typedef DECLCALLBACK(HRESULT) FNVBOXDISPMP_ENABLEEVENTS();
-typedef FNVBOXDISPMP_ENABLEEVENTS *PFNVBOXDISPMP_ENABLEEVENTS;
-
-typedef DECLCALLBACK(HRESULT) FNVBOXDISPMP_DISABLEEVENTS();
-typedef FNVBOXDISPMP_DISABLEEVENTS *PFNVBOXDISPMP_DISABLEEVENTS;
-
-typedef DECLCALLBACK(HRESULT) FNVBOXDISPMP_DISABLEEVENTS();
-typedef FNVBOXDISPMP_DISABLEEVENTS *PFNVBOXDISPMP_DISABLEEVENTS;
-
-typedef DECLCALLBACK(HRESULT) FNVBOXDISPMP_GETREGIONS(PVBOXDISPMP_REGIONS pRegions, DWORD dwMilliseconds);
-typedef FNVBOXDISPMP_GETREGIONS *PFNVBOXDISPMP_GETREGIONS;
-
-typedef DECLCALLBACK(void) FNVBOXDISPMP_LOG(LPCSTR pszMsg);
-typedef FNVBOXDISPMP_LOG *PFNVBOXDISPMP_LOG;
-
-
-typedef struct VBOXDISPMP_CALLBACKS
-{
-    PFNVBOXDISPMP_ENABLEEVENTS pfnEnableEvents;
-    PFNVBOXDISPMP_DISABLEEVENTS pfnDisableEvents;
-    /**
-     * if events are enabled - blocks until dirty region is available or timeout occurs
-     * in the former case S_OK is returned on event, in the latter case WAIT_TIMEOUT is returned
-     * if events are disabled - returns S_FALSE
-     */
-    PFNVBOXDISPMP_GETREGIONS pfnGetRegions;
-} VBOXDISPMP_CALLBACKS, *PVBOXDISPMP_CALLBACKS;
-
-/** @def VBOXNETCFGWIN_DECL
- * The usual declaration wrapper.
- */
-
-/* enable this in case we include this in a dll*/
-# ifdef VBOXWDDMDISP
-#  define VBOXDISPMP_DECL(_type) DECLEXPORT(_type) VBOXCALL
-# else
-#  define VBOXDISPMP_DECL(_type) DECLIMPORT(_type) VBOXCALL
-# endif
-
-#define VBOXDISPMP_IFVERSION 3
-#define VBOXDISPMP_VERSION (VBOXVIDEOIF_VERSION | (VBOXDISPMP_IFVERSION < 16))
-/**
- *  VBoxDispMpGetCallbacks export
- *
- *  @param u32Version - must be set to VBOXDISPMP_VERSION
- *  @param pCallbacks - callbacks structure
- */
-typedef VBOXDISPMP_DECL(HRESULT) FNVBOXDISPMP_GETCALLBACKS(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks);
-typedef FNVBOXDISPMP_GETCALLBACKS *PFNVBOXDISPMP_GETCALLBACKS;
-#endif /* 0 */
-#endif /* #ifndef ___VBoxDispMp_h___ */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk	(revision 50940)
@@ -119,8 +119,9 @@
  	$(PATH_ROOT)/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp \
  	$(PATH_ROOT)/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp \
- 	$(PATH_ROOT)/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp \
- 	$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/util/vreg.cpp
+ 	$(PATH_ROOT)/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
+ 	
  if defined(VBOX_WITH_CROGL)
    VBoxVideoWddm_SOURCES   += \
+	$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/util/vreg.cpp
  	$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c \
  	$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer/pack_bounds.c \
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h	(revision 50940)
@@ -127,5 +127,5 @@
    /* this is examined and swicthed by DxgkDdiSubmitCommand only! */
    volatile BOOLEAN fRenderToShadowDisabled;
-
+#ifdef VBOX_WITH_CROGL
    BOOLEAN f3DEnabled;
    BOOLEAN fTexPresentEnabled;
@@ -138,5 +138,5 @@
    VBOXMP_CRCTLCON CrCtlCon;
    VBOXMP_CRSHGSMITRANSPORT CrHgsmiTransport;
-
+#endif
    VBOXWDDM_GLOBAL_POINTER_INFO PointerInfo;
 
@@ -220,4 +220,5 @@
 DECLINLINE(ULONG) vboxWddmVramCpuVisibleSize(PVBOXMP_DEVEXT pDevExt)
 {
+#ifdef VBOX_WITH_CROGL
     if (pDevExt->fCmdVbvaEnabled)
     {
@@ -229,4 +230,5 @@
         return (ULONG)(pDevExt->CmdVbva.Vbva.offVRAMBuffer & ~0xfffULL);
     }
+#endif
     /* all memory layout info should be initialized */
     Assert(pDevExt->aSources[0].Vbva.Vbva.offVRAMBuffer);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp	(revision 50940)
@@ -16,4 +16,5 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+#ifdef VBOX_WITH_CROGL
 
 #include "VBoxMPWddm.h"
@@ -22,5 +23,4 @@
 #include <VBox/HostServices/VBoxCrOpenGLSvc.h>
 
-#ifdef VBOX_WITH_CROGL
 #include <cr_protocol.h>
 
@@ -746,6 +746,4 @@
 }
 
-#endif
-
 static int vboxMpCrCtlAddRef(PVBOXMP_CRCTLCON pCrCtlCon)
 {
@@ -1012,5 +1010,4 @@
     g_VBoxMpCrHostCaps = 0;
 
-#ifdef VBOX_WITH_CROGL
     VBOXMP_CRCTLCON CrCtlCon = {0};
     uint32_t u32ClientID = 0;
@@ -1038,5 +1035,4 @@
     if (RT_FAILURE(rc))
         WARN(("VBoxMpCrCtlConDisconnectHgcm failed rc (%d), ignoring..", rc));
-#endif
 }
 
@@ -1073,2 +1069,3 @@
 }
 
+#endif
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h	(revision 50940)
@@ -18,4 +18,6 @@
 #ifndef ___VBoxMPCr_h__
 #define ___VBoxMPCr_h__
+
+#ifdef VBOX_WITH_CROGL
 
 #include <VBox/VBoxGuestLib.h>
@@ -216,3 +218,5 @@
 #define VBOXMP_CRCMD_SIZE_DESTROYCONTEXT (12 + 4)
 
+#endif /* #ifdef VBOX_WITH_CROGL */
+
 #endif /* #ifndef ___VBoxMPCr_h__ */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp	(revision 50940)
@@ -180,5 +180,5 @@
     return NULL;
 }
-
+#ifdef VBOX_WITH_CROGL
 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainCreate(UINT w, UINT h)
 {
@@ -572,5 +572,5 @@
     vboxWddmHTableDestroy(&pContext->Swapchains);
 }
-
+#endif
 NTSTATUS vboxWddmRegQueryDrvKeyName(PVBOXMP_DEVEXT pDevExt, ULONG cbBuf, PWCHAR pBuf, PULONG pcbResult)
 {
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h	(revision 50940)
@@ -70,5 +70,5 @@
 PVOID vboxWddmHTableGet(PVBOXWDDM_HTABLE pTbl, VBOXWDDM_HANDLE hHandle);
 
-
+#ifdef VBOX_WITH_CROGL
 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainCreate();
 BOOLEAN vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
@@ -84,4 +84,5 @@
 NTSTATUS vboxWddmSwapchainCtxInit(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext);
 VOID vboxWddmSwapchainCtxTerm(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext);
+#endif
 
 
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h	(revision 50940)
@@ -21,5 +21,7 @@
 
 typedef struct _VBOXMP_DEVEXT *PVBOXMP_DEVEXT;
+#ifdef VBOX_WITH_CROGL
 typedef struct VBOXWDDM_SWAPCHAIN *PVBOXWDDM_SWAPCHAIN;
+#endif
 typedef struct VBOXWDDM_CONTEXT *PVBOXWDDM_CONTEXT;
 typedef struct VBOXWDDM_ALLOCATION *PVBOXWDDM_ALLOCATION;
@@ -33,5 +35,7 @@
 #include "VBoxMPCr.h"
 
+#ifdef VBOX_WITH_CROGL
 #include <cr_vreg.h>
+#endif
 
 #ifdef DEBUG_misha
@@ -126,7 +130,9 @@
     uint8_t u8SyncState;
     BOOLEAN bVisible;
+#ifdef VBOX_WITH_CROGL
     /* specifies whether the source has 3D overlay data visible */
     BOOLEAN fHas3DVrs;
     VBOXVR_LIST VrList;
+#endif
     VBOXVBVAINFO Vbva;
 #ifdef VBOX_WITH_VIDEOHWACCEL
@@ -231,4 +237,5 @@
 #define VBOXWDDM_INVALID_COORD ((LONG)((~0UL) >> 1))
 
+#ifdef VBOX_WITH_CROGL
 typedef struct VBOXWDDM_SWAPCHAIN
 {
@@ -247,4 +254,5 @@
     VBOXVR_LIST VisibleRegions;
 }VBOXWDDM_SWAPCHAIN, *PVBOXWDDM_SWAPCHAIN;
+#endif
 
 typedef struct VBOXWDDM_CONTEXT
@@ -256,8 +264,10 @@
     UINT  EngineAffinity;
     BOOLEAN fRenderFromShadowDisabled;
+#ifdef VBOX_WITH_CROGL
     int32_t hostID;
     uint32_t u32CrConClientID;
     VBOXMP_CRPACKER CrPacker;
     VBOXWDDM_HTABLE Swapchains;
+#endif
     VBOXVIDEOCM_CTX CmContext;
     VBOXVIDEOCM_ALLOC_CONTEXT AllocContext;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp	(revision 50940)
@@ -98,4 +98,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 /* command vbva ring buffer */
 
@@ -1287,2 +1288,3 @@
     return pCmd->Hdr.i32Result;
 }
+#endif
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h	(revision 50940)
@@ -59,4 +59,5 @@
 
 
+#ifdef VBOX_WITH_CROGL
 /* customized VBVA implementation */
 struct VBVAEXBUFFERCONTEXT;
@@ -232,4 +233,5 @@
 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD* pCmd, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion);
 int VBoxCmdVbvaConCmdCompletionData(void *pvCmd, VBOXCMDVBVA_CRCMD_CMD **ppCmd);
+#endif /* #ifdef VBOX_WITH_CROGL */
 
 #endif /* #ifndef ___VBoxMPVbva_h___ */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 50940)
@@ -23,6 +23,9 @@
 #include <iprt/asm.h>
 #include "VBoxMPCr.h"
-
+#include <iprt/mem.h>
+
+#ifdef VBOX_WITH_CROGL
 # include <packer.h>
+#endif
 
 NTSTATUS vboxVdmaPipeConstruct(PVBOXVDMAPIPE pPipe)
@@ -263,5 +266,5 @@
     return true;
 }
-
+#ifdef VBOX_WITH_CROGL
 NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain)
 {
@@ -283,5 +286,5 @@
     return STATUS_NO_MEMORY;
 }
-
+#endif
 static VOID vboxWddmBltPipeRectsTranslate(VBOXVDMAPIPE_RECTS *pRects, int x, int y)
 {
@@ -306,5 +309,5 @@
     return pDup;
 }
-
+#ifdef VBOX_WITH_CROGL
 typedef struct VBOXMP_VDMACR_WRITECOMPLETION
 {
@@ -640,4 +643,5 @@
     return Status;
 }
+#endif
 
 static NTSTATUS vboxVdmaGgDmaColorFill(PVBOXMP_DEVEXT pDevExt, VBOXVDMA_CLRFILL *pCF)
@@ -845,4 +849,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 typedef struct VBOXVDMA_CRRXGENERICSYNC
 {
@@ -1277,4 +1282,5 @@
     }
 }
+#endif
 
 NTSTATUS vboxVdmaProcessBltCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext, VBOXWDDM_DMA_PRIVATEDATA_BLT *pBlt)
@@ -1285,6 +1291,7 @@
     BOOLEAN fRenderFromSharedDisabled = pDevExt->fRenderToShadowDisabled;
     BOOLEAN fVRAMUpdated = FALSE;
-
+#ifdef VBOX_WITH_CROGL
     if (!pDstAlloc->AllocData.hostID && !pSrcAlloc->AllocData.hostID)
+#endif
     {
         /* the allocations contain a real data in VRAM, do blitting */
@@ -1293,4 +1300,5 @@
     }
 
+#ifdef VBOX_WITH_CROGL
     if (VBOXWDDM_IS_REAL_FB_ALLOCATION(pDevExt, pDstAlloc)
             && pDstAlloc->bVisible)
@@ -1311,5 +1319,5 @@
         }
     }
-
+#endif
     return Status;
 }
@@ -1321,4 +1329,5 @@
     VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pAlloc->AllocData.SurfDesc.VidPnSourceId];
     vboxWddmAssignPrimary(pDevExt, pSource, pAlloc, pAlloc->AllocData.SurfDesc.VidPnSourceId);
+#ifdef VBOX_WITH_CROGL
     if (pAlloc->AllocData.hostID)
     {
@@ -1341,5 +1350,8 @@
     }
     else
+#endif
+    {
         WARN(("unexpected flip request"));
+    }
 
     return Status;
@@ -1350,6 +1362,7 @@
     NTSTATUS Status = STATUS_SUCCESS;
     PVBOXWDDM_ALLOCATION pAlloc = pCF->ClrFill.Alloc.pAlloc;
-
+#ifdef VBOX_WITH_CROGL
     if (!pAlloc->AllocData.hostID)
+#endif
     {
         Status = vboxVdmaGgDmaColorFill(pDevExt, &pCF->ClrFill);
@@ -1357,6 +1370,8 @@
             WARN(("vboxVdmaGgDmaColorFill failed Status 0x%x", Status));
     }
+#ifdef VBOX_WITH_CROGL
     else
         WARN(("unexpected clrfill request"));
+#endif
 
     return Status;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h	(revision 50940)
@@ -197,19 +197,4 @@
 } VBOXVDMAPIPE_CMD_RECTSINFO, *PVBOXVDMAPIPE_CMD_RECTSINFO;
 
-typedef struct VBOXVDMAPIPE_CMD_FINISH
-{
-    VBOXVDMAPIPE_CMD_DR Hdr;
-    PVBOXWDDM_CONTEXT pContext;
-    PKEVENT pEvent;
-} VBOXVDMAPIPE_CMD_FINISH, *PVBOXVDMAPIPE_CMD_FINISH;
-
-typedef struct VBOXVDMAPIPE_CMD_CANCEL
-{
-    VBOXVDMAPIPE_CMD_DR Hdr;
-    PVBOXWDDM_CONTEXT pContext;
-    PVBOXWDDM_SWAPCHAIN pSwapchain;
-    PKEVENT pEvent;
-} VBOXVDMAPIPE_CMD_CANCEL, *PVBOXVDMAPIPE_CMD_CANCEL;
-
 typedef struct VBOXVDMAPIPE_CMD_DMACMD
 {
@@ -316,6 +301,7 @@
 
 #endif
-
+#ifdef VBOX_WITH_CROGL
 NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain);
+#endif
 
 NTSTATUS vboxVdmaGgCmdDmaNotifyCompleted(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAPIPE_CMD_DMACMD pCmd, DXGK_INTERRUPT_TYPE enmComplType);
@@ -333,6 +319,7 @@
 NTSTATUS vboxVdmaProcessFlipCmd(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_CONTEXT *pContext, struct VBOXWDDM_DMA_PRIVATEDATA_FLIP *pFlip);
 NTSTATUS vboxVdmaProcessClrFillCmd(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_CONTEXT *pContext, struct VBOXWDDM_DMA_PRIVATEDATA_CLRFILL *pCF);
-
+#ifdef VBOX_WITH_CROGL
 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pRealFbAlloc);
+#endif
 
 #endif /* #ifndef ___VBoxMPVdma_h___ */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 50940)
@@ -347,5 +347,5 @@
 {
     NTSTATUS Status;
-
+#ifdef VBOX_WITH_CROGL
     if ((u8CurCyncState & VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY) == VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY
             && pRealFbAlloc->AllocData.hostID)
@@ -356,5 +356,5 @@
         return Status;
     }
-
+#endif
     Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocData);
     if (NT_SUCCESS(Status))
@@ -366,4 +366,5 @@
             if (NT_SUCCESS(Status))
             {
+#ifdef VBOX_WITH_CROGL
                 if (pDevExt->f3DEnabled)
                 {
@@ -374,4 +375,7 @@
                         WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
                 }
+#else
+                return STATUS_SUCCESS;
+#endif
             }
             else
@@ -769,5 +773,5 @@
     }
 }
-
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS vboxWddmSetupDisplaysNew(PVBOXMP_DEVEXT pDevExt)
 {
@@ -822,7 +826,8 @@
     return STATUS_UNSUCCESSFUL;
 }
-
+#endif
 static NTSTATUS vboxWddmSetupDisplays(PVBOXMP_DEVEXT pDevExt)
 {
+#ifdef VBOX_WITH_CROGL
     if (pDevExt->fCmdVbvaEnabled)
     {
@@ -832,4 +837,5 @@
         return Status;
     }
+#endif
 
     vboxWddmSetupDisplaysLegacy(pDevExt);
@@ -965,4 +971,5 @@
             if (Status == STATUS_SUCCESS)
             {
+#ifdef VBOX_WITH_CROGL
                 pDevExt->f3DEnabled = VBoxMpCrCtlConIs3DSupported();
 
@@ -977,4 +984,5 @@
                     pDevExt->fCmdVbvaEnabled = FALSE;
                 }
+#endif
 
                 /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported.
@@ -1021,6 +1029,7 @@
                     VBoxWddmSlInit(pDevExt);
 
+#ifdef VBOX_WITH_CROGL
                     VBoxMpCrShgsmiTransportCreate(&pDevExt->CrHgsmiTransport, pDevExt);
-
+#endif
 
                     for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
@@ -1028,5 +1037,7 @@
                         PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i];
                         KeInitializeSpinLock(&pSource->AllocationLock);
+#ifdef VBOX_WITH_CROGL
                         VBoxVrListInit(&pSource->VrList);
+#endif
                     }
 
@@ -1173,5 +1184,7 @@
     NTSTATUS Status = STATUS_SUCCESS;
 
+#ifdef VBOX_WITH_CROGL
     VBoxMpCrShgsmiTransportTerm(&pDevExt->CrHgsmiTransport);
+#endif
 
     VBoxWddmSlTerm(pDevExt);
@@ -1298,5 +1311,5 @@
 }
 
-
+#ifdef VBOX_WITH_CROGL
 BOOLEAN DxgkDdiInterruptRoutineNew(
     IN CONST PVOID MiniportDeviceContext,
@@ -1437,5 +1450,5 @@
     return bOur;
 }
-
+#endif
 
 static BOOLEAN DxgkDdiInterruptRoutineLegacy(
@@ -1655,6 +1668,10 @@
     vboxVtListDetach2List(&pDevExt->VhwaCmdList, &pdc->data.VhwaCmdList);
 #endif
+#ifdef VBOX_WITH_CROGL
     if (!pDevExt->fCmdVbvaEnabled)
+#endif
+    {
         vboxVdmaDdiCmdGetCompletedListIsr(pDevExt, &pdc->data.CompletedDdiCmdQueue);
+    }
 
     pdc->data.bNotifyDpc = pDevExt->bNotifyDxDpc;
@@ -1666,4 +1683,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 static VOID DxgkDdiDpcRoutineNew(
     IN CONST PVOID  MiniportDeviceContext
@@ -1711,5 +1729,5 @@
 //    LOGF(("LEAVE, context(0x%p)", MiniportDeviceContext));
 }
-
+#endif
 
 static VOID DxgkDdiDpcRoutineLegacy(
@@ -1913,5 +1931,7 @@
     VbglTerminate();
 
+#ifdef VBOX_WITH_CROGL
     VBoxVrTerm();
+#endif
 
     PRTLOGGER pLogger = RTLogRelSetDefaultInstance(NULL);
@@ -2113,5 +2133,7 @@
                     memset (pQi, 0, sizeof (VBOXWDDM_QI));
                     pQi->u32Version = VBOXVIDEOIF_VERSION;
+#ifdef VBOX_WITH_CROGL
                     pQi->u32VBox3DCaps = VBoxMpCrGetHostCaps();
+#endif
                     pQi->cInfos = VBoxCommonFromDeviceExt(pDevExt)->cDisplays;
 #ifdef VBOX_WITH_VIDEOHWACCEL
@@ -2293,5 +2315,5 @@
             break;
     }
-
+#ifdef VBOX_WITH_CROGL
     PVBOXWDDM_SWAPCHAIN pSwapchain = vboxWddmSwapchainRetainByAlloc(pDevExt, pAllocation);
     if (pSwapchain)
@@ -2300,4 +2322,5 @@
         vboxWddmSwapchainRelease(pSwapchain);
     }
+#endif
 }
 
@@ -2820,4 +2843,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS
 APIENTRY
@@ -2868,5 +2892,5 @@
     return STATUS_SUCCESS;
 }
-
+#endif
 
 static NTSTATUS
@@ -3039,6 +3063,8 @@
     PVBOXWDDM_CALL_ISR pdc = (PVBOXWDDM_CALL_ISR)Context;
     PVBOXMP_DEVEXT pDevExt = pdc->pDevExt;
+#ifdef VBOX_WITH_CROGL
     if (pDevExt->fCmdVbvaEnabled)
         return DxgkDdiInterruptRoutineNew(pDevExt, pdc->MessageNumber);
+#endif
     return DxgkDdiInterruptRoutineLegacy(pDevExt, pdc->MessageNumber);
 }
@@ -3071,4 +3097,5 @@
 #endif
 
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS
 APIENTRY
@@ -3162,4 +3189,5 @@
     return STATUS_UNSUCCESSFUL;
 }
+#endif
 
 static NTSTATUS
@@ -3357,4 +3385,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS
 APIENTRY
@@ -3367,4 +3396,6 @@
     PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter;
 
+    vboxVDbgBreakF();
+
     VBoxCmdVbvaPreempt(pDevExt, &pDevExt->CmdVbva, pPreemptCommand->PreemptionFenceId);
 
@@ -3373,5 +3404,5 @@
     return STATUS_SUCCESS;
 }
-
+#endif
 
 static NTSTATUS
@@ -3391,4 +3422,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 /*
  * DxgkDdiBuildPagingBuffer
@@ -3544,5 +3576,5 @@
     return STATUS_SUCCESS;
 }
-
+#endif
 
 static NTSTATUS
@@ -4093,5 +4125,5 @@
                 break;
             }
-#endif
+
             case VBOXESC_UHGSMI_ALLOCATE:
             {
@@ -4134,36 +4166,4 @@
                     Status = vboxVideoAMgrCtxAllocDestroy(&pContext->AllocContext, pDealocate->hAlloc);
                     Assert(Status == STATUS_SUCCESS);
-                }
-                else
-                    Status = STATUS_BUFFER_TOO_SMALL;
-
-                break;
-            }
-
-            case VBOXESC_GETVBOXVIDEOCMCMD:
-            {
-                if (pDevExt->fCmdVbvaEnabled || pDevExt->fTexPresentEnabled)
-                {
-                    WARN(("VBOXESC_GETVBOXVIDEOCMCMD not supported for CmdVbva or TexPresent mode"));
-                    Status = STATUS_INVALID_PARAMETER;
-                    break;
-                }
-
-                /* get the list of r0->r3 commands (d3d window visible regions reporting )*/
-                PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext;
-                PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pRegions = (PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD)pEscapeHdr;
-                Assert(pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD));
-                if (pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD))
-                {
-                    if (pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D)
-                    {
-                        Status = vboxVideoCmEscape(&pContext->CmContext, pRegions, pEscape->PrivateDriverDataSize);
-                        Assert(Status == STATUS_SUCCESS);
-                    }
-                    else
-                    {
-                        WARN(("VBOXESC_GETVBOXVIDEOCMCMD recieved invalid context type %d", pContext->enmType));
-                        Status = STATUS_INVALID_PARAMETER;
-                    }
                 }
                 else
@@ -4220,4 +4220,5 @@
                 break;
             }
+#endif
 
             case VBOXESC_SETVISIBLEREGION:
@@ -4337,4 +4338,5 @@
                 break;
             }
+#ifdef VBOX_WITH_CROGL
             case VBOXESC_SETCTXHOSTID:
             {
@@ -4382,4 +4384,5 @@
                 break;
             }
+#endif
             case VBOXESC_REINITVIDEOMODES:
             {
@@ -4766,4 +4769,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS
 APIENTRY
@@ -4783,5 +4787,5 @@
     return STATUS_SUCCESS;
 }
-
+#endif
 
 static NTSTATUS
@@ -5765,4 +5769,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 static NTSTATUS
 APIENTRY
@@ -5932,4 +5937,5 @@
     return STATUS_SUCCESS;
 }
+#endif
 
 static void vboxWddmPatchLocationInit(D3DDDI_PATCHLOCATIONLIST *pPatchLocationListOut, UINT idx, UINT offPatch)
@@ -6083,4 +6089,5 @@
 }
 
+#ifdef VBOX_WITH_CROGL
 /**
  * DxgkDdiPresent
@@ -6362,4 +6369,5 @@
     return STATUS_SUCCESS;
 }
+#endif
 
 /**
@@ -6682,5 +6690,5 @@
                 Assert(tmpStatus == STATUS_SUCCESS);
             }
-
+#ifdef VBOX_WITH_CROGL
             if (!VBOXWDDM_IS_DISPLAYONLY() && pDevExt->f3DEnabled)
             {
@@ -6690,5 +6698,5 @@
                     WARN(("VBoxMpCrCtlConConnect failed rc (%d), ignoring for system context", rc));
             }
-
+#endif
             Status = STATUS_SUCCESS;
         }
@@ -6703,4 +6711,5 @@
                 switch (pInfo->enmType)
                 {
+#ifdef VBOX_WITH_CROGL
                     case VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D:
                     {
@@ -6806,4 +6815,5 @@
                         break;
                     }
+#endif
                     case VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D:
                     {
@@ -6915,15 +6925,19 @@
     }
 
+#ifdef VBOX_WITH_CROGL
     if (pContext->u32CrConClientID)
     {
         VBoxMpCrCtlConDisconnect(pDevExt, &pDevExt->CrCtlCon, pContext->u32CrConClientID);
     }
+#endif
 
     vboxWddmModeRenderFromShadowDisableUnregister(pDevExt, pContext);
 
+#ifdef VBOX_WITH_CROGL
     /* first terminate the swapchain, this will also ensure
      * all currently pending driver->user Cm commands
      * (i.e. visible regions commands) are completed */
     vboxWddmSwapchainCtxTerm(pDevExt, pContext);
+#endif
 
     Status = vboxVideoAMgrCtxDestroy(&pContext->AllocContext);
@@ -7240,5 +7254,9 @@
 static NTSTATUS vboxWddmInitFullGraphicsDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath, BOOLEAN fCmdVbva)
 {
+#ifdef VBOX_WITH_CROGL
 #define VBOXWDDM_CALLBACK_NAME(_base, _fCmdVbva) ((_fCmdVbva) ? _base##New : _base##Legacy)
+#else
+#define VBOXWDDM_CALLBACK_NAME(_base, _fCmdVbva) (_base##Legacy)
+#endif
 
     DRIVER_INITIALIZATION_DATA DriverInitializationData = {'\0'};
@@ -7401,5 +7419,5 @@
 
         Status = STATUS_SUCCESS;
-
+#ifdef VBOX_WITH_CROGL
         VBoxMpCrCtlConInit();
 
@@ -7407,4 +7425,5 @@
         LOG(("Doing the 3D check.."));
         if (!VBoxMpCrCtlConIs3DSupported())
+#endif
         {
 #ifdef VBOX_WDDM_WIN8
@@ -7431,6 +7450,8 @@
         if (NT_SUCCESS(Status))
         {
+#ifdef VBOX_WITH_CROGL
             rc = VBoxVrInit();
             if (RT_SUCCESS(rc))
+#endif
             {
 #ifdef VBOX_WDDM_WIN8
@@ -7442,12 +7463,20 @@
 #endif
                 {
-                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath, !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA));
+                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath,
+#ifdef VBOX_WITH_CROGL
+                            !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA)
+#else
+                            FALSE
+#endif
+                            );
                 }
 
                 if (NT_SUCCESS(Status))
                     return Status;
-
+#ifdef VBOX_WITH_CROGL
                 VBoxVrTerm();
-            }
+#endif
+            }
+#ifdef VBOX_WITH_CROGL
             else
             {
@@ -7455,4 +7484,5 @@
                 Status = STATUS_UNSUCCESSFUL;
             }
+#endif
         }
         else
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h	(revision 50939)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h	(revision 50940)
@@ -128,4 +128,5 @@
 DECLINLINE(void) vboxWddmAssignShadow(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
 {
+#ifdef VBOX_WITH_CROGL
     if (pDevExt->fCmdVbvaEnabled)
     {
@@ -133,4 +134,5 @@
         return;
     }
+#endif
 
     if (pSource->pShadowAllocation == pAllocation)
@@ -238,4 +240,5 @@
 bool vboxWddmGhDisplayCheckSetInfoFromSource(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource);
 
+#ifdef VBOX_WITH_CROGL
 #define VBOXWDDMENTRY_2_SWAPCHAIN(_pE) ((PVBOXWDDM_SWAPCHAIN)((uint8_t*)(_pE) - RT_OFFSETOF(VBOXWDDM_SWAPCHAIN, DevExtListEntry)))
 
@@ -244,4 +247,5 @@
     IN ULONG MessageNumber
     );
+#endif
 
 #ifdef VBOX_WDDM_WIN8
Index: trunk/src/VBox/Devices/Graphics/DevVGA.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA.cpp	(revision 50939)
+++ trunk/src/VBox/Devices/Graphics/DevVGA.cpp	(revision 50940)
@@ -5232,5 +5232,7 @@
 #endif
 
+#ifdef VBOX_WITH_CRHGSMI
     vboxCmdVBVACmdTimer(pThis);
+#endif
 }
 
@@ -5952,9 +5954,9 @@
     pThis->IVBVACallbacks.pfnCrHgsmiCommandCompleteAsync = vboxVDMACrHgsmiCommandCompleteAsync;
     pThis->IVBVACallbacks.pfnCrHgsmiControlCompleteAsync = vboxVDMACrHgsmiControlCompleteAsync;
-# endif
-#endif
+
     pThis->IVBVACallbacks.pfnCrCtlSubmit = vboxCmdVBVACmdHostCtl;
     pThis->IVBVACallbacks.pfnCrCtlSubmitSync = vboxCmdVBVACmdHostCtlSync;
-
+# endif
+#endif
     /*
      * We use our own critical section to avoid unncessary pointer indirections
Index: trunk/src/VBox/Devices/Graphics/DevVGA.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA.h	(revision 50939)
+++ trunk/src/VBox/Devices/Graphics/DevVGA.h	(revision 50940)
@@ -622,5 +622,4 @@
 int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
 int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
-# endif
 int vboxCmdVBVACmdHostCtl(PPDMIDISPLAYVBVACALLBACKS pInterface,
                                                                struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
@@ -629,4 +628,5 @@
 int vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
                                                                struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
+# endif
 
 int vboxVBVASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
@@ -645,9 +645,10 @@
 # endif /* VBOX_WITH_VDMA */
 
+# ifdef VBOX_WITH_CRHGSMI
 int vboxCmdVBVACmdSubmit(PVGASTATE pVGAState);
 int vboxCmdVBVACmdFlush(PVGASTATE pVGAState);
 void vboxCmdVBVACmdTimer(PVGASTATE pVGAState);
 int vboxCmdVBVACmdCtl(PVGASTATE pVGAState, VBOXCMDVBVA_CTL *pCtl, uint32_t cbCtl);
-
+# endif /* VBOX_WITH_CRHGSMI */
 #endif /* VBOX_WITH_HGSMI */
 
Index: trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp	(revision 50939)
+++ trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp	(revision 50940)
@@ -1942,14 +1942,19 @@
         case VBVA_CMDVBVA_SUBMIT:
         {
+# ifdef VBOX_WITH_CRHGSMI
             rc = vboxCmdVBVACmdSubmit(pVGAState);
+#endif
             break;
         }
         case VBVA_CMDVBVA_FLUSH:
         {
+# ifdef VBOX_WITH_CRHGSMI
             rc =vboxCmdVBVACmdFlush(pVGAState);
+#endif
             break;
         }
         case VBVA_CMDVBVA_CTL:
         {
+#ifdef VBOX_WITH_CRHGSMI
             if (cbBuffer < VBoxSHGSMIBufferHeaderSize() + sizeof (VBOXCMDVBVA_CTL))
             {
@@ -1961,7 +1966,7 @@
                 break;
             }
-
             VBOXCMDVBVA_CTL *pCtl = (VBOXCMDVBVA_CTL*)VBoxSHGSMIBufferData((PVBOXSHGSMIHEADER)pvBuffer);
             rc = vboxCmdVBVACmdCtl(pVGAState, pCtl, cbBuffer - VBoxSHGSMIBufferHeaderSize());
+#endif
             break;
         }
Index: trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp	(revision 50939)
+++ trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp	(revision 50940)
@@ -666,4 +666,5 @@
     PHGSMIINSTANCE pHgsmi;
     PVGASTATE pVGAState;
+#ifdef VBOX_WITH_CRHGSMI
     VBVAEXHOSTCONTEXT CmdVbva;
     VBOXVDMATHREAD Thread;
@@ -672,8 +673,11 @@
     RTSEMEVENTMULTI HostCrCtlCompleteEvent;
     int32_t volatile i32cHostCrCtlCompleted;
+#endif
 #ifdef VBOX_VDMA_WITH_WATCHDOG
     PTMTIMERR3 WatchDogTimer;
 #endif
 } VBOXVDMAHOST, *PVBOXVDMAHOST;
+
+#ifdef VBOX_WITH_CRHGSMI
 
 int VBoxVDMAThreadNotifyConstructSucceeded(PVBOXVDMATHREAD pThread)
@@ -778,6 +782,4 @@
 
 static int vdmaVBVACtlSubmitSync(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource);
-
-#ifdef VBOX_WITH_CRHGSMI
 
 typedef DECLCALLBACK(void) FNVBOXVDMACRCTL_CALLBACK(PVGASTATE pVGAState, PVBOXVDMACMD_CHROMIUM_CTL pCmd, void* pvContext);
@@ -1706,34 +1708,4 @@
 }
 
-#endif
-
-#ifdef VBOX_VDMA_WITH_WORKERTHREAD
-/* to simplify things and to avoid extra backend if modifications we assume the VBOXVDMA_RECTL is the same as VBVACMDHDR */
-AssertCompile(sizeof(VBOXVDMA_RECTL) == sizeof(VBVACMDHDR));
-AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, left) == RT_SIZEOFMEMB(VBVACMDHDR, x));
-AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, top) == RT_SIZEOFMEMB(VBVACMDHDR, y));
-AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, width) == RT_SIZEOFMEMB(VBVACMDHDR, w));
-AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, height) == RT_SIZEOFMEMB(VBVACMDHDR, h));
-AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, left) == RT_OFFSETOF(VBVACMDHDR, x));
-AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, top) == RT_OFFSETOF(VBVACMDHDR, y));
-AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, width) == RT_OFFSETOF(VBVACMDHDR, w));
-AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, height) == RT_OFFSETOF(VBVACMDHDR, h));
-
-static int vboxVDMANotifyPrimaryUpdate (PVGASTATE pVGAState, unsigned uScreenId, const VBOXVDMA_RECTL * pRectl)
-{
-    pVGAState->pDrv->pfnVBVAUpdateBegin (pVGAState->pDrv, uScreenId);
-
-    /* Updates the rectangle and sends the command to the VRDP server. */
-    pVGAState->pDrv->pfnVBVAUpdateProcess (pVGAState->pDrv, uScreenId,
-            (const PVBVACMDHDR)pRectl /* <- see above AssertCompile's and comments */,
-            sizeof (VBOXVDMA_RECTL));
-
-    pVGAState->pDrv->pfnVBVAUpdateEnd (pVGAState->pDrv, uScreenId, pRectl->left, pRectl->top,
-                                               pRectl->width, pRectl->height);
-
-    return VINF_SUCCESS;
-}
-#endif
-
 static int vboxVDMACmdExecBltPerform(PVBOXVDMAHOST pVdma,
         uint8_t *pvDstSurf, const uint8_t *pvSrcSurf,
@@ -1889,10 +1861,4 @@
         vboxVDMARectlUnite(&updateRectl, &pBlt->dstRectl);
     }
-
-#ifdef VBOX_VDMA_WITH_WORKERTHREAD
-    int iView = 0;
-    /* @todo: fixme: check if update is needed and get iView */
-    vboxVDMANotifyPrimaryUpdate (pVdma->pVGAState, iView, &updateRectl);
-#endif
 
     return cbBlt;
@@ -2192,4 +2158,6 @@
 }
 
+#endif /* #ifdef VBOX_WITH_CRHGSMI */
+
 #ifdef VBOX_VDMA_WITH_WATCHDOG
 static DECLCALLBACK(void) vboxVDMAWatchDogTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
@@ -2214,9 +2182,5 @@
 {
     int rc;
-#ifdef VBOX_VDMA_WITH_WORKERTHREAD
-    PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(RT_OFFSETOF(VBOXVDMAHOST, CmdPool.aCmds[cPipeElements]));
-#else
     PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(sizeof(*pVdma));
-#endif
     Assert(pVdma);
     if (pVdma)
@@ -2225,7 +2189,4 @@
         pVdma->pVGAState = pVGAState;
 
-        rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent);
-        if (RT_SUCCESS(rc))
-        {
 #ifdef VBOX_VDMA_WITH_WATCHDOG
             rc = PDMDevHlpTMTimerCreate(pVGAState->pDevInsR3, TMCLOCK_REAL, vboxVDMAWatchDogTimer,
@@ -2234,4 +2195,9 @@
             AssertRC(rc);
 #endif
+
+#ifdef VBOX_WITH_CRHGSMI
+        rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent);
+        if (RT_SUCCESS(rc))
+        {
             rc = VBoxVBVAExHSInit(&pVdma->CmdVbva);
             if (RT_SUCCESS(rc))
@@ -2241,7 +2207,5 @@
                 {
                     pVGAState->pVdma = pVdma;
-#ifdef VBOX_WITH_CRHGSMI
                     int rcIgnored = vboxVDMACrCtlHgsmiSetup(pVdma); NOREF(rcIgnored); /** @todo is this ignoring intentional? */
-#endif
                     return VINF_SUCCESS;
                 }
@@ -2261,4 +2225,8 @@
 
         RTMemFree(pVdma);
+#else
+        pVGAState->pVdma = pVdma;
+        return VINF_SUCCESS;
+#endif
     }
     else
@@ -2270,4 +2238,5 @@
 int vboxVDMAReset(struct VBOXVDMAHOST *pVdma)
 {
+#ifdef VBOX_WITH_CRHGSMI
     VBVAEXHOSTCTL Ctl;
     Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_RESET;
@@ -2278,4 +2247,5 @@
         return rc;
     }
+#endif
     return VINF_SUCCESS;
 }
@@ -2283,4 +2253,5 @@
 int vboxVDMADestruct(struct VBOXVDMAHOST *pVdma)
 {
+#ifdef VBOX_WITH_CRHGSMI
     VBVAEXHOSTCTL Ctl;
     Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_TERM;
@@ -2294,4 +2265,5 @@
     VBoxVBVAExHSTerm(&pVdma->CmdVbva);
     RTSemEventMultiDestroy(pVdma->HostCrCtlCompleteEvent);
+#endif
     RTMemFree(pVdma);
     return VINF_SUCCESS;
@@ -2348,5 +2320,4 @@
 void vboxVDMAControl(struct VBOXVDMAHOST *pVdma, PVBOXVDMA_CTL pCmd, uint32_t cbCmd)
 {
-#if 1
     PHGSMIINSTANCE pIns = pVdma->pHgsmi;
 
@@ -2368,5 +2339,5 @@
 #endif
         default:
-            AssertBreakpoint();
+            WARN(("cmd not supported"));
             pCmd->i32Result = VERR_NOT_SUPPORTED;
     }
@@ -2374,32 +2345,4 @@
     int rc = VBoxSHGSMICommandComplete (pIns, pCmd);
     AssertRC(rc);
-#else
-    /* test asinch completion */
-    VBOXVDMACMD_SUBMIT_CONTEXT Context;
-    Context.pVdma = pVdma;
-    Context.Cmd.enmType = VBOXVDMAPIPE_CMD_TYPE_DMACTL;
-    Context.Cmd.u.pCtl = pCmd;
-
-    int rc = vboxVDMAPipeModifyClient(&pVdma->Pipe, vboxVDMACommandSubmitCb, &Context);
-    AssertRC(rc);
-    if (RT_SUCCESS(rc))
-    {
-        Assert(Context.bQueued);
-        if (Context.bQueued)
-        {
-            /* success */
-            return;
-        }
-        rc = VERR_OUT_OF_RESOURCES;
-    }
-
-    /* failure */
-    Assert(RT_FAILURE(rc));
-    PHGSMIINSTANCE pIns = pVdma->pHgsmi;
-    pCmd->i32Result = rc;
-    int tmpRc = VBoxSHGSMICommandComplete (pIns, pCmd);
-    AssertRC(tmpRc);
-
-#endif
 }
 
@@ -2422,42 +2365,15 @@
         return;
     }
-#endif
-
-#ifndef VBOX_VDMA_WITH_WORKERTHREAD
+
     vboxVDMACommandProcess(pVdma, pCmd, cbCmd);
 #else
-
-# ifdef DEBUG_misha
-    Assert(0);
-# endif
-
-    VBOXVDMACMD_SUBMIT_CONTEXT Context;
-    Context.pVdma = pVdma;
-    Context.Cmd.enmType = VBOXVDMAPIPE_CMD_TYPE_DMACMD;
-    Context.Cmd.u.pDr = pCmd;
-
-    rc = vboxVDMAPipeModifyClient(&pVdma->Pipe, vboxVDMACommandSubmitCb, &Context);
+    pCmd->rc = rc;
+    rc = VBoxSHGSMICommandComplete (pVdma->pHgsmi, pCmd);
     AssertRC(rc);
-    if (RT_SUCCESS(rc))
-    {
-        Assert(Context.bQueued);
-        if (Context.bQueued)
-        {
-            /* success */
-            return;
-        }
-        rc = VERR_OUT_OF_RESOURCES;
-    }
-    /* failure */
-    Assert(RT_FAILURE(rc));
-    PHGSMIINSTANCE pIns = pVdma->pHgsmi;
-    pCmd->rc = rc;
-    int tmpRc = VBoxSHGSMICommandComplete (pIns, pCmd);
-    AssertRC(tmpRc);
 #endif
 }
 
 /**/
-
+#ifdef VBOX_WITH_CRHGSMI
 static int vdmaVBVACtlSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete)
 {
@@ -2794,2 +2710,4 @@
     vboxVDMACmdSubmitPerform(pVGAState->pVdma);
 }
+
+#endif
Index: trunk/src/VBox/Main/include/DisplayImpl.h
===================================================================
--- trunk/src/VBox/Main/include/DisplayImpl.h	(revision 50939)
+++ trunk/src/VBox/Main/include/DisplayImpl.h	(revision 50940)
@@ -174,8 +174,8 @@
     void handleCrHgsmiControlProcess(PVBOXVDMACMD_CHROMIUM_CTL pCtl, uint32_t cbCtl);
 #endif
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     int  handleCrHgcmCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
                                         PFNCRCTLCOMPLETION pfnCompletion,
                                         void *pvCompletion);
-#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     void  handleCrVRecScreenshotPerform(uint32_t uScreen,
                                         uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBitsPerPixel,
@@ -243,5 +243,5 @@
 #endif
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     void crViewportNotify(class VMMDev *pVMMDev, ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height);
 #endif
@@ -272,4 +272,5 @@
     static DECLCALLBACK(void)  displayCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
 #endif
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     static DECLCALLBACK(int)  displayCrHgcmCtlSubmit(PPDMIDISPLAYCONNECTOR pInterface,
                                         struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
@@ -277,4 +278,5 @@
                                         void *pvCompletion);
     static DECLCALLBACK(void)  displayCrHgcmCtlSubmitCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext);
+#endif
 #ifdef VBOX_WITH_HGSMI
     static DECLCALLBACK(int)   displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags);
@@ -370,10 +372,9 @@
     static int  displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height);
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     static BOOL  displayCheckTakeScreenshotCrOgl(Display *pDisplay, ULONG aScreenId, uint8_t *pu8Data, uint32_t u32Width, uint32_t u32Height);
-#endif
-
     int crCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, PFNCRCTLCOMPLETION pfnCompletion, void *pvCompletion);
     int crCtlSubmitSync(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
+#endif
 
 private:
@@ -387,5 +388,5 @@
     void videoAccelFlush(void);
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     int crOglWindowsShow(bool fShow);
 #endif
Index: trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp	(revision 50939)
+++ trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp	(revision 50940)
@@ -2131,4 +2131,5 @@
     }
 
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     VBOXCRCMDCTL_HGCM data;
     data.Hdr.enmType = VBOXCRCMDCTL_TYPE_HGCM;
@@ -2147,6 +2148,7 @@
 
     LogRel(("VRDE: %s 3D redirect.\n", fEnable? "Enabled": "Disabled"));
-#ifdef DEBUG_misha
+# ifdef DEBUG_misha
     AssertFailed();
+# endif
 #endif
 
Index: trunk/src/VBox/Main/src-client/DisplayImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/DisplayImpl.cpp	(revision 50939)
+++ trunk/src/VBox/Main/src-client/DisplayImpl.cpp	(revision 50940)
@@ -315,5 +315,5 @@
         uint32_t cy = 0;
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
         BOOL f3DSnapshot = FALSE;
         BOOL is3denabled;
@@ -731,5 +731,5 @@
 }
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
 int Display::crOglWindowsShow(bool fShow)
 {
@@ -2446,5 +2446,5 @@
             }
         }
-#endif /* VBOX_WITH_CROGL */
+#endif /* #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) */
     }
     else
@@ -2597,5 +2597,5 @@
 }
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
 BOOL Display::displayCheckTakeScreenshotCrOgl(Display *pDisplay, ULONG aScreenId, uint8_t *pu8Data, uint32_t u32Width, uint32_t u32Height)
 {
@@ -3610,5 +3610,5 @@
 }
 
-#ifdef VBOX_WITH_CROGL
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
 void Display::crViewportNotify(VMMDev *pVMMDev, ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height)
 {
@@ -4394,4 +4394,5 @@
 #endif
 
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
 DECLCALLBACK(void)  Display::displayCrHgcmCtlSubmitCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext)
 {
@@ -4446,5 +4447,4 @@
 }
 
-#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
 bool  Display::handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t u64TimeStamp)
 {
@@ -5056,5 +5056,7 @@
     pThis->IConnector.pfnCrHgsmiControlProcess = Display::displayCrHgsmiControlProcess;
 #endif
+#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
     pThis->IConnector.pfnCrHgcmCtlSubmit       = Display::displayCrHgcmCtlSubmit;
+#endif
 #ifdef VBOX_WITH_HGSMI
     pThis->IConnector.pfnVBVAEnable            = Display::displayVBVAEnable;
