VirtualBox

Ignore:
Timestamp:
Apr 8, 2025 11:51:30 AM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168339
Message:

VBoxUSBMon: Removed temporary registry key workaround added for bugref:9479

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp

    r108881 r108885  
    171171    LIST_ENTRY BlackDeviceList;
    172172    VBOXUSBFLT_LOCK Lock;
    173     /** Flag whether to force replugging a device we can't query descirptors from.
    174      * Short term workaround for @bugref{9479}. */
    175     ULONG           dwForceReplugWhenDevPopulateFails;
    176173} VBOXUSBFLTGLOBALS, *PVBOXUSBFLTGLOBALS;
    177174static VBOXUSBFLTGLOBALS g_VBoxUsbFltGlobals;
     
    11041101            {
    11051102                WARN(("vboxUsbFltDevPopulate for PDO 0x%p failed with Status 0x%x", pDevObj, Status));
    1106                 if (   Status == STATUS_CANCELLED
    1107                     && g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails)
    1108                 {
    1109                     /*
    1110                      * This can happen if the device got suspended and is in D3 state where we can't query any strings.
    1111                      * There is no known way to set the power state of the device, especially if there is no driver attached yet.
    1112                      * The sledgehammer approach is to just replug the device to force it out of suspend, see bugref @{9479}.
    1113                      */
    1114                     continue;
    1115                 }
    11161103            }
    11171104
     
    16811668    VBOXUSBFLT_LOCK_INIT();
    16821669
    1683     /*
    1684      * Check whether the setting to force replugging USB devices when
    1685      * querying string descriptors fail is set in the registry,
    1686      * see @bugref{9479}.
    1687      */
    1688     RTL_QUERY_REGISTRY_TABLE aParams[] =
    1689     {
    1690         {vboxUsbFltRegKeyQuery, 0, (PWSTR)L"ForceReplugWhenDevPopulateFails", &g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails, REG_DWORD, &g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails, sizeof(ULONG) },
    1691         {                 NULL, 0,                                      NULL,                                                   NULL,         0,                                                      0,             0 }
    1692     };
    1693     UNICODE_STRING UnicodePath = RTL_CONSTANT_STRING(L"\\VBoxUSB");
    1694 
    1695     NTSTATUS Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, UnicodePath.Buffer, &aParams[0], NULL, NULL);
    1696     if (Status == STATUS_SUCCESS)
    1697     {
    1698         if (g_VBoxUsbFltGlobals.dwForceReplugWhenDevPopulateFails)
    1699             LOG(("Forcing replug of USB devices where querying the descriptors fail\n"));
    1700     }
    1701     else
    1702         LOG(("RtlQueryRegistryValues() -> %#x, assuming defaults\n", Status));
    1703 
    17041670    return STATUS_SUCCESS;
    17051671}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette