| 1 |
/* |
| 2 |
* Windows backend for libusb 1.0 |
| 3 |
* Copyright © 2009-2012 Pete Batard <[email protected]> |
| 4 |
* With contributions from Michael Plante, Orin Eman et al. |
| 5 |
* Parts of this code adapted from libusb-win32-v1 by Stephan Meyer |
| 6 |
* Major code testing contribution by Xiaofan Chen |
| 7 |
* |
| 8 |
* This library is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU Lesser General Public |
| 10 |
* License as published by the Free Software Foundation; either |
| 11 |
* version 2.1 of the License, or (at your option) any later version. |
| 12 |
* |
| 13 |
* This library is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
* Lesser General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Lesser General Public |
| 19 |
* License along with this library; if not, write to the Free Software |
| 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef LIBUSB_WINDOWS_WINUSB_H |
| 24 |
#define LIBUSB_WINDOWS_WINUSB_H |
| 25 |
|
| 26 |
#include <devioctl.h> |
| 27 |
#include <initguid.h> |
| 28 |
#include <usbiodef.h> |
| 29 |
|
| 30 |
#include "windows_common.h" |
| 31 |
|
| 32 |
#define MAX_CTRL_BUFFER_LENGTH 4096 |
| 33 |
#define MAX_USB_STRING_LENGTH 128 |
| 34 |
#define MAX_HID_REPORT_SIZE 1024 |
| 35 |
#define MAX_HID_DESCRIPTOR_SIZE 256 |
| 36 |
#define MAX_GUID_STRING_LENGTH 39 |
| 37 |
#define MAX_PATH_LENGTH 256 |
| 38 |
#define MAX_KEY_LENGTH 256 |
| 39 |
#define LIST_SEPARATOR ';' |
| 40 |
|
| 41 |
// Handle code for HID interface that have been claimed ("dibs") |
| 42 |
#define INTERFACE_CLAIMED ((HANDLE)(intptr_t)0xD1B5) |
| 43 |
// Additional return code for HID operations that completed synchronously |
| 44 |
#define LIBUSB_COMPLETED (LIBUSB_SUCCESS + 1) |
| 45 |
|
| 46 |
// libusb0 Filter Device Interface GUID |
| 47 |
DEFINE_GUID(GUID_DEVINTERFACE_LIBUSB0_FILTER, 0xF9F3FF14, 0xAE21, 0x48A0, 0x8A, 0x25, 0x80, 0x11, 0xA7, 0xA9, 0x31, 0xD9); |
| 48 |
|
| 49 |
// The following define MUST be == sizeof(USB_DESCRIPTOR_REQUEST) |
| 50 |
#define USB_DESCRIPTOR_REQUEST_SIZE 12U |
| 51 |
|
| 52 |
/* |
| 53 |
* Multiple USB API backend support |
| 54 |
*/ |
| 55 |
#define USB_API_UNSUPPORTED 0 |
| 56 |
#define USB_API_HUB 1 |
| 57 |
#define USB_API_COMPOSITE 2 |
| 58 |
#define USB_API_WINUSBX 3 |
| 59 |
#define USB_API_HID 4 |
| 60 |
#define USB_API_MAX 5 |
| 61 |
|
| 62 |
// Sub-APIs for WinUSB-like driver APIs (WinUSB, libusbK, libusb-win32 through the libusbK DLL) |
| 63 |
// Must have the same values as the KUSB_DRVID enum from libusbk.h |
| 64 |
#define SUB_API_NOTSET -1 |
| 65 |
#define SUB_API_LIBUSBK 0 |
| 66 |
#define SUB_API_LIBUSB0 1 |
| 67 |
#define SUB_API_WINUSB 2 |
| 68 |
#define SUB_API_MAX 3 |
| 69 |
|
| 70 |
struct windows_usb_api_backend { |
| 71 |
const uint8_t id; |
| 72 |
const char * const designation; |
| 73 |
const char * const * const driver_name_list; // Driver name, without .sys, e.g. "usbccgp" |
| 74 |
const uint8_t nb_driver_names; |
| 75 |
bool (*init)(struct libusb_context *ctx); |
| 76 |
void (*exit)(void); |
| 77 |
int (*open)(int sub_api, struct libusb_device_handle *dev_handle); |
| 78 |
void (*close)(int sub_api, struct libusb_device_handle *dev_handle); |
| 79 |
int (*configure_endpoints)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t iface); |
| 80 |
int (*claim_interface)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t iface); |
| 81 |
int (*set_interface_altsetting)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t iface, uint8_t altsetting); |
| 82 |
int (*release_interface)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t iface); |
| 83 |
int (*clear_halt)(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint); |
| 84 |
int (*reset_device)(int sub_api, struct libusb_device_handle *dev_handle); |
| 85 |
int (*submit_bulk_transfer)(int sub_api, struct usbi_transfer *itransfer); |
| 86 |
int (*submit_iso_transfer)(int sub_api, struct usbi_transfer *itransfer); |
| 87 |
int (*submit_control_transfer)(int sub_api, struct usbi_transfer *itransfer); |
| 88 |
int (*cancel_transfer)(int sub_api, struct usbi_transfer *itransfer); |
| 89 |
enum libusb_transfer_status (*copy_transfer_data)(int sub_api, struct usbi_transfer *itransfer, DWORD length); |
| 90 |
int (*endpoint_supports_raw_io)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t endpoint); |
| 91 |
int (*endpoint_set_raw_io)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t endpoint, int enable); |
| 92 |
int (*get_max_raw_io_transfer_size)(int sub_api, struct libusb_device_handle *dev_handle, uint8_t endpoint); |
| 93 |
}; |
| 94 |
|
| 95 |
extern const struct windows_usb_api_backend usb_api_backend[USB_API_MAX]; |
| 96 |
|
| 97 |
#define PRINT_UNSUPPORTED_API(fname) \ |
| 98 |
usbi_dbg(NULL, "unsupported API call for '%s' " \ |
| 99 |
"(unrecognized device driver)", #fname) |
| 100 |
|
| 101 |
#define CHECK_SUPPORTED_API(apip, fname) \ |
| 102 |
do { \ |
| 103 |
if ((apip)->fname == NULL) { \ |
| 104 |
PRINT_UNSUPPORTED_API(fname); \ |
| 105 |
return LIBUSB_ERROR_NOT_SUPPORTED; \ |
| 106 |
} \ |
| 107 |
} while (0) |
| 108 |
|
| 109 |
/* |
| 110 |
* private structures definition |
| 111 |
* with inline pseudo constructors/destructors |
| 112 |
*/ |
| 113 |
|
| 114 |
// TODO (v2+): move hid desc to libusb.h? |
| 115 |
struct libusb_hid_descriptor { |
| 116 |
uint8_t bLength; |
| 117 |
uint8_t bDescriptorType; |
| 118 |
uint16_t bcdHID; |
| 119 |
uint8_t bCountryCode; |
| 120 |
uint8_t bNumDescriptors; |
| 121 |
uint8_t bClassDescriptorType; |
| 122 |
uint16_t wClassDescriptorLength; |
| 123 |
}; |
| 124 |
|
| 125 |
#define LIBUSB_DT_HID_SIZE 9 |
| 126 |
#define HID_MAX_CONFIG_DESC_SIZE (LIBUSB_DT_CONFIG_SIZE + LIBUSB_DT_INTERFACE_SIZE \ |
| 127 |
+ LIBUSB_DT_HID_SIZE + 2 * LIBUSB_DT_ENDPOINT_SIZE) |
| 128 |
#define HID_MAX_REPORT_SIZE 1024 |
| 129 |
#define HID_IN_EP 0x81 |
| 130 |
#define HID_OUT_EP 0x02 |
| 131 |
#define LIBUSB_REQ_RECIPIENT(request_type) ((request_type) & 0x1F) |
| 132 |
#define LIBUSB_REQ_TYPE(request_type) ((request_type) & (0x03 << 5)) |
| 133 |
#define LIBUSB_REQ_IN(request_type) ((request_type) & LIBUSB_ENDPOINT_IN) |
| 134 |
#define LIBUSB_REQ_OUT(request_type) (!LIBUSB_REQ_IN(request_type)) |
| 135 |
|
| 136 |
// The following are used for HID reports IOCTLs |
| 137 |
#define HID_IN_CTL_CODE(id) \ |
| 138 |
CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS) |
| 139 |
#define HID_OUT_CTL_CODE(id) \ |
| 140 |
CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS) |
| 141 |
|
| 142 |
#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100) |
| 143 |
#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104) |
| 144 |
#define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100) |
| 145 |
#define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101) |
| 146 |
|
| 147 |
enum libusb_hid_request_type { |
| 148 |
HID_REQ_GET_REPORT = 0x01, |
| 149 |
HID_REQ_GET_IDLE = 0x02, |
| 150 |
HID_REQ_GET_PROTOCOL = 0x03, |
| 151 |
HID_REQ_SET_REPORT = 0x09, |
| 152 |
HID_REQ_SET_IDLE = 0x0A, |
| 153 |
HID_REQ_SET_PROTOCOL = 0x0B |
| 154 |
}; |
| 155 |
|
| 156 |
enum libusb_hid_report_type { |
| 157 |
HID_REPORT_TYPE_INPUT = 0x01, |
| 158 |
HID_REPORT_TYPE_OUTPUT = 0x02, |
| 159 |
HID_REPORT_TYPE_FEATURE = 0x03 |
| 160 |
}; |
| 161 |
|
| 162 |
struct hid_device_priv { |
| 163 |
uint16_t vid; |
| 164 |
uint16_t pid; |
| 165 |
uint8_t config; |
| 166 |
uint8_t nb_interfaces; |
| 167 |
bool uses_report_ids[3]; // input, ouptput, feature |
| 168 |
uint16_t input_report_size; |
| 169 |
uint16_t output_report_size; |
| 170 |
uint16_t feature_report_size; |
| 171 |
uint16_t usage; |
| 172 |
uint16_t usagePage; |
| 173 |
WCHAR string[3][MAX_USB_STRING_LENGTH]; |
| 174 |
uint8_t string_index[3]; // man, prod, ser |
| 175 |
}; |
| 176 |
|
| 177 |
static inline struct winusb_device_priv *winusb_device_priv_init(struct libusb_device *dev) |
| 178 |
{ |
| 179 |
struct winusb_device_priv *priv = usbi_get_device_priv(dev); |
| 180 |
int i; |
| 181 |
|
| 182 |
usbi_mutex_init(&priv->interface_lock); |
| 183 |
priv->apib = &usb_api_backend[USB_API_UNSUPPORTED]; |
| 184 |
priv->sub_api = SUB_API_NOTSET; |
| 185 |
for (i = 0; i < USB_MAXINTERFACES; i++) { |
| 186 |
priv->usb_interface[i].apib = &usb_api_backend[USB_API_UNSUPPORTED]; |
| 187 |
priv->usb_interface[i].sub_api = SUB_API_NOTSET; |
| 188 |
} |
| 189 |
|
| 190 |
return priv; |
| 191 |
} |
| 192 |
|
| 193 |
static inline void winusb_device_priv_release(struct libusb_device *dev) |
| 194 |
{ |
| 195 |
struct winusb_device_priv *priv = usbi_get_device_priv(dev); |
| 196 |
int i; |
| 197 |
|
| 198 |
free(priv->dev_id); |
| 199 |
free(priv->path); |
| 200 |
if ((dev->device_descriptor.bNumConfigurations > 0) && (priv->config_descriptor != NULL)) { |
| 201 |
for (i = 0; i < dev->device_descriptor.bNumConfigurations; i++) { |
| 202 |
if (priv->config_descriptor[i] == NULL) |
| 203 |
continue; |
| 204 |
free((UCHAR *)priv->config_descriptor[i] - USB_DESCRIPTOR_REQUEST_SIZE); |
| 205 |
} |
| 206 |
} |
| 207 |
free(priv->config_descriptor); |
| 208 |
free(priv->hid); |
| 209 |
for (i = 0; i < USB_MAXINTERFACES; i++) { |
| 210 |
free(priv->usb_interface[i].path); |
| 211 |
free(priv->usb_interface[i].endpoint); |
| 212 |
} |
| 213 |
usbi_mutex_destroy(&priv->interface_lock); |
| 214 |
} |
| 215 |
|
| 216 |
// used to match a device driver (including filter drivers) against a supported API |
| 217 |
struct driver_lookup { |
| 218 |
char list[MAX_KEY_LENGTH + 1]; // REG_MULTI_SZ list of services (driver) names |
| 219 |
const DWORD reg_prop; // SPDRP registry key to use to retrieve list |
| 220 |
const char *designation; // internal designation (for debug output) |
| 221 |
}; |
| 222 |
|
| 223 |
/* |
| 224 |
* Windows DDK API definitions. Most of it copied from MinGW's includes |
| 225 |
*/ |
| 226 |
typedef DWORD DEVNODE, DEVINST; |
| 227 |
typedef DEVNODE *PDEVNODE, *PDEVINST; |
| 228 |
typedef DWORD RETURN_TYPE; |
| 229 |
typedef RETURN_TYPE CONFIGRET; |
| 230 |
|
| 231 |
#define CR_SUCCESS 0x00000000 |
| 232 |
|
| 233 |
/* Cfgmgr32 dependencies */ |
| 234 |
DLL_DECLARE_HANDLE(Cfgmgr32); |
| 235 |
DLL_DECLARE_FUNC(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG)); |
| 236 |
DLL_DECLARE_FUNC(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG)); |
| 237 |
|
| 238 |
/* AdvAPI32 dependencies */ |
| 239 |
DLL_DECLARE_HANDLE(AdvAPI32); |
| 240 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, LONG, p, RegQueryValueExA, (HKEY, LPCSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD)); |
| 241 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, LONG, p, RegCloseKey, (HKEY)); |
| 242 |
|
| 243 |
/* SetupAPI dependencies */ |
| 244 |
DLL_DECLARE_HANDLE(SetupAPI); |
| 245 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (LPCGUID, PCSTR, HWND, DWORD)); |
| 246 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA)); |
| 247 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInterfaces, (HDEVINFO, PSP_DEVINFO_DATA, |
| 248 |
LPCGUID, DWORD, PSP_DEVICE_INTERFACE_DATA)); |
| 249 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInstanceIdA, (HDEVINFO, PSP_DEVINFO_DATA, |
| 250 |
PCSTR, DWORD, PDWORD)); |
| 251 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInterfaceDetailA, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, |
| 252 |
PSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA)); |
| 253 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceRegistryPropertyA, (HDEVINFO, |
| 254 |
PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD)); |
| 255 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, BOOL, p, SetupDiDestroyDeviceInfoList, (HDEVINFO)); |
| 256 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDevRegKey, (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM)); |
| 257 |
DLL_DECLARE_FUNC_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDeviceInterfaceRegKey, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, DWORD, DWORD)); |
| 258 |
|
| 259 |
#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN |
| 260 |
|
| 261 |
#define USB_GET_NODE_INFORMATION 258 |
| 262 |
#define USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION 260 |
| 263 |
#define USB_GET_NODE_CONNECTION_INFORMATION_EX 274 |
| 264 |
#define USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 279 |
| 265 |
|
| 266 |
#define USB_CTL_CODE(id) \ |
| 267 |
CTL_CODE(FILE_DEVICE_USB, (id), METHOD_BUFFERED, FILE_ANY_ACCESS) |
| 268 |
|
| 269 |
#define IOCTL_USB_GET_NODE_INFORMATION \ |
| 270 |
USB_CTL_CODE(USB_GET_NODE_INFORMATION) |
| 271 |
|
| 272 |
#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ |
| 273 |
USB_CTL_CODE(USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION) |
| 274 |
|
| 275 |
#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ |
| 276 |
USB_CTL_CODE(USB_GET_NODE_CONNECTION_INFORMATION_EX) |
| 277 |
|
| 278 |
#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 \ |
| 279 |
USB_CTL_CODE(USB_GET_NODE_CONNECTION_INFORMATION_EX_V2) |
| 280 |
|
| 281 |
typedef enum _USB_CONNECTION_STATUS { |
| 282 |
NoDeviceConnected, |
| 283 |
DeviceConnected, |
| 284 |
DeviceFailedEnumeration, |
| 285 |
DeviceGeneralFailure, |
| 286 |
DeviceCausedOvercurrent, |
| 287 |
DeviceNotEnoughPower, |
| 288 |
DeviceNotEnoughBandwidth, |
| 289 |
DeviceHubNestedTooDeeply, |
| 290 |
DeviceInLegacyHub, |
| 291 |
DeviceEnumerating, |
| 292 |
DeviceReset |
| 293 |
} USB_CONNECTION_STATUS; |
| 294 |
|
| 295 |
typedef enum _USB_DEVICE_SPEED { |
| 296 |
UsbLowSpeed = 0, |
| 297 |
UsbFullSpeed, |
| 298 |
UsbHighSpeed, |
| 299 |
UsbSuperSpeed, |
| 300 |
UsbSuperSpeedPlus // Not in Microsoft headers |
| 301 |
} USB_DEVICE_SPEED; |
| 302 |
|
| 303 |
typedef enum _USB_HUB_NODE { |
| 304 |
UsbHub, |
| 305 |
UsbMIParent |
| 306 |
} USB_HUB_NODE; |
| 307 |
|
| 308 |
#if defined(_MSC_VER) |
| 309 |
// disable /W4 MSVC warnings that are benign |
| 310 |
#pragma warning(push) |
| 311 |
#pragma warning(disable:4214) // bit field types other than int |
| 312 |
#endif |
| 313 |
|
| 314 |
// Most of the structures below need to be packed |
| 315 |
#pragma pack(push, 1) |
| 316 |
|
| 317 |
typedef struct _USB_HUB_DESCRIPTOR { |
| 318 |
UCHAR bDescriptorLength; |
| 319 |
UCHAR bDescriptorType; |
| 320 |
UCHAR bNumberOfPorts; |
| 321 |
USHORT wHubCharacteristics; |
| 322 |
UCHAR bPowerOnToPowerGood; |
| 323 |
UCHAR bHubControlCurrent; |
| 324 |
UCHAR bRemoveAndPowerMask[64]; |
| 325 |
} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR; |
| 326 |
|
| 327 |
typedef struct _USB_HUB_INFORMATION { |
| 328 |
USB_HUB_DESCRIPTOR HubDescriptor; |
| 329 |
BOOLEAN HubIsBusPowered; |
| 330 |
} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; |
| 331 |
|
| 332 |
typedef struct _USB_NODE_INFORMATION { |
| 333 |
USB_HUB_NODE NodeType; |
| 334 |
union { |
| 335 |
USB_HUB_INFORMATION HubInformation; |
| 336 |
// USB_MI_PARENT_INFORMATION MiParentInformation; |
| 337 |
} u; |
| 338 |
} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; |
| 339 |
|
| 340 |
typedef struct _USB_DESCRIPTOR_REQUEST { |
| 341 |
ULONG ConnectionIndex; |
| 342 |
struct { |
| 343 |
UCHAR bmRequest; |
| 344 |
UCHAR bRequest; |
| 345 |
USHORT wValue; |
| 346 |
USHORT wIndex; |
| 347 |
USHORT wLength; |
| 348 |
} SetupPacket; |
| 349 |
// UCHAR Data[0]; |
| 350 |
} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; |
| 351 |
|
| 352 |
typedef struct _USB_CONFIGURATION_DESCRIPTOR_SHORT { |
| 353 |
USB_DESCRIPTOR_REQUEST req; |
| 354 |
USB_CONFIGURATION_DESCRIPTOR desc; |
| 355 |
} USB_CONFIGURATION_DESCRIPTOR_SHORT; |
| 356 |
|
| 357 |
typedef struct USB_INTERFACE_DESCRIPTOR { |
| 358 |
UCHAR bLength; |
| 359 |
UCHAR bDescriptorType; |
| 360 |
UCHAR bInterfaceNumber; |
| 361 |
UCHAR bAlternateSetting; |
| 362 |
UCHAR bNumEndpoints; |
| 363 |
UCHAR bInterfaceClass; |
| 364 |
UCHAR bInterfaceSubClass; |
| 365 |
UCHAR bInterfaceProtocol; |
| 366 |
UCHAR iInterface; |
| 367 |
} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR; |
| 368 |
|
| 369 |
typedef struct _USB_NODE_CONNECTION_INFORMATION_EX { |
| 370 |
ULONG ConnectionIndex; |
| 371 |
USB_DEVICE_DESCRIPTOR DeviceDescriptor; |
| 372 |
UCHAR CurrentConfigurationValue; |
| 373 |
UCHAR Speed; |
| 374 |
BOOLEAN DeviceIsHub; |
| 375 |
USHORT DeviceAddress; |
| 376 |
ULONG NumberOfOpenPipes; |
| 377 |
USB_CONNECTION_STATUS ConnectionStatus; |
| 378 |
// USB_PIPE_INFO PipeList[0]; |
| 379 |
} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX; |
| 380 |
|
| 381 |
typedef union _USB_PROTOCOLS { |
| 382 |
ULONG ul; |
| 383 |
struct { |
| 384 |
ULONG Usb110:1; |
| 385 |
ULONG Usb200:1; |
| 386 |
ULONG Usb300:1; |
| 387 |
ULONG ReservedMBZ:29; |
| 388 |
}; |
| 389 |
} USB_PROTOCOLS, *PUSB_PROTOCOLS; |
| 390 |
|
| 391 |
typedef union _USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS { |
| 392 |
ULONG ul; |
| 393 |
struct { |
| 394 |
ULONG DeviceIsOperatingAtSuperSpeedOrHigher:1; |
| 395 |
ULONG DeviceIsSuperSpeedCapableOrHigher:1; |
| 396 |
ULONG DeviceIsOperatingAtSuperSpeedPlusOrHigher:1; |
| 397 |
ULONG DeviceIsSuperSpeedPlusCapableOrHigher:1; |
| 398 |
ULONG ReservedMBZ:28; |
| 399 |
}; |
| 400 |
} USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS; |
| 401 |
|
| 402 |
typedef struct _USB_NODE_CONNECTION_INFORMATION_EX_V2 { |
| 403 |
ULONG ConnectionIndex; |
| 404 |
ULONG Length; |
| 405 |
USB_PROTOCOLS SupportedUsbProtocols; |
| 406 |
USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS Flags; |
| 407 |
} USB_NODE_CONNECTION_INFORMATION_EX_V2, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2; |
| 408 |
|
| 409 |
#pragma pack(pop) |
| 410 |
|
| 411 |
#if defined(_MSC_VER) |
| 412 |
// Restore original warnings |
| 413 |
#pragma warning(pop) |
| 414 |
#endif |
| 415 |
|
| 416 |
/* winusb.dll interface */ |
| 417 |
|
| 418 |
/* pipe policies */ |
| 419 |
#define SHORT_PACKET_TERMINATE 0x01 |
| 420 |
#define AUTO_CLEAR_STALL 0x02 |
| 421 |
#define PIPE_TRANSFER_TIMEOUT 0x03 |
| 422 |
#define IGNORE_SHORT_PACKETS 0x04 |
| 423 |
#define ALLOW_PARTIAL_READS 0x05 |
| 424 |
#define AUTO_FLUSH 0x06 |
| 425 |
#define RAW_IO 0x07 |
| 426 |
#define MAXIMUM_TRANSFER_SIZE 0x08 |
| 427 |
/* libusbK */ |
| 428 |
#define ISO_ALWAYS_START_ASAP 0x21 |
| 429 |
|
| 430 |
typedef struct _USBD_ISO_PACKET_DESCRIPTOR { |
| 431 |
ULONG Offset; |
| 432 |
ULONG Length; |
| 433 |
USBD_STATUS Status; |
| 434 |
} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; |
| 435 |
|
| 436 |
typedef enum _USBD_PIPE_TYPE { |
| 437 |
UsbdPipeTypeControl, |
| 438 |
UsbdPipeTypeIsochronous, |
| 439 |
UsbdPipeTypeBulk, |
| 440 |
UsbdPipeTypeInterrupt |
| 441 |
} USBD_PIPE_TYPE; |
| 442 |
|
| 443 |
typedef struct { |
| 444 |
USBD_PIPE_TYPE PipeType; |
| 445 |
UCHAR PipeId; |
| 446 |
USHORT MaximumPacketSize; |
| 447 |
UCHAR Interval; |
| 448 |
ULONG MaximumBytesPerInterval; |
| 449 |
} WINUSB_PIPE_INFORMATION_EX, *PWINUSB_PIPE_INFORMATION_EX; |
| 450 |
|
| 451 |
#pragma pack(push, 1) |
| 452 |
|
| 453 |
typedef struct _WINUSB_SETUP_PACKET { |
| 454 |
UCHAR RequestType; |
| 455 |
UCHAR Request; |
| 456 |
USHORT Value; |
| 457 |
USHORT Index; |
| 458 |
USHORT Length; |
| 459 |
} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET; |
| 460 |
|
| 461 |
#pragma pack(pop) |
| 462 |
|
| 463 |
typedef PVOID WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE; |
| 464 |
typedef PVOID WINUSB_ISOCH_BUFFER_HANDLE, *PWINUSB_ISOCH_BUFFER_HANDLE; |
| 465 |
|
| 466 |
typedef BOOL (WINAPI *WinUsb_AbortPipe_t)( |
| 467 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 468 |
UCHAR PipeID |
| 469 |
); |
| 470 |
typedef BOOL (WINAPI *WinUsb_ControlTransfer_t)( |
| 471 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 472 |
WINUSB_SETUP_PACKET SetupPacket, |
| 473 |
PUCHAR Buffer, |
| 474 |
ULONG BufferLength, |
| 475 |
PULONG LengthTransferred, |
| 476 |
LPOVERLAPPED Overlapped |
| 477 |
); |
| 478 |
typedef BOOL (WINAPI *WinUsb_FlushPipe_t)( |
| 479 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 480 |
UCHAR PipeID |
| 481 |
); |
| 482 |
typedef BOOL (WINAPI *WinUsb_Free_t)( |
| 483 |
WINUSB_INTERFACE_HANDLE InterfaceHandle |
| 484 |
); |
| 485 |
typedef BOOL (WINAPI *WinUsb_GetAssociatedInterface_t)( |
| 486 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 487 |
UCHAR AssociatedInterfaceIndex, |
| 488 |
PWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle |
| 489 |
); |
| 490 |
typedef BOOL (WINAPI *WinUsb_Initialize_t)( |
| 491 |
HANDLE DeviceHandle, |
| 492 |
PWINUSB_INTERFACE_HANDLE InterfaceHandle |
| 493 |
); |
| 494 |
typedef BOOL (WINAPI *WinUsb_QueryPipeEx_t)( |
| 495 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 496 |
UCHAR AlternateInterfaceHandle, |
| 497 |
UCHAR PipeIndex, |
| 498 |
PWINUSB_PIPE_INFORMATION_EX PipeInformationEx |
| 499 |
); |
| 500 |
typedef BOOL (WINAPI *WinUsb_ReadIsochPipeAsap_t)( |
| 501 |
PWINUSB_ISOCH_BUFFER_HANDLE BufferHandle, |
| 502 |
ULONG Offset, |
| 503 |
ULONG Length, |
| 504 |
BOOL ContinueStream, |
| 505 |
ULONG NumberOfPackets, |
| 506 |
PUSBD_ISO_PACKET_DESCRIPTOR IsoPacketDescriptors, |
| 507 |
LPOVERLAPPED Overlapped |
| 508 |
); |
| 509 |
typedef BOOL (WINAPI *WinUsb_ReadPipe_t)( |
| 510 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 511 |
UCHAR PipeID, |
| 512 |
PUCHAR Buffer, |
| 513 |
ULONG BufferLength, |
| 514 |
PULONG LengthTransferred, |
| 515 |
LPOVERLAPPED Overlapped |
| 516 |
); |
| 517 |
typedef BOOL (WINAPI *WinUsb_RegisterIsochBuffer_t)( |
| 518 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 519 |
UCHAR PipeID, |
| 520 |
PVOID Buffer, |
| 521 |
ULONG BufferLength, |
| 522 |
PWINUSB_ISOCH_BUFFER_HANDLE BufferHandle |
| 523 |
); |
| 524 |
typedef BOOL (WINAPI *WinUsb_ResetPipe_t)( |
| 525 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 526 |
UCHAR PipeID |
| 527 |
); |
| 528 |
typedef BOOL (WINAPI *WinUsb_SetCurrentAlternateSetting_t)( |
| 529 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 530 |
UCHAR AlternateSetting |
| 531 |
); |
| 532 |
typedef BOOL (WINAPI *WinUsb_SetPipePolicy_t)( |
| 533 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 534 |
UCHAR PipeID, |
| 535 |
ULONG PolicyType, |
| 536 |
ULONG ValueLength, |
| 537 |
PVOID Value |
| 538 |
); |
| 539 |
typedef BOOL (WINAPI *WinUsb_GetPipePolicy_t)( |
| 540 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 541 |
UCHAR PipeID, |
| 542 |
ULONG PolicyType, |
| 543 |
PULONG ValueLength, |
| 544 |
PVOID Value |
| 545 |
); |
| 546 |
typedef BOOL (WINAPI *WinUsb_UnregisterIsochBuffer_t)( |
| 547 |
WINUSB_ISOCH_BUFFER_HANDLE BufferHandle |
| 548 |
); |
| 549 |
typedef BOOL (WINAPI *WinUsb_WriteIsochPipeAsap_t)( |
| 550 |
WINUSB_ISOCH_BUFFER_HANDLE BufferHandle, |
| 551 |
ULONG Offset, |
| 552 |
ULONG Length, |
| 553 |
BOOL ContinueStream, |
| 554 |
LPOVERLAPPED Overlapped |
| 555 |
); |
| 556 |
typedef BOOL (WINAPI *WinUsb_WritePipe_t)( |
| 557 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 558 |
UCHAR PipeID, |
| 559 |
PUCHAR Buffer, |
| 560 |
ULONG BufferLength, |
| 561 |
PULONG LengthTransferred, |
| 562 |
LPOVERLAPPED Overlapped |
| 563 |
); |
| 564 |
|
| 565 |
/* /!\ These must match the ones from the official libusbk.h */ |
| 566 |
typedef enum _KUSB_FNID { |
| 567 |
KUSB_FNID_Init, |
| 568 |
KUSB_FNID_Free, |
| 569 |
KUSB_FNID_ClaimInterface, |
| 570 |
KUSB_FNID_ReleaseInterface, |
| 571 |
KUSB_FNID_SetAltInterface, |
| 572 |
KUSB_FNID_GetAltInterface, |
| 573 |
KUSB_FNID_GetDescriptor, |
| 574 |
KUSB_FNID_ControlTransfer, |
| 575 |
KUSB_FNID_SetPowerPolicy, |
| 576 |
KUSB_FNID_GetPowerPolicy, |
| 577 |
KUSB_FNID_SetConfiguration, |
| 578 |
KUSB_FNID_GetConfiguration, |
| 579 |
KUSB_FNID_ResetDevice, |
| 580 |
KUSB_FNID_Initialize, |
| 581 |
KUSB_FNID_SelectInterface, |
| 582 |
KUSB_FNID_GetAssociatedInterface, |
| 583 |
KUSB_FNID_Clone, |
| 584 |
KUSB_FNID_QueryInterfaceSettings, |
| 585 |
KUSB_FNID_QueryDeviceInformation, |
| 586 |
KUSB_FNID_SetCurrentAlternateSetting, |
| 587 |
KUSB_FNID_GetCurrentAlternateSetting, |
| 588 |
KUSB_FNID_QueryPipe, |
| 589 |
KUSB_FNID_SetPipePolicy, |
| 590 |
KUSB_FNID_GetPipePolicy, |
| 591 |
KUSB_FNID_ReadPipe, |
| 592 |
KUSB_FNID_WritePipe, |
| 593 |
KUSB_FNID_ResetPipe, |
| 594 |
KUSB_FNID_AbortPipe, |
| 595 |
KUSB_FNID_FlushPipe, |
| 596 |
KUSB_FNID_IsoReadPipe, |
| 597 |
KUSB_FNID_IsoWritePipe, |
| 598 |
KUSB_FNID_GetCurrentFrameNumber, |
| 599 |
KUSB_FNID_GetOverlappedResult, |
| 600 |
KUSB_FNID_GetProperty, |
| 601 |
KUSB_FNID_COUNT, |
| 602 |
} KUSB_FNID; |
| 603 |
|
| 604 |
typedef struct _KLIB_VERSION { |
| 605 |
INT Major; |
| 606 |
INT Minor; |
| 607 |
INT Micro; |
| 608 |
INT Nano; |
| 609 |
} KLIB_VERSION, *PKLIB_VERSION; |
| 610 |
|
| 611 |
typedef BOOL (WINAPI *LibK_GetProcAddress_t)( |
| 612 |
PVOID ProcAddress, |
| 613 |
INT DriverID, |
| 614 |
INT FunctionID |
| 615 |
); |
| 616 |
|
| 617 |
typedef VOID (WINAPI *LibK_GetVersion_t)( |
| 618 |
PKLIB_VERSION Version |
| 619 |
); |
| 620 |
|
| 621 |
typedef BOOL (WINAPI *LibK_ResetDevice_t)( |
| 622 |
WINUSB_INTERFACE_HANDLE InterfaceHandle |
| 623 |
); |
| 624 |
|
| 625 |
//KISO_PACKET is equivalent of libusb_iso_packet_descriptor except uses absolute "offset" field instead of sequential Lengths |
| 626 |
typedef struct _KISO_PACKET { |
| 627 |
UINT offset; |
| 628 |
USHORT actual_length; //changed from libusbk_shared.h "Length" for clarity |
| 629 |
USHORT status; |
| 630 |
} KISO_PACKET, *PKISO_PACKET; |
| 631 |
|
| 632 |
typedef enum _KISO_FLAG { |
| 633 |
KISO_FLAG_NONE = 0, |
| 634 |
KISO_FLAG_SET_START_FRAME = 0x00000001, |
| 635 |
} KISO_FLAG; |
| 636 |
|
| 637 |
//KISO_CONTEXT is the conceptual equivalent of libusb_transfer except is isochronous-specific and must match libusbk's version |
| 638 |
typedef struct _KISO_CONTEXT { |
| 639 |
KISO_FLAG Flags; |
| 640 |
UINT StartFrame; |
| 641 |
SHORT ErrorCount; |
| 642 |
SHORT NumberOfPackets; |
| 643 |
UINT UrbHdrStatus; |
| 644 |
KISO_PACKET IsoPackets[0]; |
| 645 |
} KISO_CONTEXT, *PKISO_CONTEXT; |
| 646 |
|
| 647 |
typedef BOOL(WINAPI *LibK_IsoReadPipe_t)( |
| 648 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 649 |
UCHAR PipeID, |
| 650 |
PUCHAR Buffer, |
| 651 |
ULONG BufferLength, |
| 652 |
LPOVERLAPPED Overlapped, |
| 653 |
PKISO_CONTEXT IsoContext |
| 654 |
); |
| 655 |
|
| 656 |
typedef BOOL(WINAPI *LibK_IsoWritePipe_t)( |
| 657 |
WINUSB_INTERFACE_HANDLE InterfaceHandle, |
| 658 |
UCHAR PipeID, |
| 659 |
PUCHAR Buffer, |
| 660 |
ULONG BufferLength, |
| 661 |
LPOVERLAPPED Overlapped, |
| 662 |
PKISO_CONTEXT IsoContext |
| 663 |
); |
| 664 |
|
| 665 |
struct winusb_interface { |
| 666 |
HMODULE hDll; |
| 667 |
WinUsb_AbortPipe_t AbortPipe; |
| 668 |
WinUsb_ControlTransfer_t ControlTransfer; |
| 669 |
WinUsb_FlushPipe_t FlushPipe; |
| 670 |
WinUsb_Free_t Free; |
| 671 |
WinUsb_GetAssociatedInterface_t GetAssociatedInterface; |
| 672 |
WinUsb_Initialize_t Initialize; |
| 673 |
WinUsb_ReadPipe_t ReadPipe; |
| 674 |
WinUsb_ResetPipe_t ResetPipe; |
| 675 |
WinUsb_SetCurrentAlternateSetting_t SetCurrentAlternateSetting; |
| 676 |
WinUsb_SetPipePolicy_t SetPipePolicy; |
| 677 |
WinUsb_GetPipePolicy_t GetPipePolicy; |
| 678 |
WinUsb_WritePipe_t WritePipe; |
| 679 |
union { |
| 680 |
struct { |
| 681 |
// Isochoronous functions for libusbK sub api: |
| 682 |
LibK_IsoReadPipe_t IsoReadPipe; |
| 683 |
LibK_IsoWritePipe_t IsoWritePipe; |
| 684 |
// Reset device function for libusbK sub api: |
| 685 |
LibK_ResetDevice_t ResetDevice; |
| 686 |
}; |
| 687 |
struct { |
| 688 |
// Isochronous functions for WinUSB sub api: |
| 689 |
WinUsb_QueryPipeEx_t QueryPipeEx; |
| 690 |
WinUsb_ReadIsochPipeAsap_t ReadIsochPipeAsap; |
| 691 |
WinUsb_RegisterIsochBuffer_t RegisterIsochBuffer; |
| 692 |
WinUsb_UnregisterIsochBuffer_t UnregisterIsochBuffer; |
| 693 |
WinUsb_WriteIsochPipeAsap_t WriteIsochPipeAsap; |
| 694 |
}; |
| 695 |
}; |
| 696 |
}; |
| 697 |
|
| 698 |
/* hid.dll interface */ |
| 699 |
|
| 700 |
#define HIDP_STATUS_SUCCESS 0x110000 |
| 701 |
typedef void * PHIDP_PREPARSED_DATA; |
| 702 |
|
| 703 |
#pragma pack(push, 1) |
| 704 |
|
| 705 |
typedef struct _HIDD_ATTIRBUTES { |
| 706 |
ULONG Size; |
| 707 |
USHORT VendorID; |
| 708 |
USHORT ProductID; |
| 709 |
USHORT VersionNumber; |
| 710 |
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; |
| 711 |
|
| 712 |
#pragma pack(pop) |
| 713 |
|
| 714 |
typedef USHORT USAGE; |
| 715 |
typedef struct _HIDP_CAPS { |
| 716 |
USAGE Usage; |
| 717 |
USAGE UsagePage; |
| 718 |
USHORT InputReportByteLength; |
| 719 |
USHORT OutputReportByteLength; |
| 720 |
USHORT FeatureReportByteLength; |
| 721 |
USHORT Reserved[17]; |
| 722 |
USHORT NumberLinkCollectionNodes; |
| 723 |
USHORT NumberInputButtonCaps; |
| 724 |
USHORT NumberInputValueCaps; |
| 725 |
USHORT NumberInputDataIndices; |
| 726 |
USHORT NumberOutputButtonCaps; |
| 727 |
USHORT NumberOutputValueCaps; |
| 728 |
USHORT NumberOutputDataIndices; |
| 729 |
USHORT NumberFeatureButtonCaps; |
| 730 |
USHORT NumberFeatureValueCaps; |
| 731 |
USHORT NumberFeatureDataIndices; |
| 732 |
} HIDP_CAPS, *PHIDP_CAPS; |
| 733 |
|
| 734 |
typedef enum _HIDP_REPORT_TYPE { |
| 735 |
HidP_Input, |
| 736 |
HidP_Output, |
| 737 |
HidP_Feature |
| 738 |
} HIDP_REPORT_TYPE; |
| 739 |
|
| 740 |
typedef struct _HIDP_VALUE_CAPS { |
| 741 |
USAGE UsagePage; |
| 742 |
UCHAR ReportID; |
| 743 |
BOOLEAN IsAlias; |
| 744 |
USHORT BitField; |
| 745 |
USHORT LinkCollection; |
| 746 |
USAGE LinkUsage; |
| 747 |
USAGE LinkUsagePage; |
| 748 |
BOOLEAN IsRange; |
| 749 |
BOOLEAN IsStringRange; |
| 750 |
BOOLEAN IsDesignatorRange; |
| 751 |
BOOLEAN IsAbsolute; |
| 752 |
BOOLEAN HasNull; |
| 753 |
UCHAR Reserved; |
| 754 |
USHORT BitSize; |
| 755 |
USHORT ReportCount; |
| 756 |
USHORT Reserved2[5]; |
| 757 |
ULONG UnitsExp; |
| 758 |
ULONG Units; |
| 759 |
LONG LogicalMin, LogicalMax; |
| 760 |
LONG PhysicalMin, PhysicalMax; |
| 761 |
union { |
| 762 |
struct { |
| 763 |
USAGE UsageMin, UsageMax; |
| 764 |
USHORT StringMin, StringMax; |
| 765 |
USHORT DesignatorMin, DesignatorMax; |
| 766 |
USHORT DataIndexMin, DataIndexMax; |
| 767 |
} Range; |
| 768 |
struct { |
| 769 |
USAGE Usage, Reserved1; |
| 770 |
USHORT StringIndex, Reserved2; |
| 771 |
USHORT DesignatorIndex, Reserved3; |
| 772 |
USHORT DataIndex, Reserved4; |
| 773 |
} NotRange; |
| 774 |
} u; |
| 775 |
} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS; |
| 776 |
|
| 777 |
DLL_DECLARE_HANDLE(hid); |
| 778 |
DLL_DECLARE_FUNC(WINAPI, VOID, HidD_GetHidGuid, (LPGUID)); |
| 779 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetAttributes, (HANDLE, PHIDD_ATTRIBUTES)); |
| 780 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetPreparsedData, (HANDLE, PHIDP_PREPARSED_DATA *)); |
| 781 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_FreePreparsedData, (PHIDP_PREPARSED_DATA)); |
| 782 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetManufacturerString, (HANDLE, PVOID, ULONG)); |
| 783 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetProductString, (HANDLE, PVOID, ULONG)); |
| 784 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetSerialNumberString, (HANDLE, PVOID, ULONG)); |
| 785 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetIndexedString, (HANDLE, ULONG, PVOID, ULONG)); |
| 786 |
DLL_DECLARE_FUNC(WINAPI, LONG, HidP_GetCaps, (PHIDP_PREPARSED_DATA, PHIDP_CAPS)); |
| 787 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_SetNumInputBuffers, (HANDLE, ULONG)); |
| 788 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetPhysicalDescriptor, (HANDLE, PVOID, ULONG)); |
| 789 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_FlushQueue, (HANDLE)); |
| 790 |
DLL_DECLARE_FUNC(WINAPI, BOOL, HidP_GetValueCaps, (HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PULONG, PHIDP_PREPARSED_DATA)); |
| 791 |
|
| 792 |
#endif |