Changeset 25141 in vbox
- Timestamp:
- Dec 2, 2009 9:38:41 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxGuest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxGuest/NTLegacy.cpp
r18019 r25141 58 58 { 59 59 ULONG busNumber, slotNumber; 60 // ULONG i;61 60 NTSTATUS rc = STATUS_SUCCESS; 62 61 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 */ 66 68 rc = findPCIDevice(&busNumber, (PCI_SLOT_NUMBER*)&slotNumber); 67 69 if (!NT_SUCCESS(rc)) … … 101 103 RtlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT)); 102 104 103 if (pDevObj) 105 if (pDevObj) /* pDevObj always is NULL at the moment, so don't attach to the driver stack */ 104 106 { 105 107 pDevExt->nextLowerDriver = IoAttachDeviceToDeviceStack(deviceObject, pDevObj); … … 111 113 return STATUS_NO_SUCH_DEVICE; 112 114 } 115 dprintf(("VBoxGuest::ntCreateDevice: device attached to stack\n")); 116 } 113 117 114 118 #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")); 124 130 #endif 125 } 126 / / store a reference to ourself131 132 /* Store a reference to ourself */ 127 133 pDevExt->deviceObject = deviceObject; 128 / / store bus and slot number we've queried before134 /* Store bus and slot number we've queried before */ 129 135 pDevExt->busNumber = busNumber; 130 136 pDevExt->slotNumber = slotNumber; -
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp
r25021 r25141 183 183 pDrvObj->MajorFunction[IRP_MJ_WRITE] = VBoxGuestNotSupportedStub; 184 184 #ifdef TARGET_NT4 185 rc = ntCreateDevice(pDrvObj, NULL , pRegPath);185 rc = ntCreateDevice(pDrvObj, NULL /* pDevObj */, pRegPath); 186 186 #else 187 187 pDrvObj->MajorFunction[IRP_MJ_PNP] = VBoxGuestPnP; … … 320 320 #ifdef VBOX_WITH_HGCM 321 321 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 } 323 326 #endif 324 327 IoDeleteDevice(pDrvObj->DeviceObject);
Note:
See TracChangeset
for help on using the changeset viewer.