ReactOS  0.4.15-dev-3017-g1d9542d
fxmemorybufferpreallocatedapi.cpp File Reference
Include dependency graph for fxmemorybufferpreallocatedapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL) WDFAPI NTSTATUS STDCALL WDFEXPORT(WdfMemoryCreatePreallocated)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in PVOID __in __drv_when (BufferSize==0, __drv_reportError(BufferSize cannot be zero)) size_t BufferSize
 
 if (NT_SUCCESS(FxValidateObjectAttributesForParentHandle(pFxDriverGlobals, Attributes)))
 
 FxPointerNotNull (pFxDriverGlobals, Buffer)
 
 FxPointerNotNull (pFxDriverGlobals, PMemory)
 
 if (BufferSize==0)
 
 if (!NT_SUCCESS(status))
 
 if (pBuffer==NULL)
 
 if (NT_SUCCESS(status))
 
_Must_inspect_result_ _In_ WDFMEMORY _Pre_notnull_ _Pre_writable_byte_size_ (BufferSize) PVOID Buffer
 

Variables

_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES Attributes
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in PVOID Buffer
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in PVOID __in __out WDFMEMORY * PMemory
 
PFX_DRIVER_GLOBALS pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
FxMemoryBufferPreallocatedpBuffer
 
WDFMEMORY hMemory
 
NTSTATUS status = FxValidateObjectAttributes(pFxDriverGlobals, Attributes)
 
 else
 
_Must_inspect_result_ _In_ WDFMEMORY Memory
 

Function Documentation

◆ __drv_maxIRQL()

◆ __drv_when()

Definition at line 149 of file fxmemorybufferpreallocatedapi.cpp.

152 {
153  DDI_ENTRY();
154 
158 
160  Memory,
162  (PVOID*) &pMemory,
164 
166 
167  if (BufferSize == 0) {
170  "Zero BufferSize not allowed, %!STATUS!", status);
171  return status;
172  }
173 
174  pMemory->UpdateBuffer(Buffer, BufferSize);
175 
176  return STATUS_SUCCESS;
177 }
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
FxMemoryObject * pMemory
DriverGlobals
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
#define TRACINGDEVICE
Definition: dbgtrace.h:58
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxPointerNotNull(pFxDriverGlobals, Buffer)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
#define STATUS_SUCCESS
Definition: shellext.h:65
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
Definition: ps.c:97

◆ _Pre_writable_byte_size_()

_Must_inspect_result_ _In_ WDFMEMORY _Pre_notnull_ _Pre_writable_byte_size_ ( BufferSize  )

◆ FxPointerNotNull() [1/2]

FxPointerNotNull ( pFxDriverGlobals  ,
Buffer   
)

Referenced by __drv_when().

◆ FxPointerNotNull() [2/2]

FxPointerNotNull ( pFxDriverGlobals  ,
PMemory   
)

◆ if() [1/5]

Definition at line 89 of file fxmemorybufferpreallocatedapi.cpp.

90  {
92 
94  Attributes->ParentObject,
96  (PVOID*)&pParent,
98  }
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxObject * pParent
Definition: fxdpcapi.cpp:86
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes

◆ if() [2/5]

if ( BufferSize  = = 0)

Definition at line 105 of file fxmemorybufferpreallocatedapi.cpp.

105  {
108  "Zero BufferSize not allowed, %!STATUS!", status);
109  return status;
110  }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define TRACINGDEVICE
Definition: dbgtrace.h:58
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
Definition: ps.c:97

◆ if() [3/5]

if ( NT_SUCCESSstatus)

Definition at line 113 of file fxmemorybufferpreallocatedapi.cpp.

113  {
114  return status;
115  }

◆ if() [4/5]

if ( pBuffer  = NULL)

Definition at line 120 of file fxmemorybufferpreallocatedapi.cpp.

120  {
122  }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ if() [5/5]

if ( NT_SUCCESS(status )

Definition at line 126 of file fxmemorybufferpreallocatedapi.cpp.

126  {
127  *PMemory = hMemory;
128  }
WDFMEMORY hMemory
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in PVOID __in __out WDFMEMORY * PMemory

Variable Documentation

◆ Attributes

◆ Buffer

◆ else

else
Initial value:
{
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
FxMemoryBufferPreallocated * pBuffer

Definition at line 129 of file fxmemorybufferpreallocatedapi.cpp.

◆ hMemory

WDFMEMORY hMemory

Definition at line 81 of file fxmemorybufferpreallocatedapi.cpp.

Referenced by if().

◆ Memory

◆ pBuffer

pBuffer
Initial value:
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES Attributes
Definition: bufpool.h:45
PFX_DRIVER_GLOBALS pFxDriverGlobals
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

Definition at line 80 of file fxmemorybufferpreallocatedapi.cpp.

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 79 of file fxmemorybufferpreallocatedapi.cpp.

Referenced by __drv_when(), and if().

◆ PMemory

* PMemory
Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 76 of file fxmemorybufferpreallocatedapi.cpp.

Referenced by if().

◆ status