1*c2c66affSColin Finck /* 2*c2c66affSColin Finck * usbioctl.h 3*c2c66affSColin Finck * 4*c2c66affSColin Finck * USB IOCTL interface. 5*c2c66affSColin Finck * 6*c2c66affSColin Finck * This file is part of the ReactOS PSDK package. 7*c2c66affSColin Finck * 8*c2c66affSColin Finck * Contributors: 9*c2c66affSColin Finck * Created by Casper S. Hornstrup <chorns@users.sourceforge.net> 10*c2c66affSColin Finck * 11*c2c66affSColin Finck * THIS SOFTWARE IS NOT COPYRIGHTED 12*c2c66affSColin Finck * 13*c2c66affSColin Finck * This source code is offered for use in the public domain. You may 14*c2c66affSColin Finck * use, modify or distribute it freely. 15*c2c66affSColin Finck * 16*c2c66affSColin Finck * This code is distributed in the hope that it will be useful but 17*c2c66affSColin Finck * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 18*c2c66affSColin Finck * DISCLAIMED. This includes but is not limited to warranties of 19*c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20*c2c66affSColin Finck * 21*c2c66affSColin Finck */ 22*c2c66affSColin Finck 23*c2c66affSColin Finck #pragma once 24*c2c66affSColin Finck 25*c2c66affSColin Finck #include "usb100.h" 26*c2c66affSColin Finck #include "usbiodef.h" 27*c2c66affSColin Finck 28*c2c66affSColin Finck #ifdef __cplusplus 29*c2c66affSColin Finck extern "C" { 30*c2c66affSColin Finck #endif 31*c2c66affSColin Finck 32*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_SUBMIT_URB \ 33*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS) 34*c2c66affSColin Finck 35*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_RESET_PORT \ 36*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) 37*c2c66affSColin Finck 38*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ 39*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS) 40*c2c66affSColin Finck 41*c2c66affSColin Finck #define USBD_PORT_ENABLED 1 42*c2c66affSColin Finck #define USBD_PORT_CONNECTED 2 43*c2c66affSColin Finck 44*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_PORT_STATUS \ 45*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS) 46*c2c66affSColin Finck 47*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_ENABLE_PORT \ 48*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) 49*c2c66affSColin Finck 50*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ 51*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS) 52*c2c66affSColin Finck 53*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_CYCLE_PORT \ 54*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) 55*c2c66affSColin Finck 56*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_HUB_NAME \ 57*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 58*c2c66affSColin Finck 59*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_BUS_INFO \ 60*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_BUS_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) 61*c2c66affSColin Finck 62*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME \ 63*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 64*c2c66affSColin Finck 65*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_BUSGUID_INFO \ 66*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_BUSGUID_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) 67*c2c66affSColin Finck 68*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO \ 69*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) 70*c2c66affSColin Finck 71*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0501) 72*c2c66affSColin Finck 73*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION \ 74*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS) 75*c2c66affSColin Finck 76*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ 77*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) 78*c2c66affSColin Finck 79*c2c66affSColin Finck #endif 80*c2c66affSColin Finck 81*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 82*c2c66affSColin Finck 83*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_NOTIFY_IDLE_READY \ 84*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION_EX, METHOD_NEITHER, FILE_ANY_ACCESS) 85*c2c66affSColin Finck 86*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_REQ_GLOBAL_SUSPEND \ 87*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_REQ_GLOBAL_SUSPEND, METHOD_NEITHER, FILE_ANY_ACCESS) 88*c2c66affSColin Finck 89*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_REQ_GLOBAL_RESUME \ 90*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_REQ_GLOBAL_RESUME, METHOD_NEITHER, FILE_ANY_ACCESS) 91*c2c66affSColin Finck 92*c2c66affSColin Finck #ifdef USB20_API 93*c2c66affSColin Finck typedef struct _USB_START_FAILDATA { 94*c2c66affSColin Finck ULONG LengthInBytes; 95*c2c66affSColin Finck NTSTATUS NtStatus; 96*c2c66affSColin Finck USBD_STATUS UsbdStatus; 97*c2c66affSColin Finck ULONG ConnectStatus; 98*c2c66affSColin Finck UCHAR DriverData[4]; 99*c2c66affSColin Finck } USB_START_FAILDATA, *PUSB_START_FAILDATA; 100*c2c66affSColin Finck #endif 101*c2c66affSColin Finck 102*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_RECORD_FAILURE \ 103*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_RECORD_FAILURE, METHOD_NEITHER, FILE_ANY_ACCESS) 104*c2c66affSColin Finck 105*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE_EX \ 106*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE_EX, METHOD_NEITHER, FILE_ANY_ACCESS) 107*c2c66affSColin Finck 108*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_TT_DEVICE_HANDLE \ 109*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_TT_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) 110*c2c66affSColin Finck 111*c2c66affSColin Finck typedef struct _USB_TOPOLOGY_ADDRESS { 112*c2c66affSColin Finck ULONG PciBusNumber; 113*c2c66affSColin Finck ULONG PciDeviceNumber; 114*c2c66affSColin Finck ULONG PciFunctionNumber; 115*c2c66affSColin Finck ULONG Reserved; 116*c2c66affSColin Finck USHORT RootHubPortNumber; 117*c2c66affSColin Finck USHORT HubPortNumber[5]; 118*c2c66affSColin Finck USHORT Reserved2; 119*c2c66affSColin Finck } USB_TOPOLOGY_ADDRESS, *PUSB_TOPOLOGY_ADDRESS; 120*c2c66affSColin Finck 121*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_TOPOLOGY_ADDRESS \ 122*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_TOPOLOGY_ADDRESS, METHOD_NEITHER, FILE_ANY_ACCESS) 123*c2c66affSColin Finck 124*c2c66affSColin Finck #define IOCTL_INTERNAL_USB_GET_DEVICE_CONFIG_INFO \ 125*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CONFIG_INFO, METHOD_NEITHER, FILE_ANY_ACCESS) 126*c2c66affSColin Finck 127*c2c66affSColin Finck #endif 128*c2c66affSColin Finck 129*c2c66affSColin Finck #ifndef USB_KERNEL_IOCTL 130*c2c66affSColin Finck 131*c2c66affSColin Finck #define IOCTL_USB_HCD_GET_STATS_1 \ 132*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS) 133*c2c66affSColin Finck 134*c2c66affSColin Finck #define IOCTL_USB_HCD_GET_STATS_2 \ 135*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS) 136*c2c66affSColin Finck 137*c2c66affSColin Finck #define IOCTL_USB_HCD_DISABLE_PORT \ 138*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) 139*c2c66affSColin Finck 140*c2c66affSColin Finck #define IOCTL_USB_HCD_ENABLE_PORT \ 141*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) 142*c2c66affSColin Finck 143*c2c66affSColin Finck #define IOCTL_USB_HCD_DISABLE_PORT \ 144*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) 145*c2c66affSColin Finck 146*c2c66affSColin Finck #define IOCTL_USB_HCD_ENABLE_PORT \ 147*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) 148*c2c66affSColin Finck 149*c2c66affSColin Finck #ifndef IOCTL_USB_DIAGNOSTIC_MODE_OFF 150*c2c66affSColin Finck #define IOCTL_USB_DIAGNOSTIC_MODE_OFF \ 151*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) 152*c2c66affSColin Finck #endif 153*c2c66affSColin Finck 154*c2c66affSColin Finck #ifndef IOCTL_USB_DIAGNOSTIC_MODE_ON 155*c2c66affSColin Finck #define IOCTL_USB_DIAGNOSTIC_MODE_ON \ 156*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) 157*c2c66affSColin Finck #endif 158*c2c66affSColin Finck 159*c2c66affSColin Finck #ifndef IOCTL_USB_GET_ROOT_HUB_NAME 160*c2c66affSColin Finck #define IOCTL_USB_GET_ROOT_HUB_NAME \ 161*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 162*c2c66affSColin Finck #endif 163*c2c66affSColin Finck 164*c2c66affSColin Finck #ifndef IOCTL_GET_HCD_DRIVERKEY_NAME 165*c2c66affSColin Finck #define IOCTL_GET_HCD_DRIVERKEY_NAME \ 166*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 167*c2c66affSColin Finck #endif 168*c2c66affSColin Finck 169*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_INFORMATION \ 170*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) 171*c2c66affSColin Finck 172*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION \ 173*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) 174*c2c66affSColin Finck 175*c2c66affSColin Finck #define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ 176*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) 177*c2c66affSColin Finck 178*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_CONNECTION_NAME \ 179*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 180*c2c66affSColin Finck 181*c2c66affSColin Finck #define IOCTL_USB_DIAG_IGNORE_HUBS_ON \ 182*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) 183*c2c66affSColin Finck 184*c2c66affSColin Finck #define IOCTL_USB_DIAG_IGNORE_HUBS_OFF \ 185*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) 186*c2c66affSColin Finck 187*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME \ 188*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) 189*c2c66affSColin Finck 190*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0501) 191*c2c66affSColin Finck 192*c2c66affSColin Finck #define IOCTL_USB_GET_HUB_CAPABILITIES \ 193*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS) 194*c2c66affSColin Finck 195*c2c66affSColin Finck #define IOCTL_USB_HUB_CYCLE_PORT \ 196*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) 197*c2c66affSColin Finck 198*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ 199*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) 200*c2c66affSColin Finck 201*c2c66affSColin Finck #define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ 202*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) 203*c2c66affSColin Finck 204*c2c66affSColin Finck #endif 205*c2c66affSColin Finck 206*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 207*c2c66affSColin Finck 208*c2c66affSColin Finck #define IOCTL_USB_RESET_HUB \ 209*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_RESET_HUB, METHOD_BUFFERED, FILE_ANY_ACCESS) 210*c2c66affSColin Finck 211*c2c66affSColin Finck #define IOCTL_USB_GET_HUB_CAPABILITIES_EX \ 212*c2c66affSColin Finck CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) 213*c2c66affSColin Finck 214*c2c66affSColin Finck #endif 215*c2c66affSColin Finck 216*c2c66affSColin Finck #include <pshpack1.h> 217*c2c66affSColin Finck 218*c2c66affSColin Finck typedef enum _USB_HUB_NODE { 219*c2c66affSColin Finck UsbHub, 220*c2c66affSColin Finck UsbMIParent 221*c2c66affSColin Finck } USB_HUB_NODE; 222*c2c66affSColin Finck 223*c2c66affSColin Finck typedef struct _USB_HUB_INFORMATION { 224*c2c66affSColin Finck USB_HUB_DESCRIPTOR HubDescriptor; 225*c2c66affSColin Finck BOOLEAN HubIsBusPowered; 226*c2c66affSColin Finck } USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; 227*c2c66affSColin Finck 228*c2c66affSColin Finck typedef struct _USB_MI_PARENT_INFORMATION { 229*c2c66affSColin Finck ULONG NumberOfInterfaces; 230*c2c66affSColin Finck } USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; 231*c2c66affSColin Finck 232*c2c66affSColin Finck typedef struct _USB_NODE_INFORMATION { 233*c2c66affSColin Finck USB_HUB_NODE NodeType; 234*c2c66affSColin Finck union { 235*c2c66affSColin Finck USB_HUB_INFORMATION HubInformation; 236*c2c66affSColin Finck USB_MI_PARENT_INFORMATION MiParentInformation; 237*c2c66affSColin Finck } u; 238*c2c66affSColin Finck } USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; 239*c2c66affSColin Finck 240*c2c66affSColin Finck typedef struct _USB_PIPE_INFO { 241*c2c66affSColin Finck USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; 242*c2c66affSColin Finck ULONG ScheduleOffset; 243*c2c66affSColin Finck } USB_PIPE_INFO, *PUSB_PIPE_INFO; 244*c2c66affSColin Finck 245*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 246*c2c66affSColin Finck 247*c2c66affSColin Finck typedef enum _USB_CONNECTION_STATUS { 248*c2c66affSColin Finck NoDeviceConnected, 249*c2c66affSColin Finck DeviceConnected, 250*c2c66affSColin Finck DeviceFailedEnumeration, 251*c2c66affSColin Finck DeviceGeneralFailure, 252*c2c66affSColin Finck DeviceCausedOvercurrent, 253*c2c66affSColin Finck DeviceNotEnoughPower, 254*c2c66affSColin Finck DeviceNotEnoughBandwidth, 255*c2c66affSColin Finck DeviceHubNestedTooDeeply, 256*c2c66affSColin Finck DeviceInLegacyHub, 257*c2c66affSColin Finck DeviceEnumerating, 258*c2c66affSColin Finck DeviceReset 259*c2c66affSColin Finck } USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; 260*c2c66affSColin Finck 261*c2c66affSColin Finck #elif (_WIN32_WINNT >= 0x0501) 262*c2c66affSColin Finck 263*c2c66affSColin Finck typedef enum _USB_CONNECTION_STATUS { 264*c2c66affSColin Finck NoDeviceConnected, 265*c2c66affSColin Finck DeviceConnected, 266*c2c66affSColin Finck DeviceFailedEnumeration, 267*c2c66affSColin Finck DeviceGeneralFailure, 268*c2c66affSColin Finck DeviceCausedOvercurrent, 269*c2c66affSColin Finck DeviceNotEnoughPower, 270*c2c66affSColin Finck DeviceNotEnoughBandwidth, 271*c2c66affSColin Finck DeviceHubNestedTooDeeply, 272*c2c66affSColin Finck DeviceInLegacyHub 273*c2c66affSColin Finck } USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; 274*c2c66affSColin Finck 275*c2c66affSColin Finck #else 276*c2c66affSColin Finck 277*c2c66affSColin Finck typedef enum _USB_CONNECTION_STATUS { 278*c2c66affSColin Finck NoDeviceConnected, 279*c2c66affSColin Finck DeviceConnected, 280*c2c66affSColin Finck DeviceFailedEnumeration, 281*c2c66affSColin Finck DeviceGeneralFailure, 282*c2c66affSColin Finck DeviceCausedOvercurrent, 283*c2c66affSColin Finck DeviceNotEnoughPower, 284*c2c66affSColin Finck DeviceNotEnoughBandwidth 285*c2c66affSColin Finck } USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; 286*c2c66affSColin Finck 287*c2c66affSColin Finck #endif 288*c2c66affSColin Finck 289*c2c66affSColin Finck typedef struct _USB_NODE_CONNECTION_INFORMATION { 290*c2c66affSColin Finck ULONG ConnectionIndex; 291*c2c66affSColin Finck USB_DEVICE_DESCRIPTOR DeviceDescriptor; 292*c2c66affSColin Finck UCHAR CurrentConfigurationValue; 293*c2c66affSColin Finck BOOLEAN LowSpeed; 294*c2c66affSColin Finck BOOLEAN DeviceIsHub; 295*c2c66affSColin Finck USHORT DeviceAddress; 296*c2c66affSColin Finck ULONG NumberOfOpenPipes; 297*c2c66affSColin Finck USB_CONNECTION_STATUS ConnectionStatus; 298*c2c66affSColin Finck USB_PIPE_INFO PipeList[ANYSIZE_ARRAY]; 299*c2c66affSColin Finck } USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION; 300*c2c66affSColin Finck 301*c2c66affSColin Finck typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME { 302*c2c66affSColin Finck ULONG ConnectionIndex; 303*c2c66affSColin Finck ULONG ActualLength; 304*c2c66affSColin Finck WCHAR DriverKeyName[ANYSIZE_ARRAY]; 305*c2c66affSColin Finck } USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME; 306*c2c66affSColin Finck 307*c2c66affSColin Finck typedef struct _USB_NODE_CONNECTION_NAME { 308*c2c66affSColin Finck ULONG ConnectionIndex; 309*c2c66affSColin Finck ULONG ActualLength; 310*c2c66affSColin Finck WCHAR NodeName[ANYSIZE_ARRAY]; 311*c2c66affSColin Finck } USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; 312*c2c66affSColin Finck 313*c2c66affSColin Finck typedef struct _USB_HUB_NAME { 314*c2c66affSColin Finck ULONG ActualLength; 315*c2c66affSColin Finck WCHAR HubName[ANYSIZE_ARRAY]; 316*c2c66affSColin Finck } USB_HUB_NAME, *PUSB_HUB_NAME; 317*c2c66affSColin Finck 318*c2c66affSColin Finck typedef struct _USB_ROOT_HUB_NAME { 319*c2c66affSColin Finck ULONG ActualLength; 320*c2c66affSColin Finck WCHAR RootHubName[ANYSIZE_ARRAY]; 321*c2c66affSColin Finck } USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; 322*c2c66affSColin Finck 323*c2c66affSColin Finck typedef struct _USB_HCD_DRIVERKEY_NAME { 324*c2c66affSColin Finck ULONG ActualLength; 325*c2c66affSColin Finck WCHAR DriverKeyName[ANYSIZE_ARRAY]; 326*c2c66affSColin Finck } USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME; 327*c2c66affSColin Finck 328*c2c66affSColin Finck typedef struct _USB_DESCRIPTOR_REQUEST { 329*c2c66affSColin Finck ULONG ConnectionIndex; 330*c2c66affSColin Finck struct { 331*c2c66affSColin Finck UCHAR bmRequest; 332*c2c66affSColin Finck UCHAR bRequest; 333*c2c66affSColin Finck USHORT wValue; 334*c2c66affSColin Finck USHORT wIndex; 335*c2c66affSColin Finck USHORT wLength; 336*c2c66affSColin Finck } SetupPacket; 337*c2c66affSColin Finck UCHAR Data[ANYSIZE_ARRAY]; 338*c2c66affSColin Finck } USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; 339*c2c66affSColin Finck 340*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0501) 341*c2c66affSColin Finck 342*c2c66affSColin Finck typedef struct _USB_HUB_CAPABILITIES { 343*c2c66affSColin Finck ULONG HubIs2xCapable:1; 344*c2c66affSColin Finck } USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES; 345*c2c66affSColin Finck 346*c2c66affSColin Finck typedef struct _USB_NODE_CONNECTION_ATTRIBUTES { 347*c2c66affSColin Finck ULONG ConnectionIndex; 348*c2c66affSColin Finck USB_CONNECTION_STATUS ConnectionStatus; 349*c2c66affSColin Finck ULONG PortAttributes; 350*c2c66affSColin Finck } USB_NODE_CONNECTION_ATTRIBUTES, *PUSB_NODE_CONNECTION_ATTRIBUTES; 351*c2c66affSColin Finck 352*c2c66affSColin Finck typedef struct _USB_NODE_CONNECTION_INFORMATION_EX { 353*c2c66affSColin Finck ULONG ConnectionIndex; 354*c2c66affSColin Finck USB_DEVICE_DESCRIPTOR DeviceDescriptor; 355*c2c66affSColin Finck UCHAR CurrentConfigurationValue; 356*c2c66affSColin Finck UCHAR Speed; 357*c2c66affSColin Finck BOOLEAN DeviceIsHub; 358*c2c66affSColin Finck USHORT DeviceAddress; 359*c2c66affSColin Finck ULONG NumberOfOpenPipes; 360*c2c66affSColin Finck USB_CONNECTION_STATUS ConnectionStatus; 361*c2c66affSColin Finck USB_PIPE_INFO PipeList[ANYSIZE_ARRAY]; 362*c2c66affSColin Finck } USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX; 363*c2c66affSColin Finck 364*c2c66affSColin Finck C_ASSERT(sizeof(USB_NODE_CONNECTION_INFORMATION_EX) == sizeof(USB_NODE_CONNECTION_INFORMATION)); 365*c2c66affSColin Finck 366*c2c66affSColin Finck #endif 367*c2c66affSColin Finck 368*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 369*c2c66affSColin Finck 370*c2c66affSColin Finck typedef union _USB_HUB_CAP_FLAGS { 371*c2c66affSColin Finck ULONG ul; 372*c2c66affSColin Finck struct { 373*c2c66affSColin Finck ULONG HubIsHighSpeedCapable:1; 374*c2c66affSColin Finck ULONG HubIsHighSpeed:1; 375*c2c66affSColin Finck ULONG HubIsMultiTtCapable:1; 376*c2c66affSColin Finck ULONG HubIsMultiTt:1; 377*c2c66affSColin Finck ULONG HubIsRoot:1; 378*c2c66affSColin Finck ULONG HubIsArmedWakeOnConnect:1; 379*c2c66affSColin Finck ULONG HubIsBusPowered:1; 380*c2c66affSColin Finck ULONG ReservedMBZ:25; 381*c2c66affSColin Finck }; 382*c2c66affSColin Finck } USB_HUB_CAP_FLAGS, *PUSB_HUB_CAP_FLAGS; 383*c2c66affSColin Finck 384*c2c66affSColin Finck C_ASSERT(sizeof(USB_HUB_CAP_FLAGS) == sizeof(ULONG)); 385*c2c66affSColin Finck 386*c2c66affSColin Finck typedef struct _USB_HUB_CAPABILITIES_EX { 387*c2c66affSColin Finck USB_HUB_CAP_FLAGS CapabilityFlags; 388*c2c66affSColin Finck } USB_HUB_CAPABILITIES_EX, *PUSB_HUB_CAPABILITIES_EX; 389*c2c66affSColin Finck 390*c2c66affSColin Finck typedef struct _USB_CYCLE_PORT_PARAMS { 391*c2c66affSColin Finck ULONG ConnectionIndex; 392*c2c66affSColin Finck ULONG StatusReturned; 393*c2c66affSColin Finck } USB_CYCLE_PORT_PARAMS, *PUSB_CYCLE_PORT_PARAMS; 394*c2c66affSColin Finck 395*c2c66affSColin Finck typedef struct _USB_ID_STRING { 396*c2c66affSColin Finck USHORT LanguageId; 397*c2c66affSColin Finck USHORT Pad; 398*c2c66affSColin Finck ULONG LengthInBytes; 399*c2c66affSColin Finck PWCHAR Buffer; 400*c2c66affSColin Finck } USB_ID_STRING, *PUSB_ID_STRING; 401*c2c66affSColin Finck 402*c2c66affSColin Finck typedef struct _USB_HUB_DEVICE_UXD_SETTINGS { 403*c2c66affSColin Finck ULONG Version; 404*c2c66affSColin Finck GUID PnpGuid; 405*c2c66affSColin Finck GUID OwnerGuid; 406*c2c66affSColin Finck ULONG DeleteOnShutdown; 407*c2c66affSColin Finck ULONG DeleteOnReload; 408*c2c66affSColin Finck ULONG DeleteOnDisconnect; 409*c2c66affSColin Finck ULONG Reserved[5]; 410*c2c66affSColin Finck } USB_HUB_DEVICE_UXD_SETTINGS, *PUSB_HUB_DEVICE_UXD_SETTINGS; 411*c2c66affSColin Finck 412*c2c66affSColin Finck typedef struct _HUB_DEVICE_CONFIG_INFO_V1 { 413*c2c66affSColin Finck ULONG Version; 414*c2c66affSColin Finck ULONG Length; 415*c2c66affSColin Finck USB_HUB_CAP_FLAGS HubFlags; 416*c2c66affSColin Finck USB_ID_STRING HardwareIds; 417*c2c66affSColin Finck USB_ID_STRING CompatibleIds; 418*c2c66affSColin Finck USB_ID_STRING DeviceDescription; 419*c2c66affSColin Finck ULONG Reserved[19]; 420*c2c66affSColin Finck USB_HUB_DEVICE_UXD_SETTINGS UxdSettings; 421*c2c66affSColin Finck } HUB_DEVICE_CONFIG_INFO, *PHUB_DEVICE_CONFIG_INFO; 422*c2c66affSColin Finck 423*c2c66affSColin Finck #endif 424*c2c66affSColin Finck 425*c2c66affSColin Finck typedef struct _HCD_ISO_STAT_COUNTERS { 426*c2c66affSColin Finck USHORT LateUrbs; 427*c2c66affSColin Finck USHORT DoubleBufferedPackets; 428*c2c66affSColin Finck USHORT TransfersCF_5ms; 429*c2c66affSColin Finck USHORT TransfersCF_2ms; 430*c2c66affSColin Finck USHORT TransfersCF_1ms; 431*c2c66affSColin Finck USHORT MaxInterruptLatency; 432*c2c66affSColin Finck USHORT BadStartFrame; 433*c2c66affSColin Finck USHORT StaleUrbs; 434*c2c66affSColin Finck USHORT IsoPacketNotAccesed; 435*c2c66affSColin Finck USHORT IsoPacketHWError; 436*c2c66affSColin Finck USHORT SmallestUrbPacketCount; 437*c2c66affSColin Finck USHORT LargestUrbPacketCount; 438*c2c66affSColin Finck USHORT IsoCRC_Error; 439*c2c66affSColin Finck USHORT IsoOVERRUN_Error; 440*c2c66affSColin Finck USHORT IsoINTERNAL_Error; 441*c2c66affSColin Finck USHORT IsoUNKNOWN_Error; 442*c2c66affSColin Finck ULONG IsoBytesTransferred; 443*c2c66affSColin Finck USHORT LateMissedCount; 444*c2c66affSColin Finck USHORT HWIsoMissedCount; 445*c2c66affSColin Finck ULONG Reserved7[8]; 446*c2c66affSColin Finck } HCD_ISO_STAT_COUNTERS, *PHCD_ISO_STAT_COUNTERS; 447*c2c66affSColin Finck 448*c2c66affSColin Finck typedef struct _HCD_STAT_COUNTERS { 449*c2c66affSColin Finck ULONG BytesTransferred; 450*c2c66affSColin Finck USHORT IsoMissedCount; 451*c2c66affSColin Finck USHORT DataOverrunErrorCount; 452*c2c66affSColin Finck USHORT CrcErrorCount; 453*c2c66affSColin Finck USHORT ScheduleOverrunCount; 454*c2c66affSColin Finck USHORT TimeoutErrorCount; 455*c2c66affSColin Finck USHORT InternalHcErrorCount; 456*c2c66affSColin Finck USHORT BufferOverrunErrorCount; 457*c2c66affSColin Finck USHORT SWErrorCount; 458*c2c66affSColin Finck USHORT StallPidCount; 459*c2c66affSColin Finck USHORT PortDisableCount; 460*c2c66affSColin Finck } HCD_STAT_COUNTERS, *PHCD_STAT_COUNTERS; 461*c2c66affSColin Finck 462*c2c66affSColin Finck typedef struct _HCD_STAT_INFORMATION_1 { 463*c2c66affSColin Finck ULONG Reserved1; 464*c2c66affSColin Finck ULONG Reserved2; 465*c2c66affSColin Finck ULONG ResetCounters; 466*c2c66affSColin Finck LARGE_INTEGER TimeRead; 467*c2c66affSColin Finck HCD_STAT_COUNTERS Counters; 468*c2c66affSColin Finck } HCD_STAT_INFORMATION_1, *PHCD_STAT_INFORMATION_1; 469*c2c66affSColin Finck 470*c2c66affSColin Finck typedef struct _HCD_STAT_INFORMATION_2 { 471*c2c66affSColin Finck ULONG Reserved1; 472*c2c66affSColin Finck ULONG Reserved2; 473*c2c66affSColin Finck ULONG ResetCounters; 474*c2c66affSColin Finck LARGE_INTEGER TimeRead; 475*c2c66affSColin Finck LONG LockedMemoryUsed; 476*c2c66affSColin Finck HCD_STAT_COUNTERS Counters; 477*c2c66affSColin Finck HCD_ISO_STAT_COUNTERS IsoCounters; 478*c2c66affSColin Finck } HCD_STAT_INFORMATION_2, *PHCD_STAT_INFORMATION_2; 479*c2c66affSColin Finck 480*c2c66affSColin Finck #define WMI_USB_DRIVER_INFORMATION 0 481*c2c66affSColin Finck #define WMI_USB_DRIVER_NOTIFICATION 1 482*c2c66affSColin Finck #define WMI_USB_POWER_DEVICE_ENABLE 2 483*c2c66affSColin Finck #define WMI_USB_HUB_NODE_INFORMATION 4 484*c2c66affSColin Finck 485*c2c66affSColin Finck #define WMI_USB_PERFORMANCE_INFORMATION 1 486*c2c66affSColin Finck #define WMI_USB_DEVICE_NODE_INFORMATION 2 487*c2c66affSColin Finck 488*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0501) 489*c2c66affSColin Finck 490*c2c66affSColin Finck typedef enum _USB_NOTIFICATION_TYPE { 491*c2c66affSColin Finck EnumerationFailure = 0, 492*c2c66affSColin Finck InsufficentBandwidth, 493*c2c66affSColin Finck InsufficentPower, 494*c2c66affSColin Finck OverCurrent, 495*c2c66affSColin Finck ResetOvercurrent, 496*c2c66affSColin Finck AcquireBusInfo, 497*c2c66affSColin Finck AcquireHubName, 498*c2c66affSColin Finck AcquireControllerName, 499*c2c66affSColin Finck HubOvercurrent, 500*c2c66affSColin Finck HubPowerChange, 501*c2c66affSColin Finck HubNestedTooDeeply, 502*c2c66affSColin Finck ModernDeviceInLegacyHub 503*c2c66affSColin Finck } USB_NOTIFICATION_TYPE; 504*c2c66affSColin Finck 505*c2c66affSColin Finck #else 506*c2c66affSColin Finck 507*c2c66affSColin Finck typedef enum _USB_NOTIFICATION_TYPE { 508*c2c66affSColin Finck EnumerationFailure = 0, 509*c2c66affSColin Finck InsufficentBandwidth, 510*c2c66affSColin Finck InsufficentPower, 511*c2c66affSColin Finck OverCurrent, 512*c2c66affSColin Finck ResetOvercurrent, 513*c2c66affSColin Finck AcquireBusInfo, 514*c2c66affSColin Finck AcquireHubName, 515*c2c66affSColin Finck AcquireControllerName, 516*c2c66affSColin Finck HubOvercurrent, 517*c2c66affSColin Finck HubPowerChange 518*c2c66affSColin Finck } USB_NOTIFICATION_TYPE; 519*c2c66affSColin Finck 520*c2c66affSColin Finck #endif 521*c2c66affSColin Finck 522*c2c66affSColin Finck typedef struct _USB_NOTIFICATION { 523*c2c66affSColin Finck USB_NOTIFICATION_TYPE NotificationType; 524*c2c66affSColin Finck } USB_NOTIFICATION, *PUSB_NOTIFICATION; 525*c2c66affSColin Finck 526*c2c66affSColin Finck typedef struct _USB_CONNECTION_NOTIFICATION { 527*c2c66affSColin Finck USB_NOTIFICATION_TYPE NotificationType; 528*c2c66affSColin Finck ULONG ConnectionNumber; 529*c2c66affSColin Finck ULONG RequestedBandwidth; 530*c2c66affSColin Finck ULONG EnumerationFailReason; 531*c2c66affSColin Finck ULONG PowerRequested; 532*c2c66affSColin Finck ULONG HubNameLength; 533*c2c66affSColin Finck } USB_CONNECTION_NOTIFICATION, *PUSB_CONNECTION_NOTIFICATION; 534*c2c66affSColin Finck 535*c2c66affSColin Finck typedef struct _USB_BUS_NOTIFICATION { 536*c2c66affSColin Finck USB_NOTIFICATION_TYPE NotificationType; 537*c2c66affSColin Finck ULONG TotalBandwidth; 538*c2c66affSColin Finck ULONG ConsumedBandwidth; 539*c2c66affSColin Finck ULONG ControllerNameLength; 540*c2c66affSColin Finck } USB_BUS_NOTIFICATION, *PUSB_BUS_NOTIFICATION; 541*c2c66affSColin Finck 542*c2c66affSColin Finck typedef struct _USB_ACQUIRE_INFO { 543*c2c66affSColin Finck USB_NOTIFICATION_TYPE NotificationType; 544*c2c66affSColin Finck ULONG TotalSize; 545*c2c66affSColin Finck WCHAR Buffer[ANYSIZE_ARRAY]; 546*c2c66affSColin Finck } USB_ACQUIRE_INFO, *PUSB_ACQUIRE_INFO; 547*c2c66affSColin Finck 548*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 549*c2c66affSColin Finck 550*c2c66affSColin Finck #define USB_NODE_INFO_SIG 'USBN' 551*c2c66affSColin Finck 552*c2c66affSColin Finck typedef enum _USB_WMI_DEVICE_NODE_TYPE { 553*c2c66affSColin Finck UsbDevice, 554*c2c66affSColin Finck HubDevice, 555*c2c66affSColin Finck CompositeDevice, 556*c2c66affSColin Finck UsbController 557*c2c66affSColin Finck } USB_WMI_DEVICE_NODE_TYPE, *PUSB_WMI_DEVICE_NODE_TYPE; 558*c2c66affSColin Finck 559*c2c66affSColin Finck typedef struct _USB_DEVICE_STATE { 560*c2c66affSColin Finck ULONG DeviceConnected:1; 561*c2c66affSColin Finck ULONG DeviceStarted:1; 562*c2c66affSColin Finck } USB_DEVICE_STATE, *PUSB_DEVICE_STATE; 563*c2c66affSColin Finck 564*c2c66affSColin Finck typedef struct _USB_HUB_PORT_INFORMATION { 565*c2c66affSColin Finck USB_DEVICE_STATE DeviceState; 566*c2c66affSColin Finck USHORT PortNumber; 567*c2c66affSColin Finck USHORT DeviceAddress; 568*c2c66affSColin Finck ULONG ConnectionIndex; 569*c2c66affSColin Finck USB_CONNECTION_STATUS ConnectionStatus; 570*c2c66affSColin Finck } USB_HUB_PORT_INFORMATION, *PUSB_HUB_PORT_INFORMATION; 571*c2c66affSColin Finck 572*c2c66affSColin Finck typedef struct _USB_HUB_DEVICE_INFO { 573*c2c66affSColin Finck USB_HUB_DESCRIPTOR HubDescriptor; 574*c2c66affSColin Finck ULONG HubNumber; 575*c2c66affSColin Finck USHORT DeviceAddress; 576*c2c66affSColin Finck BOOLEAN HubIsSelfPowered; 577*c2c66affSColin Finck BOOLEAN HubIsRootHub; 578*c2c66affSColin Finck USB_HUB_CAPABILITIES HubCapabilities; 579*c2c66affSColin Finck ULONG NumberOfHubPorts; 580*c2c66affSColin Finck USB_HUB_PORT_INFORMATION PortInfo[ANYSIZE_ARRAY]; 581*c2c66affSColin Finck } USB_HUB_DEVICE_INFO, *PUSB_HUB_DEVICE_INFO; 582*c2c66affSColin Finck 583*c2c66affSColin Finck typedef struct _USB_COMPOSITE_FUNCTION_INFO { 584*c2c66affSColin Finck UCHAR FunctionNumber; 585*c2c66affSColin Finck UCHAR BaseInterfaceNumber; 586*c2c66affSColin Finck UCHAR NumberOfInterfaces; 587*c2c66affSColin Finck BOOLEAN FunctionIsIdle; 588*c2c66affSColin Finck } USB_COMPOSITE_FUNCTION_INFO, *PUSB_COMPOSITE_FUNCTION_INFO; 589*c2c66affSColin Finck 590*c2c66affSColin Finck typedef struct _USB_COMPOSITE_DEVICE_INFO { 591*c2c66affSColin Finck USB_DEVICE_DESCRIPTOR DeviceDescriptor; 592*c2c66affSColin Finck USB_CONFIGURATION_DESCRIPTOR CurrentConfigDescriptor; 593*c2c66affSColin Finck UCHAR CurrentConfigurationValue; 594*c2c66affSColin Finck UCHAR NumberOfFunctions; 595*c2c66affSColin Finck USB_COMPOSITE_FUNCTION_INFO FunctionInfo[ANYSIZE_ARRAY]; 596*c2c66affSColin Finck } USB_COMPOSITE_DEVICE_INFO, *PUSB_COMPOSITE_DEVICE_INFO; 597*c2c66affSColin Finck 598*c2c66affSColin Finck typedef struct _USB_CONTROLLER_DEVICE_INFO { 599*c2c66affSColin Finck ULONG PciVendorId; 600*c2c66affSColin Finck ULONG PciDeviceId; 601*c2c66affSColin Finck ULONG PciRevision; 602*c2c66affSColin Finck ULONG NumberOfRootPorts; 603*c2c66affSColin Finck ULONG HcFeatureFlags; 604*c2c66affSColin Finck } USB_CONTROLLER_DEVICE_INFO, *PUSB_CONTROLLER_DEVICE_INFO; 605*c2c66affSColin Finck 606*c2c66affSColin Finck typedef struct _USB_DEVICE_INFO { 607*c2c66affSColin Finck USB_DEVICE_STATE DeviceState; 608*c2c66affSColin Finck USHORT PortNumber; 609*c2c66affSColin Finck USB_DEVICE_DESCRIPTOR DeviceDescriptor; 610*c2c66affSColin Finck UCHAR CurrentConfigurationValue; 611*c2c66affSColin Finck USB_DEVICE_SPEED Speed; 612*c2c66affSColin Finck USHORT DeviceAddress; 613*c2c66affSColin Finck ULONG ConnectionIndex; 614*c2c66affSColin Finck USB_CONNECTION_STATUS ConnectionStatus; 615*c2c66affSColin Finck WCHAR PnpHardwareId[128]; 616*c2c66affSColin Finck WCHAR PnpCompatibleId[128]; 617*c2c66affSColin Finck WCHAR SerialNumberId[128]; 618*c2c66affSColin Finck WCHAR PnpDeviceDescription[128]; 619*c2c66affSColin Finck ULONG NumberOfOpenPipes; 620*c2c66affSColin Finck USB_PIPE_INFO PipeList[ANYSIZE_ARRAY]; 621*c2c66affSColin Finck } USB_DEVICE_INFO, *PUSB_DEVICE_INFO; 622*c2c66affSColin Finck 623*c2c66affSColin Finck typedef struct _USB_DEVICE_NODE_INFO { 624*c2c66affSColin Finck ULONG Sig; 625*c2c66affSColin Finck ULONG LengthInBytes; 626*c2c66affSColin Finck WCHAR DeviceDescription[40]; 627*c2c66affSColin Finck USB_WMI_DEVICE_NODE_TYPE NodeType; 628*c2c66affSColin Finck USB_TOPOLOGY_ADDRESS BusAddress; 629*c2c66affSColin Finck union{ 630*c2c66affSColin Finck USB_DEVICE_INFO UsbDeviceInfo; 631*c2c66affSColin Finck USB_HUB_DEVICE_INFO HubDeviceInfo; 632*c2c66affSColin Finck USB_COMPOSITE_DEVICE_INFO CompositeDeviceInfo; 633*c2c66affSColin Finck USB_CONTROLLER_DEVICE_INFO ControllerDeviceInfo; 634*c2c66affSColin Finck UCHAR DeviceInformation[4]; 635*c2c66affSColin Finck }; 636*c2c66affSColin Finck } USB_DEVICE_NODE_INFO, *PUSB_DEVICE_NODE_INFO; 637*c2c66affSColin Finck 638*c2c66affSColin Finck typedef struct _USB_DEVICE_PERFORMANCE_INFO { 639*c2c66affSColin Finck ULONG BulkBytes; 640*c2c66affSColin Finck ULONG ControlDataBytes; 641*c2c66affSColin Finck ULONG IsoBytes; 642*c2c66affSColin Finck ULONG InterruptBytes; 643*c2c66affSColin Finck ULONG BulkUrbCount; 644*c2c66affSColin Finck ULONG ControlUrbCount; 645*c2c66affSColin Finck ULONG IsoUrbCount; 646*c2c66affSColin Finck ULONG InterruptUrbCount; 647*c2c66affSColin Finck ULONG AllocedInterrupt[6]; 648*c2c66affSColin Finck ULONG AllocedIso; 649*c2c66affSColin Finck ULONG Total32secBandwidth; 650*c2c66affSColin Finck ULONG TotalTtBandwidth; 651*c2c66affSColin Finck WCHAR DeviceDescription[60]; 652*c2c66affSColin Finck USB_DEVICE_SPEED DeviceSpeed; 653*c2c66affSColin Finck ULONG TotalIsoLatency; 654*c2c66affSColin Finck ULONG DroppedIsoPackets; 655*c2c66affSColin Finck ULONG TransferErrors; 656*c2c66affSColin Finck ULONG PciInterruptCount; 657*c2c66affSColin Finck ULONG HcIdleState; 658*c2c66affSColin Finck ULONG HcAsyncIdleState; 659*c2c66affSColin Finck ULONG HcAsyncCacheFlushCount; 660*c2c66affSColin Finck ULONG HcPeriodicIdleState; 661*c2c66affSColin Finck ULONG HcPeriodicCacheFlushCount; 662*c2c66affSColin Finck } USB_DEVICE_PERFORMANCE_INFO, *PUSB_DEVICE_PERFORMANCE_INFO; 663*c2c66affSColin Finck 664*c2c66affSColin Finck #endif 665*c2c66affSColin Finck 666*c2c66affSColin Finck #include <poppack.h> 667*c2c66affSColin Finck 668*c2c66affSColin Finck #endif /* USB_KERNEL_IOCTL */ 669*c2c66affSColin Finck 670*c2c66affSColin Finck #ifdef __cplusplus 671*c2c66affSColin Finck } 672*c2c66affSColin Finck #endif 673