共用方式為


UfxDeviceIoInternalControl 函式 (ufxclient.h)

將核心模式 IOCTL 傳遞至 UFX。

語法

BOOLEAN UfxDeviceIoInternalControl(
  [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。

傳回值

布爾值,指出呼叫是否成功。

備註

用戶端驅動程式會呼叫 UfxDeviceIoInternalControl ,將其在其 EvtIoInternalDeviceControl 回呼函式中收到的內部 IOCTLs 轉送至 UFX。 下列範例示範如何:

VOID
DefaultQueue_EvtIoInternalDeviceControl(
    _In_ WDFQUEUE Queue,
    _In_ WDFREQUEST Request,
    _In_ size_t OutputBufferLength,
    _In_ size_t InputBufferLength,
    _In_ ULONG IoControlCode
    )
/*++

Routine Description:

    EvtIoInternalDeviceControl 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("InternalQueue 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 = UfxDeviceIoInternalControl(
                        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