Fonction MbbDeviceReceiveDeviceServiceSessionData (mbbcx.h)

Les pilotes clients appellent la méthode MbbDeviceReceiveServiceSessionData pour transmettre les données de session de service d’appareil reçues à une application via l’infrastructure MBBCx.

Syntaxe

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

Paramètres

Device

Handle pour un objet d’appareil framework que le pilote client a obtenu à partir d’un appel précédent à WdfDeviceCreate.

SessionId

ID de la session de service d’appareil obtenue à partir d’un appel précédent à MbbAdapterGetSessionId.

Data

Objet WDFMEMORY alloué au pilote contenant les données à transmettre à l’application.

Valeur de retour

None

Remarques

Pour plus d’informations, consultez Gestion des sessions de service d’appareil.

Exemple

L’exemple suivant montre comment un pilote client peut transmettre les données DSS reçues au gestionnaire de réception DSS de l’infrastructure.

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

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 10, version 1809
Plateforme cible Universal
Version KMDF minimale 1,27 %
En-tête mbbcx.h
Bibliothèque mbbcxstub.lib
IRQL PASSIVE_LEVEL