VirtualBox

Changeset 33117 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 13, 2010 9:20:52 PM (14 years ago)
Author:
vboxsync
Message:

wddm/3d: chromium hgsmi transport (guest part 2, disabled)

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Display
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/Makefile.kmk

    r33048 r33117  
    8686 VBoxDispD3D_DEFS   += VBOXWDDM_TEST_UHGSMI
    8787endif
     88ifdef VBOX_WITH_CRHGSMI
     89 VBoxDispD3D_DEFS   += VBOX_WITH_CRHGSMI
     90endif
    8891VBoxDispD3D_SOURCES  = \
    8992        wddm/VBoxDispD3D.cpp \
     
    9295    wddm/VBoxDispMp.cpp \
    9396    wddm/VBoxScreen.cpp \
    94     wddm/VBoxUhgsmiDisp.cpp \
     97    $(if $(VBOX_WITH_CRHGSMI),wddm/VBoxUhgsmiDisp.cpp,) \
     98    $(if $(VBOX_WITH_CRHGSMI),wddm/VBoxUhgsmiKmt.cpp,) \
    9599    wddm/VBoxDispMpTst.cpp \
    96100        wddm/VBoxDispD3D.def \
     
    107111VBoxDispD3D64_SOURCES  = $(subst VBoxDispD3D.def,VBoxDispD3D64.def,$(VBoxDispD3D_SOURCES))
    108112 endif
     113endif
     114
     115ifdef VBOX_WITH_CRHGSMI
     116#
     117# VBoxCrHgsmi
     118#
     119LIBRARIES += VBoxCrHgsmi
     120VBoxCrHgsmi_TEMPLATE    = VBOXGUESTR3LIB
     121VBoxCrHgsmi_DEFS        = UNICODE _UNICODE VBOX_WITH_CRHGSMI IN_VBOXCRHGSMI VBOX_WITH_WDDM VBOX_WITH_VDMA
     122VBoxCrHgsmi_SOURCES     = \
     123        wddm/VBoxCrHgsmi.cpp \
     124        wddm/VBoxUhgsmiKmt.cpp
     125VBoxCrHgsmi_SDKS        = WINDDKWLH
    109126endif
    110127
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r32962 r33117  
    2626#include "VBoxDispD3D.h"
    2727#include "VBoxScreen.h"
     28#include <VBox/VBoxCrHgsmi.h>
    2829
    2930#ifdef VBOX_WDDMDISP_WITH_PROFILE
     
    705706
    706707#define VBOX_QUERYTYPE_COUNT() RT_ELEMENTS(gVBoxQueryTypes)
     708
     709static CRITICAL_SECTION g_VBoxCritSect;
     710
     711void vboxDispLock()
     712{
     713    EnterCriticalSection(&g_VBoxCritSect);
     714}
     715
     716void vboxDispUnlock()
     717{
     718    LeaveCriticalSection(&g_VBoxCritSect);
     719}
     720
     721void vboxDispLockInit()
     722{
     723    InitializeCriticalSection(&g_VBoxCritSect);
     724}
     725
     726
     727#ifdef VBOX_WITH_CRHGSMI
     728/* cr hgsmi */
     729static VBOXCRHGSMI_CALLBACKS g_VBoxCrHgsmiCallbacks = {0};
     730static VBOXUHGSMI_PRIVATE_KMT g_VBoxUhgsmiKmt;
     731static uint32_t g_cVBoxUhgsmiKmtRefs = 0;
     732#endif
     733
     734VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks)
     735{
     736#ifdef VBOX_WITH_CRHGSMI
     737    g_VBoxCrHgsmiCallbacks = *pCallbacks;
     738#endif
     739    return VINF_SUCCESS;
     740}
     741
     742#ifdef VBOX_WITH_CRHGSMI
     743static __declspec(thread) PVBOXUHGSMI_PRIVATE_BASE gt_pHgsmi = NULL;
     744#endif
     745
     746VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm()
     747{
     748    return VINF_SUCCESS;
     749}
     750
     751VBOXWDDMDISP_DECL(HVBOXCRHGSMI_CLIENT) VBoxDispCrHgsmiQueryClient()
     752{
     753#ifdef VBOX_WITH_CRHGSMI
     754    PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi;
     755    if (pHgsmi)
     756        return pHgsmi->hClient;
     757#endif
     758    return NULL;
     759}
     760
     761#ifdef VBOX_WITH_CRHGSMI
     762static int vboxUhgsmiGlobalRetain()
     763{
     764    int rc = VINF_SUCCESS;
     765    vboxDispLock();
     766    if (!g_cVBoxUhgsmiKmtRefs)
     767    {
     768        rc = vboxUhgsmiKmtCreate(&g_VBoxUhgsmiKmt, TRUE);
     769        AssertRC(rc);
     770    }
     771
     772    if (RT_SUCCESS(rc))
     773    {
     774        ++g_cVBoxUhgsmiKmtRefs;
     775    }
     776    vboxDispUnlock();
     777
     778    return rc;
     779}
     780
     781static int vboxUhgsmiGlobalRelease()
     782{
     783    int rc = VINF_SUCCESS;
     784    vboxDispLock();
     785    --g_cVBoxUhgsmiKmtRefs;
     786    if (!g_cVBoxUhgsmiKmtRefs)
     787    {
     788        rc = vboxUhgsmiKmtDestroy(&g_VBoxUhgsmiKmt);
     789        AssertRC(rc);
     790    }
     791    vboxDispUnlock();
     792    return rc;
     793}
     794
     795DECLINLINE(void) vboxDispCrHgsmiClientSet(PVBOXUHGSMI_PRIVATE_BASE pHgsmi)
     796{
     797    gt_pHgsmi = pHgsmi;
     798}
     799
     800DECLINLINE(void) vboxDispCrHgsmiClientClear()
     801{
     802    gt_pHgsmi = NULL;
     803}
     804
     805int vboxUhgsmiGlobalSetCurrent()
     806{
     807    int rc = vboxUhgsmiGlobalRetain();
     808    AssertRC(rc);
     809    if (RT_SUCCESS(rc))
     810        vboxDispCrHgsmiClientSet(&g_VBoxUhgsmiKmt.BasePrivate);
     811    return rc;
     812}
     813
     814int vboxUhgsmiGlobalClearCurrent()
     815{
     816    vboxUhgsmiGlobalRelease();
     817    vboxDispCrHgsmiClientClear();
     818    return VINF_SUCCESS;
     819}
     820
     821class VBoxDispCrHgsmiScope
     822{
     823public:
     824    VBoxDispCrHgsmiScope(PVBOXUHGSMI_PRIVATE_BASE pHgsmi)
     825    {
     826        vboxDispCrHgsmiClientSet(pHgsmi);
     827    }
     828
     829    ~VBoxDispCrHgsmiScope()
     830    {
     831        vboxDispCrHgsmiClientClear();
     832    }
     833private:
     834};
     835
     836#define VBOXDISPCRHGSMI_SCOPE_SET_DEV(_pDev) VBoxDispCrHgsmiScope __vboxCrHgsmiScope(&(_pDev)->Uhgsmi.BasePrivate)
     837#define VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL() VBoxDispCrHgsmiScope __vboxCrHgsmiScope(&g_VBoxUhgsmiKmt.BasePrivate)
     838#else
     839#define VBOXDISPCRHGSMI_SCOPE_SET_DEV(_pDev) do {} while(0)
     840#define VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL() do {} while(0)
     841#endif
    707842
    708843#ifdef VBOX_WITH_VIDEOHWACCEL
     
    27172852}
    27182853
    2719 
    2720 static CRITICAL_SECTION g_VBoxCritSect;
    2721 
    2722 void vboxDispLock()
    2723 {
    2724     EnterCriticalSection(&g_VBoxCritSect);
    2725 }
    2726 
    2727 void vboxDispUnlock()
    2728 {
    2729     LeaveCriticalSection(&g_VBoxCritSect);
    2730 }
    2731 
    2732 void vboxDispLockInit()
    2733 {
    2734     InitializeCriticalSection(&g_VBoxCritSect);
    2735 }
    2736 
    27372854/**
    27382855 * DLL entry point.
     
    28792996{
    28802997    vboxVDbgPrint(("==> "__FUNCTION__", hAdapter(0x%p), caps type(%d)\n", hAdapter, pData->Type));
     2998
     2999    VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL();
    28813000
    28823001    HRESULT hr = S_OK;
     
    31643283    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    31653284    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3285    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    31663286    Assert(pDevice);
    31673287    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
     
    31753295{
    31763296    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
     3297//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3298//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    31773299    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    31783300    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    31833305{
    31843306    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
     3307//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3308//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    31853309    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    31863310    Assert(0);
     
    31953319    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    31963320    Assert(pDevice);
     3321    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    31973322    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    31983323
     
    32203345    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    32213346    Assert(pDevice);
     3347    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    32223348    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    32233349    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)hTexture;
     
    32533379    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    32543380    Assert(pDevice);
     3381    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    32553382    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    32563383    IDirect3DPixelShader9 *pShader = (IDirect3DPixelShader9*)hShaderHandle;
     
    32683395    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    32693396    Assert(pDevice);
     3397    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    32703398    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    32713399    HRESULT hr = pDevice9If->SetPixelShaderConstantF(pData->Register, pRegisters, pData->Count);
     
    32813409    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    32823410    Assert(pDevice);
     3411    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    32833412    HRESULT hr = S_OK;
    32843413//    IDirect3DVertexBuffer9 *pStreamData;
     
    33123441    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    33133442    Assert(pDevice);
     3443    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     3444
    33143445    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    33153446    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hIndexBuffer;
     
    33403471    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    33413472    Assert(pDevice);
     3473    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     3474
    33423475    HRESULT hr = S_OK;
    33433476    pDevice->IndiciesUm.pvBuffer = pUMBuffer;
     
    33533486    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    33543487    Assert(pDevice);
     3488    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     3489
    33553490    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    33563491    Assert(!pFlagBuffer);
     
    36403775    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    36413776    Assert(pDevice);
     3777    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     3778
    36423779    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    36433780//#ifdef DEBUG_misha
     
    36943831    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    36953832    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     3833    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3834    Assert(pDevice);
     3835    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    36963836    Assert(0);
    36973837    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    37033843    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    37043844    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     3845    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3846    Assert(pDevice);
     3847    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    37053848    Assert(0);
    37063849    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    37143857    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    37153858    Assert(pDevice);
     3859    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     3860
    37163861    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    37173862    HRESULT hr;
     
    38113956    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    38123957    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     3958    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3959    Assert(pDevice);
     3960    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    38133961    Assert(0);
    38143962    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    38203968    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    38213969    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     3970    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3971    Assert(pDevice);
     3972    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    38223973    Assert(0);
    38233974    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    38293980    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    38303981    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     3982    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     3983    Assert(pDevice);
     3984    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    38313985    Assert(0);
    38323986    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    38403994    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    38413995    Assert(pDevice);
     3996    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    38423997    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    38433998    PVBOXWDDMDISP_RESOURCE pDstRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource;
     
    39584113    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    39594114    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4115    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4116    Assert(pDevice);
     4117    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    39604118    Assert(0);
    39614119    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    39654123{
    39664124    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
     4125//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4126//    Assert(pDevice);
     4127//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    39674128    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    39684129    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    39854146    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    39864147    Assert(pDevice);
     4148    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    39874149    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    39884150    HRESULT hr = pDevice9If->Clear(NumRect, (D3DRECT*)pRect /* see AssertCompile above */,
     
    39994161    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40004162    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4163    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4164    Assert(pDevice);
     4165    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40014166    Assert(0);
    40024167    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40084173    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40094174    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4175    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4176    Assert(pDevice);
     4177    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40104178    Assert(0);
    40114179    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40194187    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    40204188    Assert(pDevice);
     4189    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40214190    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    40224191    HRESULT hr = pDevice9If->SetVertexShaderConstantF(
     
    40324201    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40334202    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4203    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4204    Assert(pDevice);
     4205    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40344206    Assert(0);
    40354207    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40404212    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40414213    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4214    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4215    Assert(pDevice);
     4216    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40424217    Assert(0);
    40434218    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40504225    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    40514226    Assert(pDevice);
     4227    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     4228
    40524229    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    40534230    pDevice->ViewPort.X = pData->X;
     
    40664243    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    40674244    Assert(pDevice);
     4245    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     4246
    40684247    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    40694248    pDevice->ViewPort.MinZ = pData->MinZ;
     
    40784257    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40794258    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4259    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4260    Assert(pDevice);
     4261    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40804262    Assert(0);
    40814263    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40864268    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40874269    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4270    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4271    Assert(pDevice);
     4272    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40884273    Assert(0);
    40894274    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    40944279    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    40954280    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4281    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4282    Assert(pDevice);
     4283    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    40964284    Assert(0);
    40974285    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    41024290    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    41034291    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4292    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4293    Assert(pDevice);
     4294    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    41044295    Assert(0);
    41054296    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    41124303    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    41134304    Assert(pDevice);
     4305    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     4306
    41144307    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    41154308    HRESULT hr = pDevice9If->SetClipPlane(pData->Index, pData->Plane);
     
    41234316    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    41244317    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4318//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4319//    Assert(pDevice);
     4320//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    41254321    HRESULT hr = S_OK;
    41264322    switch (DevInfoID)
     
    41544350    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    41554351    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4352    Assert(pDevice);
     4353    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    41564354    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hResource;
    41574355    Assert(pData->SubResourceIndex < pRc->cAllocations);
     
    45474745    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    45484746    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4747    Assert(pDevice);
     4748    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    45494749    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hResource;
    45504750    HRESULT hr = S_OK;
     
    47034903    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    47044904    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4905    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4906    Assert(pDevice);
     4907    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    47054908    Assert(0);
    47064909    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    47114914    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    47124915    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4916    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4917    Assert(pDevice);
     4918    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    47134919    Assert(0);
    47144920    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    47194925    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    47204926    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4927    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4928    Assert(pDevice);
     4929    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    47214930    Assert(0);
    47224931    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    53015510    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    53025511    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     5512    Assert(pDevice);
     5513    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    53035514    PVBOXWDDMDISP_ADAPTER pAdapter = pDevice->pAdapter;
    53045515    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)hResource;
     
    53855596    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    53865597    Assert(pDevice);
     5598    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    53875599    Assert(VBOXDISPMODE_IS_3D(pDevice->pAdapter));
    53885600    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hResource;
     
    54295641//    VBOXDISPPROFILE_DDI_CHKDUMPRESET(pDevice);
    54305642    Assert(pDevice);
     5643    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    54315644    HRESULT hr = S_OK;
    54325645    if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
     
    56865899    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    56875900    Assert(pDevice);
     5901    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    56885902    HRESULT hr = S_OK;
    56895903    if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
     
    57375951    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    57385952    Assert(pDevice);
     5953    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    57395954    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    57405955    IDirect3DVertexDeclaration9 *pDecl;
     
    57845999    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    57856000    Assert(pDevice);
     6001    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    57866002    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    57876003    IDirect3DVertexDeclaration9 *pDecl = (IDirect3DVertexDeclaration9*)hShaderHandle;
     
    57986014    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    57996015    Assert(pDevice);
     6016    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58006017    IDirect3DVertexDeclaration9 *pDecl = (IDirect3DVertexDeclaration9*)hShaderHandle;
    58016018    HRESULT hr = S_OK;
     
    58106027    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58116028    Assert(pDevice);
     6029    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58126030    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58136031    IDirect3DVertexShader9 *pShader;
     
    58296047    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58306048    Assert(pDevice);
     6049    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58316050    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58326051    IDirect3DVertexShader9 *pShader = (IDirect3DVertexShader9*)hShaderHandle;
     
    58436062    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58446063    Assert(pDevice);
     6064    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58456065    IDirect3DVertexShader9 *pShader = (IDirect3DVertexShader9*)hShaderHandle;
    58466066    HRESULT hr = S_OK;
     
    58556075    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58566076    Assert(pDevice);
     6077    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58576078    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58586079    HRESULT hr = pDevice9If->SetVertexShaderConstantI(pData->Register, pRegisters, pData->Count);
     
    58676088    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58686089    Assert(pDevice);
     6090    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58696091    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58706092    HRESULT hr = pDevice9If->SetVertexShaderConstantB(pData->Register, pRegisters, pData->Count);
     
    58796101    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58806102    Assert(pDevice);
     6103    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58816104    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58826105    HRESULT hr = pDevice9If->SetScissorRect(pRect);
     
    58916114    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    58926115    Assert(pDevice);
     6116    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    58936117    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    58946118    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hVertexBuffer;
     
    59286152    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    59296153    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6154    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6155    Assert(pDevice);
     6156    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    59306157    Assert(0);
    59316158    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    59366163    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    59376164    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6165    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6166    Assert(pDevice);
     6167    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    59386168    Assert(0);
    59396169    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    59446174    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    59456175    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6176    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6177    Assert(pDevice);
     6178    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    59466179    Assert(0);
    59476180    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    60166249    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    60176250    Assert(pDevice);
     6251    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    60186252//    PVBOXWDDMDISP_SCREEN pScreen = &pDevice->aScreens[pDevice->iPrimaryScreen];
    60196253    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
     
    62916525    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    62926526    Assert(pDevice);
     6527    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    62936528    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    62946529    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hResource;
     
    63146549    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    63156550    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6551    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6552    Assert(pDevice);
     6553    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    63166554    Assert(0);
    63176555    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    63226560    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    63236561    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6562//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6563//    Assert(pDevice);
     6564//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
    63246565    HRESULT hr = S_OK;
    63256566    if (pData->QueryType == D3DDDIQUERYTYPE_EVENT)
     
    63506591    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    63516592    HRESULT hr = S_OK;
     6593//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6594//    Assert(pDevice);
     6595//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6596
    63526597    PVBOXWDDMDISP_QUERY pQuery = (PVBOXWDDMDISP_QUERY)hQuery;
    63536598    Assert(pQuery);
     
    63616606    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    63626607    HRESULT hr = S_OK;
     6608//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6609//    Assert(pDevice);
     6610//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6611
    63636612    PVBOXWDDMDISP_QUERY pQuery = (PVBOXWDDMDISP_QUERY)pData->hQuery;
    63646613    Assert(pQuery);
     
    63726621    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    63736622    HRESULT hr = S_OK;
     6623//    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6624//    Assert(pDevice);
     6625//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6626
    63746627    PVBOXWDDMDISP_QUERY pQuery = (PVBOXWDDMDISP_QUERY)pData->hQuery;
    63756628    Assert(pQuery);
     
    63966649    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    63976650    Assert(pDevice);
     6651    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6652
    63986653    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    63996654    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hRenderTarget;
     
    64126667    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    64136668    Assert(pDevice);
     6669    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6670
    64146671    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    64156672    PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hZBuffer;
     
    64306687    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    64316688    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6689    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6690    Assert(pDevice);
     6691    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6692
    64326693    Assert(0);
    64336694    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    64406701    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    64416702    Assert(pDevice);
     6703    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6704
    64426705    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    64436706    HRESULT hr = pDevice9If->SetPixelShaderConstantI(pData->Register, pRegisters, pData->Count);
     
    64526715    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    64536716    Assert(pDevice);
     6717    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6718
    64546719    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    64556720    HRESULT hr = pDevice9If->SetPixelShaderConstantB(pData->Register, pRegisters, pData->Count);
     
    64646729    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    64656730    Assert(pDevice);
     6731    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6732
    64666733    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
    64676734    IDirect3DPixelShader9 *pShader;
     
    64836750    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    64846751    Assert(pDevice);
     6752    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6753
    64856754    IDirect3DPixelShader9 *pShader = (IDirect3DPixelShader9*)hShaderHandle;
    64866755    HRESULT hr = S_OK;
     
    64936762    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    64946763    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6764    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6765    Assert(pDevice);
     6766    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6767
    64956768    Assert(0);
    64966769    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65016774    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65026775    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6776    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6777    Assert(pDevice);
     6778    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6779
    65036780    Assert(0);
    65046781    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65096786    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65106787    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6788    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6789    Assert(pDevice);
     6790    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6791
    65116792    Assert(0);
    65126793    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65176798    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65186799    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6800    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6801    Assert(pDevice);
     6802    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6803
    65196804    Assert(0);
    65206805    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65256810    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65266811    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6812    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6813    Assert(pDevice);
     6814    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6815
    65276816    Assert(0);
    65286817    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65336822    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65346823    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6824    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6825    Assert(pDevice);
     6826    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6827
    65356828    Assert(0);
    65366829    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65416834    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65426835    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6836    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6837    Assert(pDevice);
     6838    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6839
    65436840    Assert(0);
    65446841    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65496846    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65506847    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6848    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6849    Assert(pDevice);
     6850    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6851
    65516852    Assert(0);
    65526853    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65576858    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65586859    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6860    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6861    Assert(pDevice);
     6862    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6863
    65596864    Assert(0);
    65606865    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65656870    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65666871    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6872    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6873    Assert(pDevice);
     6874    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6875
    65676876    Assert(0);
    65686877    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65736882    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65746883    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6884    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6885    Assert(pDevice);
     6886    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6887
    65756888    Assert(0);
    65766889    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65816894    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65826895    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6896    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6897    Assert(pDevice);
     6898    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6899
    65836900    Assert(0);
    65846901    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65896906    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65906907    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6908    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6909    Assert(pDevice);
     6910    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6911
    65916912    Assert(0);
    65926913    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    65976918    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    65986919    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6920    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6921    Assert(pDevice);
     6922    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6923
    65996924    Assert(0);
    66006925    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    66056930    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    66066931    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6932    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6933    Assert(pDevice);
     6934    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6935
    66076936    Assert(0);
    66086937    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    66136942    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    66146943    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     6944    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6945    Assert(pDevice);
     6946    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6947
    66156948    Assert(0);
    66166949    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    66236956
    66246957    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     6958    Assert(pDevice);
     6959    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     6960
    66256961    VBOXDISPPROFILE_DDI_DUMPRESET(pDevice);
    66266962    PVBOXWDDMDISP_ADAPTER pAdapter = pDevice->pAdapter;
     
    68387174    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    68397175    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     7176//    Assert(pDevice);
     7177//    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     7178
    68407179    Assert(0);
    68417180    HRESULT hr = S_OK;
     
    68847223    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    68857224    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     7225    Assert(pDevice);
     7226    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     7227
    68867228    HRESULT hr = S_OK;
    68877229
    6888     Assert(pDevice);
    68897230    Assert(pData->NumAllocations);
    68907231    PVBOXWDDMDISP_RESOURCE pRc = vboxResourceAlloc(pData->NumAllocations);
     
    70357376    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    70367377    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     7378    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     7379    Assert(pDevice);
     7380    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     7381
    70377382    Assert(0);
    70387383    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    70447389    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
    70457390    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     7391    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     7392    Assert(pDevice);
     7393    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     7394
    70467395    Assert(0);
    70477396    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     
    71957544                    && !pCreateData->PatchLocationListSize)
    71967545            {
     7546#ifdef VBOX_WITH_CRHGSMI
    71977547                hr = vboxUhgsmiD3DInit(&pDevice->Uhgsmi, pDevice);
    71987548                Assert(hr == S_OK);
    71997549                if (hr == S_OK)
    7200                 {
     7550#endif
     7551                {
     7552                    VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice);
     7553
    72017554                    hr = vboxDispCmCtxCreate(pDevice, &pDevice->DefaultContext);
    72027555                    Assert(hr == S_OK);
     
    72847637    if (VBOXDISPMODE_IS_3D(pAdapter))
    72857638    {
     7639        VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL();
    72867640        HRESULT hr = VBoxDispWorkerDestroy(&pAdapter->WndWorker);
    72877641        Assert(hr == S_OK);
    72887642        pAdapter->pD3D9If->Release();
    72897643        VBoxDispD3DClose(&pAdapter->D3D);
     7644
     7645#ifdef VBOX_WITH_CRHGSMI
     7646        vboxUhgsmiGlobalRelease();
     7647#endif
    72907648    }
    72917649
     
    73687726            do
    73697727            {
    7370                 /* try enable the 3D */
    7371                 hr = VBoxDispD3DOpen(&pAdapter->D3D);
    7372                 Assert(hr == S_OK);
    7373                 if (hr == S_OK)
    7374                 {
    7375 //                    Assert(0);
    7376                     hr = pAdapter->D3D.pfnDirect3DCreate9Ex(D3D_SDK_VERSION, &pAdapter->pD3D9If);
     7728#ifdef VBOX_WITH_CRHGSMI
     7729                int rc = vboxUhgsmiGlobalRetain();
     7730                AssertRC(rc);
     7731                if (RT_SUCCESS(rc))
     7732#endif
     7733                {
     7734                    VBOXDISPCRHGSMI_SCOPE_SET_GLOBAL();
     7735                    /* try enable the 3D */
     7736                    hr = VBoxDispD3DOpen(&pAdapter->D3D);
    73777737                    Assert(hr == S_OK);
    73787738                    if (hr == S_OK)
    73797739                    {
    7380                         D3DCAPS9 Caps;
    7381                         memset(&Caps, 0, sizeof (Caps));
    7382                         hr = vboxWddmGetD3D9Caps(pAdapter, &Caps);
     7740//                        Assert(0);
     7741                        hr = pAdapter->D3D.pfnDirect3DCreate9Ex(D3D_SDK_VERSION, &pAdapter->pD3D9If);
    73837742                        Assert(hr == S_OK);
    73847743                        if (hr == S_OK)
    73857744                        {
    7386                             pAdapter->cMaxSimRTs = Caps.NumSimultaneousRTs;
    7387                             Assert(pAdapter->cMaxSimRTs);
    7388                             Assert(pAdapter->cMaxSimRTs < UINT32_MAX/2);
    7389                             hr = VBoxDispWorkerCreate(&pAdapter->WndWorker);
     7745                            D3DCAPS9 Caps;
     7746                            memset(&Caps, 0, sizeof (Caps));
     7747                            hr = vboxWddmGetD3D9Caps(pAdapter, &Caps);
    73907748                            Assert(hr == S_OK);
    73917749                            if (hr == S_OK)
    73927750                            {
    7393                                 vboxVDbgPrint((__FUNCTION__": SUCCESS 3D Enabled, pAdapter (0x%p)\n", pAdapter));
    7394                                 break;
     7751                                pAdapter->cMaxSimRTs = Caps.NumSimultaneousRTs;
     7752                                Assert(pAdapter->cMaxSimRTs);
     7753                                Assert(pAdapter->cMaxSimRTs < UINT32_MAX/2);
     7754                                hr = VBoxDispWorkerCreate(&pAdapter->WndWorker);
     7755                                Assert(hr == S_OK);
     7756                                if (hr == S_OK)
     7757                                {
     7758                                    vboxVDbgPrint((__FUNCTION__": SUCCESS 3D Enabled, pAdapter (0x%p)\n", pAdapter));
     7759                                    break;
     7760                                }
    73957761                            }
     7762                            pAdapter->pD3D9If->Release();
    73967763                        }
    7397                         pAdapter->pD3D9If->Release();
     7764                        else
     7765                            vboxVDbgPrintR((__FUNCTION__": pfnDirect3DCreate9Ex failed, hr (%d)\n", hr));
     7766                        VBoxDispD3DClose(&pAdapter->D3D);
    73987767                    }
    73997768                    else
    7400                         vboxVDbgPrintR((__FUNCTION__": pfnDirect3DCreate9Ex failed, hr (%d)\n", hr));
    7401                     VBoxDispD3DClose(&pAdapter->D3D);
     7769                        vboxVDbgPrintR((__FUNCTION__": VBoxDispD3DOpen failed, hr (%d)\n", hr));
     7770#ifdef VBOX_WITH_CRHGSMI
     7771                    vboxUhgsmiGlobalRelease();
     7772#endif
    74027773                }
     7774#ifdef VBOX_WITH_CRHGSMI
    74037775                else
    7404                     vboxVDbgPrintR((__FUNCTION__": VBoxDispD3DOpen failed, hr (%d)\n", hr));
     7776                {
     7777                    hr = E_FAIL;
     7778                }
     7779#endif
    74057780            } while (0);
    74067781        }
     
    76318006
    76328007#endif
     8008
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h

    r32889 r33117  
    3333#include "../../Miniport/wddm/VBoxVideoIf.h"
    3434#include "VBoxDispCm.h"
     35#ifdef VBOX_WITH_CRHGSMI
     36#include "VBoxUhgsmiBase.h"
    3537#include "VBoxUhgsmiDisp.h"
     38#include "VBoxUhgsmiKmt.h"
     39#endif
    3640#include "VBoxDispD3D.h"
    3741
     
    118122#endif
    119123
     124# ifdef VBOXWDDMDISP
     125#  define VBOXWDDMDISP_DECL(_type) DECLEXPORT(_type)
     126# else
     127#  define VBOXWDDMDISP_DECL(_type) DECLIMPORT(_type)
     128# endif
     129
    120130#endif /* #ifndef ___VBoxDispD3DCmn_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp

    r32496 r33117  
    6262    g_VBoxDispMp.cbEscapeCmd = 0;
    6363    vboxVideoCmIterInit(&g_VBoxDispMp.Iterator, NULL, 0);
     64#ifdef VBOX_WITH_CRHGSMI
     65    vboxUhgsmiGlobalSetCurrent();
     66#endif
    6467    return S_OK;
    6568}
     
    7073    if (g_VBoxDispMp.pEscapeCmd)
    7174        RTMemFree(g_VBoxDispMp.pEscapeCmd);
     75#ifdef VBOX_WITH_CRHGSMI
     76    vboxUhgsmiGlobalClearCurrent();
     77#endif
    7278    return S_OK;
    7379}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette