ReactOS 0.4.16-dev-117-g38f21f9
fxcommonbufferapi.cpp File Reference
#include "fxdmapch.hpp"
Include dependency graph for fxcommonbufferapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfCommonBufferCreate)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
_Must_inspect_result_ __in WDFDMAENABLER __in __drv_when (Length==0, __drv_reportError(Length cannot be zero)) size_t Length
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), DmaEnabler, FX_TYPE_DMA_ENABLER,(PVOID *) &pDmaEnabler, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, CommonBufferHandle)
 
 if (!NT_SUCCESS(status))
 
 if (Length==0)
 
 if (pComBuf==NULL)
 
 if (NT_SUCCESS(status))
 
 FxPointerNotNull (pFxDriverGlobals, Config)
 
 if (Config->Size !=sizeof(WDF_COMMON_BUFFER_CONFIG))
 
 __drv_maxIRQL (DISPATCH_LEVEL) PVOID STDCALL WDFEXPORT(WdfCommonBufferGetAlignedVirtualAddress)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), CommonBuffer, FX_TYPE_COMMON_BUFFER,(PVOID *) &pComBuf)
 
return pComBuf GetAlignedVirtualAddress ()
 
return pComBuf GetAlignedLogicalAddress ()
 
return pComBuf GetLength ()
 

Variables

_Must_inspect_result_ __in WDFDMAENABLER DmaEnabler
 
_Must_inspect_result_ __in WDFDMAENABLER __in __in_opt WDF_OBJECT_ATTRIBUTESAttributes
 
_Must_inspect_result_ __in WDFDMAENABLER __in __in_opt WDF_OBJECT_ATTRIBUTES __out WDFCOMMONBUFFER * CommonBufferHandle
 
FxDmaEnablerpDmaEnabler
 
NTSTATUS status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
WDFOBJECT handle
 
PFX_DRIVER_GLOBALS pFxDriverGlobals
 
 pComBuf
 
 else
 
_Must_inspect_result_ __in WDFDMAENABLER __in __in PWDF_COMMON_BUFFER_CONFIG Config
 
__in WDFCOMMONBUFFER CommonBuffer
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_when()

_Must_inspect_result_ __in WDFDMAENABLER __in __drv_when ( Length  = = 0,
__drv_reportError(Length cannot be zero  
)

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
CommonBuffer  ,
FX_TYPE_COMMON_BUFFER  ,
(PVOID *) &  pComBuf 
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
DmaEnabler  ,
FX_TYPE_DMA_ENABLER  ,
(PVOID *) &  pDmaEnabler,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/2]

FxPointerNotNull ( pFxDriverGlobals  ,
CommonBufferHandle   
)

◆ FxPointerNotNull() [2/2]

FxPointerNotNull ( pFxDriverGlobals  ,
Config   
)

◆ GetAlignedLogicalAddress()

return pComBuf GetAlignedLogicalAddress ( )

◆ GetAlignedVirtualAddress()

return pComBuf GetAlignedVirtualAddress ( )

◆ GetLength()

return pComBuf GetLength ( )

Referenced by DECLARE_INTERFACE_().

◆ if() [1/5]

if ( NT_SUCCESSstatus)

Definition at line 73 of file fxcommonbufferapi.cpp.

73 {
74 return status;
75 }
NTSTATUS status

◆ if() [2/5]

Definition at line 175 of file fxcommonbufferapi.cpp.

175 {
177
180 "WDF_COMMON_BUFFER_CONFIG Size 0x%x, expected 0x%x, %!STATUS!",
181 Config->Size, sizeof(WDF_COMMON_BUFFER_CONFIG), status);
182
183 return status;
184 }
#define TRACINGDMA
Definition: dbgtrace.h:71
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476
WDF_EXTERN_C_START struct _WDF_COMMON_BUFFER_CONFIG WDF_COMMON_BUFFER_CONFIG

◆ if() [3/5]

if ( Length  = = 0)

Definition at line 80 of file fxcommonbufferapi.cpp.

80 {
83 "Length is 0, %!STATUS!", status);
84 return status;
85 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ if() [4/5]

if ( NT_SUCCESS(status )

Definition at line 115 of file fxcommonbufferapi.cpp.

115 {
116 //
117 // Ok: now allocate a CommonBuffer via this DmaEnabler
118 //
119 status = pComBuf->AllocateCommonBuffer( Length );
120 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

◆ if() [5/5]

if ( pComBuf  = NULL)

Definition at line 101 of file fxcommonbufferapi.cpp.

101 {
103
105 "Could not allocate memory for a WDFCOMMONBUFFER, "
106 "%!STATUS!", status);
107 return status;
108 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Variable Documentation

◆ Attributes

◆ CommonBuffer

__in WDFCOMMONBUFFER CommonBuffer
Initial value:

Definition at line 255 of file fxcommonbufferapi.cpp.

◆ CommonBufferHandle

* CommonBufferHandle
Initial value:

Definition at line 50 of file fxcommonbufferapi.cpp.

◆ Config

◆ DmaEnabler

Definition at line 43 of file fxcommonbufferapi.cpp.

◆ else

else
Initial value:
{
pComBuf->DeleteFromFailedCreate()

Definition at line 128 of file fxcommonbufferapi.cpp.

◆ handle

Definition at line 56 of file fxcommonbufferapi.cpp.

◆ pComBuf

pComBuf
Initial value:
FxDmaEnabler * pDmaEnabler
_Must_inspect_result_ __in WDFDMAENABLER __in __in_opt WDF_OBJECT_ATTRIBUTES * Attributes

Definition at line 98 of file fxcommonbufferapi.cpp.

Referenced by if().

◆ pDmaEnabler

FxDmaEnabler * pDmaEnabler

Definition at line 54 of file fxcommonbufferapi.cpp.

Referenced by FxCommonBuffer::FxCommonBuffer().

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 57 of file fxcommonbufferapi.cpp.

Referenced by if().

◆ status