ReactOS  0.4.15-dev-3302-ga37d9a4
fxirpkm.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxIrpKm.hpp
8 
9 Abstract:
10 
11  This module implements km definitions for FxIrp functions.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Kernel mode only
20 
21 Revision History:
22 
23 --*/
24 
25 //
26 // All the functions in this file should use __inline so that KMDF gets
27 // inlining. FxIrp.hpp does not use __inline on the functions because it
28 // doesn't work for UMDF (see comments in FxIrp.hpp).
29 //
30 
31 #ifndef _FXIRPKM_HPP_
32 #define _FXIRPKM_HPP_
33 
34 typedef PIRP MdIrp;
35 
36 typedef DRIVER_CANCEL MdCancelRoutineType, *MdCancelRoutine;
37 typedef IO_COMPLETION_ROUTINE MdCompletionRoutineType, *MdCompletionRoutine;
38 typedef REQUEST_POWER_COMPLETE MdRequestPowerCompleteType, *MdRequestPowerComplete;
39 
40 typedef
44  __in FxIrp *Irp,
46  );
47 
48 typedef
49 VOID
52  __in FxIrp *Irp,
53  __in PVOID CancelContext
54  );
55 
56 #include "fxirp.hpp"
57 
58 
59 
60 __inline
61 MdIrp
63  VOID
64  )
65 {
66  return m_Irp;
67 }
68 
69 __inline
70 MdIrp
72  MdIrp irp
73  )
74 {
75  MdIrp old = m_Irp;
76  m_Irp = irp;
77  return old;
78 }
79 
80 __inline
81 VOID
84  )
85 {
87  m_Irp = NULL;
88 }
89 
90 __inline
94  )
95 {
97 }
98 
99 __inline
100 NTSTATUS
103  )
104 {
105  return ::PoCallDriver(DeviceObject, m_Irp);
106 }
107 
108 __inline
109 VOID
111  )
112 {
114 }
115 
116 __inline
119  VOID
120  )
121 {
123 }
124 
125 
126 __inline
127 VOID
134  )
135 {
137  m_Irp,
139  Context,
143  );
144 }
145 
146 __inline
147 VOID
155  )
156 {
158  DeviceObject,
159  m_Irp,
161  Context,
164  InvokeOnCancel))) {
165 
167  m_Irp,
169  Context,
173  );
174  }
175 }
176 
177 __inline
181  )
182 {
184 }
185 
186 __inline
187 NTSTATUS
188 STDCALL
193  )
194 {
195  FxCREvent* event = (FxCREvent*) Context;
196 
198 
199  if (OriginalIrp->PendingReturned) {
200  //
201  // No need to propagate the pending returned bit since we are handling
202  // the request synchronously
203  //
204  event->Set();
205  }
206 
208 }
209 
210 __inline
211 NTSTATUS
214  )
215 {
218 
220  event.GetSelfPointer(),
221  TRUE,
222  TRUE,
223  TRUE);
224 
226 
227  if (status == STATUS_PENDING) {
228  event.EnterCRAndWaitAndLeave();
229  status = m_Irp->IoStatus.Status;
230  }
231 
232  return status;
233 }
234 
235 __inline
236 VOID
239  )
240 {
242 
243  RtlCopyMemory(nextIrpSp,
244  Stack,
246  );
247  nextIrpSp->Control = 0;
248 }
249 
250 
251 __inline
252 VOID
254  VOID
255  )
256 {
258 }
259 
260 __inline
261 VOID
263  VOID
264  )
265 {
267 }
268 
269 __inline
270 UCHAR
272  VOID
273  )
274 {
276 }
277 
278 __inline
279 UCHAR
281  VOID
282  )
283 {
285 }
286 
287 __inline
288 UCHAR
290  VOID
291  )
292 {
294 }
295 
296 __inline
299  VOID
300  )
301 {
303 }
304 
305 __inline
308  VOID
309  )
310 {
311  return m_Irp->RequestorMode;
312 }
313 
314 __inline
315 VOID
317  __in ULONG Index,
319  )
320 {
321  m_Irp->Tail.Overlay.DriverContext[Index] = Value;
322 }
323 
324 __inline
325 PVOID
328  )
329 {
330  return m_Irp->Tail.Overlay.DriverContext[Index];
331 }
332 
333 __inline
334 VOID
337  )
338 {
339  m_Irp->Flags = Flags;
340 }
341 
342 __inline
343 ULONG
345  VOID
346  )
347 {
348  return m_Irp->Flags;
349 }
350 
351 __inline
354  VOID
355  )
356 {
358 }
359 
360 __inline
363  VOID
364  )
365 {
367 }
368 
370 __inline
372  __in MdIrp Irp
373  )
374 {
378 }
379 
380 __inline
381 VOID
383  VOID
384  )
385 {
386 
387 
388 
389 
390 
391 
393 }
394 
395 __inline
396 VOID
398  )
399 {
401 }
402 
403 __inline
404 BOOLEAN
406  )
407 {
408  return m_Irp->PendingReturned;
409 }
410 
411 __inline
412 VOID
414  VOID
415  )
416 {
417  if (PendingReturned() && m_Irp->CurrentLocation <= m_Irp->StackCount) {
418  MarkIrpPending();
419  }
420 }
421 
422 __inline
423 VOID
426  )
427 {
428  m_Irp->IoStatus.Status = Status;
429 }
430 
431 __inline
432 NTSTATUS
434  )
435 {
436  return m_Irp->IoStatus.Status;
437 }
438 
439 __inline
440 BOOLEAN
442  VOID
443  )
444 {
445  return IoCancelIrp(m_Irp);
446 }
447 
448 __inline
449 VOID
452  )
453 {
454  m_Irp->Cancel = Cancel;
455 }
456 
457 __inline
458 BOOLEAN
460  )
461 {
462  return m_Irp->Cancel ? TRUE : FALSE;
463 }
464 
465 __inline
466 KIRQL
468  )
469 {
470  return m_Irp->CancelIrql;
471 }
472 
473 __inline
474 VOID
477  )
478 {
479  m_Irp->IoStatus.Information = Information;
480 }
481 
482 __inline
483 ULONG_PTR
485  )
486 {
487  return m_Irp->IoStatus.Information;
488 }
489 
490 __inline
491 CCHAR
493  )
494 {
495  return m_Irp->CurrentLocation;
496 }
497 
498 __inline
499 CCHAR
501  )
502 {
503  return m_Irp->StackCount;
504 }
505 
506 __inline
509  )
510 {
511  return &m_Irp->Tail.Overlay.ListEntry;
512 }
513 
514 __inline
515 PVOID
517  )
518 {
519  return m_Irp->AssociatedIrp.SystemBuffer;
520 }
521 
522 __inline
523 PVOID
525  )
526 {
527  //
528  // In kernel mode, for buffered I/O, the output and input buffers are
529  // at same location.
530  //
531  return GetSystemBuffer();
532 }
533 
534 __inline
535 VOID
538  )
539 {
540  m_Irp->AssociatedIrp.SystemBuffer = Value;
541 }
542 
543 
544 __inline
545 PMDL
547  )
548 {
549  return m_Irp->MdlAddress;
550 }
551 
552 __inline
553 PMDL*
555  )
556 {
557  return &m_Irp->MdlAddress;
558 }
559 
560 __inline
561 VOID
563  __in PMDL Value
564  )
565 {
566  m_Irp->MdlAddress = Value;
567 }
568 
569 
570 __inline
571 PVOID
573  )
574 {
575  return m_Irp->UserBuffer;
576 }
577 
578 
579 __inline
580 VOID
583  )
584 {
585  m_Irp->UserBuffer = Value;
586 }
587 
588 __inline
589 VOID
592  )
593 {
595 }
596 
597 __inline
598 VOID
601  )
602 {
604 }
605 
606 __inline
607 VOID
610  )
611 {
613 }
614 
615 __inline
618  )
619 {
620  return (this->GetCurrentIrpStackLocation())->
621  Parameters.Power.SystemPowerStateContext;
622 }
623 
624 __inline
627  )
628 {
629  return (this->GetCurrentIrpStackLocation())->Parameters.Power.Type;
630 }
631 
632 __inline
635  )
636 {
637  return (this->GetCurrentIrpStackLocation())->Parameters.Power.State;
638 }
639 
640 __inline
643  )
644 {
645  return (this->GetCurrentIrpStackLocation())->
646  Parameters.Power.State.DeviceState;
647 }
648 
649 __inline
652  )
653 {
654  return (this->GetCurrentIrpStackLocation())->
655  Parameters.Power.State.SystemState;
656 }
657 
658 __inline
661  )
662 {
663  return (this->GetCurrentIrpStackLocation())->
664  Parameters.Power.ShutdownType;
665 }
666 
667 __inline
670  )
671 {
672  return (this->GetCurrentIrpStackLocation())->
673  Parameters.QueryDeviceRelations.Type;
674 }
675 
676 __inline
677 VOID
679  DEVICE_RELATION_TYPE DeviceRelation
680  )
681 {
682  this->GetNextIrpStackLocation()->
683  Parameters.QueryDeviceRelations.Type = DeviceRelation;
684 }
685 
686 __inline
689  )
690 {
691  return this->GetCurrentIrpStackLocation()->
692  Parameters.DeviceCapabilities.Capabilities;
693 }
694 
695 __inline
698  VOID
699  )
700 {
702 }
703 
704 __inline
705 VOID
708  )
709 {
711 }
712 
713 __inline
714 VOID
717  )
718 {
719  this->GetNextIrpStackLocation()->
721 }
722 
723 __inline
724 LONGLONG
726  )
727 {
728  return this->GetCurrentIrpStackLocation()->
729  Parameters.Write.ByteOffset.QuadPart;
730 }
731 
732 __inline
733 VOID
736  )
737 {
738  this->GetNextIrpStackLocation()->
739  Parameters.Write.ByteOffset.QuadPart = DeviceOffset;
740 }
741 
742 __inline
743 VOID
745  __in ULONG IoLength
746  )
747 {
748  this->GetNextIrpStackLocation()->
749  Parameters.Write.Length = IoLength;
750 }
751 
752 __inline
753 PVOID*
755  )
756 {
757  PIO_STACK_LOCATION nextStack;
758 
759  nextStack = this->GetNextIrpStackLocation();
760 
761  return &nextStack->Parameters.Others.Argument1;
762 }
763 
764 __inline
765 VOID
768  )
769 {
770  this->GetNextIrpStackLocation()->
771  Parameters.Others.Argument1 = Argument1;
772 }
773 
774 __inline
775 PVOID*
777  )
778 {
779  PIO_STACK_LOCATION nextStack;
780 
781  nextStack = this->GetNextIrpStackLocation();
782 
783  return &nextStack->Parameters.Others.Argument2;
784 }
785 
786 __inline
787 PVOID*
789  )
790 {
791  PIO_STACK_LOCATION nextStack;
792 
793  nextStack = this->GetNextIrpStackLocation();
794 
795  return &nextStack->Parameters.Others.Argument4;
796 }
797 
798 __inline
801  )
802 {
803  return this->GetCurrentIrpStackLocation()->
804  Parameters.StartDevice.AllocatedResources;
805 }
806 
807 __inline
808 VOID
811  )
812 {
813  this->GetNextIrpStackLocation()->
814  Parameters.StartDevice.AllocatedResources = AllocatedResources;
815 }
816 
817 __inline
820  )
821 {
822  return this->GetCurrentIrpStackLocation()->
823  Parameters.StartDevice.AllocatedResourcesTranslated;
824 }
825 
826 __inline
827 VOID
830  )
831 {
832  this->GetNextIrpStackLocation()->
833  Parameters.StartDevice.AllocatedResourcesTranslated =
835 }
836 
837 __inline
838 LCID
840  )
841 {
842  return this->GetCurrentIrpStackLocation()->
843  Parameters.QueryDeviceText.LocaleId;
844 }
845 
846 __inline
849  )
850 {
851  return this->GetCurrentIrpStackLocation()->
852  Parameters.QueryDeviceText.DeviceTextType;
853 }
854 
855 __inline
856 BOOLEAN
858  )
859 {
860  return this->GetCurrentIrpStackLocation()->Parameters.SetLock.Lock;
861 }
862 
863 __inline
866  )
867 {
868  return this->GetCurrentIrpStackLocation()->Parameters.QueryId.IdType;
869 }
870 
871 __inline
874  )
875 {
876  return this->GetCurrentIrpStackLocation()->
877  Parameters.QueryInterface.Interface;
878 }
879 
880 __inline
881 const GUID*
883  )
884 {
885  return this->GetCurrentIrpStackLocation()->
886  Parameters.QueryInterface.InterfaceType;
887 }
888 
889 __inline
892  VOID
893  )
894 {
895  return this->GetCurrentIrpStackLocation()->FileObject;
896 }
897 
898 __inline
899 USHORT
901  )
902 {
903  return this->GetCurrentIrpStackLocation()->Parameters.QueryInterface.Version;
904 }
905 
906 __inline
907 USHORT
909  )
910 {
912 }
913 
914 __inline
915 PVOID
917  )
918 {
919  return this->GetCurrentIrpStackLocation()->
920  Parameters.QueryInterface.InterfaceSpecificData;
921 }
922 
923 __inline
926  )
927 {
928  return this->GetCurrentIrpStackLocation()->
930 }
931 
932 __inline
933 BOOLEAN
935  )
936 {
937  return this->GetCurrentIrpStackLocation()->
939 }
940 
941 __inline
942 VOID
944  __in BOOLEAN InPath
945  )
946 {
947  this->GetNextIrpStackLocation()->
948  Parameters.UsageNotification.InPath = InPath;
949 }
950 
951 __inline
952 BOOLEAN
954  )
955 {
956  return this->GetNextIrpStackLocation()->
958 }
959 
960 
961 
962 __inline
963 ULONG
965  VOID
966  )
967 {
968  return this->GetCurrentIrpStackLocation()->
969  Parameters.DeviceIoControl.IoControlCode;
970 }
971 
972 __inline
973 ULONG
975  VOID
976  )
977 {
979 }
980 
981 __inline
982 ULONG
984  VOID
985  )
986 {
987  return this->GetCurrentIrpStackLocation()->
988  Parameters.DeviceIoControl.OutputBufferLength;
989 }
990 
991 __inline
992 ULONG
994  VOID
995  )
996 {
997  return this->GetCurrentIrpStackLocation()->
998  Parameters.DeviceIoControl.InputBufferLength;
999 }
1000 
1001 __inline
1002 VOID
1004  __in ULONG DeviceIoControlCode
1005  )
1006 {
1007  this->GetNextIrpStackLocation()->
1008  Parameters.DeviceIoControl.IoControlCode = DeviceIoControlCode;
1009 }
1010 
1011 __inline
1012 VOID
1015  )
1016 {
1017  this->GetNextIrpStackLocation()->
1018  Parameters.DeviceIoControl.InputBufferLength = InputBufferLength;
1019 }
1020 
1021 __inline
1022 VOID
1025  )
1026 {
1027  this->GetNextIrpStackLocation()->
1028  Parameters.DeviceIoControl.OutputBufferLength = OutputBufferLength;
1029 }
1030 
1031 __inline
1032 VOID
1034  __in PVOID Type3InputBuffer
1035  )
1036 {
1037  this->GetNextIrpStackLocation()->
1038  Parameters.DeviceIoControl.Type3InputBuffer = Type3InputBuffer;
1039 }
1040 
1041 __inline
1042 PVOID
1044  VOID
1045  )
1046 {
1047  return this->GetCurrentIrpStackLocation()->
1048  Parameters.DeviceIoControl.Type3InputBuffer;
1049 }
1050 
1051 __inline
1052 VOID
1055  )
1056 {
1057  this->GetNextIrpStackLocation()->
1058  Parameters.QueryInterface.Interface = Interface;
1059 }
1060 
1061 __inline
1062 VOID
1064  __in const GUID* InterfaceType
1065  )
1066 {
1067  this->GetNextIrpStackLocation()->
1068  Parameters.QueryInterface.InterfaceType = InterfaceType;
1069 }
1070 
1071 __inline
1072 VOID
1075  )
1076 {
1078 }
1079 
1080 __inline
1081 VOID
1083  __in USHORT Size
1084  )
1085 {
1087 }
1088 
1089 __inline
1090 VOID
1093  )
1094 {
1095  this->GetNextIrpStackLocation()->
1096  Parameters.QueryInterface.InterfaceSpecificData = InterfaceSpecificData;
1097 }
1098 
1099 __inline
1100 VOID
1102  __in UCHAR Flags
1103  )
1104 {
1105  this->GetNextIrpStackLocation()->Flags = Flags;
1106 }
1107 
1108 __inline
1109 VOID
1112  )
1113 {
1115 }
1116 
1117 
1118 __inline
1119 VOID
1121  VOID
1122  )
1123 {
1125 
1126  stack = this->GetNextIrpStackLocation();
1127  RtlZeroMemory(stack, sizeof(IO_STACK_LOCATION));
1128 }
1129 
1130 
1131 
1132 
1133 __inline
1134 VOID
1136  VOID
1137  )
1138 {
1141 }
1142 
1143 __inline
1144 VOID
1146  __in FxIrp* Irp
1147  )
1148 {
1149  PIO_STACK_LOCATION srcStack, destStack;
1150 
1151  srcStack = Irp->GetCurrentIrpStackLocation();
1152  destStack = this->GetNextIrpStackLocation();
1153 
1154  *destStack = *srcStack;
1155 }
1156 
1158 __inline
1159 MdIrp
1163  )
1164 {
1166 
1167  return IoAllocateIrp(StackSize, FALSE);
1168 }
1169 
1170 __inline
1171 MdIrp
1173  __in PLIST_ENTRY Ple
1174  )
1175 {
1176  return CONTAINING_RECORD(Ple, IRP, Tail.Overlay.ListEntry);
1177 }
1178 
1179 __inline
1180 ULONG
1182  VOID
1183  )
1184 {
1185  return this->GetCurrentIrpStackLocation()->Parameters.Read.Length;
1186 }
1187 
1188 __inline
1189 ULONG
1191  VOID
1192  )
1193 {
1194  return this->GetCurrentIrpStackLocation()->Parameters.Write.Length;
1195 }
1196 
1198 __inline
1199 NTSTATUS
1206  )
1207 {
1208  //
1209  // Prefast enforces that NULL is passed for IRP parameter (last parameter)
1210  // since the IRP might complete before the function returns.
1211  //
1212  return PoRequestPowerIrp(
1213  DeviceObject,
1214  MinorFunction,
1215  PowerState,
1217  Context,
1218  NULL);
1219 }
1220 
1221 __inline
1222 ULONG
1224  VOID
1225  )
1226 {
1227  return (this->GetCurrentIrpStackLocation())->Flags;
1228 }
1229 
1230 __inline
1231 PVOID
1233  VOID
1234  )
1235 {
1236  return &(this->GetCurrentIrpStackLocation())->Parameters;
1237 }
1238 
1239 __inline
1240 MdEThread
1242  VOID
1243  )
1244 {
1245  return m_Irp->Tail.Overlay.Thread;
1246 }
1247 
1248 __inline
1249 BOOLEAN
1251  VOID
1252  )
1253 {
1254 
1255 #if defined(_WIN64)
1256 
1257 #if BUILD_WOW64_ENABLED
1258 
1259  return IoIs32bitProcess(m_Irp);
1260 
1261 #else // BUILD_WOW64_ENABLED
1262 
1263  return FALSE;
1264 
1265 #endif // BUILD_WOW64_ENABLED
1266 
1267 #else // defined(_WIN64)
1268 
1269  return TRUE;
1270 
1271 #endif // defined(_WIN64)
1272 
1273 }
1274 
1275 __inline
1276 VOID
1278  VOID
1279  )
1280 {
1281  IoFreeIrp(m_Irp);
1282 }
1283 
1284 __inline
1287  VOID
1288  )
1289 {
1290  return &m_Irp->IoStatus;
1291 }
1292 
1293 __inline
1294 PVOID
1296  VOID
1297  )
1298 {
1299  return m_Irp->Tail.Overlay.DriverContext;
1300 }
1301 
1302 __inline
1303 ULONG
1305  VOID
1306  )
1307 {
1308  return sizeof(m_Irp->Tail.Overlay.DriverContext);
1309 }
1310 
1311 __inline
1312 VOID
1315  )
1316 {
1317  RtlMoveMemory(&Parameters->Parameters,
1319  sizeof(Parameters->Parameters));
1320 }
1321 
1322 __inline
1323 VOID
1325  _Out_ PIO_STATUS_BLOCK StatusBlock
1326  )
1327 {
1328  RtlCopyMemory(StatusBlock,
1329  GetStatusBlock(),
1330  sizeof(*StatusBlock));
1331 }
1332 
1333 __inline
1334 BOOLEAN
1336  _In_ UCHAR StackCount
1337  )
1338 {
1339  return (GetCurrentIrpStackLocationIndex() >= StackCount);
1340 }
1341 
1342 __inline
1343 BOOLEAN
1345  VOID
1346  )
1347 {
1349 }
1350 
1351 __inline
1353 {
1354  if (m_Irp != NULL) {
1355  IoFreeIrp(m_Irp);
1356  }
1357 }
1358 
1359 #endif // _FXIRPKM_HPP
DRIVER_CANCEL MdCancelRoutineType
Definition: fxirpkm.hpp:36
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_ BOOLEAN InvokeOnError
Definition: iofuncs.h:1939
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
DRIVER_CANCEL * MdCancelRoutine
Definition: fxirpkm.hpp:36
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:461
struct _IO_STACK_LOCATION::@3729::@3734 Write
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
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
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
#define _In_opt_
Definition: ms_sal.h:309
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(* PFX_CANCEL_ROUTINE)(__in FxDevice *Device, __in FxIrp *Irp, __in PVOID CancelContext)
Definition: fxirpkm.hpp:50
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
VOID SetStatus(__in NTSTATUS Status)
Definition: fxirpum.cpp:457
VOID NTAPI IoReuseIrp(IN OUT PIRP Irp, IN NTSTATUS Status)
Definition: irp.c:1971
CCHAR GetCurrentIrpStackLocationIndex()
Definition: fxirpum.cpp:521
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 _Out_
Definition: ms_sal.h:345
#define METHOD_FROM_CTL_CODE(ctrlCode)
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4640
#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
LONG NTSTATUS
Definition: precomp.h:26
struct _IO_STACK_LOCATION::@3729::@3746 DeviceIoControl
ULONG GetFlags(VOID)
Definition: fxirpum.cpp:1281
BOOLEAN IsCurrentIrpStackLocationValid(VOID)
Definition: fxirpum.cpp:1761
IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: fxirpkm.hpp:37
USHORT GetParameterQueryInterfaceVersion()
Definition: fxirpum.cpp:765
PIO_STACK_LOCATION GetCurrentIrpStackLocation(VOID)
Definition: fxirpum.cpp:370
Definition: fxirp.hpp:28
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
VOID SetParameterQueryInterfaceInterfaceSpecificData(__in PVOID InterfaceSpecificData)
Definition: fxirpkm.hpp:1091
PIRP MdIrp
Definition: fxirpkm.hpp:34
struct _IO_STACK_LOCATION::@3729::@3755 QueryInterface
static stack_node_t * stack
Definition: rpn_ieee.c:37
DWORD LCID
Definition: nls.h:13
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:318
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
VOID SetUserBuffer(__in PVOID Value)
Definition: fxirpum.cpp:1341
IoSetCancelRoutine(Irp, CancelRoutine)
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
REQUEST_POWER_COMPLETE * MdRequestPowerComplete
Definition: mxum.h:162
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
struct _IO_STACK_LOCATION::@3729::@3754 QueryDeviceRelations
NTSTATUS NTAPI PoRequestPowerIrp(_In_ PDEVICE_OBJECT DeviceObject, _In_ UCHAR MinorFunction, _In_ POWER_STATE PowerState, _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction, _In_opt_ __drv_aliasesMem PVOID Context, _Outptr_opt_ PIRP *pIrp)
Definition: power.c:647
struct _IO_STACK_LOCATION::@3729::@3768 Others
VOID PropagatePendingReturned(VOID)
Definition: fxirpum.cpp:443
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
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
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2868
UCHAR KIRQL
Definition: env_spec_w32.h:591
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
_In_ PIRP Irp
Definition: csq.h:116
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
const GUID * GetParameterQueryInterfaceType()
Definition: fxirpum.cpp:755
REQUEST_POWER_COMPLETE * MdRequestPowerComplete
Definition: fxirpkm.hpp:38
_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
struct _IO_STACK_LOCATION::@3729::@3766 StartDevice
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResourcesTranslated
Definition: ndis.h:4640
PVOID * GetNextStackParameterOthersArgument4Pointer()
Definition: fxirpum.cpp:1447
_In_opt_ PDRIVER_CANCEL CancelRoutine
Definition: iofuncs.h:2744
struct _IO_STACK_LOCATION::@3729::@3762 UsageNotification
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 _In_
Definition: ms_sal.h:308
#define IoCompleteRequest
Definition: irp.c:1240
PIO_STATUS_BLOCK GetStatusBlock(VOID)
Definition: fxirpum.cpp:1664
#define DeviceCapabilities
Definition: wingdi.h:4449
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
PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: iotypes.h:3314
PIO_STACK_LOCATION GetNextIrpStackLocation(VOID)
Definition: fxirpum.cpp:387
REQUEST_POWER_COMPLETE MdRequestPowerCompleteType
Definition: fxirpkm.hpp:38
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_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:1939
PMDL GetMdl()
Definition: fxirpum.cpp:625
Definition: _stack.h:47
struct _IO_STACK_LOCATION::@3729::@3756 DeviceCapabilities
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
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
#define STDCALL
Definition: wdf.h:45
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
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:1939
VOID SetParameterAllocatedResources(__in PCM_RESOURCE_LIST AllocatedResources)
Definition: fxirpum.cpp:869
PVOID GetCurrentParametersPointer(VOID)
Definition: fxirpum.cpp:1622
VOID SetInformation(__in ULONG_PTR Information)
Definition: fxirpum.cpp:504
DEVICE_POWER_STATE GetParameterPowerStateDeviceState()
Definition: fxirpum.cpp:695
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:3223
VOID FreeIrp(VOID)
Definition: fxirpum.cpp:1648
VOID SetParameterIoctlInputBufferLength(__in ULONG InputBufferLength)
Definition: fxirpum.cpp:1166
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
SYSTEM_POWER_STATE_CONTEXT GetParameterPowerSystemPowerStateContext()
Definition: fxirpum.cpp:671
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
NTSTATUS NTAPI IoSetCompletionRoutineEx(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PIO_COMPLETION_ROUTINE CompletionRoutine, IN PVOID Context, IN BOOLEAN InvokeOnSuccess, IN BOOLEAN InvokeOnError, IN BOOLEAN InvokeOnCancel)
Definition: iocomp.c:220
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
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
#define NTSTATUS
Definition: precomp.h:20
POWER_ACTION
Definition: ntpoapi.h:122
PVOID GetParameterIoctlType3InputBuffer(VOID)
Definition: fxirpum.cpp:1542
PVOID GetUserBuffer()
Definition: fxirpum.cpp:633
#define VOID
Definition: acefi.h:82
BOOLEAN IsCanceled()
Definition: fxirpum.cpp:484
static _Must_inspect_result_ MdIrp AllocateIrp(_In_ CCHAR StackSize, _In_opt_ FxDevice *Device=NULL)
Definition: fxirpum.cpp:1089
Definition: typedefs.h:119
_In_ PTRANSFER_PACKET _In_ ULONG _In_ PIRP OriginalIrp
Definition: classp.h:1757
_In_ USHORT _In_ CCHAR StackSize
Definition: iofuncs.h:1058
struct _cl_event * event
Definition: glext.h:7739
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
ULONG GetParameterWriteLength(VOID)
Definition: fxirpum.cpp:1601
VOID MarkIrpPending()
Definition: fxirpum.cpp:415
ULONG GetCurrentFlags(VOID)
Definition: fxirpum.cpp:1613
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
VOID InitNextStackUsingStack(__in FxIrp *Irp)
Definition: fxirpum.cpp:1035
PVOID * GetNextStackParameterOthersArgument2Pointer()
Definition: fxirpum.cpp:1434
ULONG_PTR GetInformation()
Definition: fxirpum.cpp:513
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
PVOID GetSystemBuffer()
Definition: fxirpum.cpp:543
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:746
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
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
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
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
NTSTATUS(* PFX_COMPLETION_ROUTINE)(__in FxDevice *Device, __in FxIrp *Irp, __in PVOID Context)
Definition: fxirpkm.hpp:42
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
#define NULL
Definition: types.h:112
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
VOID Reuse(__in NTSTATUS Status=STATUS_SUCCESS)
Definition: fxirpum.cpp:661
IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: fxirpkm.hpp:37
struct _IO_STACK_LOCATION::@3729::@3761 QueryDeviceText
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
PVOID * GetNextStackParameterOthersArgument1Pointer()
Definition: fxirpum.cpp:1421
CCHAR GetStackCount()
Definition: fxirpum.cpp:1304
VOID SetNextStackFileObject(_In_ MdFileObject FileObject)
Definition: fxirpum.cpp:1573
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
BOOLEAN NTAPI IoCancelIrp(IN PIRP Irp)
Definition: irp.c:1101
PDEVICE_CAPABILITIES GetParameterDeviceCapabilities()
Definition: fxirpum.cpp:1132
BOOLEAN Cancel(VOID)
Definition: fxirpum.cpp:475
VOID SetParameterIoctlCode(__in ULONG DeviceIoControlCode)
Definition: fxirpum.cpp:1157
VOID SetParameterQueryInterfaceType(__in const GUID *InterfaceType)
Definition: fxirpkm.hpp:1063
WUDF_IO_COMPLETION_ROUTINE * MdCompletionRoutine
Definition: mxum.h:142
struct tagContext Context
Definition: acpixf.h:1034
VOID NTAPI IoFreeIrp(IN PIRP Irp)
Definition: irp.c:1666
UCHAR GetMinorFunction(VOID)
Definition: fxirpum.cpp:297
BUS_QUERY_ID_TYPE GetParameterQueryIdType()
Definition: fxirpum.cpp:1006
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
VOID ClearNextStack(VOID)
Definition: fxirpum.cpp:1183
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
BOOLEAN HasStack(_In_ UCHAR StackCount)
Definition: fxirpum.cpp:1745
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
Definition: irp.c:615
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
ULONG GetParameterIoctlCode(VOID)
Definition: fxirpum.cpp:1474
VOID SetParameterQDRType(__in DEVICE_RELATION_TYPE DeviceRelation)
Definition: fxirpkm.hpp:678
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
MdIrp SetIrp(MdIrp irp)
Definition: fxirpkm.hpp:71
VOID CopyCurrentIrpStackLocationToNext(VOID)
Definition: fxirpum.cpp:209
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
static NTSTATUS STDCALL _IrpSynchronousCompletion(__in MdDeviceObject DeviceObject, __in MdIrp OriginalIrp, __in PVOID Context)
Definition: fxirpum.cpp:133
IoMarkIrpPending(Irp)
#define __in
Definition: dbghelp.h:35
DEVICE_RELATION_TYPE GetParameterQDRType()
Definition: fxirpum.cpp:731
static SERVICE_STATUS status
Definition: service.c:31
VOID SetParameterQueryInterfaceVersion(__in USHORT Version)
Definition: fxirpkm.hpp:1073
MdCancelRoutine SetCancelRoutine(__in_opt MdCancelRoutine CancelRoutine)
Definition: fxirpum.cpp:124
VOID SetParameterDeviceCapabilities(__in PDEVICE_CAPABILITIES DeviceCapabilities)
Definition: fxirpum.cpp:1145
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680
VOID SetParameterQueryInterfaceInterface(__in PINTERFACE Interface)
Definition: fxirpkm.hpp:1053
MdFileObject GetCurrentStackFileObject(VOID)
Definition: fxirpum.cpp:1258
FxIrp * irp
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:461
static PIO_STACK_LOCATION _GetAndClearNextStackLocation(__in MdIrp Irp)
Definition: fxirpkm.hpp:371
ULONG GetDriverContextSize()
Definition: fxirpum.cpp:1682
VOID SetParameterQueryInterfaceSize(__in USHORT Size)
Definition: fxirpkm.hpp:1082
NTSTATUS GetStatus()
Definition: fxirpum.cpp:466
Definition: ps.c:97