Changeset 82446 in vbox for trunk/src/VBox
- Timestamp:
- Dec 6, 2019 9:33:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
r82445 r82446 111 111 uint16_t idProduct; 112 112 uint16_t bcdDevice; 113 uint16_t wPort; 113 114 uint8_t bClass; 114 115 uint8_t bSubClass; 115 116 uint8_t bProtocol; 116 uint8_t bPort;117 117 char szSerial[MAX_USB_SERIAL_STRING]; 118 118 char szMfgName[MAX_USB_SERIAL_STRING]; … … 373 373 else 374 374 { 375 LOG(("Setting filter class/subclass/protocol %02X/%02X/%02X\n", pDevice->bClass, pDevice->bSubClass, pDevice->bProtocol)); 375 376 USBFilterSetNumExact(&DevFlt, USBFILTERIDX_DEVICE_CLASS, pDevice->bClass, true); 376 377 USBFilterSetNumExact(&DevFlt, USBFILTERIDX_DEVICE_SUB_CLASS, pDevice->bSubClass, true); … … 379 380 380 381 /* If the port number looks valid, add it to the filter. */ 381 if (pDevice->bPort != 0xffff) 382 { 383 USBFilterSetNumExact(&DevFlt, USBFILTERIDX_PORT, pDevice->bPort, true); 384 } 382 if (pDevice->wPort < 256) 383 { 384 LOG(("Setting filter port %04X\n", pDevice->wPort)); 385 USBFilterSetNumExact(&DevFlt, USBFILTERIDX_PORT, pDevice->wPort, true); 386 } 387 else 388 LOG(("Port number not known, ignoring!")); 385 389 386 390 /* Run filters on the thing. */ … … 655 659 if (!NT_SUCCESS(Status)) 656 660 { 657 /* We do need this, and it should always be available. */661 /* We do need this, but not critically. On Windows 7, we may get STATUS_OBJECT_NAME_NOT_FOUND. */ 658 662 WARN(("IoGetDevicePropertyData failed for DEVPKEY_Device_LocationPaths, Status (0x%x)", Status)); 659 break; 660 } 661 LOG_STRW(pDevice->szLocationPath); 663 } 664 else 665 { 666 LOG_STRW(pDevice->szLocationPath); 667 } 662 668 663 669 /* Query the location information. The hub number is iffy because the numbering is … … 667 673 if (!NT_SUCCESS(Status)) 668 674 { 669 /* We may well need this, and it should always be available. */675 /* This is useful but not critical. On Windows 7, we may get STATUS_OBJECT_NAME_NOT_FOUND. */ 670 676 WARN(("IoGetDevicePropertyData failed for DEVPKEY_Device_LocationInfo, Status (0x%x)", Status)); 671 break; 672 } 673 LOG_STRW(wchPropBuf); 674 rc = vboxUsbParseLocation(wchPropBuf, &hub, &port); 675 if (!rc) 676 { 677 /* This *really* should not happen but it's not fatal. */ 678 WARN(("Failed to parse Location Info")); 677 hub = port = 0xffff; 678 Status = STATUS_SUCCESS; /* Need to override the IoGetDevicePropertyData return. */ 679 } 680 else 681 { 682 LOG_STRW(wchPropBuf); 683 rc = vboxUsbParseLocation(wchPropBuf, &hub, &port); 684 if (!rc) 685 { 686 /* This *really* should not happen but it's not fatal. */ 687 WARN(("Failed to parse Location Info")); 688 } 679 689 } 680 690 … … 686 696 } 687 697 688 LOG(("Device pid=%x vid=%x rev=%x ", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice));689 pDevice-> bPort = port;698 LOG(("Device pid=%x vid=%x rev=%x port=%x", pDevDr->idVendor, pDevDr->idProduct, pDevDr->bcdDevice, port)); 699 pDevice->wPort = port; 690 700 pDevice->idVendor = pDevDr->idVendor; 691 701 pDevice->idProduct = pDevDr->idProduct;
Note:
See TracChangeset
for help on using the changeset viewer.