ReactOS 0.4.16-dev-91-g764881a
fxlookasidelistapi.cpp File Reference
Include dependency graph for fxlookasidelistapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_when (PoolType==1||PoolType==257, __drv_maxIRQL(APC_LEVEL)) __drv_when(PoolType
 
_Must_inspect_result_ __drv_maxIRQL (DISPATCH_LEVEL)) NTSTATUS WDFAPI STDCALL WDFEXPORT(WdfLookasideListCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __drv_when (BufferSize==0, __drv_reportError(BufferSize cannot be zero)) size_t BufferSize
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __in __drv_strictTypeMatch (__drv_typeExpr) POOL_TYPE PoolType
 
 if (NT_SUCCESS(FxValidateObjectAttributesForParentHandle(pFxDriverGlobals, LookasideAttributes)))
 
else if (NT_SUCCESS(FxValidateObjectAttributesForParentHandle(pFxDriverGlobals, MemoryAttributes)))
 
 FxPointerNotNull (pFxDriverGlobals, PLookaside)
 
 if (BufferSize==0)
 
 if (!NT_SUCCESS(status))
 
 if (PoolTag==0)
 
 FxVerifierCheckNxPoolType (pFxDriverGlobals, PoolType, PoolTag)
 
 if (FxIsPagedPoolType(PoolType)==FALSE)
 
 if (pLookasideDB !=NULL &&pMemoryDB !=NULL &&pLookasideDB !=pMemoryDB)
 
 if (pLookaside==NULL)
 
 if (NT_SUCCESS(status))
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), Lookaside, FX_TYPE_LOOKASIDE,(PVOID *)&pLookaside)
 
 FxPointerNotNull (pLookaside->GetDriverGlobals(), Memory)
 

Variables

_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES LookasideAttributes
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __in __in_opt PWDF_OBJECT_ATTRIBUTES MemoryAttributes
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __in __in_opt PWDF_OBJECT_ATTRIBUTES __in_opt ULONG PoolTag
 
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __in __in_opt PWDF_OBJECT_ATTRIBUTES __in_opt ULONG __out WDFLOOKASIDE * PLookaside
 
FxLookasideListpLookaside
 
WDFLOOKASIDE hLookaside = NULL
 
NTSTATUS status = FxValidateObjectAttributes(pFxDriverGlobals, LookasideAttributes)
 
FxObjectpParent = NULL
 
 pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)
 
 else
 
 pLookasideDB
 
 pMemoryDB
 
_Must_inspect_result_ __in WDFLOOKASIDE Lookaside
 
_Must_inspect_result_ __in WDFLOOKASIDE __out WDFMEMORY * Memory
 
FxMemoryObjectpMemory = NULL
 
WDFMEMORY hMemory
 

Function Documentation

◆ __drv_maxIRQL()

◆ __drv_strictTypeMatch()

_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES __in __in __drv_strictTypeMatch ( __drv_typeExpr  )

◆ __drv_when() [1/2]

◆ __drv_when() [2/2]

_Must_inspect_result_ __drv_when ( PoolType  = = 1 || PoolType == 257,
__drv_maxIRQL(APC_LEVEL  
)

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
Lookaside  ,
FX_TYPE_LOOKASIDE  ,
(PVOID *)&  pLookaside 
)

◆ FxPointerNotNull() [1/2]

FxPointerNotNull ( pFxDriverGlobals  ,
PLookaside   
)

◆ FxPointerNotNull() [2/2]

FxPointerNotNull ( pLookaside->  GetDriverGlobals(),
Memory   
)

◆ FxVerifierCheckNxPoolType()

FxVerifierCheckNxPoolType ( pFxDriverGlobals  ,
PoolType  ,
PoolTag   
)

◆ if() [1/9]

if ( NT_SUCCESSstatus)

Definition at line 136 of file fxlookasidelistapi.cpp.

136 {
137 return status;
138 }
NTSTATUS status

◆ if() [2/9]

if ( BufferSize  = = 0)

Definition at line 128 of file fxlookasidelistapi.cpp.

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

◆ if() [3/9]

Definition at line 154 of file fxlookasidelistapi.cpp.

154 {
155 if (BufferSize < PAGE_SIZE) {
158 }
159 else {
162 }
163 }
#define PAGE_SIZE
Definition: env_spec_w32.h:49
_Must_inspect_result_ __in_opt PWDF_OBJECT_ATTRIBUTES LookasideAttributes
FxLookasideList * pLookaside
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164

◆ if() [4/9]

Definition at line 104 of file fxlookasidelistapi.cpp.

106 {
108 LookasideAttributes->ParentObject,
110 (PVOID*)&pParent,
112 }
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
FxObject * pParent
@ FX_TYPE_OBJECT
Definition: fxtypes.h:45
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES LookasideAttributes
Definition: wdfmemory.h:401

◆ if() [5/9]

Definition at line 113 of file fxlookasidelistapi.cpp.

115 {
117 MemoryAttributes->ParentObject,
119 (PVOID*)&pParent,
121 }
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES MemoryAttributes
Definition: wdfmemory.h:409

◆ if() [6/9]

if ( NT_SUCCESS(status )

Definition at line 217 of file fxlookasidelistapi.cpp.

217 {
218 //
219 // Follow the global driver policy and either return a PVOID cookie or
220 // an index into a handle table.
221 //
223 }
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
Definition: fxobject.cpp:904
WDFLOOKASIDE hLookaside

◆ if() [7/9]

if ( pLookaside  = NULL)

Definition at line 211 of file fxlookasidelistapi.cpp.

211 {
213 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ if() [8/9]

if ( pLookasideDB = NULL && pMemoryDB != NULL && pLookasideDB != pMemoryDB)

Definition at line 178 of file fxlookasidelistapi.cpp.

179 {
181
182 //
183 // No need to check if LookasideAttributes or MemoryAttributes are
184 // equal to NULL b/c we could not get a valid pLookasideDB or
185 // pMemoryDB if they were NULL.
186 //
189 "Lookaside Attributes ancestor WDFDEVICE %p (from ParentObject %p) "
190 " is not the same as Memory Attributes ancestor WDFDEVICE %p "
191 "(from ParentObject %p), %!STATUS!",
192 pLookasideDB->GetHandle(), LookasideAttributes->ParentObject,
193 pMemoryDB->GetHandle(), MemoryAttributes->ParentObject,
194 status);
195
196 return status;
197 }

◆ if() [9/9]

if ( PoolTag  = = 0)

Definition at line 145 of file fxlookasidelistapi.cpp.

145 {
147 }

Variable Documentation

◆ else

else
Initial value:

Definition at line 164 of file fxlookasidelistapi.cpp.

◆ hLookaside

hLookaside = NULL

Definition at line 94 of file fxlookasidelistapi.cpp.

Referenced by if().

◆ hMemory

◆ Lookaside

Definition at line 244 of file fxlookasidelistapi.cpp.

◆ LookasideAttributes

◆ Memory

* Memory
Initial value:

Definition at line 246 of file fxlookasidelistapi.cpp.

◆ MemoryAttributes

◆ pFxDriverGlobals

pFxDriverGlobals = GetFxDriverGlobals(DriverGlobals)

Definition at line 99 of file fxlookasidelistapi.cpp.

Referenced by if().

◆ PLookaside

* PLookaside
Initial value:

Definition at line 56 of file fxlookasidelistapi.cpp.

◆ pLookaside

◆ pLookasideDB

pLookasideDB
Initial value:
static FxDeviceBase * _SearchForDevice(__in FxObject *Object, __out_opt IFxHasCallbacks **Callbacks)

Definition at line 172 of file fxlookasidelistapi.cpp.

Referenced by if().

◆ pMemory

IFxMemory * pMemory = NULL

Definition at line 265 of file fxlookasidelistapi.cpp.

Referenced by __drv_when(), FxDevice::_AllocAndQueryProperty(), FxDevice::_AllocAndQueryPropertyEx(), FxUsbPipe::_FormatTransfer(), array_buffer_size(), array_compute_and_size_conformance(), array_compute_and_write_conformance(), array_free(), array_read_variance_and_unmarshall(), array_write_variance_and_marshall(), call_buffer_sizer(), call_freer(), call_marshaller(), CloseSharedMemory(), ComplexBufferSize(), ComplexFree(), ComplexMarshall(), ComplexUnmarshall(), ComputeConformance(), ComputeConformanceOrVariance(), ComputeVariance(), FxRequestMemory::Create(), EmbeddedPointerBufferSize(), EmbeddedPointerFree(), EmbeddedPointerMarshall(), FxUsbPipeContinuousReader::FormatRepeater(), get_discriminant(), get_ip_iid(), NdrBaseTypeBufferSize(), NdrBaseTypeFree(), NdrBaseTypeMarshall(), NdrComplexArrayBufferSize(), NdrComplexArrayFree(), NdrComplexArrayMarshall(), NdrComplexStructBufferSize(), NdrComplexStructFree(), NdrComplexStructMarshall(), NdrComplexStructUnmarshall(), NdrConformantArrayBufferSize(), NdrConformantArrayFree(), NdrConformantArrayMarshall(), NdrConformantStringBufferSize(), NdrConformantStructBufferSize(), NdrConformantStructFree(), NdrConformantStructMarshall(), NdrConformantVaryingArrayBufferSize(), NdrConformantVaryingArrayFree(), NdrConformantVaryingArrayMarshall(), NdrConformantVaryingStructBufferSize(), NdrConformantVaryingStructFree(), NdrConformantVaryingStructMarshall(), NdrContextHandleBufferSize(), NdrContextHandleMarshall(), NdrContextHandleSize(), NdrCorrelationInitialize(), NdrEncapsulatedUnionBufferSize(), NdrEncapsulatedUnionFree(), NdrEncapsulatedUnionMarshall(), NdrFixedArrayBufferSize(), NdrFixedArrayFree(), NdrFixedArrayMarshall(), NdrInterfacePointerBufferSize(), NdrInterfacePointerFree(), NdrInterfacePointerMarshall(), NdrNonConformantStringBufferSize(), NdrNonConformantStringMarshall(), NdrNonEncapsulatedUnionBufferSize(), NdrNonEncapsulatedUnionFree(), NdrNonEncapsulatedUnionMarshall(), NdrPointerBufferSize(), NdrPointerFree(), NdrPointerMarshall(), NdrRangeBufferSize(), NdrRangeFree(), NdrRangeMarshall(), NdrSimpleStructBufferSize(), NdrSimpleStructFree(), NdrSimpleStructMarshall(), NdrSimpleTypeMarshall(), NdrSimpleTypeUnmarshall(), NdrUserMarshalBufferSize(), NdrUserMarshalFree(), NdrUserMarshalMarshall(), NdrVaryingArrayBufferSize(), NdrVaryingArrayFree(), NdrVaryingArrayMarshall(), OpenSharedMemory(), FxRequest::ProbeAndLockForRead(), FxRequest::ProbeAndLockForWrite(), START_TEST(), union_arm_buffer_size(), union_arm_free(), union_arm_marshall(), FxRequestBuffer::ValidateMemoryDescriptor(), and WTSFreeMemory().

◆ pMemoryDB

pMemoryDB
Initial value:

Definition at line 175 of file fxlookasidelistapi.cpp.

Referenced by if().

◆ PoolTag

◆ pParent

pParent = NULL

Definition at line 96 of file fxlookasidelistapi.cpp.

Referenced by if().

◆ status