Condividi tramite


Funzione SerCxRetrieveTransmitBuffer (sercx.h)

Il metodo SerCxRetrieveTransmitBuffer ottiene un buffer di output che contiene dati pronti per essere trasmessi alla porta seriale.

Sintassi

NTSTATUS SerCxRetrieveTransmitBuffer(
  [in]      WDFDEVICE                Device,
  [in]      ULONG                    Length,
  [in, out] PSERCX_BUFFER_DESCRIPTOR BufferDescriptor
);

Parametri

[in] Device

Handle WDFDEVICE per l'oggetto dispositivo framework che rappresenta il controller seriale.

[in] Length

Lunghezza del buffer richiesta, espressa in byte. Se la chiamata serCxRetrieveTransmitBuffer ha esito positivo, il chiamante riceve un buffer di output contenente fino a lunghezza byte di dati disponibili. I dati disponibili nel buffer potrebbero essere inferiori a lunghezza byte. SerCxRetrieveTransmitBuffer scrive il numero effettivo di byte di dati disponibili nel membro Length della struttura a cui punta il parametro BufferDescriptor.

[in, out] BufferDescriptor

Puntatore a una struttura SERCX_BUFFER_DESCRIPTOR allocata dal chiamante. Questa struttura descrive il buffer di dati da utilizzare per l'operazione di trasmissione. Il chiamante ha precedentemente chiamato la funzione SERCX_BUFFER_DESCRIPTOR_INIT per inizializzare questa struttura. SerCxRetrieveTransmitBuffer scrive nei membri Buffer e Length di questa struttura.

Valore restituito

SerCxRetrieveTransmitBuffer restituisce STATUS_SUCCESS se ha esito positivo. I valori restituiti di errore possibili includono i codici di stato seguenti.

Codice restituito Descrizione
STATUS_INVALID_DEVICE_REQUEST
Il metodo è stato chiamato in irQL errato; o l'handle WDFDEVICE non è valido; o dispositivo o bufferDescriptor è NULL; o il driver ha già un buffer di trasmissione.
STATUS_INFO_LENGTH_MISMATCH
La dimensione errata viene specificata per la struttura SERCX_BUFFER_DESCRIPTOR.
STATUS_INSUFFICIENT_RESOURCES
Impossibile allocare risorse di sistema (in genere memoria).

Osservazioni

Il driver del controller seriale chiama questo metodo per acquisire un buffer contenente i dati di output per l'operazione di trasmissione corrente (scrittura).

Fabbisogno

Requisito Valore
client minimo supportato Disponibile a partire da Windows 8.
piattaforma di destinazione Universale
intestazione sercx.h
IRQL <= DISPATCH_LEVEL

Vedere anche

SERCX_BUFFER_DESCRIPTOR

SERCX_BUFFER_DESCRIPTOR_INIT