ReactOS 0.4.16-dev-92-g0c2cdca
wdfmemory.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WDFMEMORY_OFFSET
 
struct  _WDF_MEMORY_DESCRIPTOR
 

Macros

#define WDF_EXTERN_C
 
#define WDF_EXTERN_C_START
 
#define WDF_EXTERN_C_END
 

Typedefs

typedef WDF_EXTERN_C_START enum _WDF_MEMORY_DESCRIPTOR_TYPE WDF_MEMORY_DESCRIPTOR_TYPE
 
typedef struct _WDFMEMORY_OFFSET WDFMEMORY_OFFSET
 
typedef struct _WDFMEMORY_OFFSETPWDFMEMORY_OFFSET
 
typedef struct _WDF_MEMORY_DESCRIPTOR WDF_MEMORY_DESCRIPTOR
 
typedef struct _WDF_MEMORY_DESCRIPTORPWDF_MEMORY_DESCRIPTOR
 
typedef _Must_inspect_result_ _When_(PoolType==1||PoolType==257, _IRQL_requires_max_(APC_LEVEL)) _When_(PoolType == 0 || PoolType == 256
 
typedef _Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL)) WDFAPI NTSTATUS(STDCALL *PFN_WDFMEMORYCREATE) (_In_ PWDF_DRIVER_GLOBALS DriverGlobals
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE PoolType
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY _Outptr_opt_result_bytebuffer_(BufferSize) PVOID *Buffer)
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer = Buffer
 
typedef _In_ WDFMEMORY _Out_opt_ size_tBufferSize
 
typedef _Must_inspect_result_ _In_ WDFMEMORY _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer
 
typedef _Must_inspect_result_ _In_ WDFMEMORY SourceMemory
 
typedef _Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
 
typedef _Must_inspect_result_ _In_ WDFMEMORY _In_ size_t _Out_writes_bytes_(NumBytesToCopyTo) PVOID Buffer
 
typedef _Must_inspect_result_ _In_ WDFMEMORY DestinationMemory
 
typedef _Must_inspect_result_ _In_ WDFMEMORY _In_ size_t DestinationOffset
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES LookasideAttributes
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES MemoryAttributes
 
typedef _Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
 

Enumerations

enum  _WDF_MEMORY_DESCRIPTOR_TYPE { WdfMemoryDescriptorTypeInvalid = 0 , WdfMemoryDescriptorTypeBuffer , WdfMemoryDescriptorTypeMdl , WdfMemoryDescriptorTypeHandle }
 

Functions

FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_BUFFER (_Out_ PWDF_MEMORY_DESCRIPTOR Descriptor, _In_ PVOID Buffer, _In_ ULONG BufferLength)
 
FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_HANDLE (_Out_ PWDF_MEMORY_DESCRIPTOR Descriptor, _In_ WDFMEMORY Memory, _In_opt_ PWDFMEMORY_OFFSET Offsets)
 
FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_MDL (_Out_ PWDF_MEMORY_DESCRIPTOR Descriptor, _In_ PMDL Mdl, _In_ ULONG BufferLength)
 
_Must_inspect_result_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _When_ (BufferSize==0, __drv_reportError(BufferSize cannot be zero)) size_t BufferSize
 
_Must_inspect_result_ _In_ size_t _In_ _When_ (NumBytesToCopyTo==0, __drv_reportError(NumBytesToCopyTo cannot be zero)) size_t NumBytesToCopyTo)
 
_Must_inspect_result_ _In_ size_t _In_ PVOID _In_ _When_ (NumBytesToCopyFrom==0, __drv_reportError(NumBytesToCopyFrom cannot be zero)) size_t NumBytesToCopyFrom)
 

Macro Definition Documentation

◆ WDF_EXTERN_C

#define WDF_EXTERN_C

Definition at line 40 of file wdfmemory.h.

◆ WDF_EXTERN_C_END

#define WDF_EXTERN_C_END

Definition at line 42 of file wdfmemory.h.

◆ WDF_EXTERN_C_START

#define WDF_EXTERN_C_START

Definition at line 41 of file wdfmemory.h.

Typedef Documentation

◆ _IRQL_requires_max_

typedef _Must_inspect_result_ _IRQL_requires_max_(DISPATCH_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFMEMORYCREATEFROMLOOKASIDE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals

Definition at line 152 of file wdfmemory.h.

◆ _Out_writes_bytes_

typedef _Must_inspect_result_ _In_ WDFMEMORY _In_ size_t _Out_writes_bytes_(NumBytesToCopyTo) PVOID Buffer

Definition at line 321 of file wdfmemory.h.

◆ _Outptr_opt_result_bytebuffer_

typedef _Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ ULONG _Out_ WDFMEMORY _Outptr_opt_result_bytebuffer_(GET_ISO_URB_SIZE(NumberOfIsochPackets)) PURB *Urb)

Definition at line 170 of file wdfmemory.h.

◆ _Pre_writable_byte_size_

_Must_inspect_result_ _Pre_notnull_ _Pre_writable_byte_size_

Definition at line 282 of file wdfmemory.h.

◆ _When_

◆ Attributes

◆ Buffer

◆ BufferSize

Initial value:
{
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals
@ WdfMemoryGetBufferTableIndex
Definition: wdffuncenum.h:219
_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

Definition at line 253 of file wdfmemory.h.

◆ DestinationMemory

Definition at line 359 of file wdfmemory.h.

◆ DestinationOffset

◆ Lookaside

Initial value:
{
@ WdfLookasideListCreateTableIndex
Definition: wdffuncenum.h:223
_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
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfmemory.h:162
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES LookasideAttributes
Definition: wdfmemory.h:401

Definition at line 413 of file wdfmemory.h.

◆ LookasideAttributes

◆ Memory

_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ WDFMEMORY Memory
Initial value:
{
@ WdfMemoryCreatePreallocatedTableIndex
Definition: wdffuncenum.h:218
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:213
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdfmemory.h:159

Definition at line 169 of file wdfmemory.h.

◆ MemoryAttributes

◆ PoolTag

◆ PoolType

◆ PWDF_MEMORY_DESCRIPTOR

◆ PWDFMEMORY_OFFSET

◆ SourceMemory

Definition at line 318 of file wdfmemory.h.

◆ SourceOffset

◆ WDF_MEMORY_DESCRIPTOR

◆ WDF_MEMORY_DESCRIPTOR_TYPE

◆ WDFMEMORY_OFFSET

Enumeration Type Documentation

◆ _WDF_MEMORY_DESCRIPTOR_TYPE

Enumerator
WdfMemoryDescriptorTypeInvalid 
WdfMemoryDescriptorTypeBuffer 
WdfMemoryDescriptorTypeMdl 
WdfMemoryDescriptorTypeHandle 

Definition at line 52 of file wdfmemory.h.

52 {
@ WdfMemoryDescriptorTypeInvalid
Definition: wdfmemory.h:53
@ WdfMemoryDescriptorTypeBuffer
Definition: wdfmemory.h:54
@ WdfMemoryDescriptorTypeHandle
Definition: wdfmemory.h:56
@ WdfMemoryDescriptorTypeMdl
Definition: wdfmemory.h:55
WDF_EXTERN_C_START enum _WDF_MEMORY_DESCRIPTOR_TYPE WDF_MEMORY_DESCRIPTOR_TYPE

Function Documentation

◆ _When_() [1/3]

Definition at line 299 of file wdfmemory.h.

302{
304}
@ WdfMemoryAssignBufferTableIndex
Definition: wdffuncenum.h:220

◆ _When_() [2/3]

_Must_inspect_result_ _In_ size_t _In_ PVOID _In_ _When_ ( NumBytesToCopyFrom  = = 0,
__drv_reportError(NumBytesToCopyFrom cannot be zero  
)

Definition at line 381 of file wdfmemory.h.

384{
385 return ((PFN_WDFMEMORYCOPYFROMBUFFER) WdfFunctions[WdfMemoryCopyFromBufferTableIndex])(WdfDriverGlobals, DestinationMemory, DestinationOffset, Buffer, NumBytesToCopyFrom);
386}
@ WdfMemoryCopyFromBufferTableIndex
Definition: wdffuncenum.h:222
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t DestinationOffset
Definition: wdfmemory.h:361
_Must_inspect_result_ _In_ WDFMEMORY DestinationMemory
Definition: wdfmemory.h:359

◆ _When_() [3/3]

_Must_inspect_result_ _In_ size_t _In_ _When_ ( NumBytesToCopyTo  = = 0,
__drv_reportError(NumBytesToCopyTo cannot be zero  
)

Definition at line 340 of file wdfmemory.h.

343{
344 return ((PFN_WDFMEMORYCOPYTOBUFFER) WdfFunctions[WdfMemoryCopyToBufferTableIndex])(WdfDriverGlobals, SourceMemory, SourceOffset, Buffer, NumBytesToCopyTo);
345}
@ WdfMemoryCopyToBufferTableIndex
Definition: wdffuncenum.h:221
_Must_inspect_result_ _In_ WDFMEMORY SourceMemory
Definition: wdfmemory.h:318
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
Definition: wdfmemory.h:320

◆ WDF_MEMORY_DESCRIPTOR_INIT_BUFFER()

FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_BUFFER ( _Out_ PWDF_MEMORY_DESCRIPTOR  Descriptor,
_In_ PVOID  Buffer,
_In_ ULONG  BufferLength 
)

Definition at line 102 of file wdfmemory.h.

107{
109
111 Descriptor->u.BufferType.Buffer = Buffer;
112 Descriptor->u.BufferType.Length = BufferLength;
113}
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342

Referenced by _IRQL_requires_max_().

◆ WDF_MEMORY_DESCRIPTOR_INIT_HANDLE()

FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_HANDLE ( _Out_ PWDF_MEMORY_DESCRIPTOR  Descriptor,
_In_ WDFMEMORY  Memory,
_In_opt_ PWDFMEMORY_OFFSET  Offsets 
)

Definition at line 117 of file wdfmemory.h.

122{
124
126 Descriptor->u.HandleType.Memory = Memory;
127 Descriptor->u.HandleType.Offsets = Offsets;
128}

◆ WDF_MEMORY_DESCRIPTOR_INIT_MDL()

FORCEINLINE VOID WDF_MEMORY_DESCRIPTOR_INIT_MDL ( _Out_ PWDF_MEMORY_DESCRIPTOR  Descriptor,
_In_ PMDL  Mdl,
_In_ ULONG  BufferLength 
)

Definition at line 133 of file wdfmemory.h.

138{
140
142 Descriptor->u.MdlType.Mdl = Mdl;
143 Descriptor->u.MdlType.BufferLength = BufferLength;
144}
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl