// wdfmemory.h
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;
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WDF_MEMORY_DESCRIPTOR structure describes a memory buffer.
TypeA WDF_MEMORY_DESCRIPTOR_TYPE-typed value that identifies the type of buffer description that this WDF_MEMORY_DESCRIPTOR structure contains.
uA union of three structures, one of which describes a buffer.
u.BufferTypeIf the Type member is WdfMemoryDescriptorTypeBuffer, the members of the BufferType structure describe a buffer. This structure contains the following two members:
u.BufferType.BufferA pointer to a buffer.
u.BufferType.LengthThe length, in bytes, of the buffer.
u.MdlTypeIf the Type member is WdfMemoryDescriptorTypeMdl, the members of the MdlType structure describe a buffer. This structure contains the following two members:
u.MdlType.MdlA pointer to a memory descriptor list (MDL).
u.MdlType.BufferLengthThe length, in bytes, of the buffer.
u.HandleTypeIf the Type member is WdfMemoryDescriptorTypeHandle, the members of the HandleType structure describe a buffer. This structure contains the following two members:
u.HandleType.MemoryA handle to a framework memory object.
u.HandleType.OffsetsA pointer to a WDFMEMORY_OFFSET structure that describes a subsection of the buffer that is represented by the memory object.
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.