funzione WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT (wdfrequest.h)
[Si applica a KMDF e UMDF]
La funzione WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT imposta un valore di timeout nella struttura di WDF_REQUEST_SEND_OPTIONS di un driver.
Sintassi
void WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(
[in, out] PWDF_REQUEST_SEND_OPTIONS Options,
[in] LONGLONG Timeout
);
Parametri
[in, out] Options
Puntatore alla struttura WDF_REQUEST_SEND_OPTIONS del conducente.
[in] Timeout
Valore di timeout assoluto o relativo. Per altre informazioni, vedere il membro Timeout della struttura WDF_REQUEST_SEND_OPTIONS.
Valore restituito
Nessuno
Osservazioni
Per impostare un valore di timeout, il driver deve chiamare WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT dopo aver chiamato WDF_REQUEST_SEND_OPTIONS_INIT.
La funzione WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT archivia il valore di timeout specificato nel membro Timeout della struttura WDF_REQUEST_SEND_OPTIONS specificato. Imposta anche il flag di WDF_REQUEST_SEND_OPTION_TIMEOUT nel membro Flag della struttura.
Esempi
Nell'esempio di codice seguente viene inizializzata una struttura WDF_REQUEST_SEND_OPTIONS e viene impostato un valore di timeout per la struttura. Nell'esempio viene chiamato WDF_REL_TIMEOUT_IN_SEC per specificare un valore di timeout relativo di 10 secondi. Nell'esempio viene quindi usata la struttura WDF_REQUEST_SEND_OPTIONS come input per WdfUsbTargetPipeWriteSynchronously.
WDF_REQUEST_SEND_OPTIONS syncReqOptions;
WDF_REQUEST_SEND_OPTIONS_INIT(
&syncReqOptions,
0
);
WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(
&syncReqOptions,
WDF_REL_TIMEOUT_IN_SEC(10)
);
status = WdfUsbTargetPipeWriteSynchronously(
pipeHandle,
NULL,
&syncReqOptions,
&writeBufDesc,
NULL
);
Fabbisogno
Requisito | Valore |
---|---|
piattaforma di destinazione | Universale |
versione minima di KMDF | 1.0 |
versione minima di UMDF | 2.0 |
intestazione | wdfrequest.h (include Wdf.h) |