7#if !defined(_WINDRVR_USB_H_)
12#if defined (i386) && defined(x86_64)
13#define PAD_TO_64(pName) DWORD dwPad_##pName;
15#define PAD_TO_64(pName)
19#if defined (i386) && defined(x86_64)
20#define PAD_TO_64_PTR_ARR(pName,size) PVOID ptPad_##pName[size];
22#define PAD_TO_64_PTR_ARR(pName, size)
26 #if !defined(__P_TYPES__)
30 typedef unsigned char UCHAR;
31 typedef unsigned short USHORT;
32 typedef unsigned int UINT;
33 typedef unsigned long ULONG;
36 typedef unsigned char *PBYTE;
39 typedef unsigned short *PWORD;
40 typedef u32 DWORD, *PDWORD;
41 typedef int PRCHANDLE;
60#define WD_USB_MAX_PIPE_NUMBER 32
61#define WD_USB_MAX_ENDPOINTS WD_USB_MAX_PIPE_NUMBER
62#define WD_USB_MAX_INTERFACES 30
63#define WD_USB_MAX_ALT_SETTINGS 255
93#define WDU_DEVICE_DESC_TYPE 0x01
94#define WDU_CONFIG_DESC_TYPE 0x02
95#define WDU_STRING_DESC_STRING 0x03
96#define WDU_INTERFACE_DESC_TYPE 0x04
97#define WDU_ENDPOINT_DESC_TYPE 0x05
100#define WDU_ENDPOINT_TYPE_MASK 0x03
101#define WDU_ENDPOINT_DIRECTION_MASK 0x80
102#define WDU_ENDPOINT_ADDRESS_MASK 0x0f
105#define WDU_ENDPOINT_DIRECTION_OUT(addr) \
106 (!((addr) & WDU_ENDPOINT_DIRECTION_MASK))
107#define WDU_ENDPOINT_DIRECTION_IN(addr) \
108 ((addr) & WDU_ENDPOINT_DIRECTION_MASK)
109#define WDU_GET_MAX_PACKET_SIZE(x) \
110 ((USHORT) (((x) & 0x7ff) * (1 + (((x) & 0x1800) >> 11))))
235 DWORD dwNumAltSettings;
435 DWORD dwBytesTransferred;
437 UCHAR SetupPacket[8];
WDU_INTERFACE_DESCRIPTOR Descriptor
Interface descriptor information structure.
UCHAR bDescriptorType
Configuration descriptor (0x02)
USHORT wTotalLength
Total length, in bytes, of data returned.
UCHAR bConfigurationValue
Configuration number.
UCHAR bLength
Size, in bytes, of the descriptor.
UCHAR bNumInterfaces
Number of interfaces.
UCHAR bmAttributes
Power settings for this configuration:
UCHAR iConfiguration
Index of string descriptor that describes this configuration.
WDU_INTERFACE * pInterfaces
Pointer to the beginning of an array of interface information structures for the configuration's inte...
DWORD dwNumInterfaces
Number of interfaces supported by this configuration.
WDU_CONFIGURATION_DESCRIPTOR Descriptor
Configuration descriptor information structure.
UCHAR bDescriptorType
Device descriptor (0x01)
UCHAR iManufacturer
Index of manufacturer string descriptor.
UCHAR bMaxPacketSize0
Maximum size of transferred packets.
UCHAR bNumConfigurations
Number of possible configurations.
USHORT idVendor
Vendor ID, as assigned by USB-IF.
UCHAR bDeviceSubClass
The device's sub-class.
UCHAR bLength
Size, in bytes, of the descriptor (18 bytes)
UCHAR iProduct
Index of product string descriptor.
USHORT idProduct
Product ID, as assigned by the product manufacturer.
UCHAR bDeviceClass
The device's class.
USHORT bcdDevice
Device release numbe.
UCHAR iSerialNumber
Index of serial number string descriptor.
UCHAR bDeviceProtocol
The device's protocol.
USHORT bcdUSB
Number of the USB specification with which the device complies.
WDU_CONFIGURATION * pConfigs
Pointer to the beginning of an array of configuration information structures describing the device's ...
WDU_DEVICE_DESCRIPTOR Descriptor
CDevice descriptor information structure.
WDU_PIPE_INFO Pipe0
Pipe information structure for the device's default control pipe (pipe 0)
UCHAR bInterval
Interval, in frame counts, for polling endpoint data transfers.
UCHAR bDescriptorType
Endpoint descriptor (0x05)
UCHAR bmAttributes
Specifies the transfer type for this endpoint (control, interrupt, isochronous or bulk).
USHORT wMaxPacketSize
Maximum size of packets this endpoint can send or receive.
UCHAR bLength
Size, in bytes, of the descriptor (7 bytes)
UCHAR bEndpointAddress
Endpoint address: Use bits 0–3 for endpoint number, set bits 4–6 to zero (0), and set bit 7 to zero (...
UCHAR bLength
Size, in bytes, of the descriptor (9 bytes)
UCHAR bInterfaceProtocol
The interface's protocol code, as assigned by USB-IF.
UCHAR bAlternateSetting
Alternate setting number.
UCHAR bInterfaceSubClass
The interface's sub-class code, as assigned by USB-IF.
UCHAR bInterfaceNumber
Interface number.
UCHAR bDescriptorType
Interface descriptor (0x04)
UCHAR bInterfaceClass
The interface's class code, as assigned by USB-IF.
UCHAR bNumEndpoints
Number of endpoints used by this interface.
UCHAR iInterface
Index of string descriptor that describes this interface.
WDU_ALTERNATE_SETTING * pAlternateSettings
Pointer to the beginning of an array of alternate setting information structures for the interface's ...
UCHAR bInterfaceProtocol
The interface's protocol code, as assigned by USB-IF (*)
UCHAR bInterfaceClass
The interface's class code, as assigned by USB-IF (*)
USHORT wProductId
Required USB Product ID to detect, as assigned by the product manufacturer (*)
UCHAR bDeviceSubClass
The device's sub-class code, as assigned by USB-IF (*)
USHORT wVendorId
Required USB Vendor ID to detect, as assigned by USB-IF (*)
UCHAR bInterfaceSubClass
The interface's sub-class code, as assigned by USB-IF (*)
UCHAR bDeviceClass
The device's class code, as assigned by USB-IF (*)
DWORD dwMaximumPacketSize
Maximum size of packets that can be transferred using this pipe.
DWORD type
Transfer type for this pipe.
DWORD dwInterval
Interval in milliseconds.
DWORD direction
Direction of the transfer:
DWORD dwNumber
Pipe number; zero for the default control pipe.
DWORD dwOptions
USB_TRANSFER options: USB_ISOCH_FULL_PACKETS_ONLY - For isochronous transfers only.
PVOID pBuffer
Pointer to buffer to read/write.
DWORD fRead
TRUE for read (IN) transfers; FALSE for write (OUT) transfers.
DWORD dwPipeNum
Pipe number on device.
WD_DEVICE_REGISTRY_PROPERTY
@ WdDevicePropertyInstallState
The device's installation state.
@ WdDevicePropertyHardwareID
The device's hardware IDs.
@ WdDevicePropertyEnumeratorName
The name of the device's enumerator (e.g., "PCI" or "root")
@ WdDevicePropertyCompatibleIDs
The device's compatible IDs.
@ WdDevicePropertyLegacyBusType
The bus type (e.g., PCIBus)
@ WdDevicePropertyFriendlyName
Friendly device name (typically defined by the class installer), which can be used to distinguish bet...
@ WdDevicePropertyClassName
The name of the device's setup class, in text format.
@ WdDevicePropertyBootConfigurationTranslated
The hardware resources assigned to the device by the firmware, in translated form.
@ WdDevicePropertyBusNumber
The legacy bus number of the bus to which the device is connected.
@ WdDevicePropertyManufacturer
Device manufacturer string.
@ WdDevicePropertyUINumber
A number associated with the device that can be displayed in the user interface.
@ WdDevicePropertyBootConfiguration
The hardware resources assigned to the device by the firmware, in raw data form.
@ WdDevicePropertyClassGuid
The GUID for the device's setup class (string format)
@ WdDevicePropertyLocationInformation
Information about the device's Location on the bus (string format).
@ WdDevicePropertyDeviceDescription
Device description.
@ WdDevicePropertyAddress
The device's bus address.
@ WdDevicePropertyRemovalPolicy
The device's current removal policy (Windows)
@ WdDevicePropertyBusTypeGuid
The GUID for the bus to which the device is connected.
@ WdDevicePropertyPhysicalDeviceObjectName
The name of the Physical Device Object (PDO) for the device.
@ WdDevicePropertyDriverKeyName
The name of the driver-specific registry key.
WDU_SELECTIVE_SUSPEND_OPTIONS
@ WDU_SELECTIVE_SUSPEND_SUBMIT
@ WDU_SELECTIVE_SUSPEND_CANCEL
@ USB_STREAM_OVERWRITE_BUFFER_WHEN_FULL
@ USB_ISOCH_FULL_PACKETS_ONLY
@ USB_BULK_INT_URB_SIZE_OVERRIDE_128K
PVOID WDU_REGISTER_DEVICES_HANDLE
#define PAD_TO_64_PTR_ARR(pName, size)
#define WD_USB_MAX_INTERFACES