Funzione UfxDeviceIoControl (ufxclient.h)

Passa IOCTLs non interni dalla modalità utente a UFX.

Sintassi

BOOLEAN UfxDeviceIoControl(
  [in] UFXDEVICE  UfxDevice,
  [in] WDFREQUEST Request,
  [in] size_t     OutputBufferLength,
  [in] size_t     InputBufferLength,
  [in] ULONG      IoControlCode
);

Parametri

[in] UfxDevice

Handle per un oggetto dispositivo UFX creato dal driver chiamando UfxDeviceCreate.

[in] Request

Handle per un oggetto richiesta del framework.

[in] OutputBufferLength

Lunghezza, in byte, del buffer di output della richiesta, se è disponibile un buffer di output.

[in] InputBufferLength

Lunghezza, in byte, del buffer di input della richiesta, se è disponibile un buffer di input.

[in] IoControlCode

IOCTL definito dal driver o definito dal sistema associato alla richiesta.

Valore restituito

Valore booleano che indica se la chiamata ha avuto esito positivo.

Commenti

Il driver client chiama UfxDeviceIoControl per inoltrare IOCTLs non interni ricevuti nella funzione di callback EvtIoDeviceControl a UFX. L'esempio seguente mostra come:

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();
}

Requisiti

Requisito Valore
Client minimo supportato Windows 10
Piattaforma di destinazione Windows
Intestazione ufxclient.h
Libreria ufxstub.lib
IRQL DISPATCH_LEVEL