ReactOS  0.4.15-dev-3441-g67ad4e7
fxusbdeviceapi.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxUsbDeviceAPI.cpp
8 
9 Abstract:
10 
11 
12 Author:
13 
14 Environment:
15 
16  Both kernel and user mode
17 
18 Revision History:
19 
20 --*/
21 
22 #include "fxusbpch.hpp"
23 
24 extern "C" {
25 #include "FxUsbDeviceAPI.tmh"
26 }
27 
28 //
29 // Extern "C" all APIs
30 //
31 extern "C" {
32 
36 WDFAPI
38  __in
39  PFX_DRIVER_GLOBALS FxDriverGlobals,
40  __in
42  __in
44  __in_opt
46  __out
47  WDFUSBDEVICE* UsbDevice
48  )
49 /*++
50 
51 Routine Description:
52  Creates a WDFUSBDEVICE handle for the client.
53 
54 Arguments:
55 
56  Device - FxDeviceBase object
57 
58  USBDClientContractVersion - The USBD Client Contract version of the client driver
59 
60  UsbDevice - Pointer which will receive the created handle
61 
62 Return Value:
63  STATUS_SUCCESS - success
64  STATUS_INSUFFICIENT_RESOURCES - no memory available
65  ...
66 
67  --*/
68 {
71 
72  //
73  // Basic parameter validation
74  //
75 
76  FxPointerNotNull(FxDriverGlobals, UsbDevice);
77  *UsbDevice = NULL;
78 
79  status = FxVerifierCheckIrqlLevel(FxDriverGlobals, PASSIVE_LEVEL);
80  if (!NT_SUCCESS(status)) {
81  return status;
82  }
83 
84  status = FxValidateObjectAttributes(FxDriverGlobals,
85  Attributes,
87  if (!NT_SUCCESS(status)) {
88  return status;
89  }
90 
91  pUsbDevice = new(FxDriverGlobals, Attributes) FxUsbDevice(FxDriverGlobals);
92  if (pUsbDevice == NULL) {
94  }
95 
96  //
97  // Perform all init and handle creation functions. Check for error at the
98  // end and clean up there.
99  //
100  status = pUsbDevice->Init(Device);
101 
104 
105  device = NULL;
106 
108 
109  if (NT_SUCCESS(status)) {
110  status = pUsbDevice->CreateInterfaces();
111  }
112 
113  if (NT_SUCCESS(status)) {
114  status = Device->AddIoTarget(pUsbDevice);
115  }
116 
117  if (NT_SUCCESS(status)) {
118  status = pUsbDevice->Commit(Attributes, &device, Device);
119  }
120 
121  if (NT_SUCCESS(status)) {
122  *UsbDevice = (WDFUSBDEVICE) device;
123  }
124  }
125 
126  if (!NT_SUCCESS(status)) {
127  //
128  // And now free it
129  //
130  pUsbDevice->DeleteFromFailedCreate();
131  }
132 
133  return status;
134 }
135 
138 NTSTATUS
139 WDFAPI
140 WDFEXPORT(WdfUsbTargetDeviceCreate)(
141  __in
143  __in
144  WDFDEVICE Device,
145  __in_opt
147  __out
148  WDFUSBDEVICE* UsbDevice
149  )
150 /*++
151 
152 Routine Description:
153  Creates a WDFUSBDEVICE handle for the client.
154 
155 Arguments:
156  Device - WDFDEVICE handle to which we are attaching the WDFUSBDEVICE handle
157  to
158  PUsbDevice - Pointer which will receive the created handle
159 
160 Return Value:
161  STATUS_SUCCESS - success
162  STATUS_INSUFFICIENT_RESOURCES - no memory available
163  ...
164 
165  --*/
166 {
167  DDI_ENTRY();
168 
171 
173  Device,
175  (PVOID*)&pDevice,
177 
179  pDevice,
181  Attributes,
182  UsbDevice);
183 }
184 
187 NTSTATUS
188 WDFAPI
189 WDFEXPORT(WdfUsbTargetDeviceCreateWithParameters)(
190  __in
192  __in
193  WDFDEVICE Device,
194  __in
196  __in_opt
198  __out
199  WDFUSBDEVICE* UsbDevice
200  )
201 /*++
202 
203 Routine Description:
204  Creates a WDFUSBDEVICE handle for the client.
205 
206 Arguments:
207  Device - WDFDEVICE handle to which we are attaching the WDFUSBDEVICE handle
208  to
209  PUsbDevice - Pointer which will receive the created handle
210 
211 Return Value:
212  STATUS_SUCCESS - success
213  STATUS_INSUFFICIENT_RESOURCES - no memory available
214  ...
215 
216  --*/
217 {
218  DDI_ENTRY();
219 
223 
225  Device,
227  (PVOID*)&pDevice,
229 
231 
232  if (Config->Size != sizeof(WDF_USB_DEVICE_CREATE_CONFIG)) {
234 
237  "WDF_USB_DEVICE_CREATE_CONFIG Size 0x%x, expected 0x%x, %!STATUS!",
238  Config->Size, sizeof(WDF_USB_DEVICE_CREATE_CONFIG), status);
239 
240  return status;
241  }
242 
244  pDevice,
245  Config->USBDClientContractVersion,
246  Attributes,
247  UsbDevice);
248 }
249 
252 NTSTATUS
253 WDFAPI
254 WDFEXPORT(WdfUsbTargetDeviceRetrieveInformation)(
255  __in
257  __in
258  WDFUSBDEVICE UsbDevice,
259  __out
261  )
262 {
263  DDI_ENTRY();
264 
268 
270  UsbDevice,
272  (PVOID*) &pUsbDevice,
274 
276 
277  if (Information->Size != sizeof(WDF_USB_DEVICE_INFORMATION)) {
280  "Information size %d, expected %d %!STATUS!",
282  status);
283  return status;
284  }
285 
286  pUsbDevice->GetInformation(Information);
287 
289 }
290 
292 VOID
293 WDFAPI
294 WDFEXPORT(WdfUsbTargetDeviceGetDeviceDescriptor)(
295  __in
297  __in
298  WDFUSBDEVICE UsbDevice,
299  __out
301  )
302 {
303  DDI_ENTRY();
304 
308 
310  UsbDevice,
312  (PVOID*) &pUsbDevice,
314 
316 
318  if (!NT_SUCCESS(status)) {
319  return;
320  }
321 
322  pUsbDevice->CopyDeviceDescriptor(UsbDeviceDescriptor);
323 }
324 
327 NTSTATUS
328 WDFAPI
329 WDFEXPORT(WdfUsbTargetDeviceRetrieveConfigDescriptor)(
330  __in
332  __in
333  WDFUSBDEVICE UsbDevice,
336  __inout
338  )
339 {
340  DDI_ENTRY();
341 
345 
347  UsbDevice,
349  (PVOID*) &pUsbDevice,
351 
353 
355  if (!NT_SUCCESS(status)) {
356  return status;
357  }
358 
359  return pUsbDevice->GetConfigDescriptor(ConfigDescriptor,
361 }
362 
365 NTSTATUS
366 WDFAPI
367 WDFEXPORT(WdfUsbTargetDeviceQueryString)(
368  __in
370  __in
371  WDFUSBDEVICE UsbDevice,
372  __in_opt
373  WDFREQUEST Request,
374  __in_opt
377  PUSHORT String,
378  __inout
380  __in
382  __in_opt
383  USHORT LangID
384  )
385 {
386  DDI_ENTRY();
387 
391 
393  UsbDevice,
395  (PVOID*) &pUsbDevice,
397 
399 
401  if (!NT_SUCCESS(status)) {
402  return status;
403  }
404 
406  if (!NT_SUCCESS(status)) {
407  return status;
408  }
409 
410  status = pUsbDevice->GetString(String,
412  StringIndex,
413  LangID,
414  Request,
416 
417  return status;
418 }
419 
422 NTSTATUS
423 WDFAPI
424 WDFEXPORT(WdfUsbTargetDeviceAllocAndQueryString)(
425  __in
427  __in
428  WDFUSBDEVICE UsbDevice,
429  __in_opt
431  __out
432  WDFMEMORY* StringMemory,
433  __out_opt
435  __in
437  __in_opt
438  USHORT LangID
439  )
440 {
441  DDI_ENTRY();
442 
444  WDFMEMORY hMemory;
448 
450  UsbDevice,
452  (PVOID*) &pUsbDevice,
454 
456 
457  *StringMemory = NULL;
458  if (NumCharacters != NULL) {
459  *NumCharacters = 0;
460  }
461 
463  if (!NT_SUCCESS(status)) {
464  return status;
465  }
466 
468  if (!NT_SUCCESS(status)) {
469  return status;
470  }
471 
472  status = pUsbDevice->GetString(NULL, &numChars, StringIndex, LangID);
473 
474  if (NT_SUCCESS(status) && numChars > 0) {
476 
479  NonPagedPool,
481  numChars * sizeof(WCHAR),
482  &pBuffer);
483 
484  if (!NT_SUCCESS(status)) {
486  }
487 
489  (WDFOBJECT*)&hMemory);
490 
491  if (NT_SUCCESS(status)) {
492  status = pUsbDevice->GetString((PUSHORT) pBuffer->GetBuffer(),
493  &numChars,
494  StringIndex,
495  LangID);
496 
497  if (NT_SUCCESS(status)) {
498  if (NumCharacters != NULL) {
500  }
502  }
503  }
504 
505  if (!NT_SUCCESS(status)) {
506  //
507  // There can only be one context on this object right now,
508  // so just clear out the one.
509  //
510  pBuffer->DeleteFromFailedCreate();
511  }
512  }
513 
514  return status;
515 }
516 
519 NTSTATUS
520 WDFEXPORT(WdfUsbTargetDeviceFormatRequestForString)(
521  __in
523  __in
524  WDFUSBDEVICE UsbDevice,
525  __in
526  WDFREQUEST Request,
527  __in
528  WDFMEMORY Memory,
529  __in_opt
531  __in
533  __in_opt
534  USHORT LangID
535  )
536 /*++
537 
538 Routine Description:
539  Formats a request so that it can be used to query for a string from the
540  device.
541 
542 Arguments:
543  UsbDevice - device to be queried
544 
545  Request - request to format
546 
547  Memory - memory to write the string into
548 
549 
550 Return Value:
551 
552 
553  --*/
554 
555 {
556  DDI_ENTRY();
557 
564  size_t bufferSize;
565 
567  UsbDevice,
569  (PVOID*) &pUsbDevice,
571 
574  "WDFUSBDEVICE %p, WDFREQUEST %p, WDFMEMORY %p, StringIndex %d, LandID 0x%x",
576 
578  Memory,
580  (PVOID*) &pMemory);
581 
583  Request,
585  (PVOID*) &pRequest);
586 
588  if (!NT_SUCCESS(status)) {
589  return status;
590  }
591 
592  buf.SetMemory(pMemory, Offset);
593 
594  bufferSize = buf.GetBufferLength();
595 
596  //
597  // the string descriptor is array of WCHARs so the buffer being used must be
598  // of an integral number of them.
599  //
600  if ((bufferSize % sizeof(WCHAR)) != 0) {
602 
605  "WDFMEMORY %p length must be even number of WCHARs, but is %I64d in "
606  "length, %!STATUS!",
608 
609  return status;
610  }
611 
612  //
613  // While the length in the descriptor (bLength) is a byte, so the requested
614  // buffer cannot be bigger then that, do not check the bufferSize < 0xFF.
615  // We don't check because the driver can be using the WDFMEMORY as a part
616  // of a larger structure.
617  //
618 
619  //
620  // Format the request
621  //
622  status = pUsbDevice->FormatStringRequest(pRequest, &buf, StringIndex, LangID);
623 
624  if (NT_SUCCESS(status)) {
625  FxUsbDeviceStringContext* pContext;
626 
628  pContext->m_UsbParameters.Parameters.DeviceString.Buffer = Memory;
629  pContext->m_UsbParameters.Parameters.DeviceString.StringIndex = StringIndex;
630  pContext->m_UsbParameters.Parameters.DeviceString.LangID = LangID;
631  }
632 
634  "WDFUSBDEVICE %p, WDFREQUEST %p, WDFMEMORY %p, %!STATUS!",
636 
637  return status;
638 }
639 
642 NTSTATUS
643 WDFAPI
644 WDFEXPORT(WdfUsbTargetDeviceSelectConfig)(
645  __in
647  __in
648  WDFUSBDEVICE UsbDevice,
649  __in_opt
651  __inout
653  )
654 {
655  DDI_ENTRY();
656 
660 
662  UsbDevice,
664  (PVOID*) &pUsbDevice,
666 
668 
670  if (!NT_SUCCESS(status)) {
671  return status;
672  }
673 
677  "Params size %d, expected %d %!STATUS!",
679  status);
680  return status;
681  }
682 
683  //
684  // Sanity check the Type value as well to be in range.
685  //
687  ||
689 
691 
693  "Params Type %d not a valid value, %!STATUS!",
694  Params->Size, status);
695 
696  return status;
697  }
698 
699 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
704 
706  "Params Type %d not supported for UMDF, %!STATUS!",
707  Params->Type, status);
708 
709  return status;
710 
711  }
712 #endif
713 
717  if (!NT_SUCCESS(status)) {
718  return status;
719  }
720 
721  if (pUsbDevice->HasMismatchedInterfacesInConfigDescriptor()) {
722  //
723  // Config descriptor reported zero interfaces, but we found an
724  // interface descriptor in it.
725  //
727 
730  "WDFUSBDEVICE %p number of interfaces found in the config descriptor "
731  "does not match bNumInterfaces in config descriptor, failing config "
732  "operation %!WdfUsbTargetDeviceSelectConfigType!, %!STATUS!",
733  UsbDevice, Params->Type, status);
734 
735  return status;
736  }
737  else if (pUsbDevice->GetNumInterfaces() == 0) {
738  //
739  // Special case the zero interface case and exit early
740  //
742 
745  "WDFUSBDEVICE %p succeeding config operation "
746  "%!WdfUsbTargetDeviceSelectConfigType! on zero interfaces "
747  "immediately, %!STATUS!", UsbDevice, Params->Type, status);
748 
749  return status;
750  }
751 
752  switch (Params->Type) {
753 
754 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
755 
757  status = pUsbDevice->Deconfig();
758  break;
759 
761  if (Params->Types.Descriptor.InterfaceDescriptors == NULL ||
762  Params->Types.Descriptor.NumInterfaceDescriptors == 0) {
766  "Either InterfaceDescriptor is NULL or NumInterfaceDescriptors is zero "
767  "WDFUSBDEVICE %p InterfaceDescriptor %p NumInterfaceDescriptors 0x%x"
768  "%!WdfUsbTargetDeviceSelectConfigType! %!STATUS!", UsbDevice,
769  Params->Types.Descriptor.InterfaceDescriptors,
770  Params->Types.Descriptor.NumInterfaceDescriptors,
771  Params->Type,
772  status);
773 
774  }
775  else {
776  status = pUsbDevice->SelectConfigDescriptor(
778  Params);
779  }
780  break;
781 
783  //
784  // Since the USBD macro's dont include the USBD_PIPE_INFORMATION for 0 EP's,
785  // make the length check to use
786  // sizeof(struct _URB_SELECT_CONFIGURATION) - sizeof(USBD_PIPE_INFORMATION)
787  //
788  if (Params->Types.Urb.Urb == NULL ||
789  Params->Types.Urb.Urb->UrbHeader.Function != URB_FUNCTION_SELECT_CONFIGURATION ||
790  Params->Types.Urb.Urb->UrbHeader.Length <
791  (sizeof(struct _URB_SELECT_CONFIGURATION) - sizeof(USBD_PIPE_INFORMATION))) {
795  "Either URB passed in was NULL or the URB Function or Length was invalid "
796  " WDFUSBDEVICE %p Urb 0x%p "
797  "%!WdfUsbTargetDeviceSelectConfigType!"
798  " %!STATUS!", UsbDevice,
799  Params->Types.Urb.Urb,
800  Params->Type,
801  status);
802 
803  }
804  else {
805  status = pUsbDevice->SelectConfig(
807  Params->Types.Urb.Urb,
809  NULL);
810  }
811  break;
812 
813 #endif
814 
815 
816 
817 
818 
820  if (Params->Types.MultiInterface.Pairs == NULL) {
822 
825  "WDFUSBDEVICE %p SettingPairs Array passed is NULL, %!STATUS!",
826  pUsbDevice->GetHandle(),status);
827 
828  break;
829  }
830  else if (Params->Types.MultiInterface.NumberInterfaces !=
831  pUsbDevice->GetNumInterfaces()) {
833 
836  "WDFUSBDEVICE %p MultiInterface.NumberInterfaces %d != %d "
837  "(reported num interfaces), %!STATUS!",
838  pUsbDevice->GetHandle(),
839  Params->Types.MultiInterface.NumberInterfaces,
840  pUsbDevice->GetNumInterfaces(), status);
841 
842  break;
843  }
844 
845  // || || Fall through || ||
846  // \/ \/ \/ \/
848 
849  //
850  // Validate SettingIndexes passed-in
851  //
852  for (ULONG i = 0;
853  i < Params->Types.MultiInterface.NumberInterfaces;
854  i++) {
855 
858  UCHAR numSettings;
859 
860  pair = &(Params->Types.MultiInterface.Pairs[i]);
861 
863  pair->UsbInterface,
865  (PVOID*) &pUsbInterface);
866 
867  numSettings = pUsbInterface->GetNumSettings();
868 
869  if (pair->SettingIndex >= numSettings) {
871 
874  "WDFUSBDEVICE %p SettingPairs contains invalid SettingIndex"
875  " for WDFUSBINTERFACE %p. Setting index passed in: %d, "
876  "max index: %d, returning %!STATUS!",
877  pUsbDevice->GetHandle(),
878  pair->UsbInterface,
879  pair->SettingIndex,
881  status);
882 
883  return status;
884  }
885  }
886 
887  status = pUsbDevice->SelectConfigMulti(
889  Params);
890  break;
891 
893  status = pUsbDevice->SelectConfigSingle( //vm changed name from SelectConfigAuto
895  Params);
896  break;
897 
898  default:
900  }
901 
902  return status;
903 }
904 
905 
907 UCHAR
908 WDFAPI
909 WDFEXPORT(WdfUsbTargetDeviceGetNumInterfaces)(
910  __in
912  __in
913  WDFUSBDEVICE UsbDevice
914  )
915 {
916  DDI_ENTRY();
917 
919 
921  UsbDevice,
923  (PVOID*) &pUsbDevice);
924 
925  return pUsbDevice->GetNumInterfaces();
926 }
927 
928 
931 WDFAPI
932 WDFEXPORT(WdfUsbTargetDeviceWdmGetConfigurationHandle)(
933  __in
935  __in
936  WDFUSBDEVICE UsbDevice
937  )
938 {
939  DDI_ENTRY();
940 
942 
944  UsbDevice,
946  (PVOID*) &pUsbDevice);
947 
948  return pUsbDevice->GetConfigHandle();
949 }
950 
953 NTSTATUS
954 WDFEXPORT(WdfUsbTargetDeviceSendControlTransferSynchronously)(
955  __in
957  __in
958  WDFUSBDEVICE UsbDevice,
959  __in_opt
960  WDFREQUEST Request,
961  __in_opt
963  __in
965  __in_opt
967  __out_opt
969  )
970 /*++
971 
972 Routine Description:
973  Synchronously sends a control transfer to the default control pipe on the
974  device.
975 
976 Arguments:
977  UsbDevice - the target representing the device
978 
979  Request - Request whose PIRP to use
980 
981  RequestOptions - options to use when sending the request
982 
983  SetupPacket - control setup packet to be used in the transfer
984 
985  MemoryDescriptor - memory to use in the transfer after the setup packet
986 
987  BytesTransferred - number of bytes sent to or by the device
988 
989 Return Value:
990  NTSTATUS
991 
992  --*/
993 {
994  DDI_ENTRY();
995 
1000 
1002  UsbDevice,
1004  (PVOID*) &pUsbDevice,
1005  &pFxDriverGlobals);
1006 
1008 
1009  FxSyncRequest request(pFxDriverGlobals, &context, Request);
1010 
1011  //
1012  // FxSyncRequest always succeesds for KM but can fail for UM.
1013  //
1014  status = request.Initialize();
1015  if (!NT_SUCCESS(status)) {
1017  "Failed to initialize FxSyncRequest");
1018  return status;
1019  }
1020 
1022  "WDFUSBDEVICE %p control transfer sync", UsbDevice);
1023 
1025 
1027  if (!NT_SUCCESS(status)) {
1028  return status;
1029  }
1030 
1032  if (!NT_SUCCESS(status)) {
1033  return status;
1034  }
1035 
1036  status = buf.ValidateMemoryDescriptor(
1040  );
1041 
1042  if (!NT_SUCCESS(status)) {
1043  return status;
1044  }
1045 
1046  status = pUsbDevice->FormatControlRequest(request.m_TrueRequest,
1047  SetupPacket,
1048  &buf);
1049 
1050  if (NT_SUCCESS(status)) {
1053  "WDFUSBDEVICE %p, WDFREQUEST %p being submitted",
1054  UsbDevice, request.m_TrueRequest->GetTraceObjectHandle());
1055 
1056  status = pUsbDevice->SubmitSync(request.m_TrueRequest, RequestOptions);
1057 
1058  if (BytesTransferred != NULL) {
1059  if (NT_SUCCESS(status)) {
1060 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
1061  *BytesTransferred = context.m_Urb->TransferBufferLength;
1062 #elif (FX_CORE_MODE == FX_CORE_USER_MODE)
1063  *BytesTransferred = context.m_UmUrb.UmUrbControlTransfer.TransferBufferLength;
1064 #endif
1065  }
1066  else {
1067  *BytesTransferred = 0;
1068  }
1069  }
1070  }
1071 
1073  "WDFUSBDEVICE %p, %!STATUS!", UsbDevice, status);
1074 
1075  return status;
1076 }
1077 
1080 NTSTATUS
1081 WDFEXPORT(WdfUsbTargetDeviceFormatRequestForControlTransfer)(
1082  __in
1084  __in
1085  WDFUSBDEVICE UsbDevice,
1086  __in
1087  WDFREQUEST Request,
1088  __in
1090  __in_opt
1091  WDFMEMORY TransferMemory,
1092  __in_opt
1094  )
1095 /*++
1096 
1097 Routine Description:
1098  Formats a request so that a control transfer can be sent to the device
1099  after this call returns successfully.
1100 
1101 Arguments:
1102  UsbDevice - the target representing the device
1103 
1104  Request - Request to format
1105 
1106  SetupPacket - control setup packet to be used in the transfer
1107 
1108  TransferMemory - memory to use in the transfer after the setup packet
1109 
1110  TransferOffset - offset into TransferMemory and size override for transfer
1111  length
1112 
1113 Return Value:
1114  NTSTATUS
1115 
1116  --*/
1118  DDI_ENTRY();
1119 
1121  IFxMemory* pMemory;
1125  NTSTATUS status;
1126 
1128  UsbDevice,
1130  (PVOID*) &pUsbDevice,
1131  &pFxDriverGlobals);
1132 
1134  "WDFUSBDEVICE %p, WDFREQUEST %p, WDFMEMORY %p",
1136 
1138 
1143  (PVOID*) &pMemory);
1144 
1146  if (!NT_SUCCESS(status)) {
1147  return status;
1148  }
1149 
1150  buf.SetMemory(pMemory, TransferOffset);
1151  }
1152  else {
1153  pMemory = NULL;
1154  }
1155 
1157  Request,
1159  (PVOID*) &pRequest);
1160 
1161  status = pUsbDevice->FormatControlRequest(pRequest, SetupPacket, &buf);
1162 
1163  if (NT_SUCCESS(status)) {
1164  FxUsbDeviceControlContext* pContext;
1165 
1167 
1168  RtlCopyMemory(
1169  &pContext->m_UsbParameters.Parameters.DeviceControlTransfer.SetupPacket,
1170  SetupPacket,
1171  sizeof(*SetupPacket)
1172  );
1173 
1174  if (pMemory != NULL) {
1177  }
1178  }
1179 
1181  "format control request WDFUSBDEVICE %p, WDFREQWUEST %p, WDFMEMORY %p, %!STATUS!",
1183 
1184  return status;
1185 }
1186 
1189 NTSTATUS
1190 WDFAPI
1191 WDFEXPORT(WdfUsbTargetDeviceResetPortSynchronously)(
1192  __in
1194  __in
1195  WDFUSBDEVICE UsbDevice
1196  )
1197 {
1198  DDI_ENTRY();
1199 
1202  NTSTATUS status;
1203 
1205  UsbDevice,
1207  (PVOID*) &pUsbDevice,
1208  &pFxDriverGlobals);
1209 
1211  if (!NT_SUCCESS(status)) {
1212  return status;
1213  }
1214 
1215  status = pUsbDevice->Reset();
1216 
1217  return status;
1218 }
1219 
1220 #pragma warning(disable:28285)
1223 NTSTATUS
1224 WDFAPI
1225 WDFEXPORT(WdfUsbTargetDeviceCreateIsochUrb)(
1226  __in
1228  __in
1229  WDFUSBDEVICE UsbDevice,
1230  __in_opt
1232  __in
1234  __out
1235  WDFMEMORY* UrbMemory,
1237  PURB* Urb
1238  )
1239 /*++
1240 
1241 Routine Description:
1242  Creates a WDFUSBDEVICE handle for the client.
1243 
1244 Arguments:
1245  Attributes - Attributes associated with this object
1246 
1247  NumberOfIsochPacket - Maximum number of Isoch packets that will be programmed into this Urb
1248 
1249  UrbMemory - The returned handle to the caller for the allocated Urb
1250 
1251  Urb - (opt) Pointer to the associated urb buffer.
1252 
1253 Return Value:
1254  STATUS_INVALID_PARAMETER - any required parameters are not present/invalid
1255 
1256  STATUS_INVALID_DEVICE_STATE - If the client did not specify a client contract verion while
1257  creating the WDFUSBDEVICE
1258 
1259  STATUS_INSUFFICIENT_RESOURCES - could not allocated the object that backs
1260  the handle
1261 
1262  STATUS_SUCCESS - success
1263 
1264  ...
1265 
1266  --*/
1267 {
1268  DDI_ENTRY();
1269 
1272  NTSTATUS status;
1273 
1275  UsbDevice,
1277  (PVOID*) &pUsbDevice,
1278  &pFxDriverGlobals);
1279 
1280  //
1281  // Basic parameter validation
1282  //
1284 
1285  if (pUsbDevice->GetUSBDHandle() == NULL) {
1287 
1290  "USBDEVICE Must have been created with Client Contract Verion Info, %!STATUS!",
1291  status);
1292 
1293  return status;
1294  }
1295 
1296  status = pUsbDevice->CreateIsochUrb(Attributes,
1298  UrbMemory,
1299  Urb);
1300 
1301  return status;
1302 }
1303 
1305 WDFUSBINTERFACE
1306 WDFAPI
1307 WDFEXPORT(WdfUsbTargetDeviceGetInterface)(
1308  __in
1310  __in
1311  WDFUSBDEVICE UsbDevice,
1312  __in
1314  )
1315 /*++
1316 
1317 Routine Description:
1318 
1319 
1320 Arguments:
1321 
1322 Return Value:
1323 
1324 
1325  --*/
1326 
1328  DDI_ENTRY();
1329 
1333 
1335  UsbDevice,
1337  (PVOID*) &pUsbDevice,
1338  &pFxDriverGlobals);
1339 
1340  pUsbInterface = pUsbDevice->GetInterfaceFromIndex(InterfaceIndex);
1341 
1343  return pUsbInterface->GetHandle();
1344  }
1345  else {
1348  "WDFUSBDEVICE %p has %d interfaces, index %d requested, returning "
1349  "NULL handle",
1350  UsbDevice, pUsbDevice->GetNumInterfaces(), InterfaceIndex);
1351 
1352  return NULL;
1353  }
1354 }
1355 
1358 NTSTATUS
1359 WDFAPI
1360 WDFEXPORT(WdfUsbTargetDeviceQueryUsbCapability)(
1361  __in
1363  __in
1364  WDFUSBDEVICE UsbDevice,
1365  __in
1367  __in
1372  PVOID CapabilityBuffer,
1373  __out_opt
1376  )
1377 /*++
1378 
1379 Routine Description:
1380  Queries USB capability for the device. Such capabilities are available
1381  only with USB 3.0 stack. On earlier stacks this API will fail with
1382  STATUS_NOT_IMPLEMENTED
1383 
1384 Arguments:
1385  UsbDevice - Device whose capability is to be queried.
1386 
1387  CapabilityType - Type of capability as defined by
1388  IOCTL_INTERNAL_USB_GET_USB_CAPABILITY
1389 
1390  CapabilityBufferLength - Length of Capability buffer
1391 
1392  CapabilityBuffer - Buffer for capability. Can be NULL if
1393  CapabilitiyBufferLength is 0
1394 
1395  ResultLength - Actual length of the capability. This parameter is optional.
1396 
1397 Return Value:
1398  STATUS_SUCCESS - success
1399  STATUS_NOT_IMPLEMENTED - Capabilties are not supported by USB stack
1400  STATUS_INSUFFICIENT_RESOURCES - no memory available
1401  ...
1402 
1403  --*/
1404 {
1405  DDI_ENTRY();
1406 
1407  NTSTATUS status;
1410 
1412  UsbDevice,
1414  (PVOID*) &pUsbDevice,
1415  &pFxDriverGlobals);
1416 
1417  if (CapabilityBufferLength > 0) {
1418  FxPointerNotNull(pFxDriverGlobals, CapabilityBuffer);
1419  }
1420 
1421  status = pUsbDevice->QueryUsbCapability(CapabilityType,
1423  CapabilityBuffer,
1424  ResultLength);
1425  return status;
1426 }
1427 
1428 } // extern "C"
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR _Out_opt_ PULONG BytesTransferred
Definition: wdfusb.h:1331
_Must_inspect_result_ __in WDFUSBDEVICE __out_bcount_part_opt ConfigDescriptorLength PVOID __inout PUSHORT ConfigDescriptorLength
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ CONST GUID * CapabilityType
Definition: wdfusb.h:1611
_Must_inspect_result_ __in WDFUSBDEVICE __in WDFREQUEST __in WDFMEMORY __in_opt PWDFMEMORY_OFFSET Offset
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ NTSTATUS ValidateMemoryOffsets(__in_opt PWDFMEMORY_OFFSET Offsets)
Definition: ifxmemory.hpp:105
_In_ WDFUSBDEVICE _In_ UCHAR InterfaceIndex
Definition: wdfusb.h:2459
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ __in WDFUSBDEVICE __in CONST GUID __in ULONG __drv_when(CapabilityBufferLength==0, __out_opt) __drv_when(CapabilityBufferLength !=0 &&ResultLength
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ CONST GUID _In_ ULONG CapabilityBufferLength
Definition: wdfusb.h:1611
__in WDFUSBDEVICE __out PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE_BASE,(PVOID *)&pDevice, &pFxDriverGlobals)
Definition: http.c:7251
#define __in_opt
Definition: dbghelp.h:38
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
Definition: wdfusb.h:1331
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET TransferOffset
Definition: wdfusb.h:1378
_Must_inspect_result_ __in WDFUSBDEVICE __out PWDF_USB_DEVICE_INFORMATION Information
_Must_inspect_result_ __in WDFUSBDEVICE __in WDFREQUEST __in WDFMEMORY Memory
FxRequest * pRequest
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __in PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID _Inout_ PUSHORT ConfigDescriptorLength
Definition: wdfusb.h:1036
return NULL
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_Must_inspect_result_ __in FxDeviceBase * Device
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR StringIndex
Definition: wdfusb.h:1075
_Must_inspect_result_ __in FxDeviceBase __in ULONG USBDClientContractVersion
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __in PWDF_USB_CONTROL_SETUP_PACKET __in_opt PWDF_MEMORY_DESCRIPTOR MemoryDescriptor
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR MemoryDescriptor
Definition: wdfusb.h:1331
DriverGlobals
_Must_inspect_result_ __in WDFUSBDEVICE __out_bcount_part_opt ConfigDescriptorLength PVOID ConfigDescriptor
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
return FxUsbTargetDeviceCreate(pFxDriverGlobals, pDevice, USBD_CLIENT_CONTRACT_VERSION_INVALID, Attributes, UsbDevice)
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __out_ecount_opt NumCharacters PUSHORT __inout PUSHORT __in UCHAR __in_opt USHORT LangID
_Must_inspect_result_ __in WDFIOTARGET __in DEVICE_REGISTRY_PROPERTY __in ULONG __out_opt PVOID __deref_out_range(<=, BufferLength) PULONG ResultLength)
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ WDFMEMORY TransferMemory
Definition: wdfusb.h:1378
FxUsbInterface * pUsbInterface
NTSTATUS __inline FxValidateRequestOptions(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ PWDF_REQUEST_SEND_OPTIONS Options, _In_opt_ FxRequestBase *Request=NULL)
FxDevice * device
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFMEMORY * StringMemory
Definition: wdfusb.h:1121
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT NumCharacters
Definition: wdfusb.h:1075
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
IFxMemory * pMemory
__checkReturn __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES __in ULONG NumberOfIsochPackets
#define __out_opt
Definition: dbghelp.h:65
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
Definition: devices.h:37
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
#define WDFAPI
Definition: wdftypes.h:53
FxPointerNotNull(FxDriverGlobals, UsbDevice)
_Must_inspect_result_ __in WDFUSBDEVICE __in CONST GUID * CapabilityType
#define __out
Definition: dbghelp.h:62
UCHAR GetNumSettings(VOID)
_Must_inspect_result_ __in WDFUSBDEVICE __in CONST GUID __in ULONG __out_bcount_part_opt(CapabilityBufferLength, *ResultLength)) PVOID CapabilityBuffer
PVOID pBuffer
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
Definition: wdfusb.h:1036
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFMEMORY * StringMemory
USHORT numChars
#define __out_ecount_opt(x)
Definition: dbghelp.h:77
pUsbDevice
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __out_ecount_opt NumCharacters PUSHORT __inout PUSHORT NumCharacters
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3660::@3662 DeviceControlTransfer
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES __inout PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
FxSyncRequest request(pFxDriverGlobals, &context, Request)
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ WDFUSBDEVICE _Out_ PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor
Definition: wdfusb.h:1005
__checkReturn __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES __in ULONG __out WDFMEMORY * UrbMemory
FxDeviceBase * pDevice
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFUSBDEVICE * UsbDevice
Definition: wdfusb.h:901
struct _pair * pair
__checkReturn __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES __in ULONG __out WDFMEMORY __deref_opt_out_bcount(GET_ISOCH_URB_SIZE(NumberOfIsochPackets)) PURB *Urb)
FxObjectHandleGetPtr(pFxDriverGlobals, Memory, IFX_TYPE_MEMORY,(PVOID *) &pMemory)
__checkReturn __in WDFDEVICE __in PWDF_USB_DEVICE_CREATE_CONFIG Config
WDFUSBINTERFACE GetHandle(VOID)
unsigned char UCHAR
Definition: xmlstorage.h:181
#define URB_FUNCTION_SELECT_CONFIGURATION
Definition: usb.h:86
WDFMEMORY hMemory
size_t bufferSize
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGIOTARGET, "WDFUSBDEVICE %p, WDFREQUEST %p, WDFMEMORY %p, StringIndex %d, LandID 0x%x", UsbDevice, Request, Memory, StringIndex, LangID)
NTSTATUS status
_Must_inspect_result_ _In_ WDFUSBINTERFACE _In_opt_ PWDF_OBJECT_ATTRIBUTES PipesAttributes
Definition: wdfusb.h:2388
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ ULONG NumberOfIsochPackets
Definition: wdfusb.h:1699
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST Request
FxRequestBuffer buf
#define __inout
Definition: dbghelp.h:50
WDF_USB_REQUEST_COMPLETION_PARAMS m_UsbParameters
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
union _WDF_USB_REQUEST_COMPLETION_PARAMS::@3660 Parameters
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define USBD_CLIENT_CONTRACT_VERSION_INVALID
Definition: usbdlib.h:99
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3660::@3661 DeviceString
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
__in WDFUSBDEVICE __in UCHAR InterfaceIndex
_Must_inspect_result_ __in FxDeviceBase __in ULONG __in_opt PWDF_OBJECT_ATTRIBUTES __out WDFUSBDEVICE * UsbDevice
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: usb.h:529
unsigned short USHORT
Definition: pedump.c:61
FxUsbDeviceControlContext context(FxUrbTypeLegacy)
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES StringMemoryAttributes
__inline FxRequestContext * GetContext(VOID)
_Must_inspect_result_ __in WDFUSBDEVICE __in CONST GUID __in ULONG __out_bcount(CapabilityBufferLength)) __drv_when(CapabilityBufferLength !=0 &&ResultLength !
unsigned int * PULONG
Definition: retypes.h:1
Definition: _pair.h:47
_Must_inspect_result_ __in WDFUSBDEVICE __in CONST GUID __in ULONG CapabilityBufferLength
Definition: tftpd.h:85
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __out_ecount_opt NumCharacters PUSHORT __inout PUSHORT __in UCHAR StringIndex
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS RequestOptions
Definition: wdfiotarget.h:859
unsigned int ULONG
Definition: retypes.h:1
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ WDFMEMORY UrbMemory
Definition: wdfusb.h:1572
_Must_inspect_result_ __in WDFUSBDEVICE __in WDFREQUEST __in PWDF_USB_CONTROL_SETUP_PACKET __in_opt WDFMEMORY __in_opt PWDFMEMORY_OFFSET TransferOffset
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt PWDF_OBJECT_ATTRIBUTES PipesAttributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES StringMemoryAttributes
Definition: wdfusb.h:1121
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
PFX_DRIVER_GLOBALS pFxDriverGlobals
_Must_inspect_result_ __in WDFUSBDEVICE __in WDFREQUEST __in PWDF_USB_CONTROL_SETUP_PACKET __in_opt WDFMEMORY TransferMemory
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1075
#define __in
Definition: dbghelp.h:35
#define __checkReturn
Definition: ms_sal.h:2873
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __out_ecount_opt NumCharacters PUSHORT String
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
unsigned short * PUSHORT
Definition: retypes.h:2
#define CONST
Definition: pedump.c:81
_Must_inspect_result_ __drv_maxIRQL(PASSIVE_LEVEL) NTSTATUS WDFAPI FxUsbTargetDeviceCreate(__in PFX_DRIVER_GLOBALS FxDriverGlobals
_Must_inspect_result_ __in FxDeviceBase __in ULONG __in_opt PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ __in WDFUSBDEVICE __in_opt WDFREQUEST __in_opt PWDF_REQUEST_SEND_OPTIONS __in PWDF_USB_CONTROL_SETUP_PACKET __in_opt PWDF_MEMORY_DESCRIPTOR __out_opt PULONG BytesTransferred
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS DriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in POOL_TYPE PoolType, __in ULONG PoolTag, __in size_t BufferSize, __out FxMemoryObject **Object)
return STATUS_SUCCESS
Definition: ps.c:97