ReactOS  0.4.15-dev-2956-g61e7ea5
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]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [2/2]

__drv_maxIRQL ( DISPATCH_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]

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
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACINGDMA
Definition: dbgtrace.h:71
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
NTSTATUS status
Definition: ps.c:97

◆ if() [3/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
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACINGDMA
Definition: dbgtrace.h:71
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
NTSTATUS status
Definition: ps.c:97

◆ 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:101
Definition: ps.c:97

◆ if() [5/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 STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACINGDMA
Definition: dbgtrace.h:71
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
WDF_EXTERN_C_START struct _WDF_COMMON_BUFFER_CONFIG WDF_COMMON_BUFFER_CONFIG
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
NTSTATUS status
Definition: ps.c:97

Variable Documentation

◆ Attributes

◆ CommonBuffer

__in WDFCOMMONBUFFER CommonBuffer
Initial value:

Definition at line 257 of file fxcommonbufferapi.cpp.

◆ CommonBufferHandle

* CommonBufferHandle
Initial value:

Definition at line 52 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:
_Must_inspect_result_ __in WDFDMAENABLER __in __in_opt WDF_OBJECT_ATTRIBUTES * Attributes
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxDmaEnabler * pDmaEnabler

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