// wdfrequest.h
typedef struct _WDF_REQUEST_COMPLETION_PARAMS {
ULONG Size;
WDF_REQUEST_TYPE Type;
IO_STATUS_BLOCK IoStatus;
union {
struct {
WDFMEMORY Buffer;
size_t Length;
size_t Offset;
} Write;
struct {
WDFMEMORY Buffer;
size_t Length;
size_t Offset;
} Read;
struct {
ULONG IoControlCode;
struct {
WDFMEMORY Buffer;
size_t Offset;
} Input;
struct {
WDFMEMORY Buffer;
size_t Offset;
size_t Length;
} Output;
} Ioctl;
struct {
union {
PVOID Ptr;
ULONG_PTR Value;
} Argument1;
union {
PVOID Ptr;
ULONG_PTR Value;
} Argument2;
union {
PVOID Ptr;
ULONG_PTR Value;
} Argument3;
union {
PVOID Ptr;
ULONG_PTR Value;
} Argument4;
} Others;
struct {
PWDF_USB_REQUEST_COMPLETION_PARAMS Completion;
} Usb;
} Parameters;
} WDF_REQUEST_COMPLETION_PARAMS, *PWDF_REQUEST_COMPLETION_PARAMS;
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WDF_REQUEST_COMPLETION_PARAMS structure contains parameters that are associated with the completion of an I/O request.
SizeThe size, in bytes, of this structure.
TypeA WDF_REQUEST_TYPE value that identifies the request type.
IoStatusAn IO_STATUS_BLOCK structure for the request.
ParametersRequest-specific values for the request.
Parameters.WriteParameters.Write.BufferA handle to a framework memory object. This object identifies the buffer that the driver specified when it formatted the request and sent it to an I/O target.
Parameters.Write.LengthLength, in bytes, of the transfer.
Parameters.Write.OffsetBeginning address within the buffer for the data transfer.
Parameters.ReadParameters.Read.BufferA handle to a framework memory object. This object identifies the buffer that the driver specified when it formatted the request and sent it to an I/O target.
Parameters.Read.LengthLength, in bytes, of the transfer.
Parameters.Read.OffsetBeginning address within the buffer for the data transfer.
Parameters.IoctlParameters.Ioctl.IoControlCodeParameters.Ioctl.InputParameters.Ioctl.Input.BufferA handle to a framework memory object. This object identifies the input buffer that the driver specified when it formatted the request and sent it to an I/O target.
Parameters.Ioctl.Input.OffsetBeginning address within the buffer for the data transfer.
Parameters.Ioctl.OutputParameters.Ioctl.Output.BufferA handle to a framework memory object. This object identifies the output buffers that the driver specified when it formatted the request and sent it to an I/O target.
Parameters.Ioctl.Output.OffsetBeginning address within the buffer for the data transfer.
Parameters.Ioctl.Output.LengthLength, in bytes, of the transfer.
Parameters.OthersParameters.Others.Argument1Use of this member is defined by the driver stack. See Remarks.
Parameters.Others.Argument1.PtrParameters.Others.Argument1.ValueParameters.Others.Argument2Use of this member is defined by the driver stack.
Parameters.Others.Argument2.PtrParameters.Others.Argument2.ValueParameters.Others.Argument3Use of this member is defined by the driver stack.
Parameters.Others.Argument3.PtrParameters.Others.Argument3.ValueParameters.Others.Argument4Use of this member is defined by the driver stack.
Parameters.Others.Argument4.PtrParameters.Others.Argument4.ValueParameters.UsbFor USB devices, this member contains a pointer to a WDF_USB_REQUEST_COMPLETION_PARAMS structure.
Parameters.Usb.CompletionThe WDF_REQUEST_COMPLETION_PARAMS structure is used as input to the WdfRequestGetCompletionParams method and a driver's CompletionRoutine callback function.
In both cases, the completion parameters structure contains valid information only if the driver has formatted the request by calling one of the WdfIoTargetFormatXxx methods. For example, see WdfIoTargetFormatRequestForRead.
Before calling WdfRequestGetCompletionParams to retrieve the I/O completion information for a request, the driver must first call WDF_REQUEST_COMPLETION_PARAMS_INIT to initialize the WDF_REQUEST_COMPLETION_PARAMS structure.
The Parameters.Others.Argument members are custom arguments that a driver typically passes down the stack (and can arrive back after the request is completed). They are used for non-standard, driver stack dependent data. For example, a USB driver specifies a pointer to a URB in Parameters.Others.Argument1 when it sends a IOCTL_INTERNAL_USB_SUBMIT_URB request to the USB stack. Similarly, a Bluetooth driver specifies a pointer to a BRB (Bluetooth Request Block) in Parameters.Others.Argument1 when it receives an IOCTL_INTERNAL_BTH_SUBMIT_BRB.
WDF_REQUEST_COMPLETION_PARAMS_INIT