ReactOS  0.4.15-dev-3187-ge372f2b
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
 
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_ _When_ (PoolType==1||PoolType==257, _IRQL_requires_max_(APC_LEVEL)) _When_(PoolType
 
_Must_inspect_result_ _IRQL_requires_max_ (DISPATCH_LEVEL)) FORCEINLINE NTSTATUS WdfMemoryCreate(_In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
 
_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_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY _Outptr_opt_result_bytebuffer_ (BufferSize) PVOID *Buffer)
 
_Must_inspect_result_ _Pre_notnull_ _Pre_writable_byte_size_ (BufferSize) PVOID Buffer
 
_Must_inspect_result_ _In_ size_t _Out_writes_bytes_ (NumBytesToCopyTo) PVOID Buffer
 
_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_

typedef _Must_inspect_result_ _In_ WDFMEMORY _Pre_notnull_ _Pre_writable_byte_size_(BufferSize) PVOID Buffer

Definition at line 282 of file wdfmemory.h.

◆ _When_

◆ Attributes

◆ Buffer

◆ BufferSize

Initial value:
{
#define WdfFunctions
Definition: wdf.h:66
_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
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

Definition at line 251 of file wdfmemory.h.

◆ DestinationMemory

Definition at line 359 of file wdfmemory.h.

◆ DestinationOffset

◆ Lookaside

Initial value:
{
_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:407
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES MemoryAttributes
Definition: wdfmemory.h:407
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfmemory.h:159
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES LookasideAttributes
Definition: wdfmemory.h:401
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

Definition at line 407 of file wdfmemory.h.

◆ LookasideAttributes

◆ Memory

_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ WDFMEMORY Memory
Initial value:
{
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define WdfFunctions
Definition: wdf.h:66
_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
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdfmemory.h:159
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

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.

Function Documentation

◆ _IRQL_requires_max_()

_Must_inspect_result_ _IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 1705 of file hardware.c.

1709 {
1710  SendKey();
1712 }
_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice
Definition: isapnp.h:399
static VOID SendKey(VOID)
Definition: hardware.c:332
static VOID Wake(_In_ UCHAR Csn)
Definition: hardware.c:149

◆ _Out_writes_bytes_()

_Must_inspect_result_ _In_ size_t _Out_writes_bytes_ ( NumBytesToCopyTo  )

◆ _Outptr_opt_result_bytebuffer_()

_Must_inspect_result_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY _Outptr_opt_result_bytebuffer_ ( BufferSize  )

Definition at line 192 of file wdfmemory.h.

195 {
197 }
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define WdfFunctions
Definition: wdf.h:66
_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
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:159
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfmemory.h:159
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: wdfmemory.h:159
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

◆ _Pre_writable_byte_size_()

_Must_inspect_result_ _Pre_notnull_ _Pre_writable_byte_size_ ( BufferSize  )

◆ _When_() [1/4]

_Must_inspect_result_ _When_ ( PoolType  = = 1 || PoolType == 257,
_IRQL_requires_max_(APC_LEVEL  
)

◆ _When_() [2/4]

Definition at line 299 of file wdfmemory.h.

302 {
303  return ((PFN_WDFMEMORYASSIGNBUFFER) WdfFunctions[WdfMemoryAssignBufferTableIndex])(WdfDriverGlobals, Memory, Buffer, BufferSize);
304 }
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define WdfFunctions
Definition: wdf.h:66
_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
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

◆ _When_() [3/4]

_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 }
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
Definition: wdfmemory.h:318
_Must_inspect_result_ _In_ WDFMEMORY SourceMemory
Definition: wdfmemory.h:318
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals

◆ _When_() [4/4]

_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 }
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define WdfFunctions
Definition: wdf.h:66
PWDF_DRIVER_GLOBALS WdfDriverGlobals
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t DestinationOffset
Definition: wdfmemory.h:359
_Must_inspect_result_ _In_ WDFMEMORY DestinationMemory
Definition: wdfmemory.h:359

◆ 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 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ __drv_aliasesMem PVOID Buffer
Definition: wdfmemory.h:211
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

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 }
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
_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
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ 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 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262