Changeset 25465 in vbox for trunk/src/VBox/HostDrivers/Support/win
- Timestamp:
- Dec 17, 2009 2:49:34 PM (15 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support/win
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r25361 r25465 106 106 { 107 107 NTSTATUS rc; 108 dprintf(("VBoxDrv::DriverEntry\n"));109 108 110 109 /* … … 127 126 if (RT_SUCCESS(rc)) 128 127 { 128 Log(("VBoxDrv::DriverEntry\n")); 129 129 130 /* 130 131 * Initialize the device extension. … … 162 163 pDevExt->hPowerCallback = ExRegisterCallback(pDevExt->pObjPowerCallback, VBoxPowerDispatchCallback, pDevObj); 163 164 164 dprintf(("VBoxDrv::DriverEntry returning STATUS_SUCCESS\n"));165 Log(("VBoxDrv::DriverEntry returning STATUS_SUCCESS\n")); 165 166 return STATUS_SUCCESS; 166 167 } 167 168 168 dprintf(("supdrvInitDevExit failed with vrc=%d!\n", vrc));169 Log(("supdrvInitDevExit failed with vrc=%d!\n", vrc)); 169 170 rc = VBoxDrvNtErr2NtStatus(vrc); 170 171 … … 174 175 else 175 176 { 176 dprintf(("RTR0Init failed with vrc=%d!\n", vrc));177 Log(("RTR0Init failed with vrc=%d!\n", vrc)); 177 178 rc = VBoxDrvNtErr2NtStatus(vrc); 178 179 } 179 180 } 180 181 else 181 dprintf(("IoCreateSymbolicLink failed with rc=%#x!\n", rc));182 Log(("IoCreateSymbolicLink failed with rc=%#x!\n", rc)); 182 183 183 184 IoDeleteDevice(pDevObj); 184 185 } 185 186 else 186 dprintf(("IoCreateDevice failed with rc=%#x!\n", rc));187 Log(("IoCreateDevice failed with rc=%#x!\n", rc)); 187 188 188 189 if (NT_SUCCESS(rc)) 189 190 rc = STATUS_INVALID_PARAMETER; 190 dprintf(("VBoxDrv::DriverEntry returning %#x\n", rc));191 Log(("VBoxDrv::DriverEntry returning %#x\n", rc)); 191 192 return rc; 192 193 } … … 202 203 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pDrvObj->DeviceObject->DeviceExtension; 203 204 204 dprintf(("VBoxDrvNtUnload at irql %d\n", KeGetCurrentIrql()));205 Log(("VBoxDrvNtUnload at irql %d\n", KeGetCurrentIrql())); 205 206 206 207 /* Clean up the power callback registration. */ … … 235 236 NTSTATUS _stdcall VBoxDrvNtCreate(PDEVICE_OBJECT pDevObj, PIRP pIrp) 236 237 { 237 dprintf(("VBoxDrvNtCreate\n"));238 Log(("VBoxDrvNtCreate\n")); 238 239 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 239 240 PFILE_OBJECT pFileObj = pStack->FileObject; … … 285 286 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 286 287 PFILE_OBJECT pFileObj = pStack->FileObject; 287 dprintf(("VBoxDrvNtClose: pDevExt=%p pFileObj=%p pSession=%p\n",288 288 Log(("VBoxDrvNtClose: pDevExt=%p pFileObj=%p pSession=%p\n", 289 pDevExt, pFileObj, pFileObj->FsContext)); 289 290 supdrvCloseSession(pDevExt, (PSUPDRVSESSION)pFileObj->FsContext); 290 291 pFileObj->FsContext = NULL; … … 358 359 unsigned cbOut = 0; 359 360 int rc = 0; 360 dprintf2(("VBoxDrvNtDeviceControlSlow(%p,%p): ioctl=%#x pBuf=%p cbIn=%#x cbOut=%#x pSession=%p\n",361 362 363 361 Log2(("VBoxDrvNtDeviceControlSlow(%p,%p): ioctl=%#x pBuf=%p cbIn=%#x cbOut=%#x pSession=%p\n", 362 pDevExt, pIrp, pStack->Parameters.DeviceIoControl.IoControlCode, 363 pIrp->AssociatedIrp.SystemBuffer, pStack->Parameters.DeviceIoControl.InputBufferLength, 364 pStack->Parameters.DeviceIoControl.OutputBufferLength, pSession)); 364 365 365 366 #ifdef RT_ARCH_AMD64 … … 394 395 else 395 396 rcNt = STATUS_INVALID_PARAMETER; 396 dprintf2(("VBoxDrvNtDeviceControlSlow: returns %#x cbOut=%d rc=%#x\n", rcNt, cbOut, rc));397 Log2(("VBoxDrvNtDeviceControlSlow: returns %#x cbOut=%d rc=%#x\n", rcNt, cbOut, rc)); 397 398 } 398 399 else 399 400 { 400 dprintf(("VBoxDrvNtDeviceControlSlow: Mismatching sizes (%#x) - Hdr=%#lx/%#lx Irp=%#lx/%#lx!\n",401 402 403 404 405 401 Log(("VBoxDrvNtDeviceControlSlow: Mismatching sizes (%#x) - Hdr=%#lx/%#lx Irp=%#lx/%#lx!\n", 402 pStack->Parameters.DeviceIoControl.IoControlCode, 403 pStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(*pHdr) ? pHdr->cbIn : 0, 404 pStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(*pHdr) ? pHdr->cbOut : 0, 405 pStack->Parameters.DeviceIoControl.InputBufferLength, 406 pStack->Parameters.DeviceIoControl.OutputBufferLength)); 406 407 rcNt = STATUS_INVALID_PARAMETER; 407 408 } … … 409 410 else 410 411 { 411 dprintf(("VBoxDrvNtDeviceControlSlow: not buffered request (%#x) - not supported\n",412 412 Log(("VBoxDrvNtDeviceControlSlow: not buffered request (%#x) - not supported\n", 413 pStack->Parameters.DeviceIoControl.IoControlCode)); 413 414 rcNt = STATUS_NOT_SUPPORTED; 414 415 } … … 417 418 else 418 419 { 419 dprintf(("VBoxDrvNtDeviceControlSlow: WOW64 req - not supported\n"));420 Log(("VBoxDrvNtDeviceControlSlow: WOW64 req - not supported\n")); 420 421 rcNt = STATUS_NOT_SUPPORTED; 421 422 } … … 445 446 unsigned cbOut = 0; 446 447 int rc = 0; 447 dprintf2(("VBoxDrvNtInternalDeviceControl(%p,%p): ioctl=%#x pBuf=%p cbIn=%#x cbOut=%#x pSession=%p\n",448 449 450 448 Log2(("VBoxDrvNtInternalDeviceControl(%p,%p): ioctl=%#x pBuf=%p cbIn=%#x cbOut=%#x pSession=%p\n", 449 pDevExt, pIrp, pStack->Parameters.DeviceIoControl.IoControlCode, 450 pIrp->AssociatedIrp.SystemBuffer, pStack->Parameters.DeviceIoControl.InputBufferLength, 451 pStack->Parameters.DeviceIoControl.OutputBufferLength, pSession)); 451 452 452 453 /** @todo IDC on NT: figure when to create the session and that stuff... */ … … 478 479 else 479 480 rcNt = STATUS_INVALID_PARAMETER; 480 dprintf2(("VBoxDrvNtInternalDeviceControl: returns %#x/rc=%#x\n", rcNt, rc));481 Log2(("VBoxDrvNtInternalDeviceControl: returns %#x/rc=%#x\n", rcNt, rc)); 481 482 } 482 483 else 483 484 { 484 dprintf(("VBoxDrvNtInternalDeviceControl: Mismatching sizes (%#x) - Hdr=%#lx Irp=%#lx/%#lx!\n",485 486 487 488 485 Log(("VBoxDrvNtInternalDeviceControl: Mismatching sizes (%#x) - Hdr=%#lx Irp=%#lx/%#lx!\n", 486 pStack->Parameters.DeviceIoControl.IoControlCode, 487 pStack->Parameters.DeviceIoControl.InputBufferLength >= sizeof(*pHdr) ? pHdr->cb : 0, 488 pStack->Parameters.DeviceIoControl.InputBufferLength, 489 pStack->Parameters.DeviceIoControl.OutputBufferLength)); 489 490 rcNt = STATUS_INVALID_PARAMETER; 490 491 } … … 495 496 else 496 497 { 497 dprintf(("VBoxDrvNtInternalDeviceControl: not buffered request (%#x) - not supported\n",498 498 Log(("VBoxDrvNtInternalDeviceControl: not buffered request (%#x) - not supported\n", 499 pStack->Parameters.DeviceIoControl.IoControlCode)); 499 500 rcNt = STATUS_NOT_SUPPORTED; 500 501 } … … 517 518 NTSTATUS _stdcall VBoxDrvNtNotSupportedStub(PDEVICE_OBJECT pDevObj, PIRP pIrp) 518 519 { 519 dprintf(("VBoxDrvNtNotSupportedStub\n"));520 Log(("VBoxDrvNtNotSupportedStub\n")); 520 521 pDevObj = pDevObj; 521 522 … … 539 540 PDEVICE_OBJECT pDevObj = (PDEVICE_OBJECT)pCallbackContext; 540 541 541 dprintf(("VBoxPowerDispatchCallback: %x %x\n", pArgument1, pArgument2));542 Log(("VBoxPowerDispatchCallback: %x %x\n", pArgument1, pArgument2)); 542 543 543 544 /* Power change imminent? */ … … 545 546 { 546 547 if ((unsigned)pArgument2 == 0) 547 dprintf(("VBoxPowerDispatchCallback: about to go into suspend mode!\n"));548 Log(("VBoxPowerDispatchCallback: about to go into suspend mode!\n")); 548 549 else 549 dprintf(("VBoxPowerDispatchCallback: resumed!\n"));550 Log(("VBoxPowerDispatchCallback: resumed!\n")); 550 551 551 552 /* Inform any clients that have registered themselves with IPRT. */ … … 885 886 886 887 /** 887 * Converts a supdrverror code to an nt status code.888 * Converts an IPRT error code to an nt status code. 888 889 * 889 890 * @returns corresponding nt status code. 890 * @param rc supdrv error code (SUPDRV_ERR_* defines).891 * @param rc IPRT error status code. 891 892 */ 892 893 static NTSTATUS VBoxDrvNtErr2NtStatus(int rc) … … 894 895 switch (rc) 895 896 { 896 case 0:return STATUS_SUCCESS;897 case SUPDRV_ERR_GENERAL_FAILURE:return STATUS_NOT_SUPPORTED;898 case SUPDRV_ERR_INVALID_PARAM:return STATUS_INVALID_PARAMETER;899 case SUPDRV_ERR_INVALID_MAGIC:return STATUS_UNKNOWN_REVISION;900 case SUPDRV_ERR_INVALID_HANDLE:return STATUS_INVALID_HANDLE;901 case SUPDRV_ERR_INVALID_POINTER:return STATUS_INVALID_ADDRESS;902 case SUPDRV_ERR_LOCK_FAILED:return STATUS_NOT_LOCKED;903 case SUPDRV_ERR_ALREADY_LOADED:return STATUS_IMAGE_ALREADY_LOADED;904 case SUPDRV_ERR_PERMISSION_DENIED:return STATUS_ACCESS_DENIED;905 case SUPDRV_ERR_VERSION_MISMATCH:return STATUS_REVISION_MISMATCH;897 case VINF_SUCCESS: return STATUS_SUCCESS; 898 case VERR_GENERAL_FAILURE: return STATUS_NOT_SUPPORTED; 899 case VERR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER; 900 case VERR_INVALID_MAGIC: return STATUS_UNKNOWN_REVISION; 901 case VERR_INVALID_HANDLE: return STATUS_INVALID_HANDLE; 902 case VERR_INVALID_POINTER: return STATUS_INVALID_ADDRESS; 903 case VERR_LOCK_FAILED: return STATUS_NOT_LOCKED; 904 case VERR_ALREADY_LOADED: return STATUS_IMAGE_ALREADY_LOADED; 905 case VERR_PERMISSION_DENIED: return STATUS_ACCESS_DENIED; 906 case VERR_VERSION_MISMATCH: return STATUS_REVISION_MISMATCH; 906 907 } 907 908 -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r19924 r25465 536 536 537 537 /** 538 * Converts a supdrv error code to an ntstatus code.539 * 540 * @returns corresponding SUPDRV_ERR_*.538 * Converts a supdrv win32 error code to an IPRT status code. 539 * 540 * @returns corresponding IPRT error code. 541 541 * @param rc Win32 error code. 542 542 */ … … 572 572 //case 0: return STATUS_SUCCESS; 573 573 case 0: return VINF_SUCCESS; 574 //case SUPDRV_ERR_GENERAL_FAILURE: return STATUS_NOT_SUPPORTED;575 574 case ERROR_NOT_SUPPORTED: return VERR_GENERAL_FAILURE; 576 //case SUPDRV_ERR_INVALID_PARAM: return STATUS_INVALID_PARAMETER;577 575 case ERROR_INVALID_PARAMETER: return VERR_INVALID_PARAMETER; 578 //case SUPDRV_ERR_INVALID_MAGIC: return STATUS_ACCESS_DENIED;579 576 case ERROR_UNKNOWN_REVISION: return VERR_INVALID_MAGIC; 580 //case SUPDRV_ERR_INVALID_HANDLE: return STATUS_INVALID_HANDLE;581 577 case ERROR_INVALID_HANDLE: return VERR_INVALID_HANDLE; 582 //case SUPDRV_ERR_INVALID_POINTER: return STATUS_INVALID_ADDRESS;583 578 case ERROR_UNEXP_NET_ERR: return VERR_INVALID_POINTER; 584 //case SUPDRV_ERR_LOCK_FAILED: return STATUS_NOT_LOCKED;585 579 case ERROR_NOT_LOCKED: return VERR_LOCK_FAILED; 586 //case SUPDRV_ERR_ALREADY_LOADED: return STATUS_IMAGE_ALREADY_LOADED;587 580 case ERROR_SERVICE_ALREADY_RUNNING: return VERR_ALREADY_LOADED; 588 //case SUPDRV_ERR_PERMISSION_DENIED: return STATUS_ACCESS_DENIED;589 581 case ERROR_ACCESS_DENIED: return VERR_PERMISSION_DENIED; 590 //case SUPDRV_ERR_VERSION_MISMATCH: return STATUS_REVISION_MISMATCH;591 582 case ERROR_REVISION_MISMATCH: return VERR_VERSION_MISMATCH; 592 583 }
Note:
See TracChangeset
for help on using the changeset viewer.