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 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 driver.
[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.
Esempio
Nell'esempio di codice seguente viene inizializzata una struttura WDF_REQUEST_SEND_OPTIONS e viene impostato un valore di timeout per la struttura. L'esempio chiama WDF_REL_TIMEOUT_IN_SEC per specificare un valore di timeout relativo di 10 secondi. L'esempio usa quindi 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
);
Requisiti
Requisito | Valore |
---|---|
Piattaforma di destinazione | Universale |
Versione KMDF minima | 1.0 |
Versione UMDF minima | 2,0 |
Intestazione | wdfrequest.h (include Wdf.h) |