共用方式為


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
目標平臺 窗戶
標頭 ufxclient.h
連結庫 ufxstub.lib
IRQL DISPATCH_LEVEL