Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

WdfRequestRetrieveUnsafeUserInputBuffer method

[Applies to KMDF only]

The WdfRequestRetrieveUnsafeUserInputBuffer method retrieves an I/O request's input buffer, if the request's technique for accessing data buffers is neither buffered nor direct I/O.

Syntax


NTSTATUS WdfRequestRetrieveUnsafeUserInputBuffer(
  [in]            WDFREQUEST Request,
  [in]            size_t     MinimumRequiredLength,
  [out]           PVOID      *InputBuffer,
  [out, optional] size_t     *Length
);

Parameters

Request [in]

A handle to a framework request object.

MinimumRequiredLength [in]

The minimum buffer size, in bytes, that the driver needs to process the I/O request.

InputBuffer [out]

A pointer to a location that receives the buffer's address.

Length [out, optional]

A pointer to a location that receives the buffer's size, in bytes. This parameter is optional and can be NULL.

Return value

WdfRequestRetrieveUnsafeUserInputBuffer returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return codeDescription
STATUS_INVALID_PARAMETER

An input parameter is invalid.

STATUS_INVALID_DEVICE_REQUEST

This value is returned if one of the following occurs:

STATUS_BUFFER_TOO_SMALL

The MinimumRequiredLength parameter specifies a buffer size that is larger than the buffer's actual size.

 

This method might also return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

The WdfRequestRetrieveUnsafeUserInputBuffer method must be called from an EvtIoInCallerContext callback function. After calling WdfRequestRetrieveUnsafeUserInputBuffer, the driver must call WdfRequestProbeAndLockUserBufferForRead.

The driver can call WdfRequestRetrieveUnsafeUserInputBuffer if a request's I/O control code is IRP_MJ_WRITE or IRP_MJ_DEVICE_CONTROL.

The driver can access the retrieved buffer until it completes the I/O request that the Request parameter represents.

For more information about WdfRequestRetrieveUnsafeUserInputBuffer, see Accessing Data Buffers in Framework-Based Drivers.

Examples

For a code example that uses WdfRequestRetrieveUnsafeUserInputBuffer, see WdfRequestProbeAndLockUserBufferForRead.

Requirements

Target platform

Universal

Minimum KMDF version

1.0

Header

Wdfrequest.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

PASSIVE_LEVEL

DDI compliance rules

BufAfterReqCompletedIntIoctl, BufAfterReqCompletedIntIoctlA, BufAfterReqCompletedIoctl, BufAfterReqCompletedIoctlA, BufAfterReqCompletedRead, BufAfterReqCompletedWrite, BufAfterReqCompletedWriteA, DriverCreate, InputBufferAPI, InvalidReqAccess, InvalidReqAccessLocal, KmdfIrql, KmdfIrql2

See also

WdfRequestProbeAndLockUserBufferForRead
WdfRequestRetrieveUnsafeUserOutputBuffer
EvtIoInCallerContext

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft