VirtualBox

Ignore:
Timestamp:
Aug 26, 2010 10:05:15 AM (14 years ago)
Author:
vboxsync
Message:

VBoxVideo: Only clear the flags in sync callback and unmap memory later.

File:
1 edited

Legend:

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

    r31873 r31979  
    14501450}
    14511451
    1452 /* Unmapping adapter information must be done carefully WRT the interrupt handler. */
    14531452BOOLEAN VBoxUnmapAdpInfoCallback(PVOID ext)
    14541453{
    14551454    PDEVICE_EXTENSION   PrimaryExtension = (PDEVICE_EXTENSION)ext;
     1455    Assert(PrimaryExtension);
     1456
     1457    PrimaryExtension->u.primary.pHostFlags = NULL;
     1458    return TRUE;
     1459}
     1460
     1461void VBoxUnmapAdapterInformation(PDEVICE_EXTENSION PrimaryExtension)
     1462{
    14561463    void                *ppv;
     1464
     1465    dprintf(("VBoxVideo::VBoxUnmapAdapterInformation\n"));
    14571466
    14581467    ppv = PrimaryExtension->u.primary.pvAdapterInformation;
    14591468    if (ppv)
    14601469    {
     1470        /* The pHostFlags field is mapped through pvAdapterInformation. It must be cleared first,
     1471         * and it must be done in a way which avoids races with the interrupt handler.
     1472         */
     1473        VideoPortSynchronizeExecution(PrimaryExtension, VpMediumPriority,
     1474                                      VBoxUnmapAdpInfoCallback, PrimaryExtension);
    14611475#ifndef VBOXWDDM
    14621476        VideoPortUnmapMemory(PrimaryExtension, ppv, NULL);
     
    14671481#endif
    14681482        PrimaryExtension->u.primary.pvAdapterInformation = NULL;
    1469         PrimaryExtension->u.primary.pHostFlags           = NULL;    /* Mapped through pvAdapterInformation */
    1470     }
    1471     return TRUE;
    1472 }
    1473 
    1474 void VBoxUnmapAdapterInformation(PDEVICE_EXTENSION PrimaryExtension)
    1475 {
    1476     dprintf(("VBoxVideo::VBoxUnmapAdapterInformation\n"));
    1477 
    1478     VideoPortSynchronizeExecution(PrimaryExtension, VpMediumPriority,
    1479                                   VBoxUnmapAdpInfoCallback, PrimaryExtension);
     1483    }
    14801484}
    14811485
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