UfxDeviceIoControl 函式 (ufxclient.h)
將非內部 IOCTL 從使用者模式傳遞至 UFX。
語法
BOOLEAN UfxDeviceIoControl(
[in] UFXDEVICE UfxDevice,
[in] WDFREQUEST Request,
[in] size_t OutputBufferLength,
[in] size_t InputBufferLength,
[in] ULONG IoControlCode
);
參數
[in] UfxDevice
呼叫 UfxDeviceCreate所建立驅動程式的UFX裝置物件的句柄。
[in] Request
架構要求物件的句柄。
[in] OutputBufferLength
如果可用的輸出緩衝區,則為要求的輸出緩衝區長度,以位元組為單位。
[in] InputBufferLength
如果輸入緩衝區可用,則為要求的輸入緩衝區長度,以位元組為單位。
[in] IoControlCode
與要求相關聯的驅動程式定義或系統定義的IOCTL。
傳回值
布爾值,指出呼叫是否成功。
備註
用戶端驅動程式會呼叫 UfxDeviceIoControl ,將它在其 EvtIoDeviceControl 回呼函式中收到的非內部 IOCTL 轉送至 UFX。 下列範例示範如何:
VOID
DefaultQueue_EvtIoDeviceControl(
_In_ WDFQUEUE Queue,
_In_ WDFREQUEST Request,
_In_ size_t OutputBufferLength,
_In_ size_t InputBufferLength,
_In_ ULONG IoControlCode
)
/*++
Routine Description:
EvtIoDeviceControl handler for the default Queue
Arguments:
Queue - Handle to the framework queue object that is associated with the
I/O request.
Request - Handle to a framework request object.
OutputBufferLength - Size of the output buffer in bytes
InputBufferLength - Size of the input buffer in bytes
IoControlCode - I/O control code.
--*/
{
WDFDEVICE WdfDevice;
PCONTROLLER_CONTEXT ControllerContext;
BOOLEAN HandledbyUfx;
TraceEntry();
TraceVerbose("Queue 0x%p, Request 0x%p, OutputBufferLength %d, "
"InputBufferLength %d, IoControlCode %d",
Queue, Request, (int) OutputBufferLength,
(int) InputBufferLength, IoControlCode);
WdfDevice = WdfIoQueueGetDevice(Queue);
ControllerContext = DeviceGetControllerContext(WdfDevice);
HandledbyUfx = UfxDeviceIoControl(
ControllerContext->UfxDevice,
Request,
OutputBufferLength,
InputBufferLength,
IoControlCode);
if (!HandledbyUfx) {
TraceError("Received an unsupported IOCTL");
WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
}
TraceExit();
}
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 | Windows 10 |
目標平台 | Windows |
標頭 | ufxclient.h |
程式庫 | ufxstub.lib |
IRQL | DISPATCH_LEVEL |