Funzione MbbDeviceReceiveDeviceServiceSessionData (mbbcx.h)

I driver client chiamano il metodo MbbDeviceReceiveServiceSessionData per passare i dati della sessione del servizio dispositivo ricevuti fino a un'applicazione tramite il framework MBBCx.

Sintassi

void MbbDeviceReceiveDeviceServiceSessionData(
  WDFDEVICE      Device,
  DSS_SESSION_ID SessionId,
  WDFMEMORY      Data
);

Parametri

Device

Handle per un oggetto dispositivo framework il driver client ottenuto da una chiamata precedente a WdfDeviceCreate.

SessionId

ID della sessione del servizio dispositivo ottenuta da una chiamata precedente a MbbAdapterGetSessionId.

Data

Oggetto WDFMEMORY allocato dal driver contenente i dati da passare all'applicazione.

Valore restituito

nessuno

Osservazioni

Per altre informazioni, vedere Gestione delle sessioni del servizio dispositivi.

Esempio

L'esempio seguente illustra come un driver client potrebbe passare i dati DSS ricevuti al gestore di ricezione DSS del framework.

VOID
MyReceiveDssData(
    _In_ PMY_DEVICE_CONTEXT DeviceContext,
    _In_ ULONG SessionId,
    _In_ PUCHAR InBuffer,
    _In_ ULONG InBufferSize
)
{
    NTSTATUS status = STATUS_SUCCESS;
    WDFMEMORY data;

    // Allocate the WDFMEMORY object from the received data buffer
    status = WdfMemoryAllocatePreallocated(WDF_NO_OBJECT_ATTRIBUTES,
                                            InBuffer,
                                            InBufferSize,
                                            &data);

    // Pass the received data to the framework
    if(NT_SUCCESS(status))
    {
        DeviceContext->DSSPacketsReceivedCount++;

        MbbDeviceReceiveServiceSessionData(DeviceContext->WdfDevice,
                                            SessionId,
                                            data);
        WdfObjectDelete(data);
    }
}

Requisiti

Requisito Valore
Client minimo supportato Windows 10, versione 1809
Piattaforma di destinazione Universale
Versione KMDF minima 1.27
Intestazione mbbcx.h
Libreria mbbcxstub.lib
IRQL PASSIVE_LEVEL