ReactOS 0.4.15-dev-6679-g945ee4b
fxiotarget.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation. All rights reserved.
4
5Module Name:
6
7 FxIoTarget.hpp
8
9Abstract:
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
16Author:
17
18
19
20Environment:
21
22 Both kernel and user mode
23
24Revision History:
25
26--*/
27
28#ifndef _FXIOTARGET_H_
29#define _FXIOTARGET_H_
30
31
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
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
88public:
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 {
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
161private:
162 virtual
163 VOID
166 )
167 {
169 }
170
171public:
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
211
213
214public:
215
217 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
218 __in USHORT ObjectSize
219 );
220
222 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
223 __in USHORT ObjectSize,
224 __in WDFTYPE WdfType
225 );
226
227 virtual
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 //
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
335 Init(
337 );
338
339 ULONG
340 Submit(
344 );
345
346 // Do not specify argument names
348 NTSTATUS,
349 VerifySubmitLocked,
351 );
352
353 ULONG
358 );
359
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
428 __in UCHAR MajorCode,
429 __in FxRequestBuffer* IoBuffer,
432 );
433
443 );
444
451 );
452
453 static
457 )
458 {
460 }
461
462 VOID
464 VOID
465 );
466
472 );
473
474 VOID
476 VOID
477 );
478
479 BOOLEAN
481 VOID
482 );
483
484 virtual
485 VOID
486 Send(
488 );
489
490protected:
491 //
492 // Hide destructor since we are reference counted object
493 //
494 ~FxIoTarget();
495
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
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
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 {
625
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,
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
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) {
798 }
799 }
800
801 VOID
803 VOID
804 );
805
806private:
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
849public:
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
863
864protected:
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_
unsigned char BOOLEAN
PVOID Buffers[0x100]
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:291
Definition: bufpool.h:45
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
NTSTATUS _Must_inspect_result_ QueryInterface(__inout FxQueryInterfaceParams *Params)
virtual _Must_inspect_result_ NTSTATUS GotoStartState(__in PLIST_ENTRY RequestListHead, __in BOOLEAN Lock=TRUE)
Definition: fxiotarget.cpp:306
VOID CancelSentIo(VOID)
VOID DrainPendedRequestsLocked(__in PLIST_ENTRY RequestListHead, __in BOOLEAN RequestWillBeResent)
Definition: fxiotarget.cpp:395
WDFIOTARGET GetHandle(VOID)
Definition: fxiotarget.hpp:307
VOID CompleteCanceledRequest(__in FxRequestBase *Request)
VOID SetCompletionRoutine(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:834
static MdCompletionRoutineType _RequestCompletionRoutine
Definition: fxiotarget.hpp:609
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
LIST_ENTRY m_IgnoredIoListHead
Definition: fxiotarget.hpp:873
VOID FailPendedRequest(__in FxRequestBase *Request, __in NTSTATUS Status)
static VOID _CancelSentRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:534
_Must_inspect_result_ NTSTATUS SubmitSync(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options=NULL, __out_opt PULONG Action=NULL)
VOID TimerCallback(__in FxRequestBase *Request)
VOID RequestCompletionRoutine(__in FxRequestBase *Request)
ULONG SubmitLocked(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options, __in ULONG Flags)
BOOLEAN m_AddedToDeviceList
Definition: fxiotarget.hpp:860
__inline WDF_IO_TARGET_STATE GetState(VOID)
Definition: fxiotarget.hpp:263
UCHAR GetTargetIoType(VOID)
Definition: fxiotarget.hpp:631
BOOLEAN __inline HasEnoughStackLocations(__in FxIrp *Irp)
Definition: fxiotarget.hpp:396
VOID HandleFailedResubmit(__in FxRequestBase *Request)
LIST_ENTRY m_SentIoListHead
Definition: fxiotarget.hpp:868
_Must_inspect_result_ NTSTATUS SubmitSyncRequestIgnoreTargetState(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions)
FxIrpQueue m_PendedQueue
Definition: fxiotarget.hpp:895
MdDeviceObject m_TargetDevice
Definition: fxiotarget.hpp:910
static FxIoTarget * _FromEntry(__in FxTransactionedEntry *Entry)
Definition: fxiotarget.hpp:455
MdDeviceObject m_TargetPdo
Definition: fxiotarget.hpp:918
FxTransactionedEntry m_TransactionedEntry
Definition: fxiotarget.hpp:853
virtual VOID WaitForDisposeEvent(VOID)
Definition: fxiotarget.cpp:124
BOOLEAN m_InStack
Definition: fxiotarget.hpp:855
LONG m_IoCount
Definition: fxiotarget.hpp:935
UCHAR m_TargetIoType
Definition: fxiotarget.hpp:947
VOID UpdateTargetIoType(VOID)
virtual BOOLEAN Dispose(VOID)
Definition: fxiotarget.cpp:154
__inline VOID CompleteRequest(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:580
MdDeviceObject m_InStackDevice
Definition: fxiotarget.hpp:905
WDF_IO_TARGET_STATE m_State
Definition: fxiotarget.hpp:928
__inline VOID CopyFileObjectAndFlags(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:743
FX_DECLARE_VF_FUNCTION_P1(NTSTATUS, VerifySubmitLocked, _In_ FxRequestBase *)
FxCREvent m_DisposeEventUm
Definition: fxiotarget.hpp:892
VOID SubmitPendedRequests(__in PLIST_ENTRY RequestListHeadHead)
Definition: fxiotarget.cpp:268
__inline WDFDEVICE GetDeviceHandle(VOID)
Definition: fxiotarget.hpp:299
_Must_inspect_result_ NTSTATUS PendRequestLocked(__in FxRequestBase *Request)
VOID CompletePendedRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:508
BOOLEAN HasValidStackSize(VOID)
__inline VOID DecrementIoCount(VOID)
Definition: fxiotarget.hpp:785
VOID CompletePendedRequestList(__in PLIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:520
VOID Construct(VOID)
Definition: fxiotarget.cpp:54
virtual VOID ClearTargetPointers(VOID)
Definition: fxiotarget.hpp:618
FxDriver * m_Driver
Definition: fxiotarget.hpp:900
__inline MdDeviceObject GetTargetPDO(VOID)
Definition: fxiotarget.hpp:281
BOOLEAN RemoveCompletedRequestLocked(__in FxRequestBase *Request)
_Must_inspect_result_ NTSTATUS FormatInternalIoctlOthersRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in FxRequestBuffer *Buffers)
virtual _Must_inspect_result_ MdDeviceObject GetTargetDeviceObject(_In_ CfxDeviceBase *Device)
Definition: fxiotarget.hpp:326
CCHAR m_TargetStackSize
Definition: fxiotarget.hpp:941
static VOID _CancelSentRequests(__in PSINGLE_LIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:550
static VOID _RequestCancelled(__in FxIrpQueue *Queue, __in MdIrp Irp, __in PMdIoCsqIrpContext pCsqContext, __in KIRQL CallerIrql)
FxCREvent * m_DisposeEvent
Definition: fxiotarget.hpp:885
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
VOID SubmitPendedRequest(__in FxRequestBase *Request)
Definition: fxiotarget.cpp:206
virtual VOID Send(_In_ MdIrp Irp)
__inline FxDriver * GetDriver(VOID)
Definition: fxiotarget.hpp:316
static const PVOID m_SentRequestTag
Definition: fxiotarget.hpp:862
FxCREvent m_SentIoEvent
Definition: fxiotarget.hpp:878
static EVT_WDF_REQUEST_COMPLETION_ROUTINE _SyncCompletionRoutine
Definition: fxiotarget.hpp:662
__inline MdDeviceObject GetTargetDevice(VOID)
Definition: fxiotarget.hpp:272
_Must_inspect_result_ NTSTATUS InitModeSpecific(__in CfxDeviceBase *Device)
_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)
BOOLEAN m_WaitingForSentIo
Definition: fxiotarget.hpp:953
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
friend FxRequestBase
Definition: fxiotarget.hpp:212
__inline VOID IncrementIoCount(VOID)
Definition: fxiotarget.hpp:767
ULONG Submit(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options, __in_opt ULONG Flags)
VOID ClearCompletedRequestVerifierFlags(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:814
virtual VOID Forward(__in MdIrp Irp)
Definition: fxiotarget.hpp:699
__inline MdFileObject GetTargetFileObject(VOID)
Definition: fxiotarget.hpp:290
VOID GetSentRequestsListLocked(__in PSINGLE_LIST_ENTRY RequestListHead, __in PLIST_ENTRY SendList, __out PBOOLEAN AddedToList)
Definition: fxiotarget.cpp:582
BOOLEAN m_Removing
Definition: fxiotarget.hpp:955
VOID PrintDisposeMessage(VOID)
Definition: fxiotarget.cpp:99
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
Definition: fxiotarget.cpp:918
virtual VOID WaitForSentIoToComplete(VOID)
Definition: fxiotarget.hpp:676
_Must_inspect_result_ NTSTATUS FormatIoRequest(__inout FxRequestBase *Request, __in UCHAR MajorCode, __in FxRequestBuffer *IoBuffer, __in_opt PLONGLONG StartingOffset, __in_opt FxFileObject *FileObject=NULL)
MdFileObject m_TargetFileObject
Definition: fxiotarget.hpp:923
Definition: fxirp.hpp:28
UCHAR GetCurrentStackFlags(VOID)
Definition: fxirpum.cpp:1243
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
MdFileObject GetCurrentStackFileObject(VOID)
Definition: fxirpum.cpp:1258
VOID SetNextStackFlags(__in UCHAR Flags)
Definition: fxirpum.cpp:1556
VOID SetNextStackFileObject(_In_ MdFileObject FileObject)
Definition: fxirpum.cpp:1573
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
CfxDevice * m_Device
Definition: fxobject.hpp:329
ULONG GetFlags(VOID)
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
_In_ PIRP Irp
Definition: csq.h:116
#define __out_opt
Definition: dbghelp.h:65
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
KIRQL irql
Definition: wave.h:1
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define DO_BUFFERED_IO
Definition: env_spec_w32.h:394
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
return pObject GetObjectHandle()
MxDeviceObject deviceObject
SubmitActionFlags
Definition: fxiotarget.hpp:201
@ SubmitTimeout
Definition: fxiotarget.hpp:206
@ SubmitWait
Definition: fxiotarget.hpp:205
@ SubmitSend
Definition: fxiotarget.hpp:202
@ SubmitSyncCallCompletion
Definition: fxiotarget.hpp:207
@ SubmitSent
Definition: fxiotarget.hpp:204
@ SubmitQueued
Definition: fxiotarget.hpp:203
_Must_inspect_result_ __in WDFIOTARGET __in_opt WDFREQUEST __in ULONG Ioctl
__in MdIrp __in PMdIoCsqIrpContext pCsqContext
Definition: fxirpqueue.hpp:75
__in MdIrp __in PMdIoCsqIrpContext __in KIRQL CallerIrql
Definition: fxirpqueue.hpp:77
FxIrp * irp
@ FXREQUEST_FLAG_SENT_TO_TARGET
#define FX_REQUEST_NUM_OTHER_PARAMS
@ FX_RCT_INTERNAL_IOCTL_OTHERS
USHORT WDFTYPE
Definition: fxtypes.h:29
Status
Definition: gdiplustypes.h:25
GLbitfield flags
Definition: glext.h:7161
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
@ Internal
Definition: hwresource.cpp:137
_In_ PVOID _Out_ BOOLEAN * Stop
Definition: ldrtypes.h:241
#define ASSERT(a)
Definition: mode.c:44
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
IWudfIrp * MdIrp
Definition: mxum.h:103
WUDF_IO_COMPLETION_ROUTINE MdCompletionRoutineType
Definition: mxum.h:142
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:382
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
base of all file and directory entries
Definition: entries.h:83
NTSTATUS EnterCRAndWaitAndLeave(VOID)
Definition: fxwaitlock.hpp:87
VOID Set(VOID)
Definition: fxwaitlock.hpp:144
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
Definition: fxiotarget.hpp:142
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
Definition: fxiotarget.hpp:164
VOID StoreAndReferenceOtherMemories(__in FxRequestBuffer *Buffer1, __in FxRequestBuffer *Buffer2, __in FxRequestBuffer *Buffer4)
Definition: fxiotarget.hpp:129
IFxMemory * m_MemoryObjects[FX_REQUEST_NUM_OTHER_PARAMS-1]
Definition: fxiotarget.hpp:176
PVOID m_OriginalSystemBuffer
Definition: fxiotarget.hpp:92
PVOID m_BufferToFree
Definition: fxiotarget.hpp:91
PFX_DRIVER_GLOBALS m_DriverGlobals
Definition: fxiotarget.hpp:97
VOID StoreAndReferenceOtherMemory(__in FxRequestBuffer *Buffer)
Definition: fxiotarget.hpp:44
virtual ~FxIoContext(VOID)
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)
UCHAR m_MajorFunction
Definition: fxiotarget.hpp:114
BOOLEAN m_RestoreState
Definition: fxiotarget.hpp:113
PMDL m_MdlToFree
Definition: fxiotarget.hpp:94
IFxMemory * m_OtherMemory
Definition: fxiotarget.hpp:115
BOOLEAN m_UnlockPages
Definition: fxiotarget.hpp:105
BOOLEAN m_CopyBackToBuffer
Definition: fxiotarget.hpp:104
VOID ClearBuffer(VOID)
size_t m_MdlToFreeSize
Definition: fxiotarget.hpp:103
PVOID m_OriginalUserBuffer
Definition: fxiotarget.hpp:93
VOID SetBufferAndLength(__in PVOID Buffer, __in size_t BufferLength, __in BOOLEAN CopyBackToBuffer)
ULONG m_OriginalFlags
Definition: fxiotarget.hpp:100
size_t m_BufferToFreeLength
Definition: fxiotarget.hpp:102
VOID CaptureState(__in FxIrp *Irp)
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
VOID CopyParameters(__in FxRequestBase *Request)
PMDL m_OriginalMdl
Definition: fxiotarget.hpp:96
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
static VOID _StoreAndReferenceMemoryWorker(__in PVOID Tag, __deref_out_opt IFxMemory **PPMemory, __in FxRequestBuffer *Buffer)
WDFCONTEXT OrigTargetCompletionContext
Definition: fxiotarget.hpp:198
PFN_WDF_REQUEST_COMPLETION_ROUTINE OrigTargetCompletionRoutine
Definition: fxiotarget.hpp:193
Definition: typedefs.h:120
Definition: ntbasedef.h:628
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
char CCHAR
Definition: typedefs.h:51
@ Start
Definition: partlist.h:33
int ret
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
@ WdfDeviceIoNeither
Definition: wdfdevice.h:451
@ WdfDeviceIoUndefined
Definition: wdfdevice.h:450
@ WdfDeviceIoBuffered
Definition: wdfdevice.h:452
@ WdfDeviceIoDirect
Definition: wdfdevice.h:453
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
enum _WDF_IO_TARGET_PURGE_IO_ACTION WDF_IO_TARGET_PURGE_IO_ACTION
enum _WDF_IO_TARGET_SENT_IO_ACTION WDF_IO_TARGET_SENT_IO_ACTION
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
WDF_EXTERN_C_START enum _WDF_IO_TARGET_STATE WDF_IO_TARGET_STATE
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_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:867
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
EVT_WDF_REQUEST_COMPLETION_ROUTINE * PFN_WDF_REQUEST_COMPLETION_ROUTINE
Definition: wdfrequest.h:313
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ BOOLEAN Remove
Definition: psfuncs.h:110
unsigned char UCHAR
Definition: xmlstorage.h:181