VirtualBox

Ignore:
Timestamp:
May 25, 2010 5:26:57 PM (15 years ago)
Author:
vboxsync
Message:

wddm: driver update w/o reboot working; dummy context creation in CreateDevice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r29742 r29798  
    595595}
    596596
     597static void vboxWddmDevExtZeroinit(PDEVICE_EXTENSION pDevExt, CONST PDEVICE_OBJECT pPDO)
     598{
     599    memset(pDevExt, 0, sizeof (DEVICE_EXTENSION));
     600    pDevExt->pPDO = pPDO;
     601#ifdef VBOXWDDM_RENDER_FROM_SHADOW
     602    for (int i = 0; i < RT_ELEMENTS(pDevExt->aSources); ++i)
     603    {
     604        pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;
     605    }
     606#endif
     607}
     608
    597609/* driver callbacks */
    598610NTSTATUS DxgkDdiAddDevice(
     
    613625    if (pContext)
    614626    {
    615         pContext->pPDO = PhysicalDeviceObject;
     627        vboxWddmDevExtZeroinit(pContext, PhysicalDeviceObject);
    616628        *MiniportDeviceContext = pContext;
    617 #ifdef VBOXWDDM_RENDER_FROM_SHADOW
    618         for (int i = 0; i < RT_ELEMENTS(pContext->aSources); ++i)
    619         {
    620             pContext->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;
    621         }
    622 #endif
    623629    }
    624630    else
     
    694700                {
    695701                    drprintf(("VBoxVideoWddm: HGSMI failed to initialize, returning err\n"));
     702
     703                    VbglTerminate();
    696704                    /* @todo: report a better status */
    697705                    Status = STATUS_UNSUCCESSFUL;
     
    729737    dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    730738
    731     AssertBreakpoint();
    732     /* @todo: fixme: implement */
    733 
    734     dfprintf(("<== "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    735 
    736     return STATUS_SUCCESS;
     739    vboxVDbgBreakF();
     740
     741    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext;
     742    NTSTATUS Status = STATUS_SUCCESS;
     743
     744    /* do everything we did on DxgkDdiStartDevice in the reverse order */
     745#ifdef VBOX_WITH_VIDEOHWACCEL
     746    vboxVHWAFree(pDevExt);
     747#endif
     748
     749    int rc = VBoxFreeDisplaysHGSMI(pDevExt);
     750    AssertRC(rc);
     751    if (RT_SUCCESS(rc))
     752    {
     753        VbglTerminate();
     754
     755        /* revert back to the state we were right after the DxgkDdiAddDevice */
     756        vboxWddmDevExtZeroinit(pDevExt, pDevExt->pPDO);
     757    }
     758    else
     759        Status = STATUS_UNSUCCESSFUL;
     760
     761    return Status;
    737762}
    738763
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