WDF_MEMORY_DESCRIPTOR structure (wdfmemory.h)
[Applies to KMDF and UMDF]
The WDF_MEMORY_DESCRIPTOR structure describes a memory buffer.
Syntax
typedef struct _WDF_MEMORY_DESCRIPTOR {
WDF_MEMORY_DESCRIPTOR_TYPE Type;
union {
struct {
PVOID Buffer;
ULONG Length;
} BufferType;
struct {
PMDL Mdl;
ULONG BufferLength;
} MdlType;
struct {
WDFMEMORY Memory;
PWDFMEMORY_OFFSET Offsets;
} HandleType;
} u;
} WDF_MEMORY_DESCRIPTOR, *PWDF_MEMORY_DESCRIPTOR;
Members
Type
A WDF_MEMORY_DESCRIPTOR_TYPE-typed value that identifies the type of buffer description that this WDF_MEMORY_DESCRIPTOR structure contains.
u
A union of three structures, one of which describes a buffer.
u.BufferType
If the Type member is WdfMemoryDescriptorTypeBuffer, the members of the BufferType structure describe a buffer. This structure contains the following two members:
u.BufferType.Buffer
A pointer to a buffer.
u.BufferType.Length
The length, in bytes, of the buffer.
u.MdlType
If the Type member is WdfMemoryDescriptorTypeMdl, the members of the MdlType structure describe a buffer. This structure contains the following two members:
u.MdlType.Mdl
A pointer to a memory descriptor list (MDL).
u.MdlType.BufferLength
The length, in bytes, of the buffer.
u.HandleType
If the Type member is WdfMemoryDescriptorTypeHandle, the members of the HandleType structure describe a buffer. This structure contains the following two members:
u.HandleType.Memory
A handle to a framework memory object.
u.HandleType.Offsets
A pointer to a WDFMEMORY_OFFSET structure that describes a subsection of the buffer that is represented by the memory object.
Remarks
The WDF_MEMORY_DESCRIPTOR structure is used as input to several of the framework's I/O target object methods and USB device object methods.
To initialize a WDF_MEMORY_DESCRIPTOR structure, your driver should call WDF_MEMORY_DESCRIPTOR_INIT_BUFFER, or WDF_MEMORY_DESCRIPTOR_INIT_MDL, or WDF_MEMORY_DESCRIPTOR_INIT_HANDLE.
Requirements
Requirement | Value |
---|---|
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdfmemory.h (include Wdf.h) |