- Timestamp:
- Aug 8, 2011 3:49:01 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxUSB/win
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/Makefile.kmk
r38292 r38356 38 38 endif 39 39 VBoxUSB_SDKS = W2K3DDK WINPSDKINCS 40 VBoxUSB_DEFS = IN_RT_R0 IN_SUP_R0 40 VBoxUSB_DEFS = IN_RT_R0 IN_SUP_R0 VBOX_DBG_LOG_NAME=\"USBDev\" 41 41 VBoxUSB_LDFLAGS.x86 = -Entry:DriverEntry@8 42 42 VBoxUSB_LDFLAGS.amd64 = -Entry:DriverEntry … … 66 66 VBoxUSBMon_DEFS = IN_RT_R0 IN_SUP_R0 i386=1 STD_CALL CONDITION_HANDLING=1 NT_INST=0 \ 67 67 WIN32=100 _NT1X_=100 WINNT=1 _WIN32_WINNT=0x0501 WINVER=0x0501 _WIN32_IE=0x0600 WIN32_LEAN_AND_MEAN=1 \ 68 VBOXUSBFILTERMGR_USB_SPINLOCK 68 VBOXUSBFILTERMGR_USB_SPINLOCK VBOX_DBG_LOG_NAME=\"USBMon\" 69 69 VBoxUSBMon_LDFLAGS.x86 = -Entry:DriverEntry@8 70 70 VBoxUSBMon_LDFLAGS.amd64 = -Entry:DriverEntry … … 86 86 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \ 87 87 $(usbd_1_TARGET) 88 #VBoxUSBMon_DEFS += LOG_ENABLED 88 if1of ($(KBUILD_TYPE), debug) 89 VBoxUSBMon_DEFS += LOG_ENABLED VBOX_USB_WITH_VERBOSE_LOGGING 90 endif 89 91 90 92 # -
trunk/src/VBox/HostDrivers/VBoxUSB/win/cmn/VBoxDrvTool.cpp
r37490 r38356 19 19 20 20 #include <iprt/assert.h> 21 #include <VBox/log.h> 22 23 #include "../../../win/VBoxDbgLog.h" 21 24 22 25 #define VBOXDRVTOOL_MEMTAG 'TDBV' … … 137 140 { 138 141 KEVENT Event; 142 LOG(("post irp (0x%p) to DevObj(0x%p) with timeout (%u)", pIrp, pDevObj, dwTimeoutMs)); 143 139 144 KeInitializeEvent(&Event, NotificationEvent, FALSE); 140 145 NTSTATUS Status = VBoxDrvToolIoPostAsync(pDevObj, pIrp, &Event); … … 152 157 if (Status == STATUS_TIMEOUT) 153 158 { 154 #ifdef DEBUG_misha 155 /* debugging only */ 156 AssertFailed(); 157 #endif 159 WARN(("irp (0x%p) to DevObj(0x%p) was not completed within timeout (%u), cancelling", pIrp, pDevObj, dwTimeoutMs)); 158 160 if (!IoCancelIrp(pIrp)) 159 161 { 160 162 /* this may happen, but this is something the caller with timeout is not expecting */ 161 AssertFailed();163 WARN(("IoCancelIrp failed")); 162 164 } 163 165 … … 167 169 else 168 170 { 169 A ssert(Status == STATUS_SUCCESS);171 ASSERT_WARN(Status == STATUS_SUCCESS, ("uunexpected Status (0x%x)", Status)); 170 172 } 171 173 172 174 /* by this time the IRP is completed */ 173 175 Status = pIrp->IoStatus.Status; 176 LOG(("Pending IRP(0x%p) completed with status(0x%x)", pIrp, Status)); 177 } 178 else 179 { 180 LOG(("IRP(0x%p) completed with status(0x%x)", pIrp, Status)); 174 181 } 175 182 return Status; -
trunk/src/VBox/HostDrivers/VBoxUSB/win/cmn/VBoxUsbTool.cpp
r37065 r38356 22 22 #include <VBox/log.h> 23 23 24 #include "../../../win/VBoxDbgLog.h" 25 24 26 #define VBOXUSBTOOL_MEMTAG 'TUBV' 25 27 … … 97 99 USHORT cbUrb = sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST); 98 100 PURB pUrb = VBoxUsbToolUrbAllocZ(URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, cbUrb); 99 Assert(pUrb);100 101 if(!pUrb) 101 102 { 103 WARN(("allocating URB failed")); 102 104 return STATUS_INSUFFICIENT_RESOURCES; 103 105 } … … 116 118 117 119 Status = VBoxUsbToolUrbPost(pDevObj, pUrb, dwTimeoutMs); 118 #ifdef DEBUG_misha 119 Assert(Status == STATUS_SUCCESS); 120 #endif 120 ASSERT_WARN(Status == STATUS_SUCCESS, ("VBoxUsbToolUrbPost failed Status (0x%x)", Status)); 121 121 122 122 VBoxUsbToolUrbFree(pUrb); … … 349 349 if (!pIrp) 350 350 { 351 WARN(("VBoxUsbToolIoBuildAsyncInternalCtl failed")); 351 352 return STATUS_INSUFFICIENT_RESOURCES; 352 353 } … … 371 372 if (!pIrp) 372 373 { 373 AssertMsgFailed(("IoBuildDeviceIoControlRequest failed!!\n"));374 WARN(("IoBuildDeviceIoControlRequest failed!!\n")); 374 375 pIoStatus->Status = STATUS_INSUFFICIENT_RESOURCES; 375 376 pIoStatus->Information = 0; … … 395 396 KeInitializeEvent(&Event, NotificationEvent, FALSE); 396 397 398 LOG(("Sending sync Ctl pDevObj(0x%p), uCtl(0x%x), pvArg1(0x%p), pvArg2(0x%p)", pDevObj, uCtl, pvArg1, pvArg2)); 399 397 400 Status = VBoxUsbToolIoInternalCtlSendAsync(pDevObj, uCtl, pvArg1, pvArg2, &Event, &IoStatus); 398 401 399 402 if (Status == STATUS_PENDING) 400 403 { 404 LOG(("VBoxUsbToolIoInternalCtlSendAsync returned pending for pDevObj(0x%x)", pDevObj)); 401 405 KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); 402 406 Status = IoStatus.Status; 403 } 404 405 return Status; 406 } 407 LOG(("Pending VBoxUsbToolIoInternalCtlSendAsync completed with Status (0x%x) for pDevObj(0x%x)", Status, pDevObj)); 408 } 409 else 410 { 411 LOG(("VBoxUsbToolIoInternalCtlSendAsync completed with Status (0x%x) for pDevObj(0x%x)", Status, pDevObj)); 412 } 413 414 return Status; 415 } -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
r38262 r38356 286 286 static PVBOXUSBFLT_DEVICE vboxUsbFltDevGetLocked(PDEVICE_OBJECT pPdo) 287 287 { 288 #ifdef DEBUG_misha288 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 289 289 for (PLIST_ENTRY pEntry = g_VBoxUsbFltGlobals.DeviceList.Flink; 290 290 pEntry != &g_VBoxUsbFltGlobals.DeviceList; … … 297 297 { 298 298 PVBOXUSBFLT_DEVICE pDevice2 = PVBOXUSBFLT_DEVICE_FROM_LE(pEntry2); 299 A ssert( pDevice->idVendor != pDevice2->idVendor299 ASSERT_WARN( pDevice->idVendor != pDevice2->idVendor 300 300 || pDevice->idProduct != pDevice2->idProduct 301 || pDevice->bcdDevice != pDevice2->bcdDevice );301 || pDevice->bcdDevice != pDevice2->bcdDevice, ("duplicate devices in a list!!")); 302 302 } 303 303 } … … 308 308 { 309 309 PVBOXUSBFLT_DEVICE pDevice = PVBOXUSBFLT_DEVICE_FROM_LE(pEntry); 310 A ssert( pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING310 ASSERT_WARN( pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING 311 311 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_UNCAPTURED 312 312 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_CAPTURING 313 313 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_CAPTURED 314 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_USED_BY_GUEST); 314 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_USED_BY_GUEST, 315 ("Invalid device state(%d) for device(0x%p) PDO(0x%p)", pDevice->enmState, pDevice, pDevice->Pdo)); 315 316 if (pDevice->Pdo == pPdo) 316 317 return pDevice; … … 328 329 { 329 330 vboxUsbFltDevRetain(pDevice); 331 LOG(("found device (0x%p), state(%d) for PDO(0x%p)", pDevice, pDevice->enmState, pPdo)); 330 332 } 331 333 else 332 334 { 335 LOG(("found replugging device (0x%p), state(%d) for PDO(0x%p)", pDevice, pDevice->enmState, pPdo)); 333 336 pDevice = NULL; 334 337 } … … 340 343 static NTSTATUS vboxUsbFltPdoReplug(PDEVICE_OBJECT pDo) 341 344 { 345 LOG(("Replugging PDO(0x%p)", pDo)); 342 346 NTSTATUS Status = VBoxUsbToolIoInternalCtlSendSync(pDo, IOCTL_INTERNAL_USB_CYCLE_PORT, NULL, NULL); 343 Assert(Status == STATUS_SUCCESS); 347 ASSERT_WARN(Status == STATUS_SUCCESS, ("replugging PDO(0x%p) failed Status(0x%x)", pDo, Status)); 348 LOG(("Replugging PDO(0x%p) done with Status(0x%x)", pDo, Status)); 344 349 return Status; 345 350 } … … 393 398 pDevice->Pdo = pDo; 394 399 400 LOG(("Populating Device(0x%p) for PDO(0x%p)", pDevice, pDo)); 401 395 402 pDevDr = (PUSB_DEVICE_DESCRIPTOR)VBoxUsbMonMemAllocZ(sizeof(*pDevDr)); 396 403 if (pDevDr == NULL) 397 404 { 398 AssertMsgFailed(("Failed to alloc mem for urb\n"));405 WARN(("Failed to alloc mem for urb\n")); 399 406 return STATUS_INSUFFICIENT_RESOURCES; 400 407 } … … 405 412 if (!NT_SUCCESS(Status)) 406 413 { 407 LOGREL((__FUNCTION__": getting device descriptor failed\n"));414 WARN(("getting device descriptor failed, Status (0x%x)\n", Status)); 408 415 break; 409 416 } … … 411 418 if (vboxUsbFltBlDevMatchLocked(pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)) 412 419 { 413 LOGREL((__FUNCTION__": found a known black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 414 #ifdef DEBUG_misha 415 AssertFailed(); 416 #endif 420 WARN(("found a known black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 417 421 Status = STATUS_UNSUCCESSFUL; 418 422 break; … … 438 442 if (!NT_SUCCESS(Status)) 439 443 { 440 AssertMsgFailed((__FUNCTION__":reading language ID failed\n"));444 WARN(("reading language ID failed\n")); 441 445 if (Status == STATUS_CANCELLED) 442 446 { 443 AssertMsgFailed((__FUNCTION__":found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice));447 WARN(("found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 444 448 vboxUsbFltBlDevAddLocked(pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice); 445 449 Status = STATUS_UNSUCCESSFUL; … … 453 457 if (!NT_SUCCESS(Status)) 454 458 { 455 AssertMsgFailed((__FUNCTION__":reading serial number failed\n"));459 WARN(("reading serial number failed\n")); 456 460 if (Status == STATUS_CANCELLED) 457 461 { 458 AssertMsgFailed((__FUNCTION__":found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice));462 WARN(("found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 459 463 vboxUsbFltBlDevAddLocked(pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice); 460 464 Status = STATUS_UNSUCCESSFUL; … … 469 473 if (!NT_SUCCESS(Status)) 470 474 { 471 AssertMsgFailed((__FUNCTION__":reading manufacturer name failed\n"));475 WARN(("reading manufacturer name failed\n")); 472 476 if (Status == STATUS_CANCELLED) 473 477 { 474 AssertMsgFailed((__FUNCTION__":found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice));478 WARN(("found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 475 479 vboxUsbFltBlDevAddLocked(pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice); 476 480 Status = STATUS_UNSUCCESSFUL; … … 485 489 if (!NT_SUCCESS(Status)) 486 490 { 487 AssertMsgFailed((__FUNCTION__":reading product name failed\n"));491 WARN(("reading product name failed\n")); 488 492 if (Status == STATUS_CANCELLED) 489 493 { 490 AssertMsgFailed((__FUNCTION__":found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice));494 WARN(("found a new black list device, vid(0x%x), pid(0x%x), rev(0x%x)\n", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice)); 491 495 vboxUsbFltBlDevAddLocked(pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice); 492 496 Status = STATUS_UNSUCCESSFUL; … … 535 539 } 536 540 #endif 537 LOG(( __FUNCTION__": strings: '%s':'%s':'%s' (lang ID %x)\n",541 LOG((": strings: '%s':'%s':'%s' (lang ID %x)\n", 538 542 pDevice->szMfgName, pDevice->szProduct, pDevice->szSerial, langId)); 539 543 } 540 544 545 LOG(("Populating Device(0x%p) for PDO(0x%p) Succeeded", pDevice, pDo)); 541 546 Status = STATUS_SUCCESS; 542 547 } while (0); 543 548 544 549 VBoxUsbMonMemFree(pDevDr); 550 LOG(("Populating Device(0x%p) for PDO(0x%p) Done, Status (0x%x)", pDevice, pDo, Status)); 545 551 return Status; 546 552 } … … 566 572 static bool vboxUsbFltDevCheckReplugLocked(PVBOXUSBFLT_DEVICE pDevice, PVBOXUSBFLTCTX pContext) 567 573 { 568 Assert(pContext); 574 ASSERT_WARN(pContext, ("context is NULL!")); 575 576 LOG(("Current context is (0x%p)", pContext)); 577 LOG(("Current Device owner is (0x%p)", pDevice->pOwner)); 569 578 570 579 /* check if device is already replugging */ 571 580 if (pDevice->enmState <= VBOXUSBFLT_DEVSTATE_ADDED) 572 581 { 582 LOG(("Device (0x%p) is already replugging, return..", pDevice)); 573 583 /* it is, do nothing */ 574 Assert(pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING); 584 ASSERT_WARN(pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING, 585 ("Device (0x%p) state is NOT REPLUGGING (%d)", pDevice, pDevice->enmState)); 575 586 return false; 576 587 } … … 578 589 if (pDevice->pOwner && pContext != pDevice->pOwner) 579 590 { 591 LOG(("Device (0x%p) is owned by another context(0x%p), current is(0x%p)", pDevice, pDevice->pOwner, pContext)); 580 592 /* this device is owned by another context, we're not allowed to do anything */ 581 593 return false; … … 589 601 false, /* do not remove a one-shot filter */ 590 602 &fFilter, &fIsOneShot); 603 LOG(("Matching Info: Filter (0x%p), NewOwner(0x%p), fFilter(%d), fIsOneShot(%d)", uId, pNewOwner, (int)fFilter, (int)fIsOneShot)); 591 604 if (pDevice->pOwner && pNewOwner && pDevice->pOwner != pNewOwner) 592 605 { 606 LOG(("Matching: Device (0x%p) is requested another owner(0x%p), current is(0x%p)", pDevice, pNewOwner, pDevice->pOwner)); 593 607 /* the device is owned by another owner, we can not change the owner here */ 594 608 return false; … … 597 611 if (!fFilter) 598 612 { 613 LOG(("Matching: Device (0x%p) should NOT be filtered", pDevice)); 599 614 /* the device should NOT be filtered, check the current state */ 600 615 if (vboxUsbFltDevStateIsNotFiltered(pDevice)) 601 616 { 617 LOG(("Device (0x%p) is NOT filtered", pDevice)); 602 618 /* no changes */ 603 619 if (fIsOneShot) 604 620 { 605 Assert(pNewOwner); 621 ASSERT_WARN(pNewOwner, ("no new owner")); 622 LOG(("Matching: This is a one-shot filter (0x%p), removing..", uId)); 606 623 /* remove a one-shot filter and keep the original filter data */ 607 624 int tmpRc = VBoxUSBFilterRemove(pNewOwner, uId); 608 A ssertRC(tmpRc);625 ASSERT_WARN(RT_SUCCESS(tmpRc), ("remove filter failed, rc (%d)", tmpRc)); 609 626 if (!pDevice->pOwner) 610 627 { 628 LOG(("Matching: updating the one-shot owner to (0x%p), fltId(0x%p)", pNewOwner, uId)); 611 629 /* update owner for one-shot if the owner is changed (i.e. assigned) */ 612 630 vboxUsbFltDevOwnerUpdateLocked(pDevice, pNewOwner, uId, true); 631 } 632 else 633 { 634 LOG(("Matching: device already has owner (0x%p) assigned", pDevice->pOwner)); 613 635 } 614 636 } 615 637 else 616 638 { 639 LOG(("Matching: This is NOT a one-shot filter (0x%p), newOwner(0x%p)", uId, pNewOwner)); 617 640 if (pNewOwner) 618 641 { … … 623 646 else 624 647 { 648 LOG(("Device (0x%p) IS filtered", pDevice)); 625 649 /* the device is currently filtered, we should release it only if 626 650 * 1. device does not have an owner … … 631 655 if (!pDevice->pOwner || fIsOneShot || !pDevice->fIsFilterOneShot) 632 656 { 657 LOG(("Matching: Need replug")); 633 658 bNeedReplug = true; 634 659 } … … 637 662 else 638 663 { 664 LOG(("Matching: Device (0x%p) SHOULD be filtered", pDevice)); 639 665 /* the device should be filtered, check the current state */ 640 A ssert(uId);641 A ssert(pNewOwner);666 ASSERT_WARN(uId, ("zero uid")); 667 ASSERT_WARN(pNewOwner, ("zero pNewOwner")); 642 668 if (vboxUsbFltDevStateIsFiltered(pDevice)) 643 669 { 670 LOG(("Device (0x%p) IS filtered", pDevice)); 644 671 /* the device is filtered */ 645 672 if (pNewOwner == pDevice->pOwner) 646 673 { 674 LOG(("Device owner match")); 647 675 /* no changes */ 648 676 if (fIsOneShot) 649 677 { 678 LOG(("Matching: This is a one-shot filter (0x%p), removing..", uId)); 650 679 /* remove a one-shot filter and keep the original filter data */ 651 680 int tmpRc = VBoxUSBFilterRemove(pNewOwner, uId); 652 A ssertRC(tmpRc);681 ASSERT_WARN(RT_SUCCESS(tmpRc), ("remove filter failed, rc (%d)", tmpRc)); 653 682 } 654 683 else 655 684 { 685 LOG(("Matching: This is NOT a one-shot filter (0x%p), Owner(0x%p)", uId, pDevice->pOwner)); 656 686 vboxUsbFltDevOwnerUpdateLocked(pDevice, pDevice->pOwner, uId, false); 657 687 } … … 659 689 else 660 690 { 661 Assert(!pDevice->pOwner); 691 ASSERT_WARN(!pDevice->pOwner, ("device should NOT have owner")); 692 LOG(("Matching: Need replug")); 662 693 /* the device needs to be filtered, but the owner changes, replug needed */ 663 694 bNeedReplug = true; … … 676 707 { 677 708 bNeedReplug = true; 709 LOG(("Matching: Need replug")); 678 710 } 679 711 } … … 682 714 if (bNeedReplug) 683 715 { 716 LOG(("Matching: Device needs replugging, marking as such")); 684 717 vboxUsbFltDevStateMarkReplugLocked(pDevice); 718 } 719 else 720 { 721 LOG(("Matching: Device does NOT need replugging")); 685 722 } 686 723 … … 697 734 pNext = pEntry->Flink; 698 735 PVBOXUSBFLT_DEVICE pDevice = PVBOXUSBFLT_DEVICE_FROM_REPLUGGINGLE(pEntry); 699 Assert(pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING 700 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_REMOVED); 736 LOG(("replugging matched PDO(0x%p), pDevice(0x%p)", pDevice->Pdo, pDevice)); 737 ASSERT_WARN(pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING 738 || pDevice->enmState == VBOXUSBFLT_DEVSTATE_REMOVED, 739 ("invalid state(0x%x) for device(0x%p)", pDevice->enmState, pDevice)); 701 740 702 741 vboxUsbFltPdoReplug(pDevice->Pdo); … … 713 752 Assert(Irql == PASSIVE_LEVEL); 714 753 715 LOG((" ==" __FUNCTION__"\n"));754 LOG(("Running filters, Context (0x%p)..", pContext)); 716 755 717 756 for (int i=0;i<RT_ELEMENTS(lpszStandardControllerName);i++) … … 758 797 PDEVICE_RELATIONS pDevRelations = NULL; 759 798 760 #ifdef DEBUG 761 LOG(("Associated driver ")); 762 vboxUsbDbgPrintUnicodeString(&pHubDevObj->DriverObject->DriverName); 763 LOG((" -> related dev obj=0x%p\n", IoGetRelatedDeviceObject(pHubFileObj))); 764 #endif 799 LOG(("Flt Associated driver ")); 800 LOG_USTR(&pHubDevObj->DriverObject->DriverName); 801 LOG((" -> related dev obj=0x%p", pHubDevObj)); 765 802 766 803 Status = VBoxUsbMonQueryBusRelations(pHubDevObj, pHubFileObj, &pDevRelations); … … 774 811 PDEVICE_OBJECT pDevObj = pDevRelations->Objects[k]; 775 812 776 LOG(("Found existing USB PDO 0x%p \n", pDevObj));813 LOG(("Found existing USB PDO 0x%p", pDevObj)); 777 814 VBOXUSBFLT_LOCK_ACQUIRE(); 778 815 PVBOXUSBFLT_DEVICE pDevice = vboxUsbFltDevGetLocked(pDevObj); 779 816 if (pDevice) 780 817 { 818 LOG(("Found existing device info (0x%p) for PDO 0x%p", pDevice, pDevObj)); 781 819 bool bReplug = vboxUsbFltDevCheckReplugLocked(pDevice, pContext); 782 820 if (bReplug) 783 821 { 822 LOG(("Replug needed for device (0x%p)", pDevice)); 784 823 InsertHeadList(&ReplugDevList, &pDevice->RepluggingLe); 785 824 vboxUsbFltDevRetain(pDevice); … … 788 827 else 789 828 { 829 LOG(("Replug NOT needed for device (0x%p)", pDevice)); 790 830 ObDereferenceObject(pDevObj); 791 831 } … … 795 835 pDevRelations->Objects[k] = NULL; 796 836 --cReplugPdos; 797 A ssert((uint32_t)cReplugPdos < UINT32_MAX/2);837 ASSERT_WARN((uint32_t)cReplugPdos < UINT32_MAX/2, ("cReplugPdos(%d) state broken", cReplugPdos)); 798 838 continue; 799 839 } 800 840 VBOXUSBFLT_LOCK_RELEASE(); 801 841 842 LOG(("NO device info found for PDO 0x%p", pDevObj)); 802 843 VBOXUSBFLT_DEVICE Device; 803 844 Status = vboxUsbFltDevPopulate(&Device, pDevObj /*, FALSE /* only need filter properties */); … … 812 853 &fFilter, &fIsOneShot); 813 854 VBOXUSBFLT_LOCK_RELEASE(); 855 LOG(("Matching Info: Filter (0x%p), pCtx(0x%p), fFilter(%d), fIsOneShot(%d)", uId, pCtx, (int)fFilter, (int)fIsOneShot)); 814 856 if (!fFilter) 815 857 { 858 LOG(("Matching: This device should NOT be filtered")); 816 859 /* this device should not be filtered, and it's not */ 817 860 ObDereferenceObject(pDevObj); … … 822 865 } 823 866 867 LOG(("Matching: This device SHOULD be filtered")); 824 868 /* this device needs to be filtered, but it's not, 825 869 * leave the PDO in array to issue a replug request for it … … 827 871 828 872 } 873 else 874 { 875 WARN(("vboxUsbFltDevPopulate for PDO 0x%p failed with Status 0x%x", pDevObj, Status)); 876 } 829 877 } 878 879 LOG(("(%d) non-matched PDOs to be replugged", cReplugPdos)); 830 880 831 881 if (cReplugPdos) … … 837 887 838 888 Status = vboxUsbFltPdoReplug(pDevRelations->Objects[k]); 839 A ssert(Status == STATUS_SUCCESS);889 ASSERT_WARN(Status == STATUS_SUCCESS, ("vboxUsbFltPdoReplug ailed Status(0x%x)", Status)); 840 890 ObDereferenceObject(pDevRelations->Objects[k]); 841 891 if (!--cReplugPdos) … … 843 893 } 844 894 845 A ssert(!cReplugPdos);895 ASSERT_WARN(!cReplugPdos, ("cReplugPdosreached zero!")); 846 896 } 847 897 … … 849 899 850 900 ExFreePool(pDevRelations); 901 } 902 else 903 { 904 WARN(("VBoxUsbMonQueryBusRelations failed for DO(0x%p), Status(0x%x), pDevRelations(0x%p)", 905 pHubDevObj, Status, pDevRelations)); 851 906 } 852 907 } … … 856 911 } 857 912 } 913 914 LOG(("DONE Running filters, Context (0x%p)", pContext)); 858 915 859 916 return STATUS_SUCCESS; … … 936 993 USBFilterGetString(pFilter, USBFILTERIDX_PRODUCT_STR) ? USBFilterGetString(pFilter, USBFILTERIDX_PRODUCT_STR) : "<null>", 937 994 USBFilterGetString(pFilter, USBFILTERIDX_SERIAL_NUMBER_STR) ? USBFilterGetString(pFilter, USBFILTERIDX_SERIAL_NUMBER_STR) : "<null>")); 938 #ifdef DEBUG939 LOG(("VBoxUSBClient::addFilter: idVendor=%#x idProduct=%#x bcdDevice=%#x bDeviceClass=%#x bDeviceSubClass=%#x bDeviceProtocol=%#x bBus=%#x bPort=%#x \n",995 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 996 LOG(("VBoxUSBClient::addFilter: idVendor=%#x idProduct=%#x bcdDevice=%#x bDeviceClass=%#x bDeviceSubClass=%#x bDeviceProtocol=%#x bBus=%#x bPort=%#x Type%#x\n", 940 997 USBFilterGetNum(pFilter, USBFILTERIDX_VENDOR_ID), 941 998 USBFilterGetNum(pFilter, USBFILTERIDX_PRODUCT_ID), … … 945 1002 USBFilterGetNum(pFilter, USBFILTERIDX_DEVICE_PROTOCOL), 946 1003 USBFilterGetNum(pFilter, USBFILTERIDX_BUS), 947 USBFilterGetNum(pFilter, USBFILTERIDX_PORT))); 1004 USBFilterGetNum(pFilter, USBFILTERIDX_PORT), 1005 USBFilterGetFilterType(pFilter))); 948 1006 #endif 949 1007 … … 957 1015 int rc = VBoxUSBFilterAdd(pFilter, pContext, &uId); 958 1016 VBOXUSBFLT_LOCK_RELEASE(); 959 AssertRC(rc);960 1017 if (RT_SUCCESS(rc)) 961 1018 { 962 Assert(uId); 1019 LOG(("ADDED filer id 0x%p", uId)); 1020 ASSERT_WARN(uId, ("uid is NULL")); 963 1021 #ifdef VBOX_USBMON_WITH_FILTER_AUTOAPPLY 964 1022 VBoxUsbFltFilterCheck(); … … 967 1025 else 968 1026 { 969 Assert(!uId); 1027 WARN(("VBoxUSBFilterAdd failed rc (%d)", rc)); 1028 ASSERT_WARN(!uId, ("uid is not NULL")); 970 1029 } 971 1030 … … 982 1041 if (!RT_SUCCESS(rc)) 983 1042 { 984 AssertFailed();1043 WARN(("VBoxUSBFilterRemove failed rc (%d)", rc)); 985 1044 VBOXUSBFLT_LOCK_RELEASE(); 986 1045 return rc; … … 994 1053 if (pDevice->fIsFilterOneShot) 995 1054 { 996 A ssert(!pDevice->uFltId);1055 ASSERT_WARN(!pDevice->uFltId, ("oneshot filter on device(0x%p): unexpected uFltId(%d)", pDevice, pDevice->uFltId)); 997 1056 } 998 1057 … … 1000 1059 continue; 1001 1060 1002 A ssert(pDevice->pOwner == pContext);1061 ASSERT_WARN(pDevice->pOwner == pContext, ("Device(0x%p) owner(0x%p) not match to (0x%p)", pDevice, pDevice->pOwner, pContext)); 1003 1062 if (pDevice->pOwner != pContext) 1004 1063 continue; 1005 1064 1006 A ssert(!pDevice->fIsFilterOneShot);1065 ASSERT_WARN(!pDevice->fIsFilterOneShot, ("device(0x%p) is filtered with a oneshot filter", pDevice)); 1007 1066 pDevice->uFltId = 0; 1008 1067 /* clear the fIsFilterOneShot flag to ensure the device is replugged on the next VBoxUsbFltFilterCheck call */ … … 1058 1117 if (pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING) 1059 1118 { 1060 Assert(!pDevice->pOwner); 1061 Assert(!pDevice->uFltId); 1062 AssertFailed(); 1119 ASSERT_WARN(!pDevice->pOwner, ("replugging device(0x%p) still has an owner(0x%p)", pDevice, pDevice->pOwner)); 1120 ASSERT_WARN(!pDevice->uFltId, ("replugging device(0x%p) still has filter(0x%p)", pDevice, pDevice->uFltId)); 1063 1121 /* no user state for this, we should not return it tu the user */ 1064 1122 return USBDEVICESTATE_USED_BY_HOST; … … 1066 1124 1067 1125 /* the device is filtered, if owner differs from the context, return as USED_BY_HOST */ 1068 A ssert(pDevice->pOwner);1126 ASSERT_WARN(pDevice->pOwner, ("device(0x%p) has noowner", pDevice)); 1069 1127 /* the id can be null if a filter is removed */ 1070 1128 // Assert(pDevice->uFltId); 1071 1129 1072 1130 if (pDevice->pOwner != pContext) 1131 { 1132 LOG(("Device owner differs from the current context, returning used by host")); 1073 1133 return USBDEVICESTATE_USED_BY_HOST; 1134 } 1074 1135 1075 1136 switch (pDevice->enmState) … … 1083 1144 return USBDEVICESTATE_USED_BY_GUEST; 1084 1145 default: 1085 AssertFailed();1146 WARN(("unexpected device state(%d) for device(0x%p)", pDevice->enmState, pDevice)); 1086 1147 return USBDEVICESTATE_UNSUPPORTED; 1087 1148 } … … 1148 1209 if (pDevice) 1149 1210 { 1150 Assert(pDevice->enmState != VBOXUSBFLT_DEVSTATE_ADDED); 1151 Assert(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REMOVED); 1211 LOG(("found device (0x%p), state(%d) for PDO(0x%p)", pDevice, pDevice->enmState, pPdo)); 1212 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_ADDED, ("VBOXUSBFLT_DEVSTATE_ADDED state for device(0x%p)", pDevice)); 1213 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REMOVED, ("VBOXUSBFLT_DEVSTATE_REMOVED state for device(0x%p)", pDevice)); 1152 1214 *pbFiltered = pDevice->enmState >= VBOXUSBFLT_DEVSTATE_CAPTURING; 1153 1215 VBOXUSBFLT_LOCK_RELEASE(); … … 1158 1220 if (!pDevice) 1159 1221 { 1160 AssertFailed();1222 WARN(("VBoxUsbMonMemAllocZ failed")); 1161 1223 return STATUS_NO_MEMORY; 1162 1224 } … … 1167 1229 if (!NT_SUCCESS(Status)) 1168 1230 { 1169 AssertFailed();1231 WARN(("vboxUsbFltDevPopulate failed, Status 0x%x", Status)); 1170 1232 VBoxUsbMonMemFree(pDevice); 1171 1233 return Status; … … 1182 1244 if (pTmpDev) 1183 1245 { 1184 Assert(pTmpDev->enmState != VBOXUSBFLT_DEVSTATE_ADDED); 1185 Assert(pTmpDev->enmState != VBOXUSBFLT_DEVSTATE_REMOVED); 1246 LOG(("second try: found device (0x%p), state(%d) for PDO(0x%p)", pDevice, pDevice->enmState, pPdo)); 1247 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_ADDED, ("second try: VBOXUSBFLT_DEVSTATE_ADDED state for device(0x%p)", pDevice)); 1248 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REMOVED, ("second try: VBOXUSBFLT_DEVSTATE_REMOVED state for device(0x%p)", pDevice)); 1186 1249 *pbFiltered = pTmpDev->enmState >= VBOXUSBFLT_DEVSTATE_CAPTURING; 1187 1250 VBOXUSBFLT_LOCK_RELEASE(); … … 1190 1253 } 1191 1254 1255 LOG(("Created Device 0x%p for PDO 0x%p", pDevice, pPdo)); 1256 1192 1257 pCtx = vboxUsbFltDevMatchLocked(pDevice, &uId, 1193 1258 true, /* remove a one-shot filter */ 1194 1259 &fFilter, &fIsOneShot); 1260 LOG(("Matching Info: Filter (0x%p), pCtx(0x%p), fFilter(%d), fIsOneShot(%d)", uId, pCtx, (int)fFilter, (int)fIsOneShot)); 1195 1261 if (fFilter) 1196 1262 { 1197 Assert(pCtx); 1198 Assert(uId); 1263 LOG(("Created Device 0x%p should be filtered", pDevice)); 1264 ASSERT_WARN(pCtx, ("zero ctx")); 1265 ASSERT_WARN(uId, ("zero uId")); 1199 1266 pDevice->enmState = VBOXUSBFLT_DEVSTATE_CAPTURING; 1200 1267 } 1201 1268 else 1202 1269 { 1203 Assert(!uId == !pCtx); /* either both zero or both not */ 1270 LOG(("Created Device 0x%p should NOT be filtered", pDevice)); 1271 ASSERT_WARN(!uId == !pCtx, ("invalid uid(0x%p) - ctx(0x%p) pair", uId, pCtx)); /* either both zero or both not */ 1204 1272 pDevice->enmState = VBOXUSBFLT_DEVSTATE_UNCAPTURED; 1205 1273 } … … 1280 1348 { 1281 1349 pDevice->enmState = VBOXUSBFLT_DEVSTATE_CAPTURED; 1350 LOG(("The proxy notified proxy start for the captured device 0x%x\n", pDevice)); 1282 1351 vboxUsbFltDevRetain(pDevice); 1283 1352 vboxUsbFltSignalChangeLocked(); … … 1285 1354 else 1286 1355 { 1287 AssertFailed();1356 WARN(("invalid state, %d", pDevice->enmState)); 1288 1357 pDevice = NULL; 1289 1358 } … … 1300 1369 { 1301 1370 /* this is due to devie was physically removed */ 1302 LOG(("The proxy notified pro gy stop for the captured device 0x%x\n", pDevice));1371 LOG(("The proxy notified proxy stop for the captured device 0x%x, current state %d\n", pDevice, pDevice->enmState)); 1303 1372 pDevice->enmState = VBOXUSBFLT_DEVSTATE_CAPTURING; 1304 1373 vboxUsbFltSignalChangeLocked(); … … 1306 1375 else 1307 1376 { 1308 Assert(pDevice->enmState == VBOXUSBFLT_DEVSTATE_REPLUGGING); 1377 if(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REPLUGGING) 1378 { 1379 WARN(("invalid state, %d", pDevice->enmState)); 1380 } 1309 1381 } 1310 1382 VBOXUSBFLT_LOCK_RELEASE(); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbHook.cpp
r38262 r38356 180 180 if (pCur->pIrp != pIrp) 181 181 continue; 182 AssertFailed();182 WARN(("found pending IRP(0x%p) when it should not be", pIrp)); 183 183 } 184 184 KeReleaseSpinLock(&pHook->Lock, oldIrql); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
r38292 r38356 168 168 if (!pIrp) 169 169 { 170 AssertMsgFailed(("IoBuildDeviceIoControlRequest failed!!\n"));170 WARN(("IoBuildDeviceIoControlRequest failed!!\n")); 171 171 return STATUS_INSUFFICIENT_RESOURCES; 172 172 } … … 196 196 } 197 197 else 198 LOG(("Invalid pointer %p\n", pRel)); 198 { 199 WARN(("Invalid pointer %p\n", pRel)); 200 } 201 } 202 else 203 { 204 WARN(("IRP_MN_QUERY_DEVICE_RELATIONS failed Status(0x%x)\n", Status)); 199 205 } 200 206 … … 302 308 static NTSTATUS vboxUsbMonHandlePnPIoctl(PDEVICE_OBJECT pDevObj, PIO_STACK_LOCATION pSl, PIO_STATUS_BLOCK pIoStatus) 303 309 { 304 LOG((" VBoxUSBMonHandlePnPIoctlIRQL = %d\n", KeGetCurrentIrql()));310 LOG(("IRQL = %d\n", KeGetCurrentIrql())); 305 311 switch(pSl->MinorFunction) 306 312 { … … 315 321 KIRQL Iqrl = KeGetCurrentIrql(); 316 322 /* IRQL should be always passive here */ 317 A ssert(Iqrl == PASSIVE_LEVEL);323 ASSERT_WARN(Iqrl == PASSIVE_LEVEL, ("irql is not PASSIVE")); 318 324 switch(pSl->Parameters.QueryDeviceText.DeviceTextType) 319 325 { … … 328 334 if (VBoxUsbFltPdoIsFiltered(pDevObj)) 329 335 { 336 LOG(("PDO (0x%p) is filtered", pDevObj)); 330 337 WCHAR *pId = (WCHAR *)ExAllocatePool(PagedPool, sizeof(szDeviceTextDescription)); 331 338 if (!pId) … … 340 347 pIoStatus->Information = (ULONG_PTR)pId; 341 348 } 349 else 350 { 351 LOG(("PDO (0x%p) is NOT filtered", pDevObj)); 352 } 342 353 break; 343 354 default: 355 LOG(("DeviceText %d", pSl->Parameters.QueryDeviceText.DeviceTextType)); 344 356 break; 345 357 } … … 357 369 { 358 370 WCHAR *pId = (WCHAR *)pIoStatus->Information; 359 #ifdef DEBUG371 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 360 372 WCHAR *pTmp; 361 373 #endif … … 364 376 KIRQL Iqrl = KeGetCurrentIrql(); 365 377 /* IRQL should be always passive here */ 366 A ssert(Iqrl == PASSIVE_LEVEL);378 ASSERT_WARN(Iqrl == PASSIVE_LEVEL, ("irql is not PASSIVE")); 367 379 368 380 switch (pSl->Parameters.QueryDeviceRelations.Type) … … 375 387 case BusQueryDeviceID: 376 388 { 389 LOG(("BusQueryDeviceID")); 377 390 pId = (WCHAR *)ExAllocatePool(PagedPool, sizeof(szBusQueryDeviceId)); 378 391 if (!pId) 379 392 { 380 AssertFailed();393 WARN(("ExAllocatePool failed")); 381 394 break; 382 395 } … … 386 399 if (Status != STATUS_SUCCESS || !bFiltered) 387 400 { 388 Assert(Status == STATUS_SUCCESS); 401 if(Status == STATUS_SUCCESS) 402 { 403 LOG(("PDO (0x%p) is NOT filtered", pDevObj)); 404 } 405 else 406 { 407 WARN(("VBoxUsbFltPdoAdd for PDO (0x%p) failed Status 0x%x", pDevObj, Status)); 408 } 389 409 ExFreePool(pId); 390 410 break; 391 411 } 392 412 413 LOG(("PDO (0x%p) is filtered", pDevObj)); 393 414 ExFreePool((PVOID)pIoStatus->Information); 394 415 memcpy(pId, szBusQueryDeviceId, sizeof(szBusQueryDeviceId)); … … 398 419 case BusQueryHardwareIDs: 399 420 { 400 #ifdef DEBUG 421 LOG(("BusQueryHardwareIDs")); 422 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 401 423 while(*pId) //MULTI_SZ 402 424 { 403 LOG(("BusQueryHardwareIDs"));404 425 LOG_STRW(pId); 405 426 while(*pId) pId++; … … 410 431 if (!pId) 411 432 { 412 AssertFailed();433 WARN(("ExAllocatePool failed")); 413 434 break; 414 435 } … … 418 439 if (Status != STATUS_SUCCESS || !bFiltered) 419 440 { 420 Assert(Status == STATUS_SUCCESS); 441 if(Status == STATUS_SUCCESS) 442 { 443 LOG(("PDO (0x%p) is NOT filtered", pDevObj)); 444 } 445 else 446 { 447 WARN(("VBoxUsbFltPdoAdd for PDO (0x%p) failed Status 0x%x", pDevObj, Status)); 448 } 421 449 ExFreePool(pId); 422 450 break; 423 451 } 424 452 453 LOG(("PDO (0x%p) is filtered", pDevObj)); 454 425 455 memcpy(pId, szBusQueryHardwareIDs, sizeof(szBusQueryHardwareIDs)); 426 #ifdef DEBUG 456 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 457 LOG(("NEW BusQueryHardwareIDs")); 427 458 pTmp = pId; 428 459 while(*pTmp) //MULTI_SZ 429 460 { 430 LOG(("NEW BusQueryHardwareIDs")); 461 431 462 LOG_STRW(pTmp); 432 463 while(*pTmp) pTmp++; … … 439 470 } 440 471 case BusQueryCompatibleIDs: 441 #ifdef DEBUG 472 LOG(("BusQueryCompatibleIDs")); 473 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 442 474 while(*pId) //MULTI_SZ 443 475 { 444 LOG(("BusQueryCompatibleIDs"));445 476 LOG_STRW(pId); 446 477 while(*pId) pId++; … … 450 481 if (VBoxUsbFltPdoIsFiltered(pDevObj)) 451 482 { 483 LOG(("PDO (0x%p) is filtered", pDevObj)); 452 484 pId = (WCHAR *)ExAllocatePool(PagedPool, sizeof(szBusQueryCompatibleIDs)); 453 485 if (!pId) 454 486 { 455 AssertFailed();487 WARN(("ExAllocatePool failed")); 456 488 break; 457 489 } 458 490 memcpy(pId, szBusQueryCompatibleIDs, sizeof(szBusQueryCompatibleIDs)); 459 #ifdef DEBUG 491 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 492 LOG(("NEW BusQueryCompatibleIDs")); 460 493 pTmp = pId; 461 494 while(*pTmp) //MULTI_SZ 462 495 { 463 LOG(("NEW BusQueryCompatibleIDs"));464 496 LOG_STRW(pTmp); 465 497 while(*pTmp) pTmp++; … … 469 501 ExFreePool((PVOID)pIoStatus->Information); 470 502 pIoStatus->Information = (ULONG_PTR)pId; 503 } 504 else 505 { 506 LOG(("PDO (0x%p) is NOT filtered", pDevObj)); 471 507 } 472 508 break; … … 474 510 } 475 511 else 512 { 476 513 LOG(("Invalid pointer %p\n", pId)); 477 } 478 break; 479 } 480 481 #ifdef DEBUG 514 } 515 } 516 break; 517 } 518 519 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 482 520 case IRP_MN_QUERY_DEVICE_RELATIONS: 483 521 { … … 542 580 } /*switch */ 543 581 544 LOG((" VBoxUSBMonHandlePnPIoctlreturns %x (IRQL = %d)\n", pIoStatus->Status, KeGetCurrentIrql()));582 LOG(("Done returns %x (IRQL = %d)\n", pIoStatus->Status, KeGetCurrentIrql())); 545 583 return pIoStatus->Status; 546 584 } … … 548 586 NTSTATUS _stdcall VBoxUsbPnPCompletion(DEVICE_OBJECT *pDevObj, IRP *pIrp, void *pvContext) 549 587 { 550 Assert(pvContext); 588 LOG(("Completion PDO(0x%p), IRP(0x%p), Status(0x%x)\n", pDevObj, pIrp, pIrp->IoStatus.Status)); 589 ASSERT_WARN(pvContext, ("zero context")); 551 590 552 591 PVBOXUSBHOOK_REQUEST pRequest = (PVBOXUSBHOOK_REQUEST)pvContext; … … 562 601 * */ 563 602 PIO_STACK_LOCATION pSl = &pRequest->OldLocation; 564 A ssert(pIrp == pRequest->pIrp);603 ASSERT_WARN(pIrp == pRequest->pIrp, ("completed IRP(0x%x) not match request IRP(0x%x)", pIrp, pRequest->pIrp)); 565 604 /* NOTE: we can not rely on pDevObj passed in IoCompletion since it may be zero 566 605 * in case IRP was created with extra stack locations and the caller did not initialize … … 574 613 case IRP_MN_QUERY_DEVICE_TEXT: 575 614 case IRP_MN_QUERY_ID: 576 #ifdef DEBUG615 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 577 616 case IRP_MN_QUERY_DEVICE_RELATIONS: 578 617 case IRP_MN_QUERY_CAPABILITIES: … … 584 623 else 585 624 { 586 A ssert(pIrp->IoStatus.Status == STATUS_NOT_SUPPORTED);625 ASSERT_WARN(pIrp->IoStatus.Status == STATUS_NOT_SUPPORTED, ("Irp failed with status(0x%x)", pIrp->IoStatus.Status)); 587 626 } 588 627 break; … … 645 684 NTSTATUS _stdcall VBoxUsbMonPnPHook(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) 646 685 { 686 LOG(("==>PnP: Mn(%s), PDO(0x%p), IRP(0x%p), Status(0x%x)\n", vboxUsbDbgStrPnPMn(IoGetCurrentIrpStackLocation(pIrp)->MinorFunction), pDevObj, pIrp, pIrp->IoStatus.Status)); 687 647 688 if(!VBoxUsbHookRetain(&g_VBoxUsbMonGlobals.UsbHubPnPHook.Hook)) 648 689 { 690 WARN(("VBoxUsbHookRetain failed")); 649 691 return VBoxUsbHookRequestPassDownHookSkip(&g_VBoxUsbMonGlobals.UsbHubPnPHook.Hook, pDevObj, pIrp); 650 692 } … … 653 695 if (!pCompletion) 654 696 { 655 AssertFailed();697 WARN(("VBoxUsbMonMemAlloc failed")); 656 698 VBoxUsbHookRelease(&g_VBoxUsbMonGlobals.UsbHubPnPHook.Hook); 657 699 pIrp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; … … 661 703 } 662 704 663 LOG(("==>PnP: Mn(%s), PDO(0x%p), IRP(0x%p), Status(0x%x)\n", vboxUsbDbgStrPnPMn(IoGetCurrentIrpStackLocation(pIrp)->MinorFunction), pDevObj, pIrp, pIrp->IoStatus.Status));664 665 705 NTSTATUS Status = VBoxUsbHookRequestPassDownHookCompletion(&g_VBoxUsbMonGlobals.UsbHubPnPHook.Hook, pDevObj, pIrp, VBoxUsbPnPCompletion, &pCompletion->Rq); 666 #ifdef DEBUG706 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 667 707 if (Status != STATUS_PENDING) 668 708 { 709 LOG(("Request completed, Status(0x%x)", Status)); 669 710 VBoxUsbHookVerifyCompletion(&g_VBoxUsbMonGlobals.UsbHubPnPHook.Hook, &pCompletion->Rq, pIrp); 711 } 712 else 713 { 714 LOG(("Request pending")); 670 715 } 671 716 #endif … … 992 1037 if (!pvBuffer || cbOutBuffer != sizeof(*pOut) || cbInBuffer != 0) 993 1038 { 994 AssertMsgFailed(("SUPUSBFLT_IOCTL_GET_VERSION: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n",1039 WARN(("SUPUSBFLT_IOCTL_GET_VERSION: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n", 995 1040 cbInBuffer, 0, cbOutBuffer, sizeof (*pOut))); 996 1041 Status = STATUS_INVALID_PARAMETER; … … 1000 1045 pOut->u32Minor = USBMON_MINOR_VERSION; 1001 1046 Info = sizeof (*pOut); 1047 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1002 1048 break; 1003 1049 } … … 1011 1057 if (RT_UNLIKELY(!pvBuffer || cbInBuffer != sizeof (*pFilter) || cbOutBuffer != sizeof (*pOut))) 1012 1058 { 1013 AssertMsgFailed(("SUPUSBFLT_IOCTL_ADD_FILTER: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n",1059 WARN(("SUPUSBFLT_IOCTL_ADD_FILTER: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n", 1014 1060 cbInBuffer, sizeof (*pFilter), cbOutBuffer, sizeof (*pOut))); 1015 1061 Status = STATUS_INVALID_PARAMETER; … … 1021 1067 pOut->uId = uId; 1022 1068 Info = sizeof (*pOut); 1069 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1023 1070 break; 1024 1071 } … … 1031 1078 if (!pvBuffer || cbInBuffer != sizeof (*pIn) || (cbOutBuffer && cbOutBuffer != sizeof (*pRc))) 1032 1079 { 1033 AssertMsgFailed(("SUPUSBFLT_IOCTL_REMOVE_FILTER: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n",1080 WARN(("SUPUSBFLT_IOCTL_REMOVE_FILTER: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n", 1034 1081 cbInBuffer, sizeof (*pIn), cbOutBuffer, 0)); 1035 1082 Status = STATUS_INVALID_PARAMETER; … … 1045 1092 Info = sizeof (*pRc); 1046 1093 } 1094 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1047 1095 break; 1048 1096 } … … 1052 1100 if (pvBuffer || cbInBuffer || cbOutBuffer) 1053 1101 { 1054 AssertMsgFailed(("SUPUSBFLT_IOCTL_RUN_FILTERS: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n",1102 WARN(("SUPUSBFLT_IOCTL_RUN_FILTERS: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n", 1055 1103 cbInBuffer, 0, cbOutBuffer, 0)); 1056 1104 Status = STATUS_INVALID_PARAMETER; … … 1059 1107 LOG(("SUPUSBFLT_IOCTL_RUN_FILTERS \n")); 1060 1108 Status = VBoxUsbMonRunFilters(pContext); 1061 Assert(Status == STATUS_SUCCESS); 1062 Assert(Status != STATUS_PENDING); 1109 ASSERT_WARN(Status != STATUS_PENDING, ("status pending!")); 1063 1110 break; 1064 1111 } … … 1070 1117 if (!pvBuffer || cbInBuffer != sizeof (hDevice) || cbOutBuffer < sizeof (*pOut)) 1071 1118 { 1072 AssertMsgFailed(("SUPUSBFLT_IOCTL_GET_DEVICE: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected >= %d.\n",1119 WARN(("SUPUSBFLT_IOCTL_GET_DEVICE: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected >= %d.\n", 1073 1120 cbInBuffer, sizeof (hDevice), cbOutBuffer, sizeof (*pOut))); 1074 1121 Status = STATUS_INVALID_PARAMETER; … … 1084 1131 else 1085 1132 { 1086 AssertFailed();1133 WARN(("VBoxUsbMonGetDevice fail 0x%x", Status)); 1087 1134 } 1088 1135 break; … … 1094 1141 if (!pvBuffer || cbInBuffer != sizeof (*pSne) || cbOutBuffer != sizeof (*pSne)) 1095 1142 { 1096 AssertMsgFailed(("SUPUSBFLT_IOCTL_SET_NOTIFY_EVENT: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n",1143 WARN(("SUPUSBFLT_IOCTL_SET_NOTIFY_EVENT: Invalid input/output sizes. cbIn=%d expected %d. cbOut=%d expected %d.\n", 1097 1144 cbInBuffer, sizeof (*pSne), cbOutBuffer, sizeof (*pSne))); 1098 1145 Status = STATUS_INVALID_PARAMETER; … … 1102 1149 pSne->u.rc = VBoxUsbMonSetNotifyEvent(pContext, pSne->u.hEvent); 1103 1150 Info = sizeof (*pSne); 1151 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1104 1152 break; 1105 1153 } 1106 1154 1107 1155 default: 1156 WARN(("Unknown code 0x%x", Ctl)); 1108 1157 Status = STATUS_INVALID_PARAMETER; 1109 1158 break; 1110 1159 } 1111 1160 1112 A ssert(Status != STATUS_PENDING);1161 ASSERT_WARN(Status != STATUS_PENDING, ("Status pending!")); 1113 1162 1114 1163 *pInfo = Info; … … 1134 1183 pSl->Parameters.DeviceIoControl.OutputBufferLength, 1135 1184 &Info); 1136 A ssert(Status != STATUS_PENDING);1185 ASSERT_WARN(Status != STATUS_PENDING, ("Status pending")); 1137 1186 1138 1187 IoReleaseRemoveLock(&g_VBoxUsbMonGlobals.RmLock, pDevObj); 1188 } 1189 else 1190 { 1191 WARN(("IoAcquireRemoveLock failed Status (0x%x)", Status)); 1139 1192 } 1140 1193 … … 1158 1211 if (!pvBuffer) 1159 1212 { 1160 AssertMsgFailed(("VBOXUSBIDC_INTERNAL_IOCTL_GET_VERSION: Buffer is NULL\n"));1213 WARN(("VBOXUSBIDC_INTERNAL_IOCTL_GET_VERSION: Buffer is NULL\n")); 1161 1214 Status = STATUS_INVALID_PARAMETER; 1162 1215 break; … … 1164 1217 pOut->u32Major = VBOXUSBIDC_VERSION_MAJOR; 1165 1218 pOut->u32Minor = VBOXUSBIDC_VERSION_MINOR; 1219 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1166 1220 break; 1167 1221 } … … 1174 1228 if (!pvBuffer) 1175 1229 { 1176 AssertMsgFailed(("VBOXUSBIDC_INTERNAL_IOCTL_GET_VERSION: Buffer is NULL\n"));1230 WARN(("VBOXUSBIDC_INTERNAL_IOCTL_PROXY_STARTUP: Buffer is NULL\n")); 1177 1231 Status = STATUS_INVALID_PARAMETER; 1178 1232 break; … … 1180 1234 1181 1235 pOut->u.hDev = VBoxUsbFltProxyStarted(pOut->u.pPDO); 1236 ASSERT_WARN(pOut->u.hDev, ("zero hDev")); 1237 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1182 1238 break; 1183 1239 } … … 1190 1246 if (!pvBuffer) 1191 1247 { 1192 AssertMsgFailed(("VBOXUSBIDC_INTERNAL_IOCTL_PROXY_TEARDOWN: Buffer is NULL\n"));1248 WARN(("VBOXUSBIDC_INTERNAL_IOCTL_PROXY_TEARDOWN: Buffer is NULL\n")); 1193 1249 Status = STATUS_INVALID_PARAMETER; 1194 1250 break; 1195 1251 } 1196 1252 1253 ASSERT_WARN(pOut->hDev, ("zero hDev")); 1197 1254 VBoxUsbFltProxyStopped(pOut->hDev); 1255 ASSERT_WARN(Status == STATUS_SUCCESS, ("unexpected status, 0x%x", Status)); 1198 1256 break; 1199 1257 } … … 1201 1259 default: 1202 1260 { 1203 AssertFailed();1261 WARN(("Unknown code 0x%x", Ctl)); 1204 1262 Status = STATUS_INVALID_PARAMETER; 1205 1263 break; … … 1276 1334 NTSTATUS _stdcall DriverEntry(PDRIVER_OBJECT pDrvObj, PUNICODE_STRING pRegPath) 1277 1335 { 1278 #ifdef DEBUG_misha1336 #ifdef VBOX_USB_WITH_VERBOSE_LOGGING 1279 1337 RTLogGroupSettings(0, "+default.e.l.f.l2.l3"); 1280 1338 RTLogDestinations(0, "debugger"); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.h
r38262 r38356 31 31 #endif 32 32 33 #define VBOX_DBG_LOG_NAME "USBMon"34 33 #include "../../../win/VBoxDbgLog.h" 35 34 #include "../cmn/VBoxDrvTool.h"
Note:
See TracChangeset
for help on using the changeset viewer.