ReactOS  0.4.14-dev-50-g13bb5e2
usbd.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Universal Serial Bus Driver/Helper Library
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: drivers/usb/usbd/usbd.c
5  * PURPOSE: Helper Library for USB
6  * PROGRAMMERS:
7  * Filip Navara <xnavara@volny.cz>
8  * Michael Martin <michael.martin@reactos.org>
9  *
10  */
11 
12 /*
13  * Universal Serial Bus Driver/Helper Library
14  *
15  * Written by Filip Navara <xnavara@volny.cz>
16  *
17  * Notes:
18  * This driver was obsoleted in Windows XP and most functions
19  * became pure stubs. But some of them were retained for backward
20  * compatibility with existing drivers.
21  *
22  * Preserved functions:
23  *
24  * USBD_Debug_GetHeap (implemented)
25  * USBD_Debug_RetHeap (implemented)
26  * USBD_CalculateUsbBandwidth (implemented, tested)
27  * USBD_CreateConfigurationRequestEx (implemented)
28  * USBD_CreateConfigurationRequest
29  * USBD_GetInterfaceLength (implemented)
30  * USBD_ParseConfigurationDescriptorEx (implemented)
31  * USBD_ParseDescriptors (implemented)
32  * USBD_GetPdoRegistryParameters (implemented)
33  */
34 
35 #define _USBD_
36 #define NDEBUG
37 #include <ntddk.h>
38 #include <usbdi.h>
39 #include <usbdlib.h>
40 #include <debug.h>
41 #ifndef PLUGPLAY_REGKEY_DRIVER
42 #define PLUGPLAY_REGKEY_DRIVER 2
43 #endif
44 
48 {
49  return STATUS_SUCCESS;
50 }
51 
52 /*
53  * @implemented
54  */
57 {
58  return 0;
59 }
60 
61 /*
62  * @implemented
63  */
66 {
67  return 0;
68 }
69 
70 /*
71  * @implemented
72  */
75  ULONG Tag)
76 {
78 }
79 
80 /*
81  * @implemented
82  */
83 VOID NTAPI
85 {
86  ExFreePool(Heap);
87 }
88 
89 /*
90  * @implemented
91  */
92 VOID NTAPI
94  ULONG_PTR Info3)
95 {
96 }
97 
98 /*
99  * @implemented
100  */
101 PVOID NTAPI
103 {
105  return NULL;
106 }
107 
108 /*
109  * @implemented
110  */
111 ULONG NTAPI
113  ULONG MaxPacketSize,
116  )
117 {
118  ULONG OverheadTable[] = {
119  0x00, /* UsbdPipeTypeControl */
120  0x09, /* UsbdPipeTypeIsochronous */
121  0x00, /* UsbdPipeTypeBulk */
122  0x0d /* UsbdPipeTypeInterrupt */
123  };
124  ULONG Result;
125 
126  if (OverheadTable[EndpointType] != 0)
127  {
128  Result = ((MaxPacketSize + OverheadTable[EndpointType]) * 8 * 7) / 6;
129  if (LowSpeed)
130  return Result << 3;
131  return Result;
132  }
133  return 0;
134 }
135 
136 /*
137  * @implemented
138  */
139 ULONG NTAPI
141 {
143  return 1;
144 }
145 
146 /*
147  * @implemented
148  */
149 VOID NTAPI
151 {
153 }
154 
155 /*
156  * @implemented
157  */
158 VOID NTAPI
160 {
162 }
163 
164 /*
165  * @implemented
166  */
167 VOID NTAPI
169 {
171 }
172 
173 /*
174  * @implemented
175  */
176 ULONG NTAPI
178 {
180  return 0;
181 }
182 
183 /*
184  * @implemented
185  */
189 {
191  return STATUS_NOT_SUPPORTED;
192 }
193 
194 /*
195  * @implemented
196  */
200  ULONG Unknown8, ULONG Unknown9, ULONG Unknown10)
201 {
203  return STATUS_NOT_SUPPORTED;
204 }
205 
206 /*
207  * @implemented
208  */
211 {
213  return STATUS_NOT_SUPPORTED;
214 }
215 
216 /*
217  * @implemented
218  */
222 {
224  return STATUS_NOT_SUPPORTED;
225 }
226 
227 /*
228  * @implemented
229  */
232 {
234  return STATUS_NOT_SUPPORTED;
235 }
236 
237 /*
238  * @implemented
239  */
240 VOID NTAPI
241 USBD_CompleteRequest(ULONG Unknown1, ULONG Unknown2)
242 {
244 }
245 
246 /*
247  * @implemented
248  */
249 VOID NTAPI
253  )
254 {
256 }
257 
258 /*
259  * @implemented
260  */
261 VOID NTAPI
263 {
265 }
266 
267 /*
268  * @implemented
269  */
271 USBD_MakePdoName(ULONG Unknown1, ULONG Unknown2)
272 {
274  return STATUS_NOT_SUPPORTED;
275 }
276 
277 /*
278  * @implemented
279  */
282  PDEVICE_OBJECT RootHubPdo,
283  PULONG CurrentFrame
284  )
285 {
287  return STATUS_NOT_SUPPORTED;
288 }
289 
290 /*
291  * @implemented
292  */
293 VOID NTAPI
296  )
297 {
298  if (Version != NULL)
299  {
300  Version->USBDI_Version = USBDI_VERSION;
301  Version->Supported_USB_Version = 0x200;
302  }
303 }
304 
305 /*
306  * @implemented
307  */
310 {
312  return STATUS_NOT_SUPPORTED;
313 }
314 
315 /*
316  * @implemented
317  */
318 VOID NTAPI
320  ULONG Unknown3)
321 {
323 }
324 
325 /*
326  * @implemented
327  */
328 PURB NTAPI
330  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
332  )
333 {
334  PURB Urb;
335  ULONG UrbSize = 0;
336  ULONG InterfaceCount = 0, PipeCount = 0;
337  ULONG InterfaceNumber, EndPointNumber;
338  PUSBD_INTERFACE_INFORMATION InterfaceInfo;
339 
340  while(InterfaceList[InterfaceCount].InterfaceDescriptor)
341  {
342  // pipe count
343  PipeCount += InterfaceList[InterfaceCount].InterfaceDescriptor->bNumEndpoints;
344 
345  // interface count
346  InterfaceCount++;
347  }
348 
349  // size of urb
350  UrbSize = GET_SELECT_CONFIGURATION_REQUEST_SIZE(InterfaceCount, PipeCount);
351 
352  // allocate urb
353  Urb = ExAllocatePool(NonPagedPool, UrbSize);
354  if (!Urb)
355  {
356  // no memory
357  return NULL;
358  }
359 
360  // zero urb
361  RtlZeroMemory(Urb, UrbSize);
362 
363  // init urb header
365  Urb->UrbSelectConfiguration.Hdr.Length = UrbSize;
366  Urb->UrbSelectConfiguration.ConfigurationDescriptor = ConfigurationDescriptor;
367 
368  // init interface information
369  InterfaceInfo = &Urb->UrbSelectConfiguration.Interface;
370  for (InterfaceNumber = 0; InterfaceNumber < InterfaceCount; InterfaceNumber++)
371  {
372  // init interface info
373  InterfaceList[InterfaceNumber].Interface = InterfaceInfo;
377 
378  // store length
379  InterfaceInfo->Length = GET_USBD_INTERFACE_SIZE(InterfaceList[InterfaceNumber].InterfaceDescriptor->bNumEndpoints);
380 
381  // sanity check
382  //C_ASSERT(FIELD_OFFSET(USBD_INTERFACE_INFORMATION, Pipes) == 16);
383 
384  for (EndPointNumber = 0; EndPointNumber < InterfaceInfo->NumberOfPipes; EndPointNumber++)
385  {
386  // init max transfer size
387  InterfaceInfo->Pipes[EndPointNumber].MaximumTransferSize = PAGE_SIZE;
388  }
389 
390  // next interface info
391  InterfaceInfo = (PUSBD_INTERFACE_INFORMATION) ((ULONG_PTR)InterfaceInfo + InterfaceInfo->Length);
392  }
393 
394  return Urb;
395 }
396 
397 /*
398  * @implemented
399  */
400 PURB NTAPI
402  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
403  PUSHORT Size
404  )
405 {
406  /* WindowsXP returns NULL */
407  return NULL;
408 }
409 
410 /*
411  * @implemented
412  */
413 ULONG NTAPI
415  PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
417  )
418 {
419  ULONG_PTR Current;
420  PUSB_INTERFACE_DESCRIPTOR CurrentDescriptor = InterfaceDescriptor;
421  ULONG Length = 0;
422  BOOLEAN InterfaceFound = FALSE;
423 
424  for (Current = (ULONG_PTR)CurrentDescriptor;
425  Current < (ULONG_PTR)BufferEnd;
426  Current += CurrentDescriptor->bLength)
427  {
428  CurrentDescriptor = (PUSB_INTERFACE_DESCRIPTOR)Current;
429 
430  if ((CurrentDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE) && (InterfaceFound))
431  break;
432  else if (CurrentDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE)
433  InterfaceFound = TRUE;
434 
435  Length += CurrentDescriptor->bLength;
436  }
437 
438  return Length;
439 }
440 
441 /*
442  * @implemented
443  */
446  PVOID DescriptorBuffer,
450  )
451 {
452  PUSB_COMMON_DESCRIPTOR CommonDescriptor;
453 
454  /* use start position */
455  CommonDescriptor = (PUSB_COMMON_DESCRIPTOR)StartPosition;
456 
457 
458  /* find next available descriptor */
459  while(CommonDescriptor)
460  {
461  if ((ULONG_PTR)CommonDescriptor >= ((ULONG_PTR)DescriptorBuffer + TotalLength))
462  {
463  /* end reached */
464  DPRINT("End reached %p\n", CommonDescriptor);
465  return NULL;
466  }
467 
468  DPRINT("CommonDescriptor Type %x Length %x\n", CommonDescriptor->bDescriptorType, CommonDescriptor->bLength);
469 
470  /* is the requested one */
471  if (CommonDescriptor->bDescriptorType == DescriptorType)
472  {
473  /* it is */
474  return CommonDescriptor;
475  }
476 
477  if (CommonDescriptor->bLength == 0)
478  {
479  /* invalid usb descriptor */
480  return NULL;
481  }
482 
483  /* move to next descriptor */
484  CommonDescriptor = (PUSB_COMMON_DESCRIPTOR)((ULONG_PTR)CommonDescriptor + CommonDescriptor->bLength);
485  }
486 
487  /* no descriptor found */
488  return NULL;
489 }
490 
491 
492 /*
493  * @implemented
494  */
497  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
504  )
505 {
506  BOOLEAN Found;
507  PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
508 
509  /* set to start position */
510  InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)StartPosition;
511 
512  DPRINT("USBD_ParseConfigurationDescriptorEx\n");
513  DPRINT("ConfigurationDescriptor %p Length %lu\n", ConfigurationDescriptor, ConfigurationDescriptor->wTotalLength);
514  DPRINT("CurrentOffset %p Offset %lu\n", StartPosition, ((ULONG_PTR)StartPosition - (ULONG_PTR)ConfigurationDescriptor));
515 
516  while(InterfaceDescriptor)
517  {
518  /* get interface descriptor */
519  InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR) USBD_ParseDescriptors(ConfigurationDescriptor, ConfigurationDescriptor->wTotalLength, InterfaceDescriptor, USB_INTERFACE_DESCRIPTOR_TYPE);
520  if (!InterfaceDescriptor)
521  {
522  /* no more descriptors available */
523  break;
524  }
525 
526  DPRINT("InterfaceDescriptor %p InterfaceNumber %x AlternateSetting %x Length %lu\n", InterfaceDescriptor, InterfaceDescriptor->bInterfaceNumber, InterfaceDescriptor->bAlternateSetting, InterfaceDescriptor->bLength);
527 
528  /* set found */
529  Found = TRUE;
530 
531  /* is there an interface number provided */
532  if(InterfaceNumber != -1)
533  {
534  if(InterfaceNumber != InterfaceDescriptor->bInterfaceNumber)
535  {
536  /* interface number does not match */
537  Found = FALSE;
538  }
539  }
540 
541  /* is there an alternate setting provided */
542  if(AlternateSetting != -1)
543  {
544  if(AlternateSetting != InterfaceDescriptor->bAlternateSetting)
545  {
546  /* alternate setting does not match */
547  Found = FALSE;
548  }
549  }
550 
551  /* match on interface class */
552  if(InterfaceClass != -1)
553  {
554  if(InterfaceClass != InterfaceDescriptor->bInterfaceClass)
555  {
556  /* no match with interface class criteria */
557  Found = FALSE;
558  }
559  }
560 
561  /* match on interface sub class */
562  if(InterfaceSubClass != -1)
563  {
564  if(InterfaceSubClass != InterfaceDescriptor->bInterfaceSubClass)
565  {
566  /* no interface sub class match */
567  Found = FALSE;
568  }
569  }
570 
571  /* interface protocol criteria */
572  if(InterfaceProtocol != -1)
573  {
574  if(InterfaceProtocol != InterfaceDescriptor->bInterfaceProtocol)
575  {
576  /* no interface protocol match */
577  Found = FALSE;
578  }
579  }
580 
581  if (Found)
582  {
583  /* the chosen one */
584  return InterfaceDescriptor;
585  }
586 
587  /* sanity check */
588  ASSERT(InterfaceDescriptor->bLength);
589 
590  /* move to next descriptor */
591  InterfaceDescriptor = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength);
592  }
593 
594  DPRINT("No Descriptor With InterfaceNumber %ld AlternateSetting %ld InterfaceClass %ld InterfaceSubClass %ld InterfaceProtocol %ld found\n", InterfaceNumber,
596 
597  return NULL;
598 }
599 
600 /*
601  * @implemented
602  */
605  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
608  )
609 {
610  return USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor,
611  (PVOID)ConfigurationDescriptor, InterfaceNumber, AlternateSetting,
612  -1, -1, -1);
613 }
614 
615 
616 /*
617  * @implemented
618  */
619 ULONG NTAPI
624  PWCHAR KeyName,
626  )
627 {
630 
631  /* Open the device key */
634  if (NT_SUCCESS(Status))
635  {
636  PKEY_VALUE_PARTIAL_INFORMATION PartialInfo;
638  ULONG Length;
639 
640  /* Initialize the unicode string based on caller data */
643 
645  PartialInfo = ExAllocatePool(PagedPool, Length);
646  if (PartialInfo)
647  {
648  Status = ZwQueryValueKey(DevInstRegKey, &ValueName,
649  KeyValuePartialInformation, PartialInfo, Length, &Length);
651  {
652  /* The caller doesn't want all the data */
653  ExFreePool(PartialInfo);
654  PartialInfo = ExAllocatePool(PagedPool, Length);
655  if (PartialInfo)
656  {
657  Status = ZwQueryValueKey(DevInstRegKey, &ValueName,
658  KeyValuePartialInformation, PartialInfo, Length, &Length);
659  }
660  else
661  {
663  }
664  }
665 
666  if (NT_SUCCESS(Status))
667  {
668  /* Compute the length to copy back */
669  if (ParameterLength < PartialInfo->DataLength)
671  else
672  Length = PartialInfo->DataLength;
673 
675  PartialInfo->Data,
676  Length);
677  }
678 
679  if (PartialInfo)
680  {
681  ExFreePool(PartialInfo);
682  }
683  } else
686  }
687  return Status;
688 }
NTSTATUS NTAPI USBD_CreateDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4, ULONG Unknown5)
Definition: usbd.c:220
signed char * PCHAR
Definition: retypes.h:7
PVOID NTAPI USBD_AllocateDeviceName(ULONG Unknown)
Definition: usbd.c:102
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
VOID NTAPI USBD_Debug_LogEntry(PCHAR Name, ULONG_PTR Info1, ULONG_PTR Info2, ULONG_PTR Info3)
Definition: usbd.c:93
NTSTATUS NTAPI USBD_RemoveDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
Definition: usbd.c:231
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:359
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:35
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define PLUGPLAY_REGKEY_DEVICE
Definition: iofuncs.h:2738
_In_ PVOID _In_ LONG _In_ LONG AlternateSetting
Definition: usbdlib.h:155
VOID NTAPI USBD_FreeDeviceMutex(PVOID Unknown)
Definition: usbd.c:150
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ PVOID _In_ LONG _In_ LONG _In_ LONG _In_ LONG InterfaceSubClass
Definition: usbdlib.h:155
#define USBDI_VERSION
Definition: usb.h:43
unsigned char * PUCHAR
Definition: retypes.h:3
USBD_PIPE_INFORMATION Pipes[1]
Definition: usb.h:286
_In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbdlib.h:168
LONG NTSTATUS
Definition: precomp.h:26
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD IN DWORD Unknown6
Definition: conport.c:35
VOID NTAPI USBD_SetSuspendPowerState(ULONG Unknown1, ULONG Unknown2)
Definition: usbd.c:262
_In_ UCHAR _In_ BOOLEAN LowSpeed
Definition: usbdlib.h:212
ULONG NTAPI USBD_GetInterfaceLength(PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, PUCHAR BufferEnd)
Definition: usbd.c:414
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
uint16_t * PWCHAR
Definition: typedefs.h:54
VOID NTAPI USBD_GetUSBDIVersion(PUSBD_VERSION_INFORMATION Version)
Definition: usbd.c:294
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1114
_In_ PVOID Parameter
Definition: ldrtypes.h:241
PUSB_INTERFACE_DESCRIPTOR NTAPI USBD_ParseConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, UCHAR InterfaceNumber, UCHAR AlternateSetting)
Definition: usbd.c:604
_In_ ULONG TotalLength
Definition: usbdlib.h:145
VOID NTAPI USBD_FreeDeviceName(PVOID Unknown)
Definition: usbd.c:159
VOID NTAPI USBD_RegisterHcFilter(PDEVICE_OBJECT DeviceObject, PDEVICE_OBJECT FilterDeviceObject)
Definition: usbd.c:250
ULONG NTAPI USBD_CalculateUsbBandwidth(ULONG MaxPacketSize, UCHAR EndpointType, BOOLEAN LowSpeed)
Definition: usbd.c:112
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
NTSTATUS NTAPI USBD_MakePdoName(ULONG Unknown1, ULONG Unknown2)
Definition: usbd.c:271
uint32_t ULONG_PTR
Definition: typedefs.h:63
Definition: usbdlib.h:7
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
ULONG NTAPI USBD_GetPdoRegistryParameter(PDEVICE_OBJECT PhysicalDeviceObject, PVOID Parameter, ULONG ParameterLength, PWCHAR KeyName, ULONG KeyNameLength)
Definition: usbd.c:620
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
VOID NTAPI USBD_WaitDeviceMutex(PVOID Unknown)
Definition: usbd.c:168
_In_ UCHAR EndpointType
Definition: usbdlib.h:212
VOID NTAPI USBD_CompleteRequest(ULONG Unknown1, ULONG Unknown2)
Definition: usbd.c:241
PURB NTAPI USBD_CreateConfigurationRequest(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSHORT Size)
Definition: usbd.c:401
unsigned char BOOLEAN
#define USB_INTERFACE_DESCRIPTOR_TYPE
Definition: usb100.h:52
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
#define GET_SELECT_CONFIGURATION_REQUEST_SIZE(totalInterfaces, totalPipes)
Definition: usbdlib.h:99
return Found
Definition: dirsup.c:1270
_In_ PDEVICE_OBJECT FilterDeviceObject
Definition: usbdlib.h:184
_In_ PVOID _In_ LONG InterfaceNumber
Definition: usbdlib.h:155
PUSB_INTERFACE_DESCRIPTOR NTAPI USBD_ParseConfigurationDescriptorEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PVOID StartPosition, LONG InterfaceNumber, LONG AlternateSetting, LONG InterfaceClass, LONG InterfaceSubClass, LONG InterfaceProtocol)
Definition: usbd.c:496
NTSTATUS NTAPI USBD_QueryBusTime(PDEVICE_OBJECT RootHubPdo, PULONG CurrentFrame)
Definition: usbd.c:281
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PVOID _In_ LONG _In_ LONG _In_ LONG _In_ LONG _In_ LONG InterfaceProtocol
Definition: usbdlib.h:155
INT POOL_TYPE
Definition: typedefs.h:76
struct _USB_COMMON_DESCRIPTOR * PUSB_COMMON_DESCRIPTOR
PUSB_COMMON_DESCRIPTOR NTAPI USBD_ParseDescriptors(PVOID DescriptorBuffer, ULONG TotalLength, PVOID StartPosition, LONG DescriptorType)
Definition: usbd.c:445
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG NTAPI USBD_Dispatch(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4)
Definition: usbd.c:140
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define GET_USBD_INTERFACE_SIZE(numEndpoints)
Definition: usbdlib.h:108
ULONG NTAPI DllInitialize(ULONG Unknown)
Definition: usbd.c:56
ULONG MaximumTransferSize
Definition: usb.h:265
unsigned char UCHAR
Definition: xmlstorage.h:181
#define URB_FUNCTION_SELECT_CONFIGURATION
Definition: usb.h:86
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define PAGE_SIZE
Definition: env_spec_w32.h:49
_In_ ULONG ParameterLength
Definition: usbdlib.h:193
ULONG NTAPI USBD_GetSuspendPowerState(ULONG Unknown1)
Definition: usbd.c:177
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: usbd.c:46
_In_ ULONG _In_ ULONG KeyNameLength
Definition: usbdlib.h:195
_In_ PUCHAR BufferEnd
Definition: usbdlib.h:176
_In_ ULONG _In_ ACCESS_MASK _Out_ PHANDLE DevInstRegKey
Definition: iofuncs.h:1123
Status
Definition: gdiplustypes.h:24
_In_ ULONG _In_ PVOID StartPosition
Definition: usbdlib.h:145
NTSTATUS NTAPI USBD_RestoreDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
Definition: usbd.c:309
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
Definition: usb.h:533
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
Definition: usbdlib.h:8
Definition: usb.h:529
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
VOID NTAPI USBD_Debug_RetHeap(PVOID Heap, ULONG Unknown2, ULONG Unknown3)
Definition: usbd.c:84
PVOID NTAPI USBD_Debug_GetHeap(ULONG Unknown1, POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag)
Definition: usbd.c:74
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS NTAPI USBD_InitializeDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4, ULONG Unknown5, ULONG Unknown6)
Definition: usbd.c:187
_In_ PVOID _In_ LONG _In_ LONG _In_ LONG InterfaceClass
Definition: usbdlib.h:155
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
Definition: pnpmgr.c:4583
PUSBD_INTERFACE_INFORMATION Interface
Definition: usbdlib.h:9
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
VOID NTAPI USBD_RegisterHcDeviceCapabilities(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
Definition: usbd.c:319
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:998
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
ULONG NTAPI DllUnload(VOID)
Definition: usbd.c:65
#define UNIMPLEMENTED
Definition: debug.h:114
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
NTSTATUS NTAPI USBD_RegisterHostController(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4, ULONG Unknown5, ULONG Unknown6, ULONG Unknown7, ULONG Unknown8, ULONG Unknown9, ULONG Unknown10)
Definition: usbd.c:198
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
Definition: conport.c:35
PURB NTAPI USBD_CreateConfigurationRequestEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSBD_INTERFACE_LIST_ENTRY InterfaceList)
Definition: usbd.c:329
return STATUS_SUCCESS
Definition: btrfs.c:2966
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
Definition: usbdlib.h:145
unsigned short * PUSHORT
Definition: retypes.h:2
NTSTATUS NTAPI USBD_GetDeviceInformation(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
Definition: usbd.c:210
#define ExFreePool(addr)
Definition: env_spec_w32.h:352