Changeset 78998 in vbox
- Timestamp:
- Jun 5, 2019 2:30:40 PM (6 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxUSB/win
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
r76553 r78998 307 307 pDev->bcdDevice = pConInfo->DeviceDescriptor.bcdDevice; 308 308 pDev->bBus = 0; /** @todo figure out bBus on windows... */ 309 #if 1 /** @todo check up the bPort value before enabling this. */ 309 310 pDev->bPort = iPort; 311 #else 312 pDev->bPort = 0; 313 #endif 310 314 /** @todo check which devices are used for primary input (keyboard & mouse) */ 311 315 if (!lpszDrvKeyName || *lpszDrvKeyName == 0) -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
r76553 r78998 175 175 LIST_ENTRY BlackDeviceList; 176 176 VBOXUSBFLT_LOCK Lock; 177 /** Flag whether to force replugging a device we can't query descirptors from. 178 * Short term workaround for @bugref{9479}. */ 179 ULONG dwForceReplugWhenDevPopulateFails; 177 180 } VBOXUSBFLTGLOBALS, *PVBOXUSBFLTGLOBALS; 178 181 static VBOXUSBFLTGLOBALS g_VBoxUsbFltGlobals; … … 830 833 { 831 834 WARN(("vboxUsbFltDevPopulate for PDO 0x%p failed with Status 0x%x", pDevObj, Status)); 835 if ( Status == STATUS_CANCELLED 836 && g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails) 837 { 838 /* 839 * This can happen if the device got suspended and is in D3 state where we can't query any strings. 840 * There is no known way to set the power state of the device, especially if there is no driver attached yet. 841 * The sledgehammer approach is to just replug the device to force it out of suspend, see bugref @{9479}. 842 */ 843 continue; 844 } 832 845 } 833 846 … … 1381 1394 } 1382 1395 1396 1397 static NTSTATUS vboxUsbFltRegKeyQuery(PWSTR ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueLength, PVOID Context, PVOID EntryContext) 1398 { 1399 NTSTATUS Status = STATUS_SUCCESS; 1400 1401 RT_NOREF(ValueName, Context); 1402 if ( ValueType == REG_DWORD 1403 && ValueLength == sizeof(ULONG)) 1404 *(ULONG *)EntryContext = *(ULONG *)ValueData; 1405 else 1406 Status = STATUS_OBJECT_TYPE_MISMATCH; 1407 1408 return Status; 1409 } 1410 1411 1383 1412 NTSTATUS VBoxUsbFltInit() 1384 1413 { … … 1396 1425 vboxUsbFltBlDevPopulateWithKnownLocked(); 1397 1426 VBOXUSBFLT_LOCK_INIT(); 1427 1428 /* 1429 * Check whether the setting to force replugging USB devices when 1430 * querying string descriptors fail is set in the registry, 1431 * see @bugref{9479}. 1432 */ 1433 RTL_QUERY_REGISTRY_TABLE aParams[] = 1434 { 1435 {vboxUsbFltRegKeyQuery, 0, L"ForceReplugWhenDevPopulateFails", &g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails, REG_DWORD, &g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails, sizeof(ULONG) }, 1436 { NULL, 0, NULL, NULL, 0, 0, 0 } 1437 }; 1438 UNICODE_STRING UnicodePath = RTL_CONSTANT_STRING(L"\\VBoxUSB"); 1439 1440 NTSTATUS Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, UnicodePath.Buffer, &aParams[0], NULL, NULL); 1441 if (Status == STATUS_SUCCESS) 1442 { 1443 if (g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails) 1444 LOG(("Forcing replug of USB devices where querying the descriptors fail\n")); 1445 } 1446 else 1447 LOG(("RtlQueryRegistryValues() -> %#x, assuming defaults\n", Status)); 1448 1398 1449 return STATUS_SUCCESS; 1399 1450 }
Note:
See TracChangeset
for help on using the changeset viewer.