Changeset 9578 in vbox
- Timestamp:
- Jun 10, 2008 4:34:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r8908 r9578 38 38 #include <iprt/assert.h> 39 39 #include <iprt/process.h> 40 #include <iprt/initterm.h> 40 41 41 42 … … 120 121 if (NT_SUCCESS(rc)) 121 122 { 122 uint64_t u64DiffCores; 123 124 /* 125 * Initialize the device extension. 126 */ 127 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pDevObj->DeviceExtension; 128 memset(pDevExt, 0, sizeof(*pDevExt)); 129 130 int vrc = supdrvInitDevExt(pDevExt); 131 if (!vrc) 123 int vrc = RTR0Init(0); 124 if (RT_SUCCESS(rc)) 132 125 { 133 /* Make sure the tsc is consistent across cpus/cores. */134 pDevExt->fForceAsyncTsc = supdrvDetermineAsyncTsc(&u64DiffCores);135 dprintf(("supdrvDetermineAsyncTsc: fAsync=%d u64DiffCores=%u.\n", pDevExt->fForceAsyncTsc, (uint32_t)u64DiffCores));136 137 126 /* 138 * Initi talize the GIP.127 * Initialize the device extension. 139 128 */ 140 rc = VBoxDrvNtGipInit(pDevExt); 141 if (NT_SUCCESS(rc)) 129 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pDevObj->DeviceExtension; 130 memset(pDevExt, 0, sizeof(*pDevExt)); 131 132 vrc = supdrvInitDevExt(pDevExt); 133 if (!vrc) 142 134 { 135 /* Make sure the tsc is consistent across cpus/cores. */ 136 uint64_t u64DiffCores; 137 pDevExt->fForceAsyncTsc = supdrvDetermineAsyncTsc(&u64DiffCores); 138 dprintf(("supdrvDetermineAsyncTsc: fAsync=%d u64DiffCores=%u.\n", pDevExt->fForceAsyncTsc, (uint32_t)u64DiffCores)); 139 143 140 /* 144 * Setup the driver entry points in pDrvObj.141 * Inititalize the GIP. 145 142 */ 146 pDrvObj->DriverUnload = VBoxDrvNtUnload; 147 pDrvObj->MajorFunction[IRP_MJ_CREATE] = VBoxDrvNtCreate; 148 pDrvObj->MajorFunction[IRP_MJ_CLOSE] = VBoxDrvNtClose; 149 pDrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = VBoxDrvNtDeviceControl; 150 pDrvObj->MajorFunction[IRP_MJ_READ] = VBoxDrvNtNotSupportedStub; 151 pDrvObj->MajorFunction[IRP_MJ_WRITE] = VBoxDrvNtNotSupportedStub; 152 /* more? */ 153 dprintf(("VBoxDrv::DriverEntry returning STATUS_SUCCESS\n")); 154 return STATUS_SUCCESS; 143 rc = VBoxDrvNtGipInit(pDevExt); 144 if (NT_SUCCESS(rc)) 145 { 146 /* 147 * Setup the driver entry points in pDrvObj. 148 */ 149 pDrvObj->DriverUnload = VBoxDrvNtUnload; 150 pDrvObj->MajorFunction[IRP_MJ_CREATE] = VBoxDrvNtCreate; 151 pDrvObj->MajorFunction[IRP_MJ_CLOSE] = VBoxDrvNtClose; 152 pDrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = VBoxDrvNtDeviceControl; 153 pDrvObj->MajorFunction[IRP_MJ_READ] = VBoxDrvNtNotSupportedStub; 154 pDrvObj->MajorFunction[IRP_MJ_WRITE] = VBoxDrvNtNotSupportedStub; 155 /* more? */ 156 dprintf(("VBoxDrv::DriverEntry returning STATUS_SUCCESS\n")); 157 return STATUS_SUCCESS; 158 } 159 dprintf(("VBoxDrvNtGipInit failed with rc=%#x!\n", rc)); 160 161 supdrvDeleteDevExt(pDevExt); 155 162 } 156 dprintf(("VBoxDrvNtGipInit failed with rc=%#x!\n", rc)); 157 158 supdrvDeleteDevExt(pDevExt); 163 else 164 { 165 dprintf(("supdrvInitDevExit failed with vrc=%d!\n", vrc)); 166 rc = VBoxDrvNtErr2NtStatus(vrc); 167 } 168 169 IoDeleteSymbolicLink(&DosName); 170 RTR0Term(); 159 171 } 160 172 else 161 { 162 dprintf((" supdrvInitDevExit failed with vrc=%d!\n", vrc));173 { 174 dprintf(("RTR0Init failed with vrc=%d!\n", vrc)); 163 175 rc = VBoxDrvNtErr2NtStatus(vrc); 164 176 } 165 166 IoDeleteSymbolicLink(&DosName);167 177 } 168 178 else … … 205 215 VBoxDrvNtGipTerm(pDevExt); 206 216 supdrvDeleteDevExt(pDevExt); 217 RTR0Term(); 207 218 IoDeleteDevice(pDrvObj->DeviceObject); 208 219 }
Note:
See TracChangeset
for help on using the changeset viewer.