ReactOS  0.4.15-dev-2344-g8ddbfde
fxirpum.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) Microsoft. All rights reserved.
3 //
4 #include "fxmin.hpp"
5 
6 extern "C" {
7 #include "FxIrpUm.tmh"
8 
9 extern IWudfHost2 *g_IWudfHost2;
10 }
11 
12 #define TraceEvents(a,b,c,d,e) UNREFERENCED_PARAMETER(d);
13 
14 MdIrp
16  VOID
17  )
18 {
19  return m_Irp;
20 }
21 
22 
23 VOID
26  )
27 {
29 
30  m_Irp->CompleteRequest();
31  m_Irp = NULL;
32 }
33 
34 
38  )
39 {
41 
42  m_Irp->Forward();
43  return STATUS_SUCCESS;
44 }
45 
46 
50  )
51 {
53 
54  m_Irp->Forward();
55  return STATUS_SUCCESS;
56 }
57 
58 
59 
60 VOID
62  )
63 {
64 
65 
66 
67  DO_NOTHING();
68 }
69 
70 
71 VOID
78  )
79 {
83 
84  //
85  // In UMDF completion callback is invoked in all three cases, there isn't an option
86  // to invoke it selectively
87 
88 
89 
90 
91  FX_VERIFY(INTERNAL, CHECK(
92  "UMDF completion routine can't be invoked selectively on Success/Error/Cancel",
93  (TRUE == InvokeOnSuccess) &&
94  (TRUE == InvokeOnError) &&
95  (TRUE == InvokeOnCancel)));
96 
97  m_Irp->SetCompletionRoutine(
99  Context
100  );
101 }
102 
103 VOID
111  )
112 {
114 
117  Context,
121 }
122 
126  )
127 {
128  return m_Irp->SetCancelRoutine(CancelRoutine);
129 }
130 
131 
132 NTSTATUS
135  __in MdIrp /*OriginalIrp*/,
137  )
138 {
139  HANDLE event = (HANDLE) Context;
140 
142 
143  SetEvent(event);
144 
146 }
147 
148 
150 NTSTATUS
153  )
154 {
156  HANDLE event;
157 
159 
160  event = CreateEvent(
161  NULL,
162  TRUE, //bManualReset
163  FALSE, //bInitialState
164  NULL //Name
165  );
166 
167  if (NULL == event)
168  {
169 #pragma prefast(suppress:__WARNING_MUST_USE, "we convert all Win32 errors into a generic failure currently")
170  DWORD err = GetLastError();
171 
172  //
173  // As such event creation would fail only for resource reasons if we pass
174  // correct parameters
175  //
176 
178 
180  FX_TRACE_IO,
181  "Failed to create event, error: %!WINERROR!, "
182  "returning %!STATUS!",
183  err, status);
184 
185  }
186 
187  if (NT_SUCCESS(status))
188  {
190  event,
191  TRUE,
192  TRUE,
193  TRUE);
194 
195  m_Irp->Forward();
196 
198  FX_VERIFY(INTERNAL, CHECK("INFNITE wait failed",
199  (retval == WAIT_OBJECT_0)));
200 
201  status = this->GetStatus();
202  }
203 
204  return status;
205 }
206 
207 
208 VOID
210  VOID
211  )
212 {
213  m_Irp->CopyCurrentIrpStackLocationToNext();
214 }
215 
216 UCHAR
218  VOID
219  )
220 {
222  IWudfIoIrp * pIoIrp = NULL;
223  IWudfPnpIrp * pPnpIrp = NULL;
224 
225  //
226  // IWudfIrp does not expose a method to get major function code. So we
227  // find out if it's an I/O irp or pnp irp. If I/O irp then we use GetType
228  // method to retrieve request tyoe and then map it to major function code,
229  // otherwise if it is pnp irp then we just use GetMajorFunction method
230  // exposed by IWudfPnpIrp.
231  //
232  HRESULT hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
233  if (SUCCEEDED(hrQI)) {
235 
236  //
237  // for Io irp, map request type to major funcction
238  //
239  type = (UMINT::WDF_REQUEST_TYPE) pIoIrp->GetType();
240  switch(type) {
241  case UMINT::WdfRequestCreate:
243  break;
244  case UMINT::WdfRequestCleanup:
246  break;
247  case UMINT::WdfRequestRead:
249  break;
250  case UMINT::WdfRequestWrite:
252  break;
253  case UMINT::WdfRequestDeviceIoControl:
255  break;
256  case UMINT::WdfRequestClose:
258  break;
259  case UMINT::WdfRequestInternalIoctl:
261  break;
262  case UMINT::WdfRequestFlushBuffers:
264  break;
265  case UMINT::WdfRequestQueryInformation:
267  break;
268  case UMINT::WdfRequestSetInformation:
270  break;
271  case UMINT::WdfRequestUsb:
272  case UMINT::WdfRequestOther:
273  // fall through
274  default:
275  FX_VERIFY(INTERNAL, TRAPMSG("The request type is not expected"));
276  }
277 
278  pIoIrp->Release();
279  }
280  else {
281  FX_VERIFY(INTERNAL, CHECK_NULL(pIoIrp));
282 
283  //
284  // see if it is a pnp irp
285  //
286  hrQI = m_Irp->QueryInterface(IID_IWudfPnpIrp, (PVOID*)&pPnpIrp);
287  FX_VERIFY(INTERNAL, CHECK_QI(hrQI, pPnpIrp));
288 
289  majorFunction = pPnpIrp->GetMajorFunction();
290  pPnpIrp->Release();
291  }
292 
293  return majorFunction;
294 }
295 
296 UCHAR
298  VOID
299  )
300 {
301  UCHAR minorFunction;
302  IWudfPnpIrp * pPnpIrp = NULL;
303  IWudfIoIrp * pIoIrp = NULL;
304 
305  HRESULT hrQI = m_Irp->QueryInterface(IID_IWudfPnpIrp, (PVOID*)&pPnpIrp);
306  if (SUCCEEDED(hrQI)) {
307  minorFunction = pPnpIrp->GetMinorFunction();
308  pPnpIrp->Release();
309  }
310  else {
311  //
312  // If this is not PnP irp then this must be Io irp.
313  //
314  hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
315  FX_VERIFY(INTERNAL, CHECK_QI(hrQI, pIoIrp));
316  pIoIrp->Release();
317 
318  //
319  // Minor function is 0 for I/O irps (create/cleanup/close/read/write/
320  // ioctl).
321  //
322  minorFunction = 0;
323  }
324 
325  return minorFunction;
326 }
327 
330  VOID
331  )
332 {
333  IWudfIoIrp * pIoIrp = NULL;
334 
335  HRESULT hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
336 
337  if (SUCCEEDED(hrQI)) {
338  KPROCESSOR_MODE requestorMode;
339 
340  requestorMode = pIoIrp->GetRequestorMode();
341  pIoIrp->Release();
342 
343  return requestorMode;
344  }
345  else {
346  return KernelMode;
347  }
348 }
349 
350 VOID
352  __in ULONG Index,
354  )
355 {
356  m_Irp->SetContext(Index, Value);
357 }
358 
359 
360 PVOID
363  )
364 {
365  return m_Irp->GetContext(Index);
366 }
367 
368 
371  VOID
372  )
373 {
374 
375 
376 
377 
378  // The Km implementation does some verifier checks in this function so
379  // mode agnostic code uses it and therefore we provide the um version as a
380  // stub. The return value is NULL and is not used by the caller.
381  //
382  return NULL;
383 }
384 
385 
388  VOID
389  )
390 {
391 
392 
393 
394 
395  FX_VERIFY(INTERNAL, TRAPMSG("Common code using io stack location directly"));
396  return NULL;
397 }
398 
399 VOID
401  VOID
402  )
403 {
404  //
405  // Earler we always used to copy because the framework always set a
406  // completion routine to notify other packages that we completed. However,
407  // since some I/O paths relied on Skip to revert the action taken by
408  // SetNextStackLocation in failure paths, we now skip instead of copy. The
409  // same behavior applies to KMDF as well.
410  //
411  m_Irp->SkipCurrentIrpStackLocation();
412 }
413 
414 VOID
416  VOID
417  )
418 {
419 
420 
421 
422 
423 
424  m_Irp->MarkIrpPending();
425 }
426 
427 
428 BOOLEAN
430  VOID
431  )
432 {
433 
434 
435 
436 
437 
438  return m_Irp->PendingReturned();
439 }
440 
441 
442 VOID
444  VOID
445  )
446 {
447 
448 
449 
450 
451 
452  m_Irp->PropagatePendingReturned();
453 }
454 
455 
456 VOID
459  )
460 {
461  m_Irp->SetStatus(Status);
462 }
463 
464 
465 NTSTATUS
467  VOID
468  )
469 {
470  return m_Irp->GetStatus();
471 }
472 
473 
474 BOOLEAN
476  VOID
477  )
478 {
479  return (m_Irp->Cancel() ? TRUE: FALSE);
480 }
481 
482 
483 BOOLEAN
485  )
486 {
487  return (m_Irp->IsCanceled() ? TRUE: FALSE);
488 }
489 
490 
491 KIRQL
493  )
494 {
495  //
496  // CancelIrql is used to pass in to IoReleaseCancelSpinLock
497  // hence it is not applicable to UMDF.
498  //
499  return PASSIVE_LEVEL;
500 }
501 
502 
503 VOID
506  )
507 {
508  m_Irp->SetInformation(Information);
509 }
510 
511 
512 ULONG_PTR
514  )
515 {
516  return m_Irp->GetInformation();
517 }
518 
519 
520 CCHAR
522  )
523 {
524 
525 
526 
527 
528  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
529 
530  return -1;
531 }
532 
533 
536  )
537 {
538  return m_Irp->GetListEntry();
539 }
540 
541 
542 PVOID
544  )
545 {
546  IWudfIoIrp * ioIrp = NULL;
547  PVOID systemBuffer = NULL;
548  HRESULT hr;
549 
550  ioIrp = GetIoIrp();
551 
552  switch (GetMajorFunction()) {
553  case IRP_MJ_WRITE:
554  //
555  // For write host provides the buffer as input buffer
556  //
557  hr = ioIrp->RetrieveBuffers(NULL, // InputBufferCb
558  &systemBuffer,// InputBuffer
559  NULL, // OutputBufferCb
560  NULL // OutputBuffer
561  );
562  break;
563  case IRP_MJ_READ:
564  //
565  // For read host provides the buffer as output buffer
566  //
567  hr = ioIrp->RetrieveBuffers(NULL, // InputBufferCb
568  NULL, // InputBuffer
569  NULL, // OutputBufferCb
570  &systemBuffer // OutputBuffer
571  );
572  break;
574  hr = ioIrp->RetrieveBuffers(NULL, // InputBufferCb
575  &systemBuffer,// InputBuffer
576  NULL, // OutputBufferCb
577  NULL // OutputBuffer
578  );
579  break;
580  default:
581  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
582  hr = E_NOTIMPL;
583  break;
584  }
585 
586  if (FAILED(hr)) {
587  systemBuffer = NULL;
588  }
589 
590  return systemBuffer;
591 }
592 
593 PVOID
595  )
596 {
597  IWudfIoIrp * ioIrp = NULL;
598  PVOID outputBuffer = NULL;
599  HRESULT hr;
600 
601  ioIrp = GetIoIrp();
602 
603  switch (GetMajorFunction()) {
605  hr = ioIrp->RetrieveBuffers(NULL, // InputBufferCb
606  NULL, // InputBuffer
607  NULL, // OutputBufferCb
608  &outputBuffer // OutputBuffer
609  );
610  break;
611  default:
612  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
613  hr = E_NOTIMPL;
614  break;
615  }
616 
617  if (FAILED(hr)) {
618  outputBuffer = NULL;
619  }
620 
621  return outputBuffer;
622 }
623 
624 PMDL
626  )
627 {
628  return NULL;
629 }
630 
631 
632 PVOID
634  )
635 {
636  //
637  // UserBuffer is used with METHOD_NEITHER
638  // For METHOD_NEITHER reflector still makes a copy of the buffer
639  // in common buffer (if METHOD_NEITHER is enabled via regkey)
640  //
641 
642  IWudfIoIrp * ioIrp = GetIoIrp();
643  PVOID userBuffer;
644  HRESULT hr;
645 
646  hr = ioIrp->RetrieveBuffers(NULL, // InputBufferCb
647  NULL, // InputBuffer
648  NULL, // OutputBufferCb
649  &userBuffer // OutputBuffer
650  );
651  if (FAILED(hr))
652  {
653  userBuffer = NULL;
654  }
655 
656  return userBuffer;
657 }
658 
659 
660 VOID
663  )
664 {
665  GetIoIrp()->Reuse(Status);
666  return;
667 }
668 
669 
672  )
673 {
674  SYSTEM_POWER_STATE_CONTEXT systemPwrStateContext = {0};
675 
676  systemPwrStateContext.ContextAsUlong = GetPnpIrp()->GetSystemPowerStateContext();
677 
678  return systemPwrStateContext;
679 }
680 
681 
684  )
685 {
686  POWER_STATE_TYPE powerType;
687 
688  powerType = GetPnpIrp()->GetPowerType();
689 
690  return powerType;
691 }
692 
693 
696  )
697 {
698  DEVICE_POWER_STATE devicePowerState;
699 
700  devicePowerState = GetPnpIrp()->GetPowerStateDeviceState();
701 
702  return devicePowerState;
703 }
704 
705 
708  )
709 {
710  SYSTEM_POWER_STATE systemPowerState;
711 
712  systemPowerState = GetPnpIrp()->GetPowerStateSystemState();
713 
714  return systemPowerState;
715 }
716 
717 
720  )
721 {
722  POWER_ACTION powerAction;
723 
724  powerAction = GetPnpIrp()->GetPowerAction();
725 
726  return powerAction;
727 }
728 
729 
732  )
733 {
734  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
735 
736  return BusRelations;
737 }
738 
739 //
740 // Get Methods for IO_STACK_LOCATION.Parameters.QueryInterface
741 
742 
743 
744 
747  )
748 {
749  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
750 
751  return NULL;
752 }
753 
754 const GUID*
756  )
757 {
758  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
759 
760  return NULL;
761 }
762 
763 
764 USHORT
766  )
767 {
768  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
769 
770  return 0;
771 }
772 
773 
774 USHORT
776  )
777 {
778  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
779 
780  return 0;
781 }
782 
783 
784 PVOID
786  )
787 {
788  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
789 
790  return NULL;
791 }
792 
793 //
794 // Get Method for IO_STACK_LOCATION.Parameters.UsageNotification
795 
796 
797 
798 
799 
802  )
803 {
804  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
805 
807 }
808 
809 
810 BOOLEAN
812  )
813 {
814  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
815 
816  return FALSE;
817 }
818 
819 
820 VOID
822  __in BOOLEAN /*InPath*/
823  )
824 {
825  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
826 }
827 
828 
829 BOOLEAN
831  )
832 {
833  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
834 
835  return FALSE;
836 }
837 
838 //
839 // Get/Set Methods for IO_STACK_LOCATION.Parameters.StartDevice
840 //
841 
844  )
845 {
846  IWudfPnpIrp * pnpIrp = NULL;
848 
849 
850 
851 
852 
853 
854  pnpIrp = static_cast<IWudfPnpIrp *>(m_Irp);
855 
856  res = pnpIrp->GetParameterAllocatedResources();
857 
858  //
859  // Release the ref even though we are returning a memory pointer from
860  // IWudfIrp object. This is fine because we know irp is valid for the
861  // lifetime of the caller who is calling this interface).
862  //
863 
864 
865  return res;
866 }
867 
868 VOID
870  __in PCM_RESOURCE_LIST /*AllocatedResources*/
871  )
872 {
873  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
874 }
875 
878  )
879 {
880  IWudfPnpIrp * pnpIrp = NULL;
882 
883 
884 
885 
886 
887 
888  pnpIrp = static_cast<IWudfPnpIrp *>(m_Irp);
889 
890  res = pnpIrp->GetParameterAllocatedResourcesTranslated();
891 
892 
893  return res;
894 }
895 
896 VOID
898  __in PCM_RESOURCE_LIST /*AllocatedResourcesTranslated*/
899  )
900 {
901  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
902 }
903 
904 VOID
907  )
908 {
909  IWudfIoIrp * pIoIrp = NULL;
910 
911  //
912  // IWudfIrp does not expose a method to set major function code directly so
913  // map it to WdfRequestType.
914  //
915  HRESULT hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
916  if (SUCCEEDED(hrQI)) {
918 
919  //
920  // for Io irp, map major function to request type
921  //
922  switch(MajorFunction) {
923  case IRP_MJ_CREATE:
924  type = UMINT::WdfRequestCreate;
925  break;
926  case IRP_MJ_CLEANUP:
927  type = UMINT::WdfRequestCleanup;
928  break;
929  case IRP_MJ_READ:
930  type = UMINT::WdfRequestRead;
931  break;
932  case IRP_MJ_WRITE:
933  type = UMINT::WdfRequestWrite;
934  break;
936  type = UMINT::WdfRequestDeviceIoControl;
937  break;
938  case IRP_MJ_CLOSE:
939  type = UMINT::WdfRequestClose;
940  break;
942  type = UMINT::WdfRequestInternalIoctl;
943  break;
945  type = UMINT::WdfRequestFlushBuffers;
946  break;
948  type = UMINT::WdfRequestQueryInformation;
949  break;
951  type = UMINT::WdfRequestSetInformation;
952  break;
953  default:
954  FX_VERIFY(INTERNAL, TRAPMSG("The request type is not expected"));
955  type = UMINT::WdfRequestUndefined;
956  }
957 
958  pIoIrp->SetTypeForNextStackLocation(type);
959  pIoIrp->Release();
960  }
961  else {
962  FX_VERIFY(INTERNAL, TRAPMSG("Not expected"));
963  }
964 }
965 
966 VOID
968  __in UCHAR /*MinorFunction*/
969  )
970 {
971  FX_VERIFY(INTERNAL, TRAPMSG("Not supported"));
972 }
973 
974 LCID
976  )
977 {
978  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
979 
980  return (LCID)(-1);
981 }
982 
985  )
986 {
987  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
988 
989  return (DEVICE_TEXT_TYPE)(-1);
990 }
991 
992 BOOLEAN
994  )
995 {
996  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
997 
998  return FALSE;
999 }
1000 
1001 //
1002 // Get Method for IO_STACK_LOCATION.Parameters.QueryId
1003 //
1004 
1007  )
1008 {
1009  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
1010 
1011  return (BUS_QUERY_ID_TYPE)(-1);
1012 }
1013 
1016  )
1017 {
1018  IWudfPnpIrp * pnpIrp = NULL;
1019  POWER_STATE powerState;
1020 
1021 
1022 
1023 
1024 
1025 
1026  pnpIrp = static_cast<IWudfPnpIrp *>(m_Irp);
1027 
1028  powerState = pnpIrp->GetPowerState();
1029 
1030 
1031  return powerState;
1032 }
1033 
1034 VOID
1036  __in FxIrp* /*Irp*/
1037  )
1038 {
1039  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
1040 }
1041 
1042 
1043 
1044 
1046 NTSTATUS
1053  )
1054 {
1055  HRESULT hr;
1056  IWudfDevice* deviceObject;
1057  IWudfDeviceStack *deviceStack;
1058 
1060  deviceStack = deviceObject->GetDeviceStackInterface();
1061 
1062  hr = deviceStack->RequestPowerIrp(MinorFunction,
1063  PowerState,
1065  Context);
1066 
1067  if (S_OK == hr)
1068  {
1069  return STATUS_SUCCESS;
1070  }
1071  else
1072  {
1073  PUMDF_VERSION_DATA driverVersion = deviceStack->GetMinDriverVersion();
1074 
1075  BOOL preserveCompat =
1076  deviceStack->ShouldPreserveIrpCompletionStatusCompatibility();
1077 
1078  return CHostFxUtil::NtStatusFromHr(
1079  hr,
1080  driverVersion->MajorNumber,
1081  driverVersion->MinorNumber,
1082  preserveCompat
1083  );
1084  }
1085 }
1086 
1088 MdIrp
1092  )
1093 {
1094  IWudfIoIrp* ioIrp;
1095  HRESULT hr;
1096  NTSTATUS status;
1097 
1098  ioIrp = NULL;
1099 
1100  FX_VERIFY(INTERNAL, CHECK_NOT_NULL(Device));
1101 
1102  //
1103  // UMDF currently support allocating of I/O Irps only
1104  //
1105  hr = Device->GetDeviceStack()->AllocateIoIrp(Device->GetDeviceObject(),
1106  StackSize,
1107  &ioIrp);
1108 
1109  if (FAILED(hr)) {
1110  status = Device->NtStatusFromHr(hr);
1112  Device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGIO,
1113  "WDFDEVICE 0x%p Failed to allocate I/O request %!STATUS!",
1114  Device->GetHandle(), status);
1115 
1116  FX_VERIFY_WITH_NAME(INTERNAL, CHECK_NULL(ioIrp),
1117  Device->GetDriverGlobals()->Public.DriverName);
1118  }
1119  else {
1120  FX_VERIFY_WITH_NAME(INTERNAL, CHECK_NOT_NULL(ioIrp),
1121  Device->GetDriverGlobals()->Public.DriverName);
1122  }
1123 
1124  return ioIrp;
1125 }
1126 
1127 //
1128 // Get/Set Methods for IO_STACK_LOCATION.Parameters.DeviceCapabilities
1129 //
1130 
1133  )
1134 {
1135  IWudfPnpIrp * pQueryCapsIrp = GetPnpIrp();
1136  PDEVICE_CAPABILITIES deviceCapabilities;
1137 
1138  deviceCapabilities = pQueryCapsIrp->GetDeviceCapabilities();
1139 
1140  return deviceCapabilities;
1141 }
1142 
1143 
1144 VOID
1146  __in PDEVICE_CAPABILITIES /*DeviceCapabilities*/
1147  )
1148 {
1149  FX_VERIFY(INTERNAL, TRAPMSG("Not implemented"));
1150 }
1151 
1152 
1153 
1154 
1155 
1156 VOID
1158  __in ULONG /*DeviceIoControlCode*/
1159  )
1160 {
1161  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1162 }
1163 
1164 
1165 VOID
1167  __in ULONG /*InputBufferLength*/
1168  )
1169 {
1170  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1171 }
1172 
1173 
1174 VOID
1176  __in PVOID /*Type3InputBuffer*/
1177  )
1178 {
1179  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1180 }
1181 
1182 VOID
1184  )
1185 {
1186  m_Irp->ClearNextStackLocation();
1187 }
1188 
1189 MdIrp
1191  __in PLIST_ENTRY ListEntry
1192  )
1193 {
1194  return g_IWudfHost2->GetIrpFromListEntry(ListEntry);
1195 }
1196 
1198 {
1199  if (m_Irp != NULL) {
1200  m_Irp->Release();
1201  m_Irp = NULL;
1202  }
1203 }
1204 
1207  VOID
1208  )
1209 {
1210 
1211  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1212  return NULL;
1213 }
1214 
1215 VOID
1218  )
1219 {
1221 
1222 
1223 
1224 
1225 
1226 
1227 
1228 
1229 
1230  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1231 
1232 }
1233 
1234 VOID
1236  VOID
1237  )
1238 {
1239  m_Irp->SetNextIrpStackLocation();
1240 }
1241 
1242 UCHAR
1244  VOID
1245  )
1246 {
1247 
1248 
1249 
1250 
1251 
1252 
1253 
1254  return 0;
1255 }
1256 
1259  VOID
1260  )
1261 {
1262  return GetIoIrp()->GetFile();
1263 }
1264 
1265 VOID
1267  __in ULONG Flags
1268  )
1269 {
1271 
1272 
1273 
1274 
1275 
1276 
1277  FX_VERIFY(INTERNAL, CHECK_TODO(Flags == 0));
1278 }
1279 
1280 ULONG
1282  VOID
1283  )
1284 {
1285 
1286 
1287 
1288 
1289 
1290  return 0;
1291 }
1292 
1293 VOID
1296  )
1297 {
1299 
1300  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1301 }
1302 
1303 CCHAR
1305  )
1306 {
1307 
1308  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1309  return 0;
1310 }
1311 
1312 VOID
1314  __in PVOID Value
1315  )
1316 {
1318 
1319  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1320 }
1321 
1322 PMDL*
1324  )
1325 {
1326  return NULL;
1327 }
1328 
1329 VOID
1331  __in PMDL Value
1332  )
1333 {
1334  //
1335  // MDL is not supported in UMDF so must be NULL.
1336  //
1337  FX_VERIFY(INTERNAL, CHECK_NULL(Value));
1338 }
1339 
1340 VOID
1342  __in PVOID Value
1343  )
1344 {
1346 
1347 
1348  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1349 }
1350 
1353  VOID
1354  )
1355 {
1356 
1357  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1358  return NULL;
1359 }
1360 
1361 VOID
1364  )
1365 {
1367 
1368 
1369  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1370 }
1371 
1372 LONGLONG
1374  )
1375 {
1376 
1377 
1378 
1379 
1380  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1381  return 0;
1382 }
1383 
1384 VOID
1387  )
1388 {
1390 
1391 
1392 
1393 
1394  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1395 }
1396 
1397 VOID
1399  __in ULONG IoLength
1400  )
1401 {
1402  UNREFERENCED_PARAMETER(IoLength);
1403 
1404 
1405 
1406 
1407  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1408 }
1409 
1410 VOID
1413  )
1414 {
1416 
1417  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1418 }
1419 
1420 PVOID*
1422  )
1423 {
1424 
1425 
1426 
1427 
1428 
1429  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1430  return NULL;
1431 }
1432 
1433 PVOID*
1435  )
1436 {
1437 
1438 
1439 
1440 
1441 
1442  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1443  return NULL;
1444 }
1445 
1446 PVOID*
1448  )
1449 {
1450 
1451 
1452 
1453 
1454 
1455  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1456  return NULL;
1457 }
1458 
1461  VOID
1462  )
1463 {
1464  IWudfIoIrp * pIoIrp = NULL;
1465 
1466  HRESULT hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
1467  FX_VERIFY(INTERNAL, CHECK_QI(hrQI, pIoIrp));
1468  pIoIrp->Release();
1469 
1470  return pIoIrp->GetFile();
1471 }
1472 
1473 ULONG
1475  VOID
1476  )
1477 {
1478  IWudfIoIrp * ioIrp = NULL;
1479  ULONG ioControlCode = 0;
1480 
1482  ioIrp = GetIoIrp();
1483  ioIrp->GetDeviceIoControlParameters(&ioControlCode, NULL, NULL);
1484  }
1485 
1486  return ioControlCode;
1487 }
1488 
1489 ULONG
1491  VOID
1492  )
1493 {
1494  //
1495  // For UMDF, always return METHOD_BUFFERED. This is because merged code
1496  // uses this info to decide how and where to fetch the buffers from, from
1497  // inside the irp, and for UMDF, the buffers are always fetched from host in
1498  // same manner irrespective of IOCTL type.
1499  //
1500  return METHOD_BUFFERED;
1501 }
1502 
1503 ULONG
1505  VOID
1506  )
1507 {
1508  IWudfIoIrp * ioIrp = NULL;
1509  ULONG outputBufferLength;
1510 
1511  ioIrp = GetIoIrp();
1512  ioIrp->GetDeviceIoControlParameters(NULL, NULL, &outputBufferLength);
1513 
1514  return outputBufferLength;
1515 }
1516 
1517 ULONG
1519  VOID
1520  )
1521 {
1522  IWudfIoIrp * ioIrp = NULL;
1523  ULONG inputBufferLength;
1524 
1525  ioIrp = GetIoIrp();
1526  ioIrp->GetDeviceIoControlParameters(NULL, &inputBufferLength, NULL);
1527 
1528  return inputBufferLength;
1529 }
1530 
1531 VOID
1534  )
1535 {
1537 
1538  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1539 }
1540 
1541 PVOID
1543  VOID
1544  )
1545 {
1546 
1547 
1548 
1549 
1550 
1551  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1552  return NULL;
1553 }
1554 
1555 VOID
1557  __in UCHAR Flags
1558  )
1559 {
1561 
1562 
1563 
1564 
1565 
1566 
1567 
1568 
1569  DO_NOTHING();
1570 }
1571 
1572 VOID
1575  )
1576 {
1577  GetIoIrp()->SetFileForNextIrpStackLocation(FileObject);
1578 }
1579 
1580 VOID
1582  VOID
1583  )
1584 {
1585  m_Irp->ClearNextStackLocation();
1586 }
1587 
1588 ULONG
1590  VOID
1591  )
1592 {
1593  ULONG length;
1594 
1595  GetIoIrp()->GetReadParameters(&length, NULL, NULL);
1596 
1597  return length;
1598 }
1599 
1600 ULONG
1602  VOID
1603  )
1604 {
1605  ULONG length;
1606 
1607  GetIoIrp()->GetWriteParameters(&length, NULL, NULL);
1608 
1609  return length;
1610 }
1611 
1612 ULONG
1614  VOID
1615  )
1616 {
1617  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1618  return 0;
1619 }
1620 
1621 PVOID
1623  VOID
1624  )
1625 {
1626  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1627  return NULL;
1628 }
1629 
1630 MdEThread
1632  VOID
1633  )
1634 {
1635  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1636  return NULL;
1637 }
1638 
1639 BOOLEAN
1641  VOID
1642  )
1643 {
1644  return (GetIoIrp()->IsFrom32BitProcess() ? TRUE : FALSE);
1645 }
1646 
1647 VOID
1649  VOID
1650  )
1651 {
1652  //
1653  // Release the um com irp creation ref
1654  //
1655  m_Irp->Release();
1656 
1657  //
1658  // This is equivalent to IoFreeIrp in km.
1659  //
1660  GetIoIrp()->Deallocate();
1661 }
1662 
1665  VOID
1666  )
1667 {
1668  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1669  return NULL;
1670 }
1671 
1672 PVOID
1674  VOID
1675  )
1676 {
1677  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1678  return NULL;
1679 }
1680 
1681 ULONG
1683  VOID
1684  )
1685 {
1686  FX_VERIFY(INTERNAL, TRAPMSG("To be implemented"));
1687  return 0;
1688 }
1689 
1690 VOID
1693  )
1694 {
1695  IWudfIoIrp* ioIrp;
1697 
1698  ioIrp = GetIoIrp();
1700 
1701  switch (majorFunction) {
1702  case IRP_MJ_CREATE:
1703  ioIrp->GetCreateParameters(
1704  &Parameters->Parameters.Create.Options,
1705  &Parameters->Parameters.Create.FileAttributes,
1706  &Parameters->Parameters.Create.ShareAccess,
1707  NULL // ACCESS_MASK*
1708  );
1709  break;
1710  case IRP_MJ_READ:
1711  ioIrp->GetReadParameters((ULONG*)&Parameters->Parameters.Read.Length,
1712  &Parameters->Parameters.Read.DeviceOffset,
1713  &Parameters->Parameters.Read.Key);
1714  break;
1715  case IRP_MJ_WRITE:
1716  ioIrp->GetWriteParameters((ULONG*)&Parameters->Parameters.Write.Length,
1717  &Parameters->Parameters.Write.DeviceOffset,
1718  &Parameters->Parameters.Write.Key);
1719  break;
1720  case IRP_MJ_DEVICE_CONTROL:
1721  ioIrp->GetDeviceIoControlParameters(
1722  &Parameters->Parameters.DeviceIoControl.IoControlCode,
1723  (ULONG*)&Parameters->Parameters.DeviceIoControl.InputBufferLength,
1724  (ULONG*)&Parameters->Parameters.DeviceIoControl.OutputBufferLength
1725  );
1726  break;
1727  default:
1728  FX_VERIFY(INTERNAL, TRAPMSG("Not expected"));
1729  break;
1730  }
1731 
1732  return;
1733 }
1734 
1735 VOID
1737  _Out_ PIO_STATUS_BLOCK StatusBlock
1738  )
1739 {
1740  StatusBlock->Status = GetStatus();
1741  StatusBlock->Information = GetInformation();
1742 }
1743 
1744 BOOLEAN
1746  _In_ UCHAR StackCount
1747  )
1748 {
1749  UNREFERENCED_PARAMETER(StackCount);
1750 
1751 
1752 
1753 
1754 
1755 
1756 
1757  return TRUE;
1758 }
1759 
1760 BOOLEAN
1762  VOID
1763  )
1764 {
1765 
1766 
1767 
1768 
1769 
1770 
1771 
1772 
1773  return TRUE;
1774 }
1775 
1776 IWudfIoIrp*
1778  VOID
1779  )
1780 {
1781  IWudfIoIrp* pIoIrp;
1782  HRESULT hrQI;
1783 
1784  hrQI = m_Irp->QueryInterface(IID_IWudfIoIrp, (PVOID*)&pIoIrp);
1785  FX_VERIFY(INTERNAL, CHECK_QI(hrQI, pIoIrp));
1786  pIoIrp->Release();
1787 
1788  //
1789  // Now that we confirmed the irp is an io irp, just return the underlying
1790  // irp.
1791  //
1792  return static_cast<IWudfIoIrp*>(m_Irp);
1793 }
1794 
1795 
1796 IWudfPnpIrp*
1798  VOID
1799  )
1800 {
1801  IWudfPnpIrp* pPnpIrp;
1802  HRESULT hrQI;
1803 
1804  hrQI = m_Irp->QueryInterface(IID_IWudfPnpIrp, (PVOID*)&pPnpIrp);
1805  FX_VERIFY(INTERNAL, CHECK_QI(hrQI, pPnpIrp));
1806  pPnpIrp->Release();
1807 
1808  //
1809  // Now that we confirmed the irp is a pnp irp, just return the underlying
1810  // irp.
1811  //
1812  return static_cast<IWudfPnpIrp*>(m_Irp);
1813 }
1814 
#define CreateEvent
Definition: winbase.h:3604
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_ BOOLEAN InvokeOnError
Definition: iofuncs.h:1935
PLIST_ENTRY ListEntry()
Definition: fxirpum.cpp:535
POWER_ACTION GetParameterPowerShutdownType()
Definition: fxirpum.cpp:719
LONGLONG GetParameterWriteByteOffsetQuadPart()
Definition: fxirpum.cpp:1373
ULONG GetParameterReadLength(VOID)
Definition: fxirpum.cpp:1589
enum _POWER_STATE_TYPE POWER_STATE_TYPE
#define _Must_inspect_result_
Definition: no_sal2.h:62
VOID SetMajorFunction(__in UCHAR MajorFunction)
Definition: fxirpum.cpp:905
MdFileObject GetFileObject(VOID)
Definition: fxirpum.cpp:1460
VOID SetParameterIoctlType3InputBuffer(__in PVOID Type3InputBuffer)
Definition: fxirpum.cpp:1175
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PVOID GetContext(__in ULONG Index)
Definition: fxirpum.cpp:361
static MdIrp GetIrpFromListEntry(__in PLIST_ENTRY Ple)
Definition: fxirpum.cpp:1190
MdIrp m_Irp
Definition: fxirp.hpp:33
UCHAR GetCurrentStackFlags(VOID)
Definition: fxirpum.cpp:1243
VOID SetCurrentDeviceObject(__in MdDeviceObject DeviceObject)
Definition: fxirpum.cpp:1362
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:696
VOID CopyToNextIrpStackLocation(__in PIO_STACK_LOCATION Stack)
Definition: fxirpum.cpp:1216
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
#define IRP_MJ_FLUSH_BUFFERS
HRESULT hr
Definition: shlfolder.c:183
VOID SetStatus(__in NTSTATUS Status)
Definition: fxirpum.cpp:457
CCHAR GetCurrentIrpStackLocationIndex()
Definition: fxirpum.cpp:521
REQUEST_POWER_COMPLETE * PREQUEST_POWER_COMPLETE
Definition: potypes.h:469
MdDeviceObject GetDeviceObject(VOID)
Definition: fxirpum.cpp:1352
BOOLEAN GetParameterSetLockLock()
Definition: fxirpum.cpp:993
DEVICE_USAGE_NOTIFICATION_TYPE GetParameterUsageNotificationType()
Definition: fxirpum.cpp:801
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define __in_opt
Definition: dbghelp.h:38
POWER_STATE GetParameterPowerState()
Definition: fxirpum.cpp:1015
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTATUS PoCallDriver(__in MdDeviceObject DeviceObject)
Definition: fxirpum.cpp:48
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG DeviceOffset
Definition: wdfiotarget.h:859
PVOID GetParameterQueryInterfaceInterfaceSpecificData()
Definition: fxirpum.cpp:785
VOID SetContext(__in ULONG Index, __in PVOID Value)
Definition: fxirpum.cpp:351
VOID SetNextStackParameterOthersArgument1(__in PVOID Argument1)
Definition: fxirpum.cpp:1411
BOOLEAN GetNextStackParameterUsageNotificationInPath()
Definition: fxirpum.cpp:830
enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
ULONG GetFlags(VOID)
Definition: fxirpum.cpp:1281
BOOLEAN IsCurrentIrpStackLocationValid(VOID)
Definition: fxirpum.cpp:1761
USHORT GetParameterQueryInterfaceVersion()
Definition: fxirpum.cpp:765
PIO_STACK_LOCATION GetCurrentIrpStackLocation(VOID)
Definition: fxirpum.cpp:370
Definition: fxirp.hpp:28
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
IWudfDeviceStack * deviceStack
DWORD LCID
Definition: nls.h:13
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
#define CHECK(type, val, base, expected)
VOID SetUserBuffer(__in PVOID Value)
Definition: fxirpum.cpp:1341
enum _DEVICE_TEXT_TYPE DEVICE_TEXT_TYPE
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
PCM_RESOURCE_LIST GetParameterAllocatedResources()
Definition: fxirpum.cpp:843
LCID GetParameterQueryDeviceTextLocaleId()
Definition: fxirpum.cpp:975
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
BOOLEAN PendingReturned()
Definition: fxirpum.cpp:429
#define _In_opt_
Definition: no_sal2.h:212
FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK(ERROR_STRING_HW_ACCESS_NOT_ALLOWED,(pDevice->IsDirectHardwareAccessAllowed()==TRUE)), DriverGlobals->DriverName)
VOID PropagatePendingReturned(VOID)
Definition: fxirpum.cpp:443
VOID SetParameterUsageNotificationInPath(__in BOOLEAN InPath)
Definition: fxirpum.cpp:821
uint32_t ULONG_PTR
Definition: typedefs.h:65
MdCompletionRoutine GetNextCompletionRoutine(VOID)
Definition: fxirpum.cpp:1206
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:318
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
UCHAR KIRQL
Definition: env_spec_w32.h:591
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
PVOID GetDriverContext()
Definition: fxirpum.cpp:1673
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
PMDL * GetMdlAddressPointer()
Definition: fxirpum.cpp:1323
VOID SetParameterIoctlOutputBufferLength(__in ULONG OutputBufferLength)
Definition: fxirpum.cpp:1532
#define FALSE
Definition: types.h:117
VOID SetNextIrpStackLocation(VOID)
Definition: fxirpum.cpp:1235
SYSTEM_POWER_STATE GetParameterPowerStateSystemState()
Definition: fxirpum.cpp:707
_In_ WDFREQUEST _In_ NTSTATUS _In_ CCHAR PriorityBoost
Definition: wdfrequest.h:1011
CHECK_RETURN_IF_USER_MODE NTSTATUS SendIrpSynchronously(__in MdDeviceObject DeviceObject)
Definition: fxirpum.cpp:151
VOID SetCompletionRoutine(__in MdCompletionRoutine CompletionRoutine, __in PVOID Context, __in BOOLEAN InvokeOnSuccess=TRUE, __in BOOLEAN InvokeOnError=TRUE, __in BOOLEAN InvokeOnCancel=TRUE)
Definition: fxirpum.cpp:72
ULONG GetParameterIoctlInputBufferLength(VOID)
Definition: fxirpum.cpp:1518
unsigned int BOOL
Definition: ntddk_ex.h:94
const GUID * GetParameterQueryInterfaceType()
Definition: fxirpum.cpp:755
if SUCCEEDED(hr)
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1697
PCM_RESOURCE_LIST GetParameterAllocatedResourcesTranslated()
Definition: fxirpum.cpp:877
DEVICE_TEXT_TYPE GetParameterQueryDeviceTextType()
Definition: fxirpum.cpp:984
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
PVOID * GetNextStackParameterOthersArgument4Pointer()
Definition: fxirpum.cpp:1447
_In_opt_ PDRIVER_CANCEL CancelRoutine
Definition: iofuncs.h:2740
MdEThread GetThread(VOID)
Definition: fxirpum.cpp:1631
VOID SkipCurrentIrpStackLocation(VOID)
Definition: fxirpum.cpp:400
unsigned char BOOLEAN
PINTERFACE GetParameterQueryInterfaceInterface()
Definition: fxirpum.cpp:746
NTSTATUS CallDriver(__in MdDeviceObject DeviceObject)
Definition: fxirpum.cpp:36
VOID StartNextPowerIrp()
Definition: fxirpum.cpp:61
PVOID GetOutputBuffer()
Definition: fxirpum.cpp:594
#define _Out_
Definition: no_sal2.h:160
PIO_STATUS_BLOCK GetStatusBlock(VOID)
Definition: fxirpum.cpp:1664
IWudfIrp * MdIrp
Definition: mxum.h:103
WUDF_DRIVER_CANCEL * MdCancelRoutine
Definition: mxum.h:143
VOID ClearNextStackLocation(VOID)
Definition: fxirpum.cpp:1581
VOID SetSystemBuffer(__in PVOID Value)
Definition: fxirpum.cpp:1313
HRESULT hrQI
Definition: framework.cpp:106
PIO_STACK_LOCATION GetNextIrpStackLocation(VOID)
Definition: fxirpum.cpp:387
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
VOID SetFlags(__in ULONG Flags)
Definition: fxirpum.cpp:1266
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN InvokeOnCancel
Definition: iofuncs.h:1935
PMDL GetMdl()
Definition: fxirpum.cpp:625
VOID SetMdlAddress(__in PMDL Value)
Definition: fxirpum.cpp:1330
Status
Definition: gdiplustypes.h:24
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
int64_t LONGLONG
Definition: typedefs.h:68
VOID SetParameterAllocatedResourcesTranslated(__in PCM_RESOURCE_LIST AllocatedResourcesTranslated)
Definition: fxirpum.cpp:897
VOID SetCompletionRoutineEx(__in MdDeviceObject DeviceObject, __in MdCompletionRoutine CompletionRoutine, __in PVOID Context, __in BOOLEAN InvokeOnSuccess=TRUE, __in BOOLEAN InvokeOnError=TRUE, __in BOOLEAN InvokeOnCancel=TRUE)
Definition: fxirpum.cpp:104
VOID CopyStatus(_Out_ PIO_STATUS_BLOCK StatusBlock)
Definition: fxirpum.cpp:1736
#define WAIT_OBJECT_0
Definition: winbase.h:403
POWER_STATE_TYPE GetParameterPowerType()
Definition: fxirpum.cpp:683
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void Cancel(int sigNum)
Definition: shell.c:481
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
enum _WDF_REQUEST_TYPE WDF_REQUEST_TYPE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG HRESULT
Definition: typedefs.h:79
char CCHAR
Definition: typedefs.h:51
_In_ WDFCOLLECTION _In_ ULONG Index
VOID CompleteRequest(__in_opt CCHAR PriorityBoost=IO_NO_INCREMENT)
Definition: fxirpum.cpp:24
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN InvokeOnSuccess
Definition: iofuncs.h:1935
VOID SetParameterAllocatedResources(__in PCM_RESOURCE_LIST AllocatedResources)
Definition: fxirpum.cpp:869
nsrefcnt Release()
PVOID GetCurrentParametersPointer(VOID)
Definition: fxirpum.cpp:1622
VOID SetInformation(__in ULONG_PTR Information)
Definition: fxirpum.cpp:504
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
DEVICE_POWER_STATE GetParameterPowerStateDeviceState()
Definition: fxirpum.cpp:695
VOID FreeIrp(VOID)
Definition: fxirpum.cpp:1648
VOID SetParameterIoctlInputBufferLength(__in ULONG InputBufferLength)
Definition: fxirpum.cpp:1166
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
SYSTEM_POWER_STATE_CONTEXT GetParameterPowerSystemPowerStateContext()
Definition: fxirpum.cpp:671
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID SetNextParameterWriteLength(__in ULONG IoLength)
Definition: fxirpum.cpp:1398
USHORT GetParameterQueryInterfaceSize()
Definition: fxirpum.cpp:775
VOID SetCancel(__in BOOLEAN Cancel)
Definition: fxirpum.cpp:1294
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID SetNextParameterWriteByteOffsetQuadPart(__in LONGLONG DeviceOffset)
Definition: fxirpum.cpp:1385
VOID SetNextStackFlags(__in UCHAR Flags)
Definition: fxirpum.cpp:1556
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
BOOLEAN GetParameterUsageNotificationInPath()
Definition: fxirpum.cpp:811
_In_ UCHAR _In_ POWER_STATE _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction
Definition: pofuncs.h:42
KIRQL GetCancelIrql()
Definition: fxirpum.cpp:492
BOOLEAN Is32bitProcess(VOID)
Definition: fxirpum.cpp:1640
POWER_ACTION
Definition: ntpoapi.h:122
PVOID GetParameterIoctlType3InputBuffer(VOID)
Definition: fxirpum.cpp:1542
PVOID GetUserBuffer()
Definition: fxirpum.cpp:633
BOOLEAN IsCanceled()
Definition: fxirpum.cpp:484
static _Must_inspect_result_ MdIrp AllocateIrp(_In_ CCHAR StackSize, _In_opt_ FxDevice *Device=NULL)
Definition: fxirpum.cpp:1089
IWudfIoIrp * GetIoIrp(VOID)
Definition: fxirpum.cpp:1777
Definition: typedefs.h:119
#define err(...)
_In_ USHORT _In_ CCHAR StackSize
Definition: iofuncs.h:1056
struct _cl_event * event
Definition: glext.h:7739
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
ULONG GetParameterWriteLength(VOID)
Definition: fxirpum.cpp:1601
VOID MarkIrpPending()
Definition: fxirpum.cpp:415
ULONG GetCurrentFlags(VOID)
Definition: fxirpum.cpp:1613
MxDeviceObject deviceObject
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
VOID InitNextStackUsingStack(__in FxIrp *Irp)
Definition: fxirpum.cpp:1035
PVOID * GetNextStackParameterOthersArgument2Pointer()
Definition: fxirpum.cpp:1434
#define _In_
Definition: no_sal2.h:158
ULONG_PTR GetInformation()
Definition: fxirpum.cpp:513
#define S_OK
Definition: intsafe.h:51
PVOID GetSystemBuffer()
Definition: fxirpum.cpp:543
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
KPROCESSOR_MODE GetRequestorMode(VOID)
Definition: fxirpum.cpp:329
unsigned short USHORT
Definition: pedump.c:61
ULONG GetParameterIoctlOutputBufferLength(VOID)
Definition: fxirpum.cpp:1504
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3032
#define METHOD_BUFFERED
Definition: nt_native.h:594
#define E_NOTIMPL
Definition: ddrawi.h:99
#define TraceEvents(a, b, c, d, e)
Definition: fxirpum.cpp:12
VOID CopyParameters(_Out_ PWDF_REQUEST_PARAMETERS Parameters)
Definition: fxirpum.cpp:1691
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:893
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
#define NULL
Definition: types.h:112
VOID Reuse(__in NTSTATUS Status=STATUS_SUCCESS)
Definition: fxirpum.cpp:661
UCHAR majorFunction
PVOID * GetNextStackParameterOthersArgument1Pointer()
Definition: fxirpum.cpp:1421
CCHAR GetStackCount()
Definition: fxirpum.cpp:1304
IWudfHost2 * g_IWudfHost2
Definition: framework.cpp:48
VOID SetNextStackFileObject(_In_ MdFileObject FileObject)
Definition: fxirpum.cpp:1573
#define IRP_MJ_READ
Definition: rdpdr.c:46
PDEVICE_CAPABILITIES GetParameterDeviceCapabilities()
Definition: fxirpum.cpp:1132
BOOLEAN Cancel(VOID)
Definition: fxirpum.cpp:475
VOID SetParameterIoctlCode(__in ULONG DeviceIoControlCode)
Definition: fxirpum.cpp:1157
#define IRP_MJ_CLEANUP
WUDF_IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: mxum.h:142
GLuint res
Definition: glext.h:9613
UCHAR GetMinorFunction(VOID)
Definition: fxirpum.cpp:297
BUS_QUERY_ID_TYPE GetParameterQueryIdType()
Definition: fxirpum.cpp:1006
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
unsigned int ULONG
Definition: retypes.h:1
VOID ClearNextStack(VOID)
Definition: fxirpum.cpp:1183
BOOLEAN HasStack(_In_ UCHAR StackCount)
Definition: fxirpum.cpp:1745
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
static _Must_inspect_result_ NTSTATUS RequestPowerIrp(__in MdDeviceObject DeviceObject, __in UCHAR MinorFunction, __in POWER_STATE PowerState, __in MdRequestPowerComplete CompletionFunction, __in PVOID Context)
Definition: fxirpum.cpp:1047
VOID SetMinorFunction(__in UCHAR MinorFunction)
Definition: fxirpum.cpp:967
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACINGIO
Definition: dbgtrace.h:66
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ULONG GetParameterIoctlCode(VOID)
Definition: fxirpum.cpp:1474
VOID CopyCurrentIrpStackLocationToNext(VOID)
Definition: fxirpum.cpp:209
#define INFINITE
Definition: serial.h:102
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
static NTSTATUS STDCALL _IrpSynchronousCompletion(__in MdDeviceObject DeviceObject, __in MdIrp OriginalIrp, __in PVOID Context)
Definition: fxirpum.cpp:133
#define __in
Definition: dbghelp.h:35
DEVICE_RELATION_TYPE GetParameterQDRType()
Definition: fxirpum.cpp:731
static SERVICE_STATUS status
Definition: service.c:31
MdCancelRoutine SetCancelRoutine(__in_opt MdCancelRoutine CancelRoutine)
Definition: fxirpum.cpp:124
VOID SetParameterDeviceCapabilities(__in PDEVICE_CAPABILITIES DeviceCapabilities)
Definition: fxirpum.cpp:1145
IWudfPnpIrp * GetPnpIrp(VOID)
Definition: fxirpum.cpp:1797
MdFileObject GetCurrentStackFileObject(VOID)
Definition: fxirpum.cpp:1258
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
ULONG GetDriverContextSize()
Definition: fxirpum.cpp:1682
#define DO_NOTHING()
Definition: mxgeneral.h:32
NTSTATUS GetStatus()
Definition: fxirpum.cpp:466
Definition: ps.c:97