VirtualBox

Changeset 25141 in vbox


Ignore:
Timestamp:
Dec 2, 2009 9:38:41 AM (15 years ago)
Author:
vboxsync
Message:

VBoxGuest: Fixed spinlock creation for NT4.

Location:
trunk/src/VBox/Additions/WINNT/VBoxGuest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/NTLegacy.cpp

    r18019 r25141  
    5858{
    5959    ULONG busNumber, slotNumber;
    60 //    ULONG i;
    6160    NTSTATUS rc = STATUS_SUCCESS;
    6261
    63     dprintf(("VBoxGuest::ntCreateDevice: entered\n"));
    64 
    65     // find our virtual PCI device
     62    dprintf(("VBoxGuest::ntCreateDevice: entered, pDrvObj=%x, pDevObj=%x, pRegPath=%x\n",
     63        pDrvObj, pDevObj, pRegPath));
     64
     65    /*
     66     * Find our virtual PCI device
     67     */
    6668    rc = findPCIDevice(&busNumber, (PCI_SLOT_NUMBER*)&slotNumber);
    6769    if (!NT_SUCCESS(rc))
     
    101103    RtlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT));
    102104
    103     if (pDevObj)
     105    if (pDevObj) /* pDevObj always is NULL at the moment, so don't attach to the driver stack */
    104106    {
    105107        pDevExt->nextLowerDriver = IoAttachDeviceToDeviceStack(deviceObject, pDevObj);
     
    111113            return STATUS_NO_SUCH_DEVICE;
    112114        }
     115        dprintf(("VBoxGuest::ntCreateDevice: device attached to stack\n"));
     116    }
    113117
    114118#ifdef VBOX_WITH_HGCM
    115         int rc2 = RTSpinlockCreate(&pDevExt->SessionSpinlock);
    116         if (RT_FAILURE(rc2))
    117         {
    118             dprintf(("VBoxGuest::ntCreateDevice: RTSpinlockCreate failed\n"));
    119             IoDetachDevice(pDevExt->nextLowerDriver);
    120             IoDeleteSymbolicLink(&DosName);
    121             IoDeleteDevice(deviceObject);
    122             return STATUS_DRIVER_UNABLE_TO_LOAD;
    123         }
     119    /* Create global spinlock for all driver sessions */
     120    int rc2 = RTSpinlockCreate(&pDevExt->SessionSpinlock);
     121    if (RT_FAILURE(rc2))
     122    {
     123        dprintf(("VBoxGuest::ntCreateDevice: RTSpinlockCreate failed\n"));
     124        IoDetachDevice(pDevExt->nextLowerDriver);
     125        IoDeleteSymbolicLink(&DosName);
     126        IoDeleteDevice(deviceObject);
     127        return STATUS_DRIVER_UNABLE_TO_LOAD;
     128    }
     129    dprintf(("VBoxGuest::ntCreateDevice: spinlock created\n"));
    124130#endif
    125     }
    126     // store a reference to ourself
     131
     132    /* Store a reference to ourself */
    127133    pDevExt->deviceObject = deviceObject;
    128     // store bus and slot number we've queried before
     134    /* Store bus and slot number we've queried before */
    129135    pDevExt->busNumber = busNumber;
    130136    pDevExt->slotNumber = slotNumber;
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r25021 r25141  
    183183    pDrvObj->MajorFunction[IRP_MJ_WRITE]              = VBoxGuestNotSupportedStub;
    184184#ifdef TARGET_NT4
    185     rc = ntCreateDevice(pDrvObj, NULL, pRegPath);
     185    rc = ntCreateDevice(pDrvObj, NULL /* pDevObj */, pRegPath);
    186186#else
    187187    pDrvObj->MajorFunction[IRP_MJ_PNP]                = VBoxGuestPnP;
     
    320320#ifdef VBOX_WITH_HGCM
    321321    if (pDevExt->SessionSpinlock != NIL_RTSPINLOCK)
    322         RTSpinlockDestroy(pDevExt->SessionSpinlock);
     322    {
     323        int rc2 = RTSpinlockDestroy(pDevExt->SessionSpinlock);
     324        dprintf(("VBoxGuest::VBoxGuestUnload: spinlock destroyed with rc=%Rrc\n", rc2));
     325    }
    323326#endif
    324327    IoDeleteDevice(pDrvObj->DeviceObject);
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