VirtualBox

Ignore:
Timestamp:
Mar 11, 2013 2:34:08 PM (12 years ago)
Author:
vboxsync
Message:

VBoxGuest-win*: Reversed the VBOXGUESTDEVEXTWIN and VBOXGUESTDEVEXT relationship, VBOXGUESTDEVEXTWIN now includes VBOXGUESTDEVEXT as member 'Core' (first). (untested)

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp

    r44983 r44988  
    2525#include <VBox/version.h>
    2626#include <VBox/VBoxGuestLib.h>
     27#include <iprt/string.h>
    2728
    2829
     
    7980    RtlInitUnicodeString(&szDevName, VBOXGUEST_DEVICE_NAME_NT);
    8081    PDEVICE_OBJECT pDeviceObject = NULL;
    81     rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXT), &szDevName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);
     82    rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXTWIN), &szDevName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);
    8283    if (NT_SUCCESS(rc))
    8384    {
     
    9697            Log(("VBoxGuest::vbgdNt4CreateDevice: Setting up device extension ...\n"));
    9798
    98             PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDeviceObject->DeviceExtension;
    99             RtlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT));
     99            PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDeviceObject->DeviceExtension;
     100            RT_ZERO(*pDevExt);
    100101
    101102            Log(("VBoxGuest::vbgdNt4CreateDevice: Device extension created\n"));
    102103
    103104            /* Store a reference to ourself. */
    104             pDevExt->win.s.pDeviceObject = pDeviceObject;
     105            pDevExt->pDeviceObject = pDeviceObject;
    105106
    106107            /* Store bus and slot number we've queried before. */
    107             pDevExt->win.s.busNumber  = uBusNumber;
    108             pDevExt->win.s.slotNumber = SlotNumber.u.AsULONG;
     108            pDevExt->busNumber  = uBusNumber;
     109            pDevExt->slotNumber = SlotNumber.u.AsULONG;
    109110
    110111#ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp

    r44987 r44988  
    104104NTSTATUS vbgdNtPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp)
    105105{
    106     PVBOXGUESTDEVEXT   pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
    107     PIO_STACK_LOCATION pStack  = IoGetCurrentIrpStackLocation(pIrp);
     106    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
     107    PIO_STACK_LOCATION  pStack  = IoGetCurrentIrpStackLocation(pIrp);
    108108
    109109#ifdef LOG_ENABLED
     
    147147
    148148            /* This must be handled first by the lower driver. */
    149             rc = vbgdNtSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE);
     149            rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE);
    150150
    151151            if (   NT_SUCCESS(rc)
     
    158158                {
    159159                    Log(("VBoxGuest::vbgdNtVBoxGuestPnP: START_DEVICE: No resources, pDevExt = %p, nextLowerDriver = %p!\n",
    160                          pDevExt, pDevExt ? pDevExt->win.s.pNextLowerDriver : NULL));
     160                         pDevExt, pDevExt ? pDevExt->pNextLowerDriver : NULL));
    161161                    rc = STATUS_UNSUCCESSFUL;
    162162                }
     
    182182
    183183            /* This must be handled first by the lower driver. */
    184             rc = vbgdNtSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE);
    185 
    186             if (NT_SUCCESS(rc) && pDevExt->win.s.devState == PENDINGREMOVE)
     184            rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE);
     185
     186            if (NT_SUCCESS(rc) && pDevExt->devState == PENDINGREMOVE)
    187187            {
    188188                /* Return to the state prior to receiving the IRP_MN_QUERY_REMOVE_DEVICE request. */
    189                 pDevExt->win.s.devState = pDevExt->win.s.prevDevState;
     189                pDevExt->devState = pDevExt->prevDevState;
    190190            }
    191191
     
    210210            IoSkipCurrentIrpStackLocation(pIrp);
    211211
    212             rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     212            rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    213213
    214214            /* Do not complete the IRP. */
     
    234234                IoSkipCurrentIrpStackLocation(pIrp);
    235235
    236                 rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     236                rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    237237                Log(("VBoxGuest::vbgdNtGuestPnp: QUERY_REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc));
    238238
     
    267267            IoSkipCurrentIrpStackLocation(pIrp);
    268268
    269             rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     269            rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    270270            Log(("VBoxGuest::vbgdNtGuestPnp: REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc));
    271271
    272             IoDetachDevice(pDevExt->win.s.pNextLowerDriver);
     272            IoDetachDevice(pDevExt->pNextLowerDriver);
    273273
    274274            Log(("VBoxGuest::vbgdNtGuestPnp: REMOVE_DEVICE: Removing device ...\n"));
    275275
    276276            /* Destroy device extension and clean up everything else. */
    277             VBoxGuestDeleteDevExt(pDevExt);
     277            VBoxGuestDeleteDevExt(&pDevExt->Core);
    278278
    279279            /* Remove DOS device + symbolic link. */
     
    299299
    300300            /* This must be handled first by the lower driver. */
    301             rc = vbgdNtSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE);
    302 
    303             if (NT_SUCCESS(rc) && pDevExt->win.s.devState == PENDINGSTOP)
     301            rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE);
     302
     303            if (NT_SUCCESS(rc) && pDevExt->devState == PENDINGSTOP)
    304304            {
    305305                /* Return to the state prior to receiving the IRP_MN_QUERY_STOP_DEVICE request. */
    306                 pDevExt->win.s.devState = pDevExt->win.s.prevDevState;
     306                pDevExt->devState = pDevExt->prevDevState;
    307307            }
    308308
     
    329329                IoSkipCurrentIrpStackLocation(pIrp);
    330330
    331                 rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     331                rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    332332                Log(("VBoxGuest::vbgdNtGuestPnp: QUERY_STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc));
    333333
     
    358358            IoSkipCurrentIrpStackLocation(pIrp);
    359359
    360             rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     360            rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    361361            Log(("VBoxGuest::vbgdNtGuestPnp: STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc));
    362362
     
    367367        {
    368368            IoSkipCurrentIrpStackLocation(pIrp);
    369             rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     369            rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    370370            return rc;
    371371        }
     
    391391{
    392392#ifdef VBOX_STRICT
    393     PVBOXGUESTDEVEXT   pDevExt = (PVBOXGUESTDEVEXT)pContext;
    394     PIO_STACK_LOCATION pIrpSp  = IoGetCurrentIrpStackLocation(pIrp);
     393    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pContext;
     394    PIO_STACK_LOCATION  pIrpSp  = IoGetCurrentIrpStackLocation(pIrp);
    395395
    396396    Assert(pDevExt);
     
    435435NTSTATUS vbgdNtPower(PDEVICE_OBJECT pDevObj, PIRP pIrp)
    436436{
    437     PIO_STACK_LOCATION pStack   = IoGetCurrentIrpStackLocation(pIrp);
    438     PVBOXGUESTDEVEXT   pDevExt  = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
    439     POWER_STATE_TYPE   enmPowerType   = pStack->Parameters.Power.Type;
    440     POWER_STATE        PowerState     = pStack->Parameters.Power.State;
    441     POWER_ACTION       enmPowerAction = pStack->Parameters.Power.ShutdownType;
     437    PIO_STACK_LOCATION  pStack   = IoGetCurrentIrpStackLocation(pIrp);
     438    PVBOXGUESTDEVEXTWIN pDevExt  = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
     439    POWER_STATE_TYPE    enmPowerType   = pStack->Parameters.Power.Type;
     440    POWER_STATE         PowerState     = pStack->Parameters.Power.State;
     441    POWER_ACTION        enmPowerAction = pStack->Parameters.Power.ShutdownType;
    442442
    443443    Log(("VBoxGuest::vbgdNtGuestPower\n"));
     
    463463                            {
    464464                                if (   pDevExt
    465                                     && pDevExt->win.s.LastSystemPowerAction == PowerActionHibernate)
     465                                    && pDevExt->LastSystemPowerAction == PowerActionHibernate)
    466466                                {
    467467                                    Log(("VBoxGuest::vbgdNtGuestPower: Returning from hibernation!\n"));
    468                                     int rc = VBoxGuestReinitDevExtAfterHibernation(pDevExt,
     468                                    int rc = VBoxGuestReinitDevExtAfterHibernation(&pDevExt->Core,
    469469                                                                                   vbgdNtVersionToOSType(g_enmVbgdNtVer));
    470470                                    if (RT_FAILURE(rc))
     
    491491                                if (RT_FAILURE(vrc))
    492492                                {
    493                                     Log(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. "
    494                                              "vrc = %Rrc\n", vrc));
     493                                    Log(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. vrc = %Rrc\n", vrc));
    495494                                }
    496495
     
    511510                                Log(("VBoxGuest::vbgdNtGuestPower: Telling the VMMDev to close the VM ...\n"));
    512511
    513                                 VMMDevPowerStateRequest *pReq = pDevExt->win.s.pPowerStateRequest;
     512                                VMMDevPowerStateRequest *pReq = pDevExt->pPowerStateRequest;
    514513                                int vrc = VERR_NOT_IMPLEMENTED;
    515514                                if (pReq)
     
    540539                     */
    541540                    if (pDevExt)
    542                         pDevExt->win.s.LastSystemPowerAction = enmPowerAction;
     541                        pDevExt->LastSystemPowerAction = enmPowerAction;
    543542
    544543                    break;
     
    570569                           TRUE,
    571570                           TRUE);
    572     return PoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     571    return PoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    573572}
    574573
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp

    r44985 r44988  
    207207     */
    208208    PDEVICE_OBJECT pDeviceObject = NULL;
    209     PVBOXGUESTDEVEXT pDevExt = NULL;
     209    PVBOXGUESTDEVEXTWIN pDevExt = NULL;
    210210    UNICODE_STRING devName;
    211211    UNICODE_STRING win32Name;
    212212    RtlInitUnicodeString(&devName, VBOXGUEST_DEVICE_NAME_NT);
    213     rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXT), &devName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);
     213    rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXTWIN), &devName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);
    214214    if (NT_SUCCESS(rc))
    215215    {
     
    224224             * Setup the device extension.
    225225             */
    226             pDevExt = (PVBOXGUESTDEVEXT)pDeviceObject->DeviceExtension;
     226            pDevExt = (PVBOXGUESTDEVEXTWIN)pDeviceObject->DeviceExtension;
    227227            RtlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT));
    228228
    229             KeInitializeSpinLock(&pDevExt->win.s.MouseEventAccessLock);
    230 
    231             pDevExt->win.s.pDeviceObject = pDeviceObject;
    232             pDevExt->win.s.prevDevState = STOPPED;
    233             pDevExt->win.s.devState = STOPPED;
    234 
    235             pDevExt->win.s.pNextLowerDriver = IoAttachDeviceToDeviceStack(pDeviceObject, pDevObj);
    236             if (pDevExt->win.s.pNextLowerDriver == NULL)
     229            KeInitializeSpinLock(&pDevExt->MouseEventAccessLock);
     230
     231            pDevExt->pDeviceObject = pDeviceObject;
     232            pDevExt->prevDevState = STOPPED;
     233            pDevExt->devState = STOPPED;
     234
     235            pDevExt->pNextLowerDriver = IoAttachDeviceToDeviceStack(pDeviceObject, pDevObj);
     236            if (pDevExt->pNextLowerDriver == NULL)
    237237            {
    238238                Log(("VBoxGuest::vbgdNtGuestAddDevice: IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n"));
     
    267267        if (pDevExt)
    268268        {
    269             if (pDevExt->win.s.pNextLowerDriver)
    270                 IoDetachDevice(pDevExt->win.s.pNextLowerDriver);
     269            if (pDevExt->pNextLowerDriver)
     270                IoDetachDevice(pDevExt->pNextLowerDriver);
    271271        }
    272272        IoDeleteSymbolicLink(&win32Name);
     
    355355#endif
    356356{
    357     PVBOXGUESTDEVEXT pDevExt   = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     357    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    358358#ifndef TARGET_NT4
    359     PIO_STACK_LOCATION pStack  = IoGetCurrentIrpStackLocation(pIrp);
     359    PIO_STACK_LOCATION  pStack  = IoGetCurrentIrpStackLocation(pIrp);
    360360#endif
    361361
     
    375375    rc = HalAssignSlotResources(pRegPath, &classNameString,
    376376                                pDrvObj, pDevObj,
    377                                 PCIBus, pDevExt->win.s.busNumber, pDevExt->win.s.slotNumber,
     377                                PCIBus, pDevExt->busNumber, pDevExt->slotNumber,
    378378                                &pResourceList);
    379379    if (pResourceList && pResourceList->Count > 0)
     
    385385        vbgdNtShowDeviceResources(&pStack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList);
    386386    if (NT_SUCCESS(rc))
    387         rc = vbgdNtScanPCIResourceList(pStack->Parameters.StartDevice.AllocatedResourcesTranslated,
    388                                              pDevExt);
     387        rc = vbgdNtScanPCIResourceList(pStack->Parameters.StartDevice.AllocatedResourcesTranslated, pDevExt);
    389388#endif
    390389    if (NT_SUCCESS(rc))
     
    397396        uint32_t cbMMIO = 0;
    398397        rc = vbgdNtMapVMMDevMemory(pDevExt,
    399                                    pDevExt->win.s.vmmDevPhysMemoryAddress,
    400                                    pDevExt->win.s.vmmDevPhysMemoryLength,
     398                                   pDevExt->vmmDevPhysMemoryAddress,
     399                                   pDevExt->vmmDevPhysMemoryLength,
    401400                                   &pvMMIOBase,
    402401                                   &cbMMIO);
    403402        if (NT_SUCCESS(rc))
    404403        {
    405             pDevExt->pVMMDevMemory = (VMMDevMemory *)pvMMIOBase;
     404            pDevExt->Core.pVMMDevMemory = (VMMDevMemory *)pvMMIOBase;
    406405
    407406            Log(("VBoxGuest::vbgdNtInit: pvMMIOBase = 0x%p, pDevExt = 0x%p, pDevExt->pVMMDevMemory = 0x%p\n",
    408407                 pvMMIOBase, pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));
    409408
    410             int vrc = VBoxGuestInitDevExt(pDevExt,
    411                                           pDevExt->IOPortBase,
     409            int vrc = VBoxGuestInitDevExt(&pDevExt->Core,
     410                                          pDevExt->Core.IOPortBase,
    412411                                          pvMMIOBase, cbMMIO,
    413412                                          vbgdNtVersionToOSType(g_enmVbgdNtVer),
     
    425424    if (NT_SUCCESS(rc))
    426425    {
    427         int vrc = VbglGRAlloc((VMMDevRequestHeader **)&pDevExt->win.s.pPowerStateRequest,
    428                               sizeof (VMMDevPowerStateRequest), VMMDevReq_SetPowerStatus);
     426        int vrc = VbglGRAlloc((VMMDevRequestHeader **)&pDevExt->pPowerStateRequest,
     427                              sizeof(VMMDevPowerStateRequest), VMMDevReq_SetPowerStatus);
    429428        if (RT_FAILURE(vrc))
    430429        {
     
    441440        Log(("VBoxGuest::vbgdNtInit: Initializing DPC/ISR ...\n"));
    442441
    443         IoInitializeDpcRequest(pDevExt->win.s.pDeviceObject, vbgdNtDpcHandler);
     442        IoInitializeDpcRequest(pDevExt->pDeviceObject, vbgdNtDpcHandler);
    444443#ifdef TARGET_NT4
    445444        ULONG uInterruptVector;
     
    447446        /* Get an interrupt vector. */
    448447        /* Only proceed if the device provides an interrupt. */
    449         if (   pDevExt->win.s.interruptLevel
    450             || pDevExt->win.s.interruptVector)
     448        if (   pDevExt->interruptLevel
     449            || pDevExt->interruptVector)
    451450        {
    452451            Log(("VBoxGuest::vbgdNtInit: Getting interrupt vector (HAL): Bus: %u, IRQL: %u, Vector: %u\n",
    453                  pDevExt->win.s.busNumber, pDevExt->win.s.interruptLevel, pDevExt->win.s.interruptVector));
     452                 pDevExt->busNumber, pDevExt->interruptLevel, pDevExt->interruptVector));
    454453
    455454            uInterruptVector = HalGetInterruptVector(PCIBus,
    456                                                      pDevExt->win.s.busNumber,
    457                                                      pDevExt->win.s.interruptLevel,
    458                                                      pDevExt->win.s.interruptVector,
     455                                                     pDevExt->busNumber,
     456                                                     pDevExt->interruptLevel,
     457                                                     pDevExt->interruptVector,
    459458                                                     &irqLevel,
    460                                                      &pDevExt->win.s.interruptAffinity);
     459                                                     &pDevExt->interruptAffinity);
    461460            Log(("VBoxGuest::vbgdNtInit: HalGetInterruptVector returns vector %u\n", uInterruptVector));
    462461            if (uInterruptVector == 0)
     
    466465            Log(("VBoxGuest::vbgdNtInit: Device does not provide an interrupt!\n"));
    467466#endif
    468         if (pDevExt->win.s.interruptVector)
     467        if (pDevExt->interruptVector)
    469468        {
    470469            Log(("VBoxGuest::vbgdNtInit: Connecting interrupt ...\n"));
    471470
    472             rc = IoConnectInterrupt(&pDevExt->win.s.pInterruptObject,         /* Out: interrupt object. */
    473                                     (PKSERVICE_ROUTINE)vbgdNtIsrHandler,      /* Our ISR handler. */
    474                                     pDevExt,                                  /* Device context. */
    475                                     NULL,                                     /* Optional spinlock. */
     471            rc = IoConnectInterrupt(&pDevExt->pInterruptObject,                 /* Out: interrupt object. */
     472                                    (PKSERVICE_ROUTINE)vbgdNtIsrHandler,        /* Our ISR handler. */
     473                                    pDevExt,                                    /* Device context. */
     474                                    NULL,                                       /* Optional spinlock. */
    476475#ifdef TARGET_NT4
    477                                     uInterruptVector,                         /* Interrupt vector. */
    478                                     irqLevel,                                 /* Interrupt level. */
    479                                     irqLevel,                                 /* Interrupt level. */
     476                                    uInterruptVector,                           /* Interrupt vector. */
     477                                    irqLevel,                                   /* Interrupt level. */
     478                                    irqLevel,                                   /* Interrupt level. */
    480479#else
    481                                     pDevExt->win.s.interruptVector,           /* Interrupt vector. */
    482                                     (KIRQL)pDevExt->win.s.interruptLevel,     /* Interrupt level. */
    483                                     (KIRQL)pDevExt->win.s.interruptLevel,     /* Interrupt level. */
    484 #endif
    485                                     pDevExt->win.s.interruptMode,             /* LevelSensitive or Latched. */
    486                                     TRUE,                                     /* Shareable interrupt. */
    487                                     pDevExt->win.s.interruptAffinity,         /* CPU affinity. */
    488                                     FALSE);                                   /* Don't save FPU stack. */
     480                                    pDevExt->interruptVector,                   /* Interrupt vector. */
     481                                    (KIRQL)pDevExt->interruptLevel,             /* Interrupt level. */
     482                                    (KIRQL)pDevExt->interruptLevel,             /* Interrupt level. */
     483#endif
     484                                    pDevExt->interruptMode,                     /* LevelSensitive or Latched. */
     485                                    TRUE,                                       /* Shareable interrupt. */
     486                                    pDevExt->interruptAffinity,                 /* CPU affinity. */
     487                                    FALSE);                                     /* Don't save FPU stack. */
    489488            if (NT_ERROR(rc))
    490489                Log(("VBoxGuest::vbgdNtInit: Could not connect interrupt, rc = 0x%x\n", rc));
     
    497496#ifdef VBOX_WITH_HGCM
    498497    Log(("VBoxGuest::vbgdNtInit: Allocating kernel session data ...\n"));
    499     int vrc = VBoxGuestCreateKernelSession(pDevExt, &pDevExt->win.s.pKernelSession);
     498    int vrc = VBoxGuestCreateKernelSession(&pDevExt->Core, &pDevExt->pKernelSession);
    500499    if (RT_FAILURE(vrc))
    501500    {
     
    511510        if (NT_SUCCESS(rcNt))
    512511        {
    513             pDevExt->fLoggingEnabled = ulValue >= 0xFF;
    514             if (pDevExt->fLoggingEnabled)
     512            pDevExt->Core.fLoggingEnabled = ulValue >= 0xFF;
     513            if (pDevExt->Core.fLoggingEnabled)
    515514                Log(("Logging to release log enabled (0x%x)", ulValue));
    516515        }
     
    521520    }
    522521    else
    523     {
    524         pDevExt->win.s.pInterruptObject = NULL;
    525     }
     522        pDevExt->pInterruptObject = NULL;
    526523
    527524    Log(("VBoxGuest::vbgdNtInit: Returned with rc = 0x%x\n", rc));
     
    540537    Log(("VBoxGuest::vbgdNtCleanup\n"));
    541538
    542     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     539    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    543540    if (pDevExt)
    544541    {
     
    546543#if 0 /* @todo: test & enable cleaning global session data */
    547544#ifdef VBOX_WITH_HGCM
    548         if (pDevExt->win.s.pKernelSession)
    549         {
    550             VBoxGuestCloseSession(pDevExt, pDevExt->win.s.pKernelSession);
    551             pDevExt->win.s.pKernelSession = NULL;
    552         }
    553 #endif
    554 #endif
    555 
    556         if (pDevExt->win.s.pInterruptObject)
    557         {
    558             IoDisconnectInterrupt(pDevExt->win.s.pInterruptObject);
    559             pDevExt->win.s.pInterruptObject = NULL;
    560         }
    561 
    562         /* @todo: cleanup the rest stuff */
     545        if (pDevExt->pKernelSession)
     546        {
     547            VBoxGuestCloseSession(pDevExt, pDevExt->pKernelSession);
     548            pDevExt->pKernelSession = NULL;
     549        }
     550#endif
     551#endif
     552
     553        if (pDevExt->pInterruptObject)
     554        {
     555            IoDisconnectInterrupt(pDevExt->pInterruptObject);
     556            pDevExt->pInterruptObject = NULL;
     557        }
     558
     559        /** @todo: cleanup the rest stuff */
    563560
    564561
     
    616613{
    617614    /** @todo AssertPtrReturn(pIrp); */
    618     PIO_STACK_LOCATION pStack   = IoGetCurrentIrpStackLocation(pIrp);
     615    PIO_STACK_LOCATION  pStack   = IoGetCurrentIrpStackLocation(pIrp);
    619616    /** @todo AssertPtrReturn(pStack); */
    620     PFILE_OBJECT       pFileObj = pStack->FileObject;
    621     PVBOXGUESTDEVEXT   pDevExt  = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
    622     NTSTATUS           rc       = STATUS_SUCCESS;
    623 
    624     if (pDevExt->win.s.devState != WORKING)
    625     {
    626         Log(("VBoxGuest::vbgdNtGuestCreate: device is not working currently: %d!\n",
    627              pDevExt->win.s.devState));
     617    PFILE_OBJECT        pFileObj = pStack->FileObject;
     618    PVBOXGUESTDEVEXTWIN pDevExt  = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
     619    NTSTATUS            rc       = STATUS_SUCCESS;
     620
     621    if (pDevExt->devState != WORKING)
     622    {
     623        Log(("VBoxGuest::vbgdNtGuestCreate: device is not working currently: %d!\n", pDevExt->devState));
    628624        rc = STATUS_UNSUCCESSFUL;
    629625    }
     
    653649                 * exists for every R3 process.
    654650                 */
    655                 vrc = VBoxGuestCreateUserSession(pDevExt, &pSession);
     651                vrc = VBoxGuestCreateUserSession(&pDevExt->Core, &pSession);
    656652            }
    657653            else
    658654            {
    659655                /* ... otherwise we've been called from R0! */
    660                 vrc = VBoxGuestCreateKernelSession(pDevExt, &pSession);
     656                vrc = VBoxGuestCreateKernelSession(&pDevExt->Core, &pSession);
    661657            }
    662658            if (RT_SUCCESS(vrc))
     
    684680static NTSTATUS vbgdNtClose(PDEVICE_OBJECT pDevObj, PIRP pIrp)
    685681{
    686     PVBOXGUESTDEVEXT   pDevExt  = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
    687     PIO_STACK_LOCATION pStack   = IoGetCurrentIrpStackLocation(pIrp);
    688     PFILE_OBJECT       pFileObj = pStack->FileObject;
     682    PVBOXGUESTDEVEXTWIN pDevExt  = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
     683    PIO_STACK_LOCATION  pStack   = IoGetCurrentIrpStackLocation(pIrp);
     684    PFILE_OBJECT        pFileObj = pStack->FileObject;
    689685
    690686    Log(("VBoxGuest::vbgdNtGuestClose: pDevExt=0x%p pFileObj=0x%p FsContext=0x%p\n",
     
    695691    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pFileObj->FsContext;
    696692    if (pSession)
    697         VBoxGuestCloseSession(pDevExt, pSession);
     693        VBoxGuestCloseSession(&pDevExt->Core, pSession);
    698694#endif
    699695
     
    716712{
    717713    NTSTATUS            Status   = STATUS_SUCCESS;
    718     PVBOXGUESTDEVEXT    pDevExt  = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     714    PVBOXGUESTDEVEXTWIN pDevExt  = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    719715    PIO_STACK_LOCATION  pStack   = IoGetCurrentIrpStackLocation(pIrp);
    720716    unsigned int        uCmd     = (unsigned int)pStack->Parameters.DeviceIoControl.IoControlCode;
     
    740736    {
    741737        Log(("VBoxGuest::vbgdNtIOCtl: Using kernel session data ...\n"));
    742         pSession = pDevExt->win.s.pKernelSession;
     738        pSession = pDevExt->pKernelSession;
    743739    }
    744740
     
    794790             */
    795791            size_t cbDataReturned;
    796             int vrc = VBoxGuestCommonIOCtl(uCmd, pDevExt, pSession, pBuf, cbData, &cbDataReturned);
     792            int vrc = VBoxGuestCommonIOCtl(uCmd, &pDevExt->Core, pSession, pBuf, cbData, &cbDataReturned);
    797793
    798794            Log(("VBoxGuest::vbgdNtGuestDeviceControl: rc=%Rrc, pBuf=0x%p, cbData=%u, cbDataReturned=%u\n",
     
    851847{
    852848    NTSTATUS            Status      = STATUS_SUCCESS;
    853     PVBOXGUESTDEVEXT    pDevExt     = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     849    PVBOXGUESTDEVEXTWIN pDevExt     = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    854850    PIO_STACK_LOCATION  pStack      = IoGetCurrentIrpStackLocation(pIrp);
    855851    unsigned int        uCmd        = (unsigned int)pStack->Parameters.DeviceIoControl.IoControlCode;
     
    875871            /* we need a lock here to avoid concurrency with the set event functionality */
    876872            KIRQL OldIrql;
    877             KeAcquireSpinLock(&pDevExt->win.s.MouseEventAccessLock, &OldIrql);
    878             pDevExt->MouseNotifyCallback = *pInfo;
    879             KeReleaseSpinLock(&pDevExt->win.s.MouseEventAccessLock, OldIrql);
     873            KeAcquireSpinLock(&pDevExt->MouseEventAccessLock, &OldIrql);
     874            pDevExt->Core.MouseNotifyCallback = *pInfo;
     875            KeReleaseSpinLock(&pDevExt->MouseEventAccessLock, OldIrql);
    880876
    881877            Status = STATUS_SUCCESS;
     
    910906NTSTATUS vbgdNtSystemControl(PDEVICE_OBJECT pDevObj, PIRP pIrp)
    911907{
    912     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     908    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    913909
    914910    Log(("VBoxGuest::vbgdNtGuestSystemControl\n"));
     
    917913    IoSkipCurrentIrpStackLocation(pIrp);
    918914
    919     return IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp);
     915    return IoCallDriver(pDevExt->pNextLowerDriver, pIrp);
    920916}
    921917
     
    930926NTSTATUS vbgdNtShutdown(PDEVICE_OBJECT pDevObj, PIRP pIrp)
    931927{
    932     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     928    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    933929
    934930    Log(("VBoxGuest::vbgdNtGuestShutdown\n"));
    935931
    936     VMMDevPowerStateRequest *pReq = pDevExt->win.s.pPowerStateRequest;
     932    VMMDevPowerStateRequest *pReq = pDevExt->pPowerStateRequest;
    937933    if (pReq)
    938934    {
     
    980976void vbgdNtDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, PIRP pIrp, PVOID pContext)
    981977{
    982     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
     978    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    983979    Log(("VBoxGuest::vbgdNtGuestDpcHandler: pDevExt=0x%p\n", pDevExt));
    984980
    985981    /* test & reset the counter */
    986     if (ASMAtomicXchgU32(&pDevExt->u32MousePosChangedSeq, 0))
     982    if (ASMAtomicXchgU32(&pDevExt->Core.u32MousePosChangedSeq, 0))
    987983    {
    988984        /* we need a lock here to avoid concurrency with the set event ioctl handler thread,
    989985         * i.e. to prevent the event from destroyed while we're using it */
    990986        Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    991         KeAcquireSpinLockAtDpcLevel(&pDevExt->win.s.MouseEventAccessLock);
    992 
    993         if (pDevExt->MouseNotifyCallback.pfnNotify)
    994             pDevExt->MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser);
    995 
    996         KeReleaseSpinLockFromDpcLevel(&pDevExt->win.s.MouseEventAccessLock);
     987        KeAcquireSpinLockAtDpcLevel(&pDevExt->MouseEventAccessLock);
     988
     989        if (pDevExt->Core.MouseNotifyCallback.pfnNotify)
     990            pDevExt->Core.MouseNotifyCallback.pfnNotify(pDevExt->Core.MouseNotifyCallback.pvUser);
     991
     992        KeReleaseSpinLockFromDpcLevel(&pDevExt->MouseEventAccessLock);
    997993    }
    998994
    999995    /* Process the wake-up list we were asked by the scheduling a DPC
    1000996     * in vbgdNtIsrHandler(). */
    1001     VBoxGuestWaitDoWakeUps(pDevExt);
     997    VBoxGuestWaitDoWakeUps(&pDevExt->Core);
    1002998}
    1003999
     
    10121008BOOLEAN vbgdNtIsrHandler(PKINTERRUPT pInterrupt, PVOID pServiceContext)
    10131009{
    1014     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pServiceContext;
     1010    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pServiceContext;
    10151011    if (pDevExt == NULL)
    10161012        return FALSE;
     
    10201016
    10211017    /* Enter the common ISR routine and do the actual work. */
    1022     BOOLEAN fIRQTaken = VBoxGuestCommonISR(pDevExt);
     1018    BOOLEAN fIRQTaken = VBoxGuestCommonISR(&pDevExt->Core);
    10231019
    10241020    /* If we need to wake up some events we do that in a DPC to make
     
    10281024        Log(("VBoxGuest::vbgdNtGuestIsrHandler: IRQ was taken! pInterrupt = 0x%p, pDevExt = 0x%p\n",
    10291025             pInterrupt, pDevExt));
    1030         if (ASMAtomicUoReadU32(&pDevExt->u32MousePosChangedSeq) || !RTListIsEmpty(&pDevExt->WakeUpList))
     1026        if (ASMAtomicUoReadU32(&pDevExt->Core.u32MousePosChangedSeq) || !RTListIsEmpty(&pDevExt->Core.WakeUpList))
    10311027        {
    10321028            Log(("VBoxGuest::vbgdNtGuestIsrHandler: Requesting DPC ...\n"));
    1033             IoRequestDpc(pDevExt->win.s.pDeviceObject, pDevExt->win.s.pCurrentIrp, NULL);
     1029            IoRequestDpc(pDevExt->pDeviceObject, pDevExt->pCurrentIrp, NULL);
    10341030        }
    10351031    }
     
    10381034
    10391035
    1040 /*
     1036/**
    10411037 * Overridden routine for mouse polling events.
    10421038 *
     
    10941090 * @param pDevExt   Device extension
    10951091 */
    1096 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXT pDevExt)
     1092NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTWIN pDevExt)
    10971093{
    10981094    /* Enumerate the resource list. */
     
    11041100    ULONG rangeCount = 0;
    11051101    ULONG cMMIORange = 0;
    1106     PVBOXGUESTWINBASEADDRESS pBaseAddress = pDevExt->win.s.pciBaseAddress;
     1102    PVBOXGUESTWINBASEADDRESS pBaseAddress = pDevExt->pciBaseAddress;
    11071103    for (ULONG i = 0; i < pResList->List->PartialResourceList.Count; i++)
    11081104    {
     
    11221118                    /* Save the IO port base. */
    11231119                    /** @todo Not so good. */
    1124                     pDevExt->IOPortBase = (RTIOPORT)pPartialData->u.Port.Start.LowPart;
     1120                    pDevExt->Core.IOPortBase = (RTIOPORT)pPartialData->u.Port.Start.LowPart;
    11251121
    11261122                    /* Save resource information. */
     
    11491145
    11501146                /* Save information. */
    1151                 pDevExt->win.s.interruptLevel    = pPartialData->u.Interrupt.Level;
    1152                 pDevExt->win.s.interruptVector   = pPartialData->u.Interrupt.Vector;
    1153                 pDevExt->win.s.interruptAffinity = pPartialData->u.Interrupt.Affinity;
     1147                pDevExt->interruptLevel    = pPartialData->u.Interrupt.Level;
     1148                pDevExt->interruptVector   = pPartialData->u.Interrupt.Vector;
     1149                pDevExt->interruptAffinity = pPartialData->u.Interrupt.Affinity;
    11541150
    11551151                /* Check interrupt mode. */
    11561152                if (pPartialData->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
    1157                 {
    1158                     pDevExt->win.s.interruptMode = Latched;
    1159                 }
     1153                    pDevExt->interruptMode = Latched;
    11601154                else
    1161                 {
    1162                     pDevExt->win.s.interruptMode = LevelSensitive;
    1163                 }
     1155                    pDevExt->interruptMode = LevelSensitive;
    11641156                break;
    11651157            }
     
    11811173                    {
    11821174                        /* Save physical MMIO base + length for VMMDev. */
    1183                         pDevExt->win.s.vmmDevPhysMemoryAddress = pPartialData->u.Memory.Start;
    1184                         pDevExt->win.s.vmmDevPhysMemoryLength = (ULONG)pPartialData->u.Memory.Length;
     1175                        pDevExt->vmmDevPhysMemoryAddress = pPartialData->u.Memory.Start;
     1176                        pDevExt->vmmDevPhysMemoryLength = (ULONG)pPartialData->u.Memory.Length;
    11851177
    11861178                        /* Save resource information. */
     
    12161208
    12171209    /* Memorize the number of resources found. */
    1218     pDevExt->win.s.pciAddressCount = rangeCount;
     1210    pDevExt->pciAddressCount = rangeCount;
    12191211    return rc;
    12201212}
     
    12321224 * @param pcbMMIO           Length of mapped I/O base.
    12331225 */
    1234 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,
     1226NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,
    12351227                               void **ppvMMIOBase, uint32_t *pcbMMIO)
    12361228{
     
    12821274 * @param   pDevExt     The device extension.
    12831275 */
    1284 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt)
    1285 {
    1286     Log(("VBoxGuest::vbgdNtUnmapVMMDevMemory: pVMMDevMemory = 0x%x\n", pDevExt->pVMMDevMemory));
    1287     if (pDevExt->pVMMDevMemory)
    1288     {
    1289         MmUnmapIoSpace((void*)pDevExt->pVMMDevMemory, pDevExt->win.s.vmmDevPhysMemoryLength);
    1290         pDevExt->pVMMDevMemory = NULL;
    1291     }
    1292 
    1293     pDevExt->win.s.vmmDevPhysMemoryAddress.QuadPart = 0;
    1294     pDevExt->win.s.vmmDevPhysMemoryLength = 0;
     1276void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt)
     1277{
     1278    Log(("VBoxGuest::vbgdNtUnmapVMMDevMemory: pVMMDevMemory = 0x%x\n", pDevExt->Core.pVMMDevMemory));
     1279    if (pDevExt->Core.pVMMDevMemory)
     1280    {
     1281        MmUnmapIoSpace((void*)pDevExt->Core.pVMMDevMemory, pDevExt->vmmDevPhysMemoryLength);
     1282        pDevExt->Core.pVMMDevMemory = NULL;
     1283    }
     1284
     1285    pDevExt->vmmDevPhysMemoryAddress.QuadPart = 0;
     1286    pDevExt->vmmDevPhysMemoryLength = 0;
    12951287}
    12961288
     
    13651357{
    13661358    AssertPtrReturn(pu32Bits, 0);
    1367     LogFlowFunc(("*pu32Bits=0x%x, u32Mask=0x%x\n", *(long *)pu32Bits,
    1368                  u32Mask));
     1359    LogFlowFunc(("*pu32Bits=0x%x, u32Mask=0x%x\n", *(uint32_t *)pu32Bits, u32Mask));
    13691360    uint32_t u32Result = 0;
    13701361    uint32_t u32WorkingMask = u32Mask;
     
    14121403
    14131404#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
    1414 #pragma pack(1)
     1405
     1406/*
     1407 * DPC latency checker.
     1408 */
     1409
     1410# pragma pack(1) /** @todo r=bird: Not needed for DPCSAMPLE, screwes up member alignment in DPCDATA! */
    14151411typedef struct DPCSAMPLE
    14161412{
    1417     LARGE_INTEGER PerfDelta;
    1418     LARGE_INTEGER PerfCounter;
    1419     LARGE_INTEGER PerfFrequency;
    1420     uint64_t u64TSC;
     1413    LARGE_INTEGER   PerfDelta;
     1414    LARGE_INTEGER   PerfCounter;
     1415    LARGE_INTEGER   PerfFrequency;
     1416    uint64_t        u64TSC;
    14211417} DPCSAMPLE;
    14221418
    14231419typedef struct DPCDATA
    14241420{
    1425     KDPC Dpc;
    1426     KTIMER Timer;
    1427     KSPIN_LOCK SpinLock;
    1428 
    1429     ULONG ulTimerRes;
    1430 
    1431     LARGE_INTEGER DueTime;
    1432 
    1433     BOOLEAN fFinished;
    1434 
    1435     LARGE_INTEGER PerfCounterPrev;
    1436 
    1437     int iSampleCount;
    1438     DPCSAMPLE aSamples[8192];
     1421    KDPC            Dpc;
     1422    KTIMER          Timer;
     1423    KSPIN_LOCK      SpinLock;
     1424
     1425    ULONG           ulTimerRes;
     1426
     1427    BOOLEAN         fFinished;
     1428
     1429    LARGE_INTEGER   DueTime;
     1430
     1431    LARGE_INTEGER   PerfCounterPrev;
     1432
     1433    int             cSamples;
     1434    DPCSAMPLE       aSamples[8192];
    14391435} DPCDATA;
    1440 #pragma pack(1)
    1441 
    1442 #define VBOXGUEST_DPC_TAG 'DPCS'
     1436# pragma pack(1)
     1437
     1438# define VBOXGUEST_DPC_TAG 'DPCS'
    14431439
    14441440static VOID DPCDeferredRoutine(struct _KDPC *Dpc,
     
    14511447    KeAcquireSpinLockAtDpcLevel(&pData->SpinLock);
    14521448
    1453     if (pData->iSampleCount >= RT_ELEMENTS(pData->aSamples))
     1449    if (pData->cSamples >= RT_ELEMENTS(pData->aSamples))
    14541450    {
    14551451        pData->fFinished = 1;
     
    14581454    }
    14591455
    1460     DPCSAMPLE *pSample = &pData->aSamples[pData->iSampleCount++];
     1456    DPCSAMPLE *pSample = &pData->aSamples[pData->cSamples++];
    14611457
    14621458    pSample->u64TSC = ASMReadTSC();
     
    14711467}
    14721468
    1473 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
     1469int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXTWIN pDevExt, PVBOXGUESTSESSION pSession,
    14741470                             void *pvData, size_t cbData, size_t *pcbDataReturned)
    14751471{
    1476     int rc = VINF_SUCCESS;
    1477 
    14781472    /* Allocate a non paged memory for samples and related data. */
    14791473    DPCDATA *pData = (DPCDATA *)ExAllocatePoolWithTag(NonPagedPool, sizeof(DPCDATA), VBOXGUEST_DPC_TAG);
     
    14901484
    14911485    pData->fFinished = 0;
    1492     pData->iSampleCount = 0;
     1486    pData->cSamples = 0;
    14931487    pData->PerfCounterPrev.QuadPart = 0;
    14941488
     
    15101504    /* Log everything to the host. */
    15111505    RTLogBackdoorPrintf("DPC: ulTimerRes = %d\n", pData->ulTimerRes);
    1512     int i;
    1513     for (i = 0; i < pData->iSampleCount; i++)
     1506    for (int i = 0; i < pData->cSamples; i++)
    15141507    {
    15151508        DPCSAMPLE *pSample = &pData->aSamples[i];
    15161509
    15171510        RTLogBackdoorPrintf("[%d] pd %lld pc %lld pf %lld t %lld\n",
    1518                 i,
    1519                 pSample->PerfDelta.QuadPart,
    1520                 pSample->PerfCounter.QuadPart,
    1521                 pSample->PerfFrequency.QuadPart,
    1522                 pSample->u64TSC);
     1511                            i,
     1512                            pSample->PerfDelta.QuadPart,
     1513                            pSample->PerfCounter.QuadPart,
     1514                            pSample->PerfFrequency.QuadPart,
     1515                            pSample->u64TSC);
    15231516    }
    15241517
    15251518    ExFreePoolWithTag(pData, VBOXGUEST_DPC_TAG);
    1526     return rc;
    1527 }
     1519    return VINF_SUCCESS;
     1520}
     1521
    15281522#endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
     1523
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.h

    r44983 r44988  
    3737#include <VBox/VMMDev.h>
    3838#include <VBox/VBoxGuest.h>
     39#include "VBoxGuestInternal.h"
    3940
    4041
     
    7172typedef struct VBOXGUESTDEVEXTWIN
    7273{
     74    VBOXGUESTDEVEXT Core;
     75
    7376    /** Our functional driver object. */
    7477    PDEVICE_OBJECT pDeviceObject;
     
    139142#define VBOXGUEST_UPDATE_DEVSTATE(a_pDevExt, a_newDevState) \
    140143    do { \
    141         (a_pDevExt)->win.s.prevDevState = (a_pDevExt)->win.s.devState; \
    142         (a_pDevExt)->win.s.devState     = (a_newDevState); \
     144        (a_pDevExt)->prevDevState = (a_pDevExt)->devState; \
     145        (a_pDevExt)->devState     = (a_newDevState); \
    143146    } while (0)
    144147
    145148/** CM_RESOURCE_MEMORY_* flags which were used on XP or earlier. */
    146149#define VBOX_CM_PRE_VISTA_MASK (0x3f)
    147 
    148 
    149 /* Include the internal header now as we've declared the internal
    150    structure and stuff. */
    151 #include "VBoxGuestInternal.h"
    152150
    153151
     
    173171VOID       vbgdNtDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, PIRP pIrp, PVOID pContext);
    174172BOOLEAN    vbgdNtIsrHandler(PKINTERRUPT interrupt, PVOID serviceContext);
    175 NTSTATUS   vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXT pDevExt);
    176 NTSTATUS   vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,
     173NTSTATUS   vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTWIN pDevExt);
     174NTSTATUS   vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,
    177175                                 void **ppvMMIOBase, uint32_t *pcbMMIO);
    178 void       vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt);
     176void       vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt);
    179177VBOXOSTYPE vbgdNtVersionToOSType(VBGDNTVER enmNtVer);
    180178/** @}  */
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r44130 r44988  
    7171static int VBoxGuestCommonIOCtl_SetMouseStatus(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fFeatures);
    7272
    73 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER
    74 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
    75                              void *pvData, size_t cbData, size_t *pcbDataReturned);
    76 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
    7773
    7874/*******************************************************************************
     
    25002496    }
    25012497#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
     2498    /** @todo r=bird: This request doesn't vary in size?? AFAIK it doesn't have
     2499     *        any data associated with it... grumble. */
    25022500    else if (VBOXGUEST_IOCTL_STRIP_SIZE(iFunction) == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_DPC))
    25032501    {
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    r44983 r44988  
    181181    /** Callback and user data for a kernel mouse handler. */
    182182    VBoxGuestMouseSetNotifyCallback MouseNotifyCallback;
    183 
    184     /** Windows part.
    185      * @todo r=bird: Entirely wrong approach. You should create
    186      *       VBOXGUESTDEVEXTWIN as a super structure to VBOXGUESTDEVEXT. If they
    187      *       were classes, class VBOXGUESTDEVEXTWIN : public VBOXGUESTDEVEXT ... */
    188     union
    189     {
    190 #ifdef ___VBoxGuest_win_h
    191         VBOXGUESTDEVEXTWIN          s;
    192 #else
    193         uint32_t                    dummy;
    194 #endif
    195     } win;
    196 
    197183} VBOXGUESTDEVEXT;
    198184/** Pointer to the VBoxGuest driver data. */
     
    278264void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt);
    279265
     266
     267#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
     268int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
     269                             void *pvData, size_t cbData, size_t *pcbDataReturned);
     270#endif
     271
    280272RT_C_DECLS_END
    281273
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