ReactOS  0.4.15-dev-3187-ge372f2b
fxrequest.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxRequest.hpp
8 
9 Abstract:
10 
11  This is the request object for the driver frameworks.
12 
13  The request object wraps the IRP, containing persistent
14  information required by the driver frameworks.
15 
16 Author:
17 
18 
19 
20 
21 
22 Environment:
23 
24  Both kernel and user mode
25 
26 Revision History:
27 
28 --*/
29 
30 #ifndef _FXREQUEST_H_
31 #define _FXREQUEST_H_
32 
33 //
34 // Magic number to differentiate between default value and caller provided one
35 //
36 #define USE_DEFAULT_PRIORITY_BOOST ((CHAR) 0x7F)
37 
38 //
39 // This tag is used to set and clear the completion callback state as the
40 // ownership of the request transfers from I/O pkg-to-queue or queue-to-queue.
41 //
42 #define FXREQUEST_STATE_TAG (PVOID) 'tatS'
43 
44 //
45 // This tag is used when the request is added and removed from FxIrpQueue.
46 //
47 #define FXREQUEST_QUEUE_TAG (PVOID) 'ueuQ'
48 
49 //
50 // This tag is used to take a reference in the completion path.
51 //
52 #define FXREQUEST_COMPLETE_TAG (PVOID) 'pmoC'
53 
54 //
55 // Use this tag when you want to temporarily hold the object from
56 // disappearing between unlock and lock operation.
57 //
58 #define FXREQUEST_HOLD_TAG (PVOID) 'dloH'
59 
60 //
61 // This tag is used to take a reference in the completion path.
62 //
63 #define FXREQUEST_FWDPRG_TAG (PVOID) 'PdwF'
64 
65 //
66 // This tag is used to take a reference in the completion path for driver created
67 // requests that support completion operations.
68 //
69 #define FXREQUEST_DCRC_TAG (PVOID) 'CRCD'
70 
71 extern "C" {
72 #if defined(EVENT_TRACING)
73 #include "FxRequest.hpp.tmh"
74 #endif
75 }
76 
77 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
78 #define WDF_REQUEST_SEND_OPTION_IMPERSONATION_FLAGS \
79  (WDF_REQUEST_SEND_OPTION_IMPERSONATE_CLIENT | \
80  WDF_REQUEST_SEND_OPTION_IMPERSONATION_IGNORE_FAILURE)
81 
82 #define FxIrpStackFlagsFromSendFlags(sendFlags) \
83  ((WUDFX_IRP_STACK_FLAGS) \
84  ((sendFlags) & WDF_REQUEST_SEND_OPTION_IMPERSONATION_FLAGS))
85 #endif
86 
87 typedef
93  );
94 
96  friend FxRequest;
97 
98 public:
100  VOID
101  )
102  {
103  m_Buffer = NULL;
104  }
105 
107  virtual
108  PVOID
109  GetBuffer(
110  VOID
111  );
112 
113  virtual
114  size_t
116  VOID
117  );
118 
120  virtual
121  PMDL
122  GetMdl(
123  VOID
124  );
125 
126  virtual
127  WDFMEMORY
128  GetHandle(
129  VOID
130  );
131 
132  virtual
133  USHORT
134  GetFlags(
135  VOID
136  );
137 
138  virtual
141  VOID
142  );
143 
144  virtual
145  ULONG
146  AddRef(
147  __in PVOID Tag,
148  __in LONG Line,
150  );
151 
152  virtual
153  ULONG
154  Release(
155  __in PVOID Tag,
156  __in LONG Line,
158  );
159 
160  virtual
161  VOID
162  Delete(
163  VOID
164  );
165 
166  __inline
167  BOOLEAN
169  VOID
170  )
171  {
172  return m_Buffer != NULL ? TRUE : FALSE;
173  }
174 
175  __inline
176  VOID
178  VOID
179  )
180  {
181  m_Buffer = NULL;
182  m_Mdl = NULL;
183  }
184 
185 protected:
186  __inline
187  VOID
189  PVOID Buffer
190  )
191  {
192  ASSERT(m_Buffer == NULL);
193  m_Buffer = Buffer;
194  }
195 
196  __inline
197  VOID
199  PMDL Mdl
200  )
201  {
202  ASSERT(m_Mdl == NULL);
203  m_Mdl = Mdl;
204  }
205 
206  FxRequest*
207  GetRequest(
208  VOID
209  );
210 
211 protected:
212  //
213  // The current irp stack location indicates which type to use
214  //
215  // The buffer / MDL is cached away as a copy instead of using the PIRP values
216  // directly because we want to capture the current state of the irp when
217  // returning the WDFMEMORY. For instance, if used the PIRP value directly
218  // when implementing GetBuffer(), we are subject to the PIRP being formatted
219  // for the next stack location and changing the buffer pointer, or worse,
220  // changing the MDL value and have the resulting MDL not be mapped, and then
221  // a call to MmGetSystemAddressForMdlSafe can return NULL, and thus GetBuffer(),
222  // return NULL, which would violate the contract for GetBuffer().
223  //
224  // As an example, let's
225  // 1) the WDFREQUEST/PIRP comes in as a read on a direct io device object,
226  // so Irp->MdlAddress = <read MDL>
227  // 2) This WDFMEMORY will return <read MDL VA> in GetBuffer()
228  // 3) the WDFREQUEST is formatted for an IOCTL which is METHOD_OUT_DIRECT
229  // with a new output buffer. Irp->MdlAddres = <IOCTL MDL> now.
230  // 4) This same WDFMEMORY will now return <IOCTL MDL VA> in GetBuffer()
231  //
232  // Essentialy, formatting the WDFREQUEST causes unintended side affects for
233  // the WDFMEMORYs it returns. To eliminate those side affects, we capture
234  // the original buffer.
235  //
236  union {
239  };
240 };
241 
243  friend FxRequest;
244 
245 public:
247  VOID
248  )
249  {
250  m_Buffer = NULL;
251  }
252 
253  virtual
254  PVOID
255  GetBuffer(
256  VOID
257  );
258 
259  virtual
260  size_t
262  VOID
263  );
264 
266  virtual
267  PMDL
268  GetMdl(
269  VOID
270  );
271 
272  virtual
273  WDFMEMORY
274  GetHandle(
275  VOID
276  );
277 
278  virtual
279  USHORT
280  GetFlags(
281  VOID
282  );
283 
284  virtual
287  VOID
288  );
289 
290  virtual
291  ULONG
292  AddRef(
293  __in PVOID Tag,
294  __in LONG Line,
296  );
297 
298  virtual
299  ULONG
300  Release(
301  __in PVOID Tag,
302  __in LONG Line,
304  );
305 
306  virtual
307  VOID
308  Delete(
309  VOID
310  );
311 
312  __inline
313  BOOLEAN
315  VOID
316  )
317  {
318  return m_Buffer != NULL ? TRUE : FALSE;
319  }
320 
321  __inline
322  VOID
324  VOID
325  )
326  {
327  m_Buffer = NULL;
328  m_Mdl = NULL;
329  }
330 
331 protected:
332  __inline
333  VOID
336  )
337  {
338  ASSERT(m_Buffer == NULL);
339  m_Buffer = Buffer;
340  }
341 
342  __inline
343  VOID
345  __in PMDL Mdl
346  )
347  {
348  ASSERT(m_Mdl == NULL);
349  m_Mdl = Mdl;
350  }
351 
352  FxRequest*
353  GetRequest(
354  VOID
355  );
356 
357 protected:
358  //
359  // The current irp stack location indicates which type to use
360  //
361  // See comments in FxRequestSystemBuffer's union for why we capture the
362  // values vs using them directly from the PIRP.
363  //
364  union {
367  };
368 };
369 
370 // begin_wpp enum
373 
374  // this entry is used when the request is owned by the framework
376 
377  // this entry is used when the request is presented to the driver
379 
380  // this entry is used for forward progress
382 };
383 
385  FxRequestPowerStopUnknown = 0, // Initial state
386 
387  // Set when the driver calls WdfRequestStopAcknowledge
389 
390  // Set when the driver WdfRequestStopAcknowledge with requeue option
392 };
393 
394 // end_wpp
395 
396 class FxRequest : public FxRequestBase {
397 
398  friend FxIoTarget;
399  friend FxIoQueue;
400 
404  friend VOID GetTriageInfo(VOID);
405 
406 protected:
407  //
408  // This field points to the queue that the request is currently
409  // associated with.
410  //
412 
414 
416 
417  //
418  // This is for use by the owner of the FxRequest which is FxIoQueue OR FxIoTarget
419  //
421 
423 
424  //
425  // This is used by the queue to keep track of all forward progress requests
426  //
428 
429  //
430  // Used when the request is a reserved request to track the queue it was
431  // originally allocated for, so that it can be returned to the forward
432  // progress queue for reuse when the request is completed.
433  //
435 
436  //
437  // Generic context exposed to other modules.
438  //
440 
441  //
442  // If TRUE, the client driver has been presented with this WDFREQUEST at
443  // least once.
444  //
446 
447  //
448  // For tracking whether the driver has acknowledged power stop/purge notifications.
449  //
451 
452  //
453  // If TRUE, this is a reserved request
454  //
456 
457  //
458  // If TRUE, this is used to determine how to free the request -
459  // either to the lookaside list or using ExFreePool
460  //
462 
463 public:
464 
465  //
466  // Normally, this is available by the object implementing
467  // IFxListEntry, but currently all callers of this know they
468  // are dealing with an FxRequest*.
469  //
470  // If FxRequests must go on a general typeless list, then
471  // the IFxListEntry interface should be added to FxRequest.
472  //
473  __inline
477  )
478  {
479  switch (Index) {
483  default: ASSERT(FALSE); return NULL;
484  }
485  }
486 
487  static
488  FxRequest*
491  __in PLIST_ENTRY OwnerListEntry
492  )
493  {
494  switch (Index) {
496  return CONTAINING_RECORD(OwnerListEntry, FxRequest, m_OwnerListEntry);
498  return CONTAINING_RECORD(OwnerListEntry, FxRequest, m_OwnerListEntry2);
500  return CONTAINING_RECORD(OwnerListEntry, FxRequest, m_ForwardProgressList);
501  default:
502  ASSERT(FALSE);
503  return NULL;
504  }
505  }
506 
507  __inline
508  VOID
510  VOID
511  )
512  {
513  FxIrp* irp = GetSubmitFxIrp();
515  }
516 
518  NTSTATUS
519  Reuse(
521  );
522 
523  __inline
524  BOOLEAN
526  VOID
527  )
528  {
529  return m_Irp.IsCanceled() || m_Canceled;
530  }
531 
532  __inline
533  VOID
536  )
537  {
538  if (m_RequestContext != NULL) {
542  }
543  else {
546  "WdfRequestGetCompletionParams will not return valid information if the"
547  " request is not formatted using WdfIoTargetFormatxxx DDIs"
548  );
549 
551 
553  }
554  }
555 
556  VOID
557  __inline
559  VOID
560  )
561  {
562  //
563  // No need to synchronize setting this value with checking it because
564  // we check it in the complete path. We will not be about to present
565  // and completing the request in 2 simultaneous contexts.
566  //
567  m_Presented = TRUE;
568  }
569 
570  VOID
572  VOID
573  );
574 
575  VOID
577  VOID
578  );
579 
580  virtual
581  ULONG
584  __in PVOID Tag = NULL,
585  __in LONG Line = 0,
587  );
588 
589  virtual
590  ULONG
593  __in PVOID Tag = NULL,
594  __in LONG Line = 0,
596  );
597 
598  __inline
599  CfxDevice*
601  VOID
602  )
603  {
604  return m_Device;
605  }
606 
607  __inline
608  BOOLEAN
610  )
611  {
612  return m_Reserved;
613  }
614 
615  __inline
616  VOID
618  )
619  {
620  m_Reserved = TRUE;
621  }
622 
623  __inline
624  VOID
627  )
628  {
630  }
631 
632 protected:
633  FxRequest(
634  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
635  __in MdIrp Irp,
636  __in FxRequestIrpOwnership Ownership,
638  __in USHORT ObjectSize
639  );
640 
641  #if DBG
642  ~FxRequest(
643  VOID
644  );
645  #endif // DBG
646 
647  __inline
648  VOID
651  )
652  {
653  m_IoQueue = Queue;
654  }
655 
656 
657  WDFMEMORY
660  )
661  {
663 
664  //
665  // The offset into this object must be self relative.
666  //
668 
670 
671  //
672  // Make sure initial value has the flag bits cleared.
673  //
674  ASSERT((handle & FxHandleFlagMask) == 0);
675 
676  //
677  // We always apply the mask.
678  //
680 
681  //
682  // Make sure final value (before we set the flag) has the flag bits
683  // cleared.
684  //
685  ASSERT((handle & FxHandleFlagMask) == 0);
686 
687  //
688  // This handle is an offset
690 
691  return (WDFMEMORY) handle;
692  }
693 
695  virtual
696  NTSTATUS
699  );
700 
701 public:
702  // Factory functions to create FxRequest* objects
704  static
705  NTSTATUS
709  __in MdIrp Irp,
711  );
712 
714  static
715  NTSTATUS
716  _Create(
717  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
721  __in FxRequestIrpOwnership Ownership,
724  );
725 
727  FxIoQueue*
729  VOID
730  )
731  {
732  if(m_Completed) {
733  return NULL;
734  }
735 
736  return m_IoQueue;
737  }
738 
742  );
743 
744  VOID
745  __inline
748  )
749  {
751  }
752 
753  NTSTATUS
756  );
757 
758  ULONG_PTR
760  VOID
761  );
762 
765  VOID
766  );
767 
768  __inline
769  NTSTATUS
772  )
773  {
774  CfxDevice* const fxDevice = GetDevice();
775 
776  //
777  // Complete the current request object. Can be called directly
778  // by the FxIoQueue to complete a request.
779  //
780  // When an FxRequest is completed, it is marked as completed,
781  // removed from any CSQ it may be a member of, and any registered
782  // callback functions are called. Then the NT IRP is completed,
783  // and the reference count on the object due to the callback routine
784  // is released if a callback routine was specified.
785  //
786  // Completing a request object can cause its reference
787  // count to go to zero, thus deleting it. So the caller
788  // must either reference it explicitly, or not touch it
789  // any more after calling complete.
790  //
791 
794  "Completing WDFREQUEST 0x%p for IRP 0x%p with "
795  "Information 0x%I64x, %!STATUS!",
797 
798  if (fxDevice != NULL) {
800  }
801  else {
802  SetPriorityBoost(0);
803  }
804 
805  return CompleteInternal(Status);
806  }
807 
808  __inline
809  NTSTATUS
813  )
814  {
815  //
816  // Complete the request object. If the status is success, get the
817  // priority boost for the owning device type, and complete the request.
818  //
820  return Complete(Status);
821  }
822 
823  __inline
824  NTSTATUS
828  )
829  {
830  //
831  // Complete the current request object. Can be called directly
832  // by the FxIoQueue to complete a request.
833  //
834  // When an FxRequest is completed, it is marked as completed,
835  // removed from any CSQ it may be a member of, and any registered
836  // callback functions are called. Then the NT IRP is completed,
837  // and the reference count on the object due to the callback routine
838  // is released if a callback routine was specified.
839  //
840  // Completing a request object can cause its reference
841  // count to go to zero, thus deleting it. So the caller
842  // must either reference it explicitly, or not touch it
843  // any more after calling complete.
844  //
845 
848  "Completing WDFREQUEST 0x%p for IRP 0x%p with "
849  "Information 0x%I64x, %!STATUS!",
851 
853  return CompleteInternal(Status);
854  }
855 
856  // Do not specify argument names
858  VOID,
859  VerifyPreProcessSendAndForget
860  );
861 
862  VOID
864  VOID
865  );
866 
867  VOID
869  VOID
870  );
871 
872  NTSTATUS
873  GetStatus(
874  VOID
875  );
876 
878  NTSTATUS
881  );
882 
884  NTSTATUS
887  __out PVOID* Buffer,
888  __out size_t* Length
889  );
890 
892  NTSTATUS
893  GetMdl(
894  __out PMDL *pMdl
895  );
896 
898  NTSTATUS
901  __out PVOID* Buffer,
902  __out size_t* Length
903  );
904 
906  NTSTATUS
908  __out PMDL *pMdl
909  );
910 
911  // Do not specify argument names
913  NTSTATUS,
914  VerifyProbeAndLock
915  );
916 
918  NTSTATUS
920  __in PVOID Buffer,
921  __in ULONG Length,
922  __deref_out FxRequestMemory** pMemoryObject
923  );
924 
926  NTSTATUS
928  __in PVOID Buffer,
929  __in ULONG Length,
930  __deref_out FxRequestMemory** pMemoryObject
931  );
932 
933 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
935  NTSTATUS
936  Impersonate(
938  _In_ PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate,
940  );
941 #endif
942 
943  VOID
946  )
947  {
948 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
949  GetSubmitFxIrp()->GetIoIrp()->SetFlagsForNextStackLocation(
951 #else
953 #endif
954  }
955 
956  FxIrp*
958  VOID
959  )
960  {
961  return &m_Irp;
962  }
963 
964  __inline
965  FxIoQueue*
967  VOID
968  )
969  {
970  return m_IoQueue;
971  }
972 
974  NTSTATUS
976  __deref_out MdIrp* ppIrp
977  )
978  {
979  if (GetDriverGlobals()->FxVerifierIO) {
981  KIRQL irql;
982 
983  Lock(&irql);
984 
985  status = VerifyRequestIsNotCompleted(GetDriverGlobals());
986  if (!NT_SUCCESS(status)) {
987  *ppIrp = NULL;
989  }
990  else {
991  *ppIrp = m_Irp.GetIrp();
992  }
993 
994  Unlock(irql);
995 
996  return status;
997  }
998  else {
999  *ppIrp = m_Irp.GetIrp();
1000  return STATUS_SUCCESS;
1001  }
1002  }
1003 
1004  //
1005  // Return the FxFileObject if associated with this request
1006  //
1008  NTSTATUS
1009  GetFileObject(
1010  __deref_out_opt FxFileObject** pFileObject
1011  );
1012 
1013  //
1014  // Get the IoStack location of the request.
1015  //
1016  // Since this returns the pointer to the underlying IRP
1017  // IO_STACK_LOCATION, it can not be called in a situation
1018  // which the request is completed out from underneath us.
1019  //
1020  // Note: Must implemention a version for the drivers use.
1021  // Must interact with completion events from the
1022  // driver due to cancel as well.
1023  //
1024  //
1027  VOID
1028  )
1029  {
1030  if (GetDriverGlobals()->FxVerifierIO) {
1032  KIRQL irql;
1033  NTSTATUS status;
1034 
1035  Lock(&irql);
1036  status = VerifyRequestIsNotCompleted(GetDriverGlobals());
1037  if (!NT_SUCCESS(status)) {
1038  ios = NULL;
1039  }
1040  else {
1042  }
1043  Unlock(irql);
1044 
1045  return ios;
1046  }
1047  else {
1049  }
1050  }
1051 
1052  //
1053  // The following functions are to support use of
1054  // the Cancel Safe FxIrpQueue.
1055  //
1056 
1057  // Do not specify argument names
1059  NTSTATUS,
1060  VerifyInsertIrpQueue,
1061  _In_ FxIrpQueue*
1062  );
1063 
1064  //
1065  // Insert the request in the supplied FxIrpQueue
1066  // and associated it with it.
1067  //
1069  NTSTATUS
1072  __out_opt ULONG* pRequestCount
1073  );
1074 
1076  NTSTATUS
1079  __out_opt ULONG* pRequestCount
1080  );
1081 
1082  //
1083  // Remove it from the FxIrpQueue it is associated with.
1084  //
1085  // Returns STATUS_CANCELLED if the cancel routine has
1086  // fired and removed it from the queue first.
1087  //
1088  //
1090  NTSTATUS
1093  );
1094 
1095  //
1096  // Mark that this request is no longer on the IrpQueue
1097  //
1098  __inline
1099  VOID
1101  VOID
1102  )
1103  {
1104  m_IrpQueue = NULL;
1105  return;
1106  }
1107 
1108  //
1109  // Return the FxRequest's CsqContext address
1110  //
1111  __inline
1114  VOID
1115  )
1116  {
1117  return &m_CsqContext;
1118  }
1119 
1120 
1121  //
1122  // Function to return an FxRequest from an FxIrpQueue
1123  //
1125  static
1126  FxRequest*
1129  );
1130 
1132  static
1133  NTSTATUS
1138  __deref_out FxRequest** ppOutRequest
1139  );
1140 
1141  //
1142  // Allow peeking at requests in the IrpQueue
1143  //
1145  static
1146  NTSTATUS
1147  PeekRequest(
1152  __deref_out FxRequest** ppOutRequest
1153  );
1154 
1155  //
1156  // Internal function to retrieve the FxRequest
1157  // structure from a pointer to its CsqContext
1158  // member.
1159  //
1160  __inline
1161  static
1162  FxRequest*
1165  )
1166  {
1168  }
1169 
1170 
1171  __inline
1172  BOOLEAN
1174  __in FxIrpQueue* pIrpQueue
1175  )
1176  {
1177  return pIrpQueue->IsIrpInQueue(GetCsqContext());
1178  }
1179 
1180 
1181  // Do not specify argument names
1183  NTSTATUS,
1184  VerifyStopAcknowledge,
1185  _In_ BOOLEAN
1186  );
1187 
1188  VOID
1191  );
1192 
1193  __inline
1194  BOOLEAN
1196  VOID
1197  )
1198  {
1200  ||
1202  }
1203 
1204  __inline
1205  BOOLEAN
1207  VOID
1208  )
1209  {
1211  }
1212 
1213  VOID
1215  VOID
1216  )
1217  {
1219  }
1220 
1221  // Do not specify argument names
1223  VOID,
1224  VerifierBreakpoint_RequestEarlyDisposeDeferred
1225  );
1226 
1227  // Do not specify argument names
1229  NTSTATUS,
1231  );
1232 
1233  // Do not specify argument names
1235  NTSTATUS,
1236  VerifyRequestIsCancelable
1237  );
1238 
1239  // Do not specify argument names
1241  NTSTATUS,
1242  VerifyRequestIsNotCancelable
1243  );
1244 
1245  // Do not specify argument names
1247  NTSTATUS,
1248  VerifyRequestIsInCallerContext
1249  );
1250 
1251  // Do not specify argument names
1253  NTSTATUS,
1254  VerifyRequestIsInEvtIoStopContext
1255  );
1256 
1257  // Do not specify argument names
1259  NTSTATUS,
1260  VerifyRequestIsNotCompleted
1261  );
1262 
1263  // Do not specify argument names
1265  NTSTATUS,
1266  VerifyRequestIsTagRequest
1267  );
1268 
1269  // Do not specify argument names
1271  NTSTATUS,
1272  VerifyRequestIsAllocatedFromIo
1273  );
1274 
1275  // Do not specify argument names
1277  NTSTATUS,
1278  VerifyRequestIsCurrentStackValid
1279  );
1280 
1281  // Do not specify argument names
1283  NTSTATUS,
1284  VerifyRequestCanBeCompleted
1285  );
1286 
1287  VOID
1288  FreeRequest(
1289  VOID
1290  );
1291 
1292  __inline
1293  VOID
1295  VOID
1296  )
1297  {
1300 
1302 
1303  FxRequestBase::ClearFieldsForReuse(); // __super call
1304  }
1305 
1306  virtual
1307  ULONG
1308  Release(
1309  __in PVOID Tag,
1310  __in LONG Line,
1312  );
1313 
1314  __inline
1315  BOOLEAN
1317  VOID
1318  )
1319  {
1320  return m_ForwardRequestToParent;
1321  }
1322 
1323 private:
1325  VOID,
1326  VerifyCompleteInternal,
1327  _In_ NTSTATUS
1328  );
1329 
1330  NTSTATUS
1334  );
1335 
1336  NTSTATUS
1339  );
1340 
1341  VOID
1345  );
1346 
1347  VOID
1351  );
1352 
1353  VOID
1357  );
1358 
1359  VOID
1363  );
1364 
1365  static
1366  VOID
1368  VOID
1369  );
1370 
1371  VOID
1374  )
1375 {
1376 
1377  switch (m_Irp.GetMajorFunction()) {
1378  case IRP_MJ_DEVICE_CONTROL:
1380 
1381 
1382 
1383 
1384 
1385 
1386 
1387 
1388 
1390  case METHOD_BUFFERED:
1391  //
1392  // Set the buffer in the memory interface. For kernel mode,
1393  // GetOutputBuffer is same as GetSystemBuffer, but for user-mode,
1394  // host provides separate buffers, so that input buffer can only be
1395  // read, and output buffer can only be written to.
1396  //
1399  break;
1400 
1401  case METHOD_IN_DIRECT:
1402  //
1403  // InputBuffer is in SystemBuffer
1404  // OutputBuffer is in MdlAddress with read access
1405  //
1408  break;
1409 
1410  case METHOD_OUT_DIRECT:
1411  //
1412  // InputBuffer is in SystemBuffer
1413  // OutputBuffer is in MdlAddress with write access
1414  //
1417  break;
1418 
1419  case METHOD_NEITHER:
1420  //
1421  // Internal device controls are kernel mode to kernel mode, and deal
1422  // with direct unmapped pointers.
1423  //
1424  // In addition, a normal device control with
1425  // RequestorMode == KernelMode is also treated as kernel mode
1426  // to kernel mode since the I/O Manager will not generate requests
1427  // with this setting from a user mode request.
1428  //
1434  );
1436  }
1437  else {
1438  return;
1439  }
1440  break;
1441  }
1442  break;
1443 
1444  case IRP_MJ_READ:
1445  case IRP_MJ_WRITE:
1446  switch (IoType) {
1447  case WdfDeviceIoBuffered:
1449  break;
1450 
1451  case WdfDeviceIoNeither:
1453  if (m_Irp.GetRequestorMode() == KernelMode) {
1455  }
1456  else {
1457  return;
1458  }
1459  break;
1460 
1461  default:
1462  return;
1463  }
1464  break;
1465 
1466  default:
1467  return;
1468  }
1469 
1470  if (m_SystemBuffer.IsBufferSet()) {
1472  }
1473  if (m_OutputBuffer.IsBufferSet()) {
1475  }
1476 }
1477 
1478 
1479 public:
1480  __inline
1481  VOID
1483  PVOID Context
1484  )
1485  {
1488  }
1489 
1490  __inline
1491  PVOID
1493  VOID
1494  )
1495  {
1496  PVOID context;
1497 
1500 
1501  return context;
1502  }
1503 };
1504 
1506 
1507 public:
1510  __in MdIrp Irp
1511  );
1512 
1513  PVOID
1514  operator new(
1515  __in size_t Size,
1518  );
1519 
1520 protected:
1521  //
1522  // FxObject override
1523  //
1524  VOID
1525  SelfDestruct(
1526  VOID
1527  );
1528 };
1529 
1530 #endif // _FXREQUEST_H_
BOOLEAN m_ForwardRequestToParent
Definition: fxrequest.hpp:461
static _Must_inspect_result_ FxRequest * GetNextRequest(__in FxIrpQueue *IrpQueue)
Definition: fxrequest.cpp:2025
VOID AddIrpReference(VOID)
Definition: fxrequest.cpp:2470
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
Definition: fxobject.hpp:1474
FxRequestIrpOwnership
CfxDevice * m_Device
Definition: fxobject.hpp:329
VOID ClearPowerStopState(VOID)
Definition: fxrequest.hpp:1214
virtual size_t GetBufferSize(VOID)
FxRequestCompletionState SetCompletionState(__in FxRequestCompletionState NewState)
Definition: fxrequest.cpp:1760
VOID StopAcknowledge(__in BOOLEAN Requeue)
Definition: fxrequest.cpp:2634
VOID FreeRequest(VOID)
Definition: fxrequest.cpp:1022
__inline BOOLEAN IsInIrpQueue(__in FxIrpQueue *pIrpQueue)
Definition: fxrequest.hpp:1173
__in MdIrp __in PMdIoCsqIrpContext pCsqContext
Definition: fxirpqueue.hpp:74
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define _In_opt_
Definition: ms_sal.h:309
VOID ClearFieldsForReuse(VOID)
LIST_ENTRY m_OwnerListEntry
Definition: fxrequest.hpp:420
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
__inline NTSTATUS Complete(__in NTSTATUS Status)
Definition: fxrequest.hpp:770
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
VOID SetStatus(__in NTSTATUS Status)
Definition: fxirpum.cpp:457
Definition: http.c:7251
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
FxIoQueue * m_ForwardProgressQueue
Definition: fxrequest.hpp:434
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
__inline PLIST_ENTRY GetListEntry(__in FxListEntryNames Index)
Definition: fxrequest.hpp:475
NTSTATUS(* PFN_FX_QUEUE_REQUEST_COMPLETE)(__in FxRequest *Request, __in FxIoQueue *Queue, __in_opt WDFCONTEXT Context)
Definition: fxrequest.hpp:89
_Must_inspect_result_ _In_ WDFREQUEST _In_ SECURITY_IMPERSONATION_LEVEL _In_ PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2221
_In_ WDFREQUEST _In_ PWDF_REQUEST_REUSE_PARAMS ReuseParams
Definition: wdfrequest.h:551
VOID __inline SetStatus(__in NTSTATUS Status)
Definition: fxrequest.hpp:746
__inline BOOLEAN IsBufferSet(VOID)
Definition: fxrequest.hpp:168
_Must_inspect_result_ FxIoQueue * GetCurrentQueue(VOID)
Definition: fxrequest.hpp:728
LONG NTSTATUS
Definition: precomp.h:26
friend FxRequestOutputBuffer
Definition: fxrequest.hpp:402
__inline VOID CopyCompletionParams(__in PWDF_REQUEST_COMPLETION_PARAMS Params)
Definition: fxrequest.hpp:534
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
_Must_inspect_result_ NTSTATUS GetParameters(__out PWDF_REQUEST_PARAMETERS Parameters)
Definition: fxrequest.cpp:1221
PIO_STACK_LOCATION GetCurrentIrpStackLocation(VOID)
Definition: fxirpum.cpp:370
_Must_inspect_result_ NTSTATUS GetFileObject(__deref_out_opt FxFileObject **pFileObject)
Definition: fxrequest.cpp:2408
__inline FxIrp * GetSubmitFxIrp(VOID)
Definition: fxirp.hpp:28
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
UCHAR m_RequestBaseStaticFlags
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxrequest.cpp:2714
LIST_ENTRY IrpQueue
Definition: csqrtns.c:49
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES RequestAttributes, __in_opt MdIrp Irp, __in_opt FxIoTarget *Target, __in FxRequestIrpOwnership Ownership, __in FxRequestConstructorCaller Caller, __deref_out FxRequest **Request)
Definition: fxrequest.cpp:161
static _Must_inspect_result_ NTSTATUS _CreateForPackage(__in CfxDevice *Device, __in PWDF_OBJECT_ATTRIBUTES RequestAttributes, __in MdIrp Irp, __deref_out FxRequest **Request)
Definition: fxrequest.cpp:75
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
KIRQL irql
Definition: wave.h:1
NTSTATUS GetStatus(VOID)
Definition: fxrequest.cpp:1187
virtual _Must_inspect_result_ PMDL GetMdl(VOID)
_Must_inspect_result_ NTSTATUS GetDeviceControlOutputMdl(__out PMDL *pMdl)
_Must_inspect_result_ NTSTATUS GetMemoryObject(__deref_out IFxMemory **Memory, __out PVOID *Buffer, __out size_t *Length)
Definition: fxrequest.cpp:1284
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
FxRequestPowerStopState
Definition: fxrequest.hpp:384
_Must_inspect_result_ NTSTATUS GetMdl(__out PMDL *pMdl)
Definition: fxrequestkm.cpp:80
__inline VOID SetInternalContext(PVOID Context)
Definition: fxrequest.hpp:1482
LIST_ENTRY m_OwnerListEntry2
Definition: fxrequest.hpp:422
__inline NTSTATUS CompleteWithInformation(__in NTSTATUS Status, __in ULONG_PTR Information)
Definition: fxrequest.hpp:810
FxRequest(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in MdIrp Irp, __in FxRequestIrpOwnership Ownership, __in FxRequestConstructorCaller Caller, __in USHORT ObjectSize)
Definition: fxrequest.cpp:33
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
#define TRACINGREQUEST
Definition: dbgtrace.h:65
VOID PostProcessSendAndForget(VOID)
Definition: fxrequest.cpp:1149
_Must_inspect_result_ NTSTATUS ProbeAndLockForWrite(__in PVOID Buffer, __in ULONG Length, __deref_out FxRequestMemory **pMemoryObject)
#define METHOD_IN_DIRECT
Definition: nt_native.h:595
uint32_t ULONG_PTR
Definition: typedefs.h:65
WDFMEMORY GetMemoryHandle(__in USHORT Offset)
Definition: fxrequest.hpp:658
__inline FxIoQueue * GetIoQueue(VOID)
Definition: fxrequest.hpp:966
virtual PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS SetInformation(__in ULONG_PTR Information)
Definition: fxrequest.cpp:229
__inline VOID SetBuffer(__in PVOID Buffer)
Definition: fxrequest.hpp:334
_Must_inspect_result_ NTSTATUS InsertTailIrpQueue(__in FxIrpQueue *IrpQueue, __out_opt ULONG *pRequestCount)
Definition: fxrequest.cpp:1858
#define __out_opt
Definition: dbghelp.h:65
VOID PreProcessCompletionForDriverRequest(__in FxRequestCompletionState State, __in FxIoQueue *Queue)
Definition: fxrequest.cpp:955
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define METHOD_NEITHER
Definition: nt_native.h:597
#define FALSE
Definition: types.h:117
_In_ WDFREQUEST _In_ NTSTATUS _In_ CCHAR PriorityBoost
Definition: wdfrequest.h:1011
_In_ PIRP Irp
Definition: csq.h:116
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
virtual USHORT GetFlags(VOID)
__inline BOOLEAN IsCancelled(VOID)
Definition: fxrequest.hpp:525
long LONG
Definition: pedump.c:60
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
_In_ PWDFDEVICE_INIT _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes
Definition: wdfdevice.h:3428
virtual ULONG Release(__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
Definition: fxrequest.cpp:3089
virtual ULONG AddRefOverride(__in WDFOBJECT_OFFSET Offset, __in PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxrequest.cpp:2675
#define __out
Definition: dbghelp.h:62
_Must_inspect_result_ NTSTATUS ProbeAndLockForRead(__in PVOID Buffer, __in ULONG Length, __deref_out FxRequestMemory **pMemoryObject)
VOID PreProcessSendAndForget(VOID)
Definition: fxrequest.cpp:1101
unsigned char BOOLEAN
__inline VOID CopyCurrentIrpStackLocationToNext(VOID)
Definition: fxrequest.hpp:509
__inline VOID ClearBufferMdl(VOID)
Definition: fxrequest.hpp:177
PVOID GetOutputBuffer()
Definition: fxirpum.cpp:594
virtual USHORT GetFlags(VOID)
#define _In_
Definition: ms_sal.h:308
VOID PostProcessCompletionForDriverRequest(__in FxRequestCompletionState State, __in FxIoQueue *Queue)
Definition: fxrequest.cpp:996
IWudfIrp * MdIrp
Definition: mxum.h:103
Definition: bufpool.h:45
USHORT WDFOBJECT_OFFSET
Definition: fxobject.hpp:80
virtual WDFMEMORY GetHandle(VOID)
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifyInsertIrpQueue, _In_ FxIrpQueue *)
DECLSPEC_SELECTANY const ULONG_PTR FxHandleValueMask
FxRequestOutputBuffer m_OutputBuffer
Definition: fxrequest.hpp:415
FxIoQueue * m_IoQueue
Definition: fxrequest.hpp:411
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 __inline SetPriorityBoost(CCHAR PriorityBoost)
__inline PMdIoCsqIrpContext GetCsqContext(VOID)
Definition: fxrequest.hpp:1113
_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
NTSTATUS CompleteInternalReserved(__in NTSTATUS Status, __in CCHAR PriorityBoost)
__inline BOOLEAN IsBufferSet(VOID)
Definition: fxrequest.hpp:314
__inline BOOLEAN IsPowerStopAcknowledgedWithRequeue(VOID)
Definition: fxrequest.hpp:1206
Status
Definition: gdiplustypes.h:24
FORCEINLINE VOID WDF_REQUEST_COMPLETION_PARAMS_INIT(_Out_ PWDF_REQUEST_COMPLETION_PARAMS Params)
Definition: wdfrequest.h:288
basic_ios< char, char_traits< char > > ios
Definition: _iosfwd.h:76
virtual ULONG ReleaseOverride(__in WDFOBJECT_OFFSET Offset, __in PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxrequest.cpp:2694
#define METHOD_OUT_DIRECT
Definition: nt_native.h:596
virtual _Must_inspect_result_ PVOID GetBuffer(VOID)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
KPROCESSOR_MODE GetRequestorMode(VOID)
Definition: fxrequest.cpp:327
#define ASSERT(a)
Definition: mode.c:44
__inline VOID SetForwardProgressQueue(__in FxIoQueue *Queue)
Definition: fxrequest.hpp:625
__inline BOOLEAN IsReserved()
Definition: fxrequest.hpp:609
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
char CCHAR
Definition: typedefs.h:51
_In_ WDFCOLLECTION _In_ ULONG Index
friend FxRequestSystemBuffer
Definition: fxrequest.hpp:403
#define FxIrpStackFlagsFromSendFlags(sendFlags)
Definition: fxrequest.hpp:82
BYTE m_PowerStopState
Definition: fxrequest.hpp:450
_Out_ PBOOLEAN _Out_ PBOOLEAN _Out_ PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: psfuncs.h:154
VOID PostProcessCompletionForReserved(__in FxRequestCompletionState State, __in FxIoQueue *Queue)
Definition: fxrequest.cpp:916
FX_DECLARE_VF_FUNCTION(VOID, VerifyPreProcessSendAndForget)
__inline PVOID GetInternalContext(VOID)
Definition: fxrequest.hpp:1492
VOID SetInformation(__in ULONG_PTR Information)
Definition: fxirpum.cpp:504
__inline VOID SetBuffer(PVOID Buffer)
Definition: fxrequest.hpp:188
FxRequestCompletionState
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
FxIrpQueue * m_IrpQueue
_In_ WDFREQUEST _In_ BOOLEAN Requeue
Definition: wdfrequest.h:1651
static __inline FxRequest * RetrieveFromCsqContext(__in PMdIoCsqIrpContext pCsqContext)
Definition: fxrequest.hpp:1163
FxRequestConstructorCaller
Definition: ncftp.h:79
__inline VOID SetReserved()
Definition: fxrequest.hpp:617
VOID SetImpersonationFlags(_In_ ULONG Flags)
Definition: fxrequest.hpp:944
_Must_inspect_result_ _In_ WDFREQUEST _In_ size_t _Out_ WDFMEMORY * MemoryObject
Definition: wdfrequest.h:1470
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
#define NTSTATUS
Definition: precomp.h:20
PVOID GetParameterIoctlType3InputBuffer(VOID)
Definition: fxirpum.cpp:1542
__inline VOID SetMdl(PMDL Mdl)
Definition: fxrequest.hpp:198
PVOID GetUserBuffer()
Definition: fxirpum.cpp:633
BOOLEAN IsCanceled()
Definition: fxirpum.cpp:484
virtual WDFMEMORY GetHandle(VOID)
virtual ULONG Release(__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
static FxRequest * _FromOwnerListEntry(__in FxListEntryNames Index, __in PLIST_ENTRY OwnerListEntry)
Definition: fxrequest.hpp:489
__inline VOID SetCurrentQueue(__in FxIoQueue *Queue)
Definition: fxrequest.hpp:649
IWudfIoIrp * GetIoIrp(VOID)
Definition: fxirpum.cpp:1777
Definition: typedefs.h:119
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
unsigned char BYTE
Definition: xxhash.c:193
virtual PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
virtual _Must_inspect_result_ PMDL GetMdl(VOID)
_Must_inspect_result_ NTSTATUS Reuse(__in PWDF_REQUEST_REUSE_PARAMS ReuseParams)
Definition: fxrequest.cpp:2136
#define KMDF_ONLY_CODE_PATH_ASSERT()
Definition: fx.hpp:55
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
__inline VOID ClearBufferMdl(VOID)
Definition: fxrequest.hpp:323
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
BOOLEAN m_Reserved
Definition: fxrequest.hpp:455
ULONG_PTR GetInformation()
Definition: fxirpum.cpp:513
PVOID GetSystemBuffer()
Definition: fxirpum.cpp:543
_Must_inspect_result_ NTSTATUS Impersonate(_In_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, _In_ PFN_WDF_REQUEST_IMPERSONATE EvtRequestImpersonate, _In_opt_ PVOID Context)
FxRequestFromLookaside(__in CfxDevice *Device, __in MdIrp Irp)
Definition: fxrequest.cpp:3144
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
virtual ULONG Release(__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
__inline CHAR GetDefaultPriorityBoost(VOID)
Definition: fxdevice.hpp:1111
friend FxIoQueue
Definition: fxrequest.hpp:399
MdIrp GetIrp(VOID)
Definition: fxirpum.cpp:15
KPROCESSOR_MODE GetRequestorMode(VOID)
Definition: fxirpum.cpp:329
VOID ReleaseIrpReference(VOID)
Definition: fxrequest.cpp:2512
unsigned short USHORT
Definition: pedump.c:61
VOID Request VerifyRequestIsDriverOwned(FxDriverGlobals)
__inline BOOLEAN IsRequestForwardedToParent(VOID)
Definition: fxrequest.hpp:1316
WDF_REQUEST_COMPLETION_PARAMS m_CompletionParams
#define METHOD_BUFFERED
Definition: nt_native.h:594
signed char * PSTR
Definition: retypes.h:7
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
friend FxRequestMemory
Definition: fxrequest.hpp:401
ULONG GetParameterIoctlCodeBufferMethod(VOID)
Definition: fxirpum.cpp:1490
friend VOID GetTriageInfo(VOID)
#define NULL
Definition: types.h:112
VOID __inline SetPresented(VOID)
Definition: fxrequest.hpp:558
_In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_IO_TYPE IoType
Definition: wdfdevice.h:3138
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define __deref_out_opt
Definition: dbghelp.h:29
#define IRP_MJ_READ
Definition: rdpdr.c:46
_Must_inspect_result_ NTSTATUS RemoveFromIrpQueue(__in FxIrpQueue *IrpQueue)
Definition: fxrequest.cpp:1961
LIST_ENTRY m_ForwardProgressList
Definition: fxrequest.hpp:427
__inline VOID ClearFieldsForReuse(VOID)
Definition: fxrequest.hpp:1294
FxRequestContext * m_RequestContext
ULONG_PTR GetInformation(VOID)
Definition: fxrequest.cpp:277
struct tagContext Context
Definition: acpixf.h:1034
virtual ULONG AddRef(__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
#define __deref_out
Definition: dbghelp.h:26
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
FxListEntryNames
Definition: fxrequest.hpp:371
unsigned int ULONG
Definition: retypes.h:1
PVOID m_InternalContext
Definition: fxrequest.hpp:439
__inline CfxDevice * GetDevice(VOID)
Definition: fxrequest.hpp:600
_Must_inspect_result_ NTSTATUS GetDeviceControlOutputMemoryObject(__deref_out IFxMemory **MemoryObject, __out PVOID *Buffer, __out size_t *Length)
Definition: fxrequest.cpp:1524
#define ULONG_PTR
Definition: config.h:101
friend FxIoTarget
Definition: fxrequest.hpp:398
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
virtual ULONG AddRef(__in PVOID Tag, __in LONG Line, __in_opt PSTR File)
BOOLEAN m_Presented
Definition: fxrequest.hpp:445
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
__inline VOID SetMdl(__in PMDL Mdl)
Definition: fxrequest.hpp:344
MdIoCsqIrpContext m_CsqContext
static VOID CheckAssumptions(VOID)
Definition: fxrequestkm.cpp:34
Definition: File.h:15
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ NTSTATUS InsertHeadIrpQueue(__in FxIrpQueue *IrpQueue, __out_opt ULONG *pRequestCount)
Definition: fxrequest.cpp:1908
virtual size_t GetBufferSize(VOID)
VOID CopyCurrentIrpStackLocationToNext(VOID)
Definition: fxirpum.cpp:209
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
NTSTATUS CompleteInternal(__in NTSTATUS Status)
Definition: fxrequest.cpp:515
_Must_inspect_result_ NTSTATUS GetIrp(__deref_out MdIrp *ppIrp)
Definition: fxrequest.hpp:975
#define __in
Definition: dbghelp.h:35
__inline VOID MarkRemovedFromIrpQueue(VOID)
Definition: fxrequest.hpp:1100
static _Must_inspect_result_ NTSTATUS PeekRequest(__in FxIrpQueue *IrpQueue, __in_opt FxRequest *TagRequest, __in_opt MdFileObject FileObject, __out_opt PWDF_REQUEST_PARAMETERS Parameters, __deref_out FxRequest **ppOutRequest)
Definition: fxrequest.cpp:2098
static SERVICE_STATUS status
Definition: service.c:31
PIO_STACK_LOCATION GetCurrentIrpStackLocation(VOID)
Definition: fxrequest.hpp:1026
unsigned short * PUSHORT
Definition: retypes.h:2
FxIrp * irp
__inline WDFREQUEST GetHandle(VOID)
__inline NTSTATUS CompleteWithPriority(__in NTSTATUS Status, __in CCHAR PriorityBoost)
Definition: fxrequest.hpp:825
FxVerifierDbgBreakPoint(pFxDriverGlobals)
VOID PostProcessCompletion(__in FxRequestCompletionState State, __in FxIoQueue *Queue)
Definition: fxrequest.cpp:874
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
virtual PVOID GetBuffer(VOID)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
FxRequestSystemBuffer m_SystemBuffer
Definition: fxrequest.hpp:413
VOID AssignMemoryBuffers(__in WDF_DEVICE_IO_TYPE IoType)
Definition: fxrequest.hpp:1372
__inline BOOLEAN IsPowerStopAcknowledged(VOID)
Definition: fxrequest.hpp:1195
Definition: ps.c:97