ReactOS 0.4.16-dev-334-g4d9f67c
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}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define TRACINGDEVICE
Definition: dbgtrace.h:58
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
FxMemoryObject * pMemory
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
PFX_DRIVER_GLOBALS pFxDriverGlobals
@ FX_TYPE_MEMORY_PREALLOCATED
Definition: fxtypes.h:75
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_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
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

◆ _Pre_writable_byte_size_()

_Must_inspect_result_ _In_ WDFMEMORY _Pre_notnull_ _Pre_writable_byte_size_ ( BufferSize  )

◆ FxPointerNotNull() [1/2]

FxPointerNotNull ( pFxDriverGlobals  ,
Buffer   
)

◆ FxPointerNotNull() [2/2]

FxPointerNotNull ( pFxDriverGlobals  ,
PMemory   
)

◆ if() [1/5]

if ( NT_SUCCESSstatus)

Definition at line 113 of file fxmemorybufferpreallocatedapi.cpp.

113 {
114 return status;
115 }

◆ 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 }

◆ if() [3/5]

Definition at line 89 of file fxmemorybufferpreallocatedapi.cpp.

90 {
92
94 Attributes->ParentObject,
96 (PVOID*)&pParent,
98 }
FxObject * pParent
Definition: fxdpcapi.cpp:86
@ FX_TYPE_OBJECT
Definition: fxtypes.h:45
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes

◆ if() [4/5]

if ( NT_SUCCESS(status )

Definition at line 126 of file fxmemorybufferpreallocatedapi.cpp.

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

◆ if() [5/5]

if ( pBuffer  = NULL)

Definition at line 120 of file fxmemorybufferpreallocatedapi.cpp.

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

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 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:

Definition at line 49 of file fxmemorybufferpreallocatedapi.cpp.

Referenced by if().

◆ status