VirtualBox

Changeset 72621 in vbox for trunk


Ignore:
Timestamp:
Jun 20, 2018 11:27:14 AM (7 years ago)
Author:
vboxsync
Message:

WDDM: display driver: handle the case when VBOXWDDMDISP_DEVICE::DefaultContext is not initialized

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp

    r69500 r72621  
    846846        {
    847847            Assert(hostId);
     848            Assert(pDevice->DefaultContext.ContextInfo.hContext);
    848849
    849850            VBOXDISPIFESCAPE Data;
     
    876877}
    877878
    878 int vboxD3DIfSetHostId(PVBOXWDDMDISP_ALLOCATION pAlloc, uint32_t hostID, uint32_t *pHostID)
     879static int vboxD3DIfSetHostId(PVBOXWDDMDISP_ALLOCATION pAlloc, uint32_t hostID, uint32_t *pHostID)
    879880{
    880881    struct VBOXWDDMDISP_RESOURCE *pRc = pAlloc->pRc;
    881882    PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice;
     883
     884    AssertReturn(pDevice->DefaultContext.ContextInfo.hContext, VERR_GENERAL_FAILURE);
    882885
    883886    VBOXDISPIFESCAPE_SETALLOCHOSTID SetHostID = {0};
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h

    r70052 r72621  
    4040void VBoxD3DIfLockUnlockMemSynch(struct VBOXWDDMDISP_ALLOCATION *pAlloc, D3DLOCKED_RECT *pLockInfo, RECT *pRect, bool bToLockInfo);
    4141
    42 int vboxD3DIfSetHostId(PVBOXWDDMDISP_ALLOCATION pAlloc, uint32_t hostID, uint32_t *pHostID);
    4342IUnknown* vboxD3DIfCreateSharedPrimary(PVBOXWDDMDISP_ALLOCATION pAlloc);
    4443
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispCm.cpp

    r69500 r72621  
    209209HRESULT vboxDispCmCtxDestroy(PVBOXWDDMDISP_DEVICE pDevice, PVBOXWDDMDISP_CONTEXT pContext)
    210210{
     211    if (!pContext->ContextInfo.hContext)
     212        return S_OK;
     213
    211214    return vboxDispCmSessionCtxDestroy(&g_pVBoxCmMgr.Session, pDevice, pContext);
    212215}
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp

    r72010 r72621  
    291291static HRESULT vboxWddmDalNotifyChange(PVBOXWDDMDISP_DEVICE pDevice)
    292292{
     293    if (!pDevice->DefaultContext.ContextInfo.hContext)
     294        return E_FAIL;
     295
    293296    VBOXWDDMDISP_NSCADD NscAdd = { NULL }; /* Shuts up MSC. */
    294297    BOOL bReinitRenderData = TRUE;
     
    471474        else
    472475        {
    473             WARN(("vboxWddmDalNotifyChange failed %#x", hr));
     476            // WARN(("vboxWddmDalNotifyChange failed %#x", hr));
    474477            if (pAlloc->DirtyAllocListEntry.pNext)
    475478                vboxWddmDalRemove(pAlloc);
     
    749752    if (cAllocsKm == Buf.SwapchainInfo.SwapchainInfo.cAllocs)
    750753    {
     754        AssertReturn(pDevice->DefaultContext.ContextInfo.hContext, E_FAIL);
     755
    751756        D3DDDICB_ESCAPE DdiEscape = {0};
    752757        DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiDisp.cpp

    r69500 r72621  
    163163    PVBOXUHGSMI_PRIVATE_D3D pHg = VBOXUHGSMID3D_GET(pHgsmi);
    164164    PVBOXWDDMDISP_DEVICE pDevice = pHg->pDevice;
     165
     166    AssertReturn(pDevice->DefaultContext.ContextInfo.hContext, VERR_GENERAL_FAILURE);
     167
    165168    UINT cbDmaCmd = pDevice->DefaultContext.ContextInfo.CommandBufferSize;
    166169    int rc = vboxUhgsmiBaseDxDmaFill(aBuffers, cBuffers,
     
    207210    PVBOXUHGSMI_PRIVATE_D3D pPrivate = VBOXUHGSMID3D_GET(pHgsmi);
    208211    PVBOXWDDMDISP_DEVICE pDevice = pPrivate->pDevice;
     212
     213    AssertReturn(pDevice->DefaultContext.ContextInfo.hContext, VERR_GENERAL_FAILURE);
     214
    209215    D3DDDICB_ESCAPE DdiEscape = {0};
    210216    DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext;
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