This file is indexed.

/usr/i686-w64-mingw32/include/ddk/usbdlib.h is in mingw-w64-i686-dev 2.0.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#pragma once

#ifndef DECLSPEC_EXPORT
#define DECLSPEC_EXPORT __declspec(dllexport)
#endif

typedef struct _USBD_INTERFACE_LIST_ENTRY {
  PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
  PUSBD_INTERFACE_INFORMATION Interface;
} USBD_INTERFACE_LIST_ENTRY, *PUSBD_INTERFACE_LIST_ENTRY;

#define UsbBuildInterruptOrBulkTransferRequest(urb,length, pipeHandle, transferBuffer, transferBufferMDL, transferBufferLength, transferFlags, link) \
{												\
	(urb)->UrbHeader.Function = URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER;			\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbBulkOrInterruptTransfer.PipeHandle = (pipeHandle);				\
	(urb)->UrbBulkOrInterruptTransfer.TransferBufferLength = (transferBufferLength);	\
	(urb)->UrbBulkOrInterruptTransfer.TransferBufferMDL = (transferBufferMDL);		\
	(urb)->UrbBulkOrInterruptTransfer.TransferBuffer = (transferBuffer);			\
	(urb)->UrbBulkOrInterruptTransfer.TransferFlags = (transferFlags);			\
	(urb)->UrbBulkOrInterruptTransfer.UrbLink = (link);					\
}

#define UsbBuildGetDescriptorRequest(urb, length, descriptorType, descriptorIndex, languageId, transferBuffer, transferBufferMDL, transferBufferLength, link) \
{												\
	(urb)->UrbHeader.Function =  URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE;			\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbControlDescriptorRequest.TransferBufferLength = (transferBufferLength);	\
	(urb)->UrbControlDescriptorRequest.TransferBufferMDL = (transferBufferMDL);		\
	(urb)->UrbControlDescriptorRequest.TransferBuffer = (transferBuffer);			\
	(urb)->UrbControlDescriptorRequest.DescriptorType = (descriptorType);			\
	(urb)->UrbControlDescriptorRequest.Index = (descriptorIndex);				\
	(urb)->UrbControlDescriptorRequest.LanguageId = (languageId);				\
	(urb)->UrbControlDescriptorRequest.UrbLink = (link);					\
}

#define UsbBuildGetStatusRequest(urb, op, index, transferBuffer, transferBufferMDL, link)	\
{												\
	(urb)->UrbHeader.Function =  (op);							\
	(urb)->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_STATUS_REQUEST);		\
	(urb)->UrbControlGetStatusRequest.TransferBufferLength = sizeof(USHORT);		\
	(urb)->UrbControlGetStatusRequest.TransferBufferMDL = (transferBufferMDL);		\
	(urb)->UrbControlGetStatusRequest.TransferBuffer = (transferBuffer);			\
	(urb)->UrbControlGetStatusRequest.Index = (index);					\
	(urb)->UrbControlGetStatusRequest.UrbLink = (link);					\
}

#define UsbBuildFeatureRequest(urb, op, featureSelector, index, link)				\
{												\
	(urb)->UrbHeader.Function =  (op);							\
	(urb)->UrbHeader.Length = sizeof(struct _URB_CONTROL_FEATURE_REQUEST);			\
	(urb)->UrbControlFeatureRequest.FeatureSelector = (featureSelector);			\
	(urb)->UrbControlFeatureRequest.Index = (index);					\
	(urb)->UrbControlFeatureRequest.UrbLink = (link);					\
}

#define UsbBuildSelectConfigurationRequest(urb, length, configurationDescriptor)		\
{												\
	(urb)->UrbHeader.Function =  URB_FUNCTION_SELECT_CONFIGURATION;				\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbSelectConfiguration.ConfigurationDescriptor = (configurationDescriptor);	\
}

#define UsbBuildSelectInterfaceRequest(urb, length, configurationHandle, interfaceNumber, alternateSetting) \
{												\
	(urb)->UrbHeader.Function =  URB_FUNCTION_SELECT_INTERFACE;				\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbSelectInterface.Interface.AlternateSetting = (alternateSetting);		\
	(urb)->UrbSelectInterface.Interface.InterfaceNumber = (interfaceNumber);		\
	(urb)->UrbSelectInterface.Interface.Length =						\
		(length - sizeof(struct _URB_HEADER) - sizeof(USBD_CONFIGURATION_HANDLE));	\
	(urb)->UrbSelectInterface.ConfigurationHandle = (configurationHandle);			\
}

#define UsbBuildVendorRequest(urb, cmd, length, transferFlags, reservedbits, request, value, index, transferBuffer, transferBufferMDL, transferBufferLength, link) \
{												\
	(urb)->UrbHeader.Function =  cmd;							\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbControlVendorClassRequest.TransferBufferLength = (transferBufferLength);	\
	(urb)->UrbControlVendorClassRequest.TransferBufferMDL = (transferBufferMDL);		\
	(urb)->UrbControlVendorClassRequest.TransferBuffer = (transferBuffer);			\
	(urb)->UrbControlVendorClassRequest.RequestTypeReservedBits = (reservedbits);		\
	(urb)->UrbControlVendorClassRequest.Request = (request);				\
	(urb)->UrbControlVendorClassRequest.Value = (value);					\
	(urb)->UrbControlVendorClassRequest.Index = (index);					\
	(urb)->UrbControlVendorClassRequest.TransferFlags = (transferFlags);			\
	(urb)->UrbControlVendorClassRequest.UrbLink = (link);					\
}

#if (NTDDI_VERSION >= NTDDI_WINXP)

#define UsbBuildOsFeatureDescriptorRequest(urb, length, interface, index, transferBuffer, transferBufferMDL, transferBufferLength, link)  \
{												\
	(urb)->UrbHeader.Function = URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR;			\
	(urb)->UrbHeader.Length = (length);							\
	(urb)->UrbOSFeatureDescriptorRequest.TransferBufferLength = (transferBufferLength);	\
	(urb)->UrbOSFeatureDescriptorRequest.TransferBufferMDL = (transferBufferMDL);		\
	(urb)->UrbOSFeatureDescriptorRequest.TransferBuffer = (transferBuffer);			\
	(urb)->UrbOSFeatureDescriptorRequest.InterfaceNumber = (interface);			\
	(urb)->UrbOSFeatureDescriptorRequest.MS_FeatureDescriptorIndex = (index);		\
	(urb)->UrbOSFeatureDescriptorRequest.UrbLink = (link);					\
}

#endif	/* NTDDI_VERSION >= NTDDI_WINXP */

#define URB_STATUS(urb)					((urb)->UrbHeader.Status)

#define GET_SELECT_CONFIGURATION_REQUEST_SIZE(totalInterfaces, totalPipes)			\
	(sizeof(struct _URB_SELECT_CONFIGURATION) +						\
	  ((totalInterfaces-1) * sizeof(USBD_INTERFACE_INFORMATION)) +				\
	  ((totalPipes-totalInterfaces)*sizeof(USBD_PIPE_INFORMATION)))

#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes)						\
	(sizeof(struct _URB_SELECT_INTERFACE) +							\
	  ((totalPipes-1)*sizeof(USBD_PIPE_INFORMATION)))

#define GET_USBD_INTERFACE_SIZE(numEndpoints) (sizeof(USBD_INTERFACE_INFORMATION) +		\
	(sizeof(USBD_PIPE_INFORMATION)*(numEndpoints))						\
	  - sizeof(USBD_PIPE_INFORMATION))

#define  GET_ISO_URB_SIZE(n) (sizeof(struct _URB_ISOCH_TRANSFER)+				\
			      sizeof(USBD_ISO_PACKET_DESCRIPTOR)*n)

#ifndef _USBD_

DECLSPEC_IMPORT
VOID
NTAPI
USBD_GetUSBDIVersion(
  OUT PUSBD_VERSION_INFORMATION VersionInformation);

DECLSPEC_IMPORT
PUSB_INTERFACE_DESCRIPTOR
NTAPI
USBD_ParseConfigurationDescriptor(
  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  IN UCHAR InterfaceNumber,
  IN UCHAR AlternateSetting);

DECLSPEC_IMPORT
PURB
NTAPI
USBD_CreateConfigurationRequest(
  IN  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  OUT PUSHORT Siz);

DECLSPEC_IMPORT
PUSB_COMMON_DESCRIPTOR
NTAPI
USBD_ParseDescriptors(
  IN PVOID DescriptorBuffer,
  IN ULONG TotalLength,
  IN PVOID StartPosition,
  IN LONG DescriptorType);

DECLSPEC_IMPORT
PUSB_INTERFACE_DESCRIPTOR
NTAPI
USBD_ParseConfigurationDescriptorEx(
  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  IN PVOID StartPosition,
  IN LONG InterfaceNumber,
  IN LONG AlternateSetting,
  IN LONG InterfaceClass,
  IN LONG InterfaceSubClass,
  IN LONG InterfaceProtocol);

DECLSPEC_IMPORT
PURB
NTAPI
USBD_CreateConfigurationRequestEx(
  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  IN PUSBD_INTERFACE_LIST_ENTRY InterfaceList);

DECLSPEC_EXPORT
ULONG
NTAPI
USBD_GetInterfaceLength(
  IN PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
  IN PUCHAR BufferEnd);

DECLSPEC_EXPORT
VOID
NTAPI
USBD_RegisterHcFilter(
  IN PDEVICE_OBJECT DeviceObject,
  IN PDEVICE_OBJECT FilterDeviceObject);

DECLSPEC_EXPORT
NTSTATUS
NTAPI
USBD_GetPdoRegistryParameter(
  IN PDEVICE_OBJECT PhysicalDeviceObject,
  IN OUT PVOID Parameter,
  IN ULONG ParameterLength,
  IN PWSTR KeyName,
  IN ULONG KeyNameLength);

DECLSPEC_EXPORT
NTSTATUS
NTAPI
USBD_QueryBusTime(
  IN PDEVICE_OBJECT RootHubPdo,
  OUT PULONG CurrentFrame);

#if (NTDDI_VERSION >= NTDDI_WINXP)

DECLSPEC_IMPORT
ULONG
NTAPI
USBD_CalculateUsbBandwidth(
  IN ULONG MaxPacketSize,
  IN UCHAR EndpointType,
  IN BOOLEAN LowSpeed);

#endif

#if (NTDDI_VERSION >= NTDDI_VISTA)

DECLSPEC_IMPORT
USBD_STATUS
NTAPI
USBD_ValidateConfigurationDescriptor(
  IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
  IN ULONG BufferLength,
  IN USHORT Level,
  OUT PUCHAR *Offset,
  IN ULONG Tag OPTIONAL);

#endif

#endif /* ! _USBD_ */