ReactOS  0.4.15-dev-2704-gd5265b0
fxiotarget.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 Module Name:
6 
7  FxIoTarget.hpp
8 
9 Abstract:
10 
11  Encapsulation of the target to which FxRequest are sent to. For example,
12  an FxTarget could represent the next device object in the pnp stack.
13  Derivations from this class could include bus specific formatters or device
14  objects outside of the pnp stack of the device.
15 
16 Author:
17 
18 
19 
20 Environment:
21 
22  Both kernel and user mode
23 
24 Revision History:
25 
26 --*/
27 
28 #ifndef _FXIOTARGET_H_
29 #define _FXIOTARGET_H_
30 
31 
32 struct FxIoContext : public FxRequestContext {
33 
35  VOID
36  );
37 
38  virtual
40  VOID
41  );
42 
43  VOID
46  )
47  {
49  }
50 
51  virtual
52  VOID
55  );
56 
57  VOID
59  VOID
60  );
61 
62  VOID
65  __in size_t BufferLength,
66  __in BOOLEAN CopyBackToBuffer
67  );
68 
69  VOID
72  );
73 
74  VOID
76  __in FxIrp* Irp
77  );
78 
79  VOID
82  _In_ ULONG NewInputBufferCb,
83  _In_reads_bytes_opt_(NewInputBufferCb) PVOID NewInputBuffer,
84  _In_ ULONG NewOutputBufferCb,
85  _In_reads_bytes_opt_(NewOutputBufferCb) PVOID NewOutputBuffer
86  );
87 
88 public:
89 
90 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
95  union {
98  };
99 
101 
106 #else
107  //
108  // Captured state of the IRP before buffers are modified by Format
109  //
110  WUDFX_IRP_BUFFER_INFO m_OriginalBufferInfo;
111 #endif
112 
116 };
117 
119 
121  VOID
122  ) :
124  {
126  }
127 
128  VOID
130  __in FxRequestBuffer* Buffer1,
131  __in FxRequestBuffer* Buffer2,
132  __in FxRequestBuffer* Buffer4
133  )
134  {
135  StoreAndReferenceMemory(Buffer1);
138  }
139 
140  virtual
141  VOID
144  )
145  {
146  ULONG i;
147 
148  for (i = 0;
149  i < sizeof(m_MemoryObjects)/sizeof(m_MemoryObjects[0]);
150  i++) {
151 
152  if (m_MemoryObjects[i] != NULL) {
153  m_MemoryObjects[i]->RELEASE(this);
155  }
156  }
157 
159  }
160 
161 private:
162  virtual
163  VOID
166  )
167  {
169  }
170 
171 public:
172  //
173  // __super has a field for one IFxMemory, so we don't need to store all
174  // 3 in the derivative, reuse the __super's field for one of them.
175  //
177 };
178 
180  //
181  // Event to set if the request is synchronous after the request has completed
182  //
184 
185  //
186  // Status of the request if it was synchronous
187  //
189 
190  //
191  // Original completion routine to be called in the synchronous case
192  //
194 
195  //
196  // Original completion context to be passed in the synchronous case
197  //
199 };
200 
202  SubmitSend = 0x00000001,
203  SubmitQueued = 0x00000002,
204  SubmitSent = 0x00000004,
205  SubmitWait = 0x00000008,
206  SubmitTimeout = 0x00000010,
208 };
209 
210 class FxIoTarget : public FxNonPagedObject {
211 
213 
214 public:
215 
216  FxIoTarget(
217  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
218  __in USHORT ObjectSize
219  );
220 
221  FxIoTarget(
222  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
223  __in USHORT ObjectSize,
224  __in WDFTYPE WdfType
225  );
226 
227  virtual
229  NTSTATUS
230  Start(
231  VOID
232  );
233 
234  virtual
235  VOID
236  Stop(
238  );
239 
240  virtual
241  VOID
242  Purge(
244  );
245 
246  virtual
247  VOID
248  Remove(
249  VOID
250  );
251 
252  //
253  // IFxObject override
254  //
255  NTSTATUS
259  );
260 
261  __inline
264  VOID
265  )
266  {
267  return m_State;
268  }
269 
270  __inline
273  VOID
274  )
275  {
276  return m_TargetDevice;
277  }
278 
279  __inline
282  VOID
283  )
284  {
285  return m_TargetPdo;
286  }
287 
288  __inline
291  VOID
292  )
293  {
294  return m_TargetFileObject;
295  }
296 
297  __inline
298  WDFDEVICE
300  VOID
301  )
302  {
303  return m_Device->GetHandle();
304  }
305 
306  WDFIOTARGET
308  VOID
309  )
310  {
311  return (WDFIOTARGET) GetObjectHandle();
312  }
313 
314  __inline
315  FxDriver*
317  VOID
318  )
319  {
320  return m_Driver;
321  }
322 
323  virtual
328  )
329  {
330  return Device->GetAttachedDevice();
331  }
332 
334  NTSTATUS
335  Init(
337  );
338 
339  ULONG
340  Submit(
344  );
345 
346  // Do not specify argument names
348  NTSTATUS,
349  VerifySubmitLocked,
351  );
352 
353  ULONG
354  SubmitLocked(
358  );
359 
361  NTSTATUS
362  SubmitSync(
366  );
367 
368  VOID
371  );
372 
373  VOID
376  );
377 
378  VOID
381  );
382 
383  VOID
386  );
387 
388  static
389  VOID
392  );
393 
394  BOOLEAN
395  __inline
397  __in FxIrp* Irp
398  )
399  {
400 #if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
401  //
402  // Check to make sure there are enough current stack locations available.
403  // When a IRP is initially created, Irp->CurrentLocation is set to
404  // StackSize + 1. When comparing against the target device, subtract
405  // off the extra space to see how many locations are left.
406  //
407  // Say Target->m_TargetStackSize == 1, then:
408  // irp = IoAllocateIrp(Target->m_TargetStackSize, FALSE);
409  // ASSERT(irp->CurrentLocation == 2);
410  //
411  return (Irp->GetCurrentIrpStackLocationIndex() - 1 >= m_TargetStackSize) ? TRUE : FALSE;
412 #else // FX_CORE_USER_MODE
413  //
414  // For UMDF, host does the necessary checks to ensure there are enough
415  // stack locations. In addition, UMDF drivers can't create WDM IRPs
416  // so they don't get to dictate the number of stack locations in the irp
417  // so this kind of check in framework for UMDF is redundant. Return TRUE
418  // always.
419  //
420  return TRUE;
421 #endif
422  }
423 
425  NTSTATUS
428  __in UCHAR MajorCode,
429  __in FxRequestBuffer* IoBuffer,
432  );
433 
435  NTSTATUS
438  __in ULONG Ioctl,
443  );
444 
446  NTSTATUS
449  __in ULONG Ioctl,
451  );
452 
453  static
454  FxIoTarget*
457  )
458  {
460  }
461 
462  VOID
463  CancelSentIo(
464  VOID
465  );
466 
468  NTSTATUS
472  );
473 
474  VOID
476  VOID
477  );
478 
479  BOOLEAN
481  VOID
482  );
483 
484  virtual
485  VOID
486  Send(
487  _In_ MdIrp Irp
488  );
489 
490 protected:
491  //
492  // Hide destructor since we are reference counted object
493  //
494  ~FxIoTarget();
495 
497  NTSTATUS
500  );
501 
502  // FxObject overrides
503  virtual
504  BOOLEAN
505  Dispose(
506  VOID
507  );
508  // FxObject overrides
509 
510  VOID
514  );
515 
516  VOID
518  __in PLIST_ENTRY RequestListHead,
519  __in BOOLEAN RequestWillBeResent
520  );
521 
522  VOID
524  __in PLIST_ENTRY RequestListHead
525  );
526 
527  VOID
529  __in PLIST_ENTRY RequestListHeadHead
530  );
531 
532  VOID
534  __in PSINGLE_LIST_ENTRY RequestListHead,
535  __in PLIST_ENTRY SendList,
536  __out PBOOLEAN AddedToList
537  );
538 
539  static
540  VOID
542  __in PSINGLE_LIST_ENTRY RequestListHead
543  );
544 
545  virtual
547  NTSTATUS
549  __in PLIST_ENTRY RequestListHead,
551  );
552 
553  virtual
554  VOID
557  __in PSINGLE_LIST_ENTRY SentRequestListHead,
559  __in BOOLEAN LockSelf
560  );
561 
562  virtual
563  VOID
566  __in PLIST_ENTRY PendedRequestListHead,
567  __in PSINGLE_LIST_ENTRY SentRequestListHead,
569  __in BOOLEAN LockSelf
570  );
571 
573  NTSTATUS
576  );
577 
578  __inline
579  VOID
582  )
583  {
584  //
585  // This will remove the reference taken by this object on the request
586  //
587  Request->CompleteSubmitted();
588  }
589 
590  //
591  // Completion routine to handle the case when re-submitting a pended
592  // request fails.
593  //
594  VOID
597  );
598 
599  //
600  // Generic I/O completion routine and its static caller.
601  //
602  VOID
605  );
606 
607  static
610 
611  BOOLEAN
614  );
615 
616  virtual
617  VOID
619  VOID
620  )
621  {
623  m_TargetPdo = NULL;
625 
626  m_TargetStackSize = 0;
628  }
629 
630  UCHAR
632  VOID
633  )
634  {
635  ULONG flags;
637 
639 
640  if (flags & DO_BUFFERED_IO) {
641  return WdfDeviceIoBuffered;
642  }
643  else if (flags & DO_DIRECT_IO) {
644  return WdfDeviceIoDirect;
645  }
646  else {
647  return WdfDeviceIoNeither;
648  }
649  }
650 
651  static
652  VOID
655  __in MdIrp Irp,
658  );
659 
660  static
661  EVT_WDF_REQUEST_COMPLETION_ROUTINE
663 
664  virtual
665  VOID
667  __in WDF_IO_TARGET_STATE NewState,
668  __in PLIST_ENTRY PendedRequestListHead,
669  __in PSINGLE_LIST_ENTRY SentRequestListHead,
670  __in BOOLEAN Lock,
672  );
673 
674  virtual
675  VOID
677  VOID
678  )
679  {
681 
683  }
684 
685  virtual
686  VOID
688  VOID
689  );
690 
691 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
692  //
693  //Making it a virtual function so that derived classes can override it
694  //For example, CWdfIoTargetLocal overrides it to set the file object
695  //before forwarding the request
696  //
697  virtual
698  VOID
700  __in MdIrp Irp
701  )
702  {
703  //
704  // Ignore the return value because once we have sent the request, we
705  // want all processing to be done in the completion routine.
706  //
707  (void) Irp->Forward();
708  }
709 #endif
710 
711 
712 
713 
714 
715 
716 
717 
718 
719 
720 
721 
722 
723 
724 
725 
726 
727 
728 
729 
730 
731 
732 
733 
734 
735 
736 
737 
738 
739 
740 
741  __inline
742  VOID
745  )
746  {
747  FxIrp* irp = Request->GetSubmitFxIrp();
748 
749  if (Request->IsAllocatedFromIo()) {
752  }
753 
754  //
755  // Use the target's fileobject if present, otherwise use the current
756  // stack location's fileobject (if there is a current stack location).
757  //
758  if (m_InStack == FALSE) {
760  }
761  }
762 
763 
764 
765  __inline
766  VOID
768  VOID
769  )
770  {
771  LONG ret;
772 
774 
775 #if DBG
776  ASSERT(ret > 1);
777 #else
779 #endif
780  }
781 
782 
783  __inline
784  VOID
786  VOID
787  )
788  {
789  LONG ret;
790 
792  ASSERT(ret >= 0);
793 
794  if (ret == 0) {
797  m_DisposeEvent->Set();
798  }
799  }
800 
801  VOID
803  VOID
804  );
805 
806 private:
807 
808  VOID
809  Construct(
810  VOID
811  );
812 
813  VOID
816  )
817  {
818  if (GetDriverGlobals()->FxVerifierOn &&
819  GetDriverGlobals()->FxVerifierIO) {
820  KIRQL irql;
821 
822  Request->Lock(&irql);
823  //
824  // IF we are completing a request that was pended in the target,
825  // this flag was not set.
826  //
827  // ASSERT(Request->GetVerifierFlagsLocked() & FXREQUEST_FLAG_SENT_TO_TARGET);
828  Request->ClearVerifierFlagsLocked(FXREQUEST_FLAG_SENT_TO_TARGET);
829  Request->Unlock(irql);
830  }
831  }
832 
833  VOID
836  )
837  {
838  FxIrp* irp = Request->GetSubmitFxIrp();
839 
843  Request,
844  TRUE,
845  TRUE,
846  TRUE);
847  }
848 
849 public:
850  //
851  // Transaction entry for FxDevice to queue this target on
852  //
854 
856 
857  //
858  // TRUE when FxDevice::AddIoTarget has been called
859  //
861 
862  static const PVOID m_SentRequestTag;
863 
864 protected:
865  //
866  // List of requests that have been sent to the target
867  //
869 
870  //
871  // List of requests which were sent ignoring the state of the target
872  //
874 
875  //
876  // Event used to wait for sent I/O to complete
877  //
879 
880  //
881  // Event used to wait by Dispose to make sure all I/O's are completed.
882  // This is required to make sure that all the I/O are completed before
883  // disposing the target. This acts like remlock.
884  //
886 
887 #if (FX_CORE_MODE == FX_CORE_USER_MODE)
888  //
889  // Eventy initialization can fail in user-mode so we define one as
890  // part of object.
891  //
893 #endif
894 
896 
897  //
898  // Back link to the object that represents our devobj
899  //
901 
902  //
903  // The PDEVICE_OBJECT that is owned by m_Device
904  //
906 
907  //
908  // The device object which is our "target"
909  //
911 
912  //
913  // The PDO for m_TargetDevice. For this class, it would be the same PDO
914  // as the owning WDFDEVICE. In a derived class (like FxIoTargetRemote),
915  // this would not be the PDO of the owning WDFDEVICE, rather the PDO for
916  // the other stack.
917  //
919 
920  //
921  // File object that is attached to all I/O sent to m_TargetDevice
922  //
924 
925  //
926  // Current state
927  //
929 
930  //
931  // This is used to track the I/O's sent to the lower driver
932  // and is used to make sure all I/Os are completed before disposing the
933  // Iotarget.
934  //
936 
937  //
938  // Cached value of m_TargetDevice->StackSize. The value is cached so that
939  // we can still format to the target during query remove transitions.
940  //
942 
943  //
944  // Cached value of m_TargetDevice->Flags & (DO_BUFFERED_IO | DO_DIRECT_IO)
945  // which uses WDF_DEVICE_IO_TYPE to indicate state.
946  //
948 
949  //
950  // TRUE if we are in the processing of stopping/purging and there are
951  // requests that have been sent and must be waited upon for completion.
952  //
954 
956 
957 };
958 
959 
960 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
961 #include "fxiotargetkm.hpp"
962 #elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
963 #include "fxiotargetum.hpp"
964 #endif
965 
966 #endif //_FXIOTARGET_H_
__in MdIrp __in PMdIoCsqIrpContext __in KIRQL CallerIrql
Definition: fxirpqueue.hpp:74
CfxDevice * m_Device
Definition: fxobject.hpp:329
MdDeviceObject m_TargetDevice
Definition: fxiotarget.hpp:910
WDFCONTEXT OrigTargetCompletionContext
Definition: fxiotarget.hpp:198
enum _WDF_IO_TARGET_PURGE_IO_ACTION WDF_IO_TARGET_PURGE_IO_ACTION
virtual VOID GotoPurgeState(__in WDF_IO_TARGET_PURGE_IO_ACTION Action, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __out PBOOLEAN Wait, __in BOOLEAN LockSelf)
Definition: fxiotarget.cpp:790
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
#define _Must_inspect_result_
Definition: no_sal2.h:62
PVOID m_OriginalUserBuffer
Definition: fxiotarget.hpp:93
__inline WDFDEVICE GetDeviceHandle(VOID)
Definition: fxiotarget.hpp:299
__in MdIrp __in PMdIoCsqIrpContext pCsqContext
Definition: fxirpqueue.hpp:74
VOID CompletePendedRequestList(__in PLIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:520
LONG m_IoCount
Definition: fxiotarget.hpp:935
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
FxTransactionedEntry m_TransactionedEntry
Definition: fxiotarget.hpp:853
UCHAR GetCurrentStackFlags(VOID)
Definition: fxirpum.cpp:1243
VOID PrintDisposeMessage(VOID)
Definition: fxiotarget.cpp:99
BOOLEAN m_RestoreState
Definition: fxiotarget.hpp:113
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:290
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
_Must_inspect_result_ NTSTATUS PendRequestLocked(__in FxRequestBase *Request)
Definition: ntbasedef.h:628
PMDL m_MdlToFree
Definition: fxiotarget.hpp:94
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
virtual BOOLEAN Dispose(VOID)
Definition: fxiotarget.cpp:154
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2221
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
static MdCompletionRoutineType _RequestCompletionRoutine
Definition: fxiotarget.hpp:609
_Must_inspect_result_ NTSTATUS FormatInternalIoctlOthersRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in FxRequestBuffer *Buffers)
PVOID Buffers[0x100]
static EVT_WDF_REQUEST_COMPLETION_ROUTINE _SyncCompletionRoutine
Definition: fxiotarget.hpp:662
LONG NTSTATUS
Definition: precomp.h:26
__inline VOID CopyFileObjectAndFlags(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:743
BOOLEAN m_WaitingForSentIo
Definition: fxiotarget.hpp:953
__inline WDF_IO_TARGET_STATE GetState(VOID)
Definition: fxiotarget.hpp:263
virtual VOID Forward(__in MdIrp Irp)
Definition: fxiotarget.hpp:699
VOID DrainPendedRequestsLocked(__in PLIST_ENTRY RequestListHead, __in BOOLEAN RequestWillBeResent)
Definition: fxiotarget.cpp:395
#define FX_REQUEST_NUM_OTHER_PARAMS
Definition: fxirp.hpp:28
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_Must_inspect_result_ NTSTATUS SubmitSync(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options=NULL, __out_opt PULONG Action=NULL)
KIRQL irql
Definition: wave.h:1
VOID ClearCompletedRequestVerifierFlags(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:814
VOID GetSentRequestsListLocked(__in PSINGLE_LIST_ENTRY RequestListHead, __in PLIST_ENTRY SendList, __out PBOOLEAN AddedToList)
Definition: fxiotarget.cpp:582
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:142
VOID CompletePendedRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:508
__inline MdDeviceObject GetTargetPDO(VOID)
Definition: fxiotarget.hpp:281
VOID FailPendedRequest(__in FxRequestBase *Request, __in NTSTATUS Status)
VOID Set(VOID)
Definition: fxwaitlock.hpp:144
__inline MdFileObject GetTargetFileObject(VOID)
Definition: fxiotarget.hpp:290
virtual ~FxIoContext(VOID)
_Must_inspect_result_ NTSTATUS InitModeSpecific(__in CfxDeviceBase *Device)
FxCREvent m_SentIoEvent
Definition: fxiotarget.hpp:878
WDF_IO_TARGET_STATE m_State
Definition: fxiotarget.hpp:928
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
Definition: fxiotarget.hpp:164
ULONG Submit(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options, __in_opt ULONG Flags)
MdDeviceObject m_InStackDevice
Definition: fxiotarget.hpp:905
size_t m_BufferToFreeLength
Definition: fxiotarget.hpp:102
__inline VOID IncrementIoCount(VOID)
Definition: fxiotarget.hpp:767
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
enum _WDF_IO_TARGET_SENT_IO_ACTION WDF_IO_TARGET_SENT_IO_ACTION
UCHAR m_MajorFunction
Definition: fxiotarget.hpp:114
FxDriver * m_Driver
Definition: fxiotarget.hpp:900
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:382
static VOID _CancelSentRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:534
UCHAR KIRQL
Definition: env_spec_w32.h:591
WDFIOTARGET GetHandle(VOID)
Definition: fxiotarget.hpp:307
PMDL m_OriginalMdl
Definition: fxiotarget.hpp:96
FxCREvent m_DisposeEventUm
Definition: fxiotarget.hpp:892
_Must_inspect_result_ NTSTATUS SubmitSyncRequestIgnoreTargetState(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions)
#define __out_opt
Definition: dbghelp.h:65
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
FxIoContext(VOID)
long LONG
Definition: pedump.c:60
VOID UpdateTargetIoType(VOID)
BOOLEAN m_AddedToDeviceList
Definition: fxiotarget.hpp:860
_Must_inspect_result_ NTSTATUS FormatIoRequest(__inout FxRequestBase *Request, __in UCHAR MajorCode, __in FxRequestBuffer *IoBuffer, __in_opt PLONGLONG StartingOffset, __in_opt FxFileObject *FileObject=NULL)
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
VOID ClearBuffer(VOID)
#define __out
Definition: dbghelp.h:62
PFX_DRIVER_GLOBALS m_DriverGlobals
Definition: fxiotarget.hpp:97
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
NTSTATUS EnterCRAndWaitAndLeave(VOID)
Definition: fxwaitlock.hpp:87
unsigned char BOOLEAN
VOID CancelSentIo(VOID)
FxIoTarget(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT ObjectSize)
Definition: fxiotarget.cpp:34
MdFileObject m_TargetFileObject
Definition: fxiotarget.hpp:923
IWudfIrp * MdIrp
Definition: mxum.h:103
EVT_WDF_REQUEST_COMPLETION_ROUTINE * PFN_WDF_REQUEST_COMPLETION_ROUTINE
Definition: wdfrequest.h:313
Definition: bufpool.h:45
SubmitActionFlags
Definition: fxiotarget.hpp:201
MdDeviceObject m_TargetPdo
Definition: fxiotarget.hpp:918
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 Construct(VOID)
Definition: fxiotarget.cpp:54
virtual VOID Remove(VOID)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:859
VOID RequestCompletionRoutine(__in FxRequestBase *Request)
friend FxRequestBase
Definition: fxiotarget.hpp:212
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:949
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
__inline MdDeviceObject GetTargetDevice(VOID)
Definition: fxiotarget.hpp:272
UCHAR GetTargetIoType(VOID)
Definition: fxiotarget.hpp:631
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3531
IFxMemory * m_MemoryObjects[FX_REQUEST_NUM_OTHER_PARAMS-1]
Definition: fxiotarget.hpp:176
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN m_InStack
Definition: fxiotarget.hpp:855
#define ASSERT(a)
Definition: mode.c:44
WDF_EXTERN_C_START enum _WDF_IO_TARGET_STATE WDF_IO_TARGET_STATE
ULONG m_OriginalFlags
Definition: fxiotarget.hpp:100
VOID CopyParameters(__in FxRequestBase *Request)
static FxIoTarget * _FromEntry(__in FxTransactionedEntry *Entry)
Definition: fxiotarget.hpp:455
char CCHAR
Definition: typedefs.h:51
BOOLEAN HasValidStackSize(VOID)
#define DO_BUFFERED_IO
Definition: env_spec_w32.h:394
__inline VOID CompleteRequest(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:580
BOOLEAN __inline HasEnoughStackLocations(__in FxIrp *Irp)
Definition: fxiotarget.hpp:396
PFN_WDF_REQUEST_COMPLETION_ROUTINE OrigTargetCompletionRoutine
Definition: fxiotarget.hpp:193
BOOLEAN m_Removing
Definition: fxiotarget.hpp:955
VOID TimerCallback(__in FxRequestBase *Request)
virtual VOID GotoStopState(__in WDF_IO_TARGET_SENT_IO_ACTION Action, __in PSINGLE_LIST_ENTRY SentRequestListHead, __out PBOOLEAN Wait, __in BOOLEAN LockSelf)
Definition: fxiotarget.cpp:617
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
VOID CompleteCanceledRequest(__in FxRequestBase *Request)
BOOLEAN RemoveCompletedRequestLocked(__in FxRequestBase *Request)
GLbitfield flags
Definition: glext.h:7161
static const PVOID m_SentRequestTag
Definition: fxiotarget.hpp:862
unsigned char UCHAR
Definition: xmlstorage.h:181
int ret
char * PBOOLEAN
Definition: retypes.h:11
VOID SetNextStackFlags(__in UCHAR Flags)
Definition: fxirpum.cpp:1556
VOID SetBufferAndLength(__in PVOID Buffer, __in size_t BufferLength, __in BOOLEAN CopyBackToBuffer)
BOOLEAN m_UnlockPages
Definition: fxiotarget.hpp:105
#define InterlockedDecrement
Definition: armddk.h:52
_Must_inspect_result_ NTSTATUS FormatIoctlRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in BOOLEAN Internal, __in FxRequestBuffer *InputBuffer, __in FxRequestBuffer *OutputBuffer, __in_opt FxFileObject *FileObject=NULL)
UCHAR m_TargetIoType
Definition: fxiotarget.hpp:947
VOID HandleFailedResubmit(__in FxRequestBase *Request)
LIST_ENTRY m_SentIoListHead
Definition: fxiotarget.hpp:868
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
Definition: fxiotarget.cpp:918
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
Definition: fxiotarget.cpp:282
#define __inout
Definition: dbghelp.h:50
Definition: typedefs.h:119
__inline FxDriver * GetDriver(VOID)
Definition: fxiotarget.hpp:316
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
FxCREvent * m_DisposeEvent
Definition: fxiotarget.hpp:885
virtual VOID ClearTargetPointers(VOID)
Definition: fxiotarget.hpp:618
MxDeviceObject deviceObject
NTSTATUS _Must_inspect_result_ QueryInterface(__inout FxQueryInterfaceParams *Params)
_Must_inspect_result_ NTSTATUS Init(__in CfxDeviceBase *Device)
static VOID _RequestCancelled(__in FxIrpQueue *Queue, __in MdIrp Irp, __in PMdIoCsqIrpContext pCsqContext, __in KIRQL CallerIrql)
virtual VOID WaitForSentIoToComplete(VOID)
Definition: fxiotarget.hpp:676
virtual _Must_inspect_result_ MdDeviceObject GetTargetDeviceObject(_In_ CfxDeviceBase *Device)
Definition: fxiotarget.hpp:326
virtual _Must_inspect_result_ NTSTATUS GotoStartState(__in PLIST_ENTRY RequestListHead, __in BOOLEAN Lock=TRUE)
Definition: fxiotarget.cpp:306
#define _In_
Definition: no_sal2.h:158
ULONG SubmitLocked(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options, __in ULONG Flags)
PVOID m_BufferToFree
Definition: fxiotarget.hpp:91
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define InterlockedIncrement
Definition: armddk.h:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned short USHORT
Definition: pedump.c:61
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
CCHAR m_TargetStackSize
Definition: fxiotarget.hpp:941
virtual VOID WaitForDisposeEvent(VOID)
Definition: fxiotarget.cpp:124
USHORT WDFTYPE
Definition: fxtypes.h:29
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
virtual VOID GotoRemoveState(__in WDF_IO_TARGET_STATE NewState, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __in BOOLEAN Lock, __out PBOOLEAN Wait)
Definition: fxiotarget.cpp:964
static VOID _CancelSentRequests(__in PSINGLE_LIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:550
VOID SubmitPendedRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:206
VOID StoreAndReferenceOtherMemories(__in FxRequestBuffer *Buffer1, __in FxRequestBuffer *Buffer2, __in FxRequestBuffer *Buffer4)
Definition: fxiotarget.hpp:129
static VOID _StoreAndReferenceMemoryWorker(__in PVOID Tag, __deref_out_opt IFxMemory **PPMemory, __in FxRequestBuffer *Buffer)
VOID SetCompletionRoutine(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:834
VOID SetNextStackFileObject(_In_ MdFileObject FileObject)
Definition: fxirpum.cpp:1573
IFxMemory * m_OtherMemory
Definition: fxiotarget.hpp:115
LIST_ENTRY m_IgnoredIoListHead
Definition: fxiotarget.hpp:873
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS RequestOptions
Definition: wdfiotarget.h:859
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
VOID CaptureState(__in FxIrp *Irp)
ULONG GetFlags(VOID)
virtual VOID Send(_In_ MdIrp Irp)
FxIrpQueue m_PendedQueue
Definition: fxiotarget.hpp:895
VOID SwapIrpBuffer(_In_ FxRequestBase *Request, _In_ ULONG NewInputBufferCb, _In_reads_bytes_opt_(NewInputBufferCb) PVOID NewInputBuffer, _In_ ULONG NewOutputBufferCb, _In_reads_bytes_opt_(NewOutputBufferCb) PVOID NewOutputBuffer)
BOOLEAN m_CopyBackToBuffer
Definition: fxiotarget.hpp:104
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifySubmitLocked, _In_ FxRequestBase *)
__inline VOID DecrementIoCount(VOID)
Definition: fxiotarget.hpp:785
#define __in
Definition: dbghelp.h:35
size_t m_MdlToFreeSize
Definition: fxiotarget.hpp:103
PVOID m_OriginalSystemBuffer
Definition: fxiotarget.hpp:92
VOID SubmitPendedRequests(__in PLIST_ENTRY RequestListHeadHead)
Definition: fxiotarget.cpp:268
MdFileObject GetCurrentStackFileObject(VOID)
Definition: fxirpum.cpp:1258
FxIrp * irp
base of all file and directory entries
Definition: entries.h:82
VOID StoreAndReferenceOtherMemory(__in FxRequestBuffer *Buffer)
Definition: fxiotarget.hpp:44
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
Definition: fxiotarget.cpp:748