WDF_MEMORY_DESCRIPTOR_INIT_BUFFER function (wdfmemory.h)

[Applies to KMDF and UMDF]

The WDF_MEMORY_DESCRIPTOR_INIT_BUFFER function initializes a WDF_MEMORY_DESCRIPTOR structure so that it describes a specified buffer.

Syntax

void WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(
  [out] PWDF_MEMORY_DESCRIPTOR Descriptor,
  [in]  PVOID                  Buffer,
  [in]  ULONG                  BufferLength
);

Parameters

[out] Descriptor

A pointer to a WDF_MEMORY_DESCRIPTOR structure.

[in] Buffer

A pointer to a memory buffer.

[in] BufferLength

The size, in bytes, of the memory buffer that Buffer points to.

Return value

None

Remarks

The WDF_MEMORY_DESCRIPTOR_INIT_BUFFER function zeros the specified WDF_MEMORY_DESCRIPTOR structure and sets the structure's Type member to WdfMemoryDescriptorTypeBuffer. Then it sets the structure's u.BufferType.Buffer and u.BufferType.Length members to the values that the Buffer and BufferLength parameters specify, respectively.

Examples

For a code example that uses WDF_MEMORY_DESCRIPTOR_INIT_BUFFER, see WdfIoTargetSendIoctlSynchronously.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfmemory.h (include Wdf.h)
DDI compliance rules BufAfterReqCompletedIntIoctlA(kmdf), BufAfterReqCompletedIoctlA(kmdf), BufAfterReqCompletedReadA(kmdf), BufAfterReqCompletedWriteA(kmdf)

See also

WDF_MEMORY_DESCRIPTOR

WDF_MEMORY_DESCRIPTOR_INIT_HANDLE

WDF_MEMORY_DESCRIPTOR_INIT_MDL