ReactOS  0.4.15-dev-3163-gf17c2c0
fxrequestbuffer.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft. All rights reserved.
4 
5 Module Name:
6 
7  FxRequestBuffer.hpp
8 
9 Abstract:
10 
11 Author:
12 
13 
14 
15 Environment:
16 
17  Both kernel and user mode
18 
19 Revision History:
20 
21 --*/
22 
23 #ifndef _FXREQUESTBUFFER_H_
24 #define _FXREQUESTBUFFER_H_
25 
28  FxRequestBufferMemory, // framework managed memory
29  FxRequestBufferMdl, // raw MDL
30  FxRequestBufferBuffer, // raw PVOID
31  FxRequestBufferReferencedMdl, // MDL belonging to a FxMemoryObject
32 };
33 
37 };
38 
40 public:
42 
43  NTSTATUS
45  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
47  __in ULONG Flags = 0x0
48  );
49 
50  VOID
51  SetMemory(
54  );
55 
56  VOID
57  SetMdl(
58  __in PMDL Mdl,
60  );
61 
62  __inline
63  VOID
67  )
68  {
70  u.Buffer.Buffer = Buffer;
71  u.Buffer.Length = Length;
72  }
73 
74  __inline
75  BOOLEAN
77  VOID
78  )
79  {
80  return (DataType == FxRequestBufferMdl ||
82  }
83 
84  ULONG
86  VOID
87  );
88 
90  NTSTATUS
91  GetBuffer(
93  );
94 
96  NTSTATUS
98  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
100  __inout PMDL* MdlToFree,
101  __inout PBOOLEAN UnlockWhenFreed,
103  __in BOOLEAN ReuseMdl = FALSE,
104  __inout_opt size_t* SizeOfMdl = NULL
105  );
106 
107  NTSTATUS
109  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
111  __in BOOLEAN * ReuseMdl,
112  __in LONG Length,
113  __in PVOID Buffer,
114  __inout size_t* SizeOfMdl,
115  __in BOOLEAN UnlockWhenFreed,
116  __deref_out_opt PMDL* MdlToFree
117  );
118 
119  VOID
120  AssignValues(
121  __deref_out_opt PVOID* PPBuffer,
122  __deref_out_opt PMDL* PPMdl,
124  );
125 
126 public:
128 
129  union {
130  struct {
133  } Memory;
134  struct {
137  } Mdl;
138  struct {
140  ULONG Length;
141  } Buffer;
142  struct {
143  IFxMemory* Memory;
145  PMDL Mdl;
146  } RefMdl;
147  } u;
148 };
149 
150 #if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
151 #include "fxrequestbufferkm.hpp"
152 #elif ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
153 #include "fxrequestbufferum.hpp"
154 #endif
155 
156 
157 #endif // _FXREQUESTBUFFER_H_
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
VOID SetMemory(__in IFxMemory *Memory, __in PWDFMEMORY_OFFSET Offsets)
ULONG GetBufferLength(VOID)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
FxRequestBufferType
GLint x0
Definition: linetemp.h:95
#define TRUE
Definition: types.h:120
__inline VOID SetBuffer(__in PVOID Buffer, __in ULONG Length)
LONG NTSTATUS
Definition: precomp.h:26
PWDFMEMORY_OFFSET Offsets
#define __inout_opt
Definition: dbghelp.h:53
VOID AssignValues(__deref_out_opt PVOID *PPBuffer, __deref_out_opt PMDL *PPMdl, __out PULONG BufferLength)
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define __out
Definition: dbghelp.h:62
unsigned char BOOLEAN
Definition: bufpool.h:45
_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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
struct FxRequestBuffer::@4570::@4574 RefMdl
char * PBOOLEAN
Definition: retypes.h:11
static ULONG SizeOfMdl(VOID)
Definition: NtReadFile.c:36
__inline BOOLEAN HasMdl(VOID)
#define __inout
Definition: dbghelp.h:50
#define _Must_inspect_result_
Definition: ms_sal.h:558
NTSTATUS ValidateMemoryDescriptor(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_MEMORY_DESCRIPTOR Descriptor, __in ULONG Flags=0x0)
enum _LOCK_OPERATION LOCK_OPERATION
FxRequestBufferType DataType
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
union FxRequestBuffer::@4570 u
#define __deref_out_opt
Definition: dbghelp.h:29
_Must_inspect_result_ NTSTATUS GetBuffer(__deref_out PVOID *Buffer)
NTSTATUS GetOrAllocateMdlWorker(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __deref_out PMDL *Mdl, __in BOOLEAN *ReuseMdl, __in LONG Length, __in PVOID Buffer, __inout size_t *SizeOfMdl, __in BOOLEAN UnlockWhenFreed, __deref_out_opt PMDL *MdlToFree)
#define __deref_out
Definition: dbghelp.h:26
_Must_inspect_result_ NTSTATUS GetOrAllocateMdl(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __deref_out_opt PMDL *Mdl, __inout PMDL *MdlToFree, __inout PBOOLEAN UnlockWhenFreed, __in LOCK_OPERATION Operation, __in BOOLEAN ReuseMdl=FALSE, __inout_opt size_t *SizeOfMdl=NULL)
unsigned int ULONG
Definition: retypes.h:1
_In_ FLT_SET_CONTEXT_OPERATION Operation
Definition: fltkernel.h:1467
VOID SetMdl(__in PMDL Mdl, __in ULONG Length)
FxValidateMemoryDescriptorFlags
#define __in
Definition: dbghelp.h:35