EVT_MBB_DEVICE_SEND_DEVICE_SERVICE_SESSION_DATA funzione di callback (mbbcx.h)

La funzione di callback dell'evento EvtMbbDeviceSendServiceSessionData di un driver client invia i dati della sessione del servizio dispositivo al dispositivo modem.

Sintassi

EVT_MBB_DEVICE_SEND_DEVICE_SERVICE_SESSION_DATA EvtMbbDeviceSendDeviceServiceSessionData;

void EvtMbbDeviceSendDeviceServiceSessionData(
  WDFDEVICE Device,
  DSS_SESSION_ID SessionId,
  WDFMEMORY Data
)
{...}

Parametri

Device

Handle a 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 contenente i dati da passare al dispositivo.

Valore restituito

nessuno

Osservazioni

MBBCx richiama la funzione di callback EvtMbbDeviceSendServiceSessionData di un'applicazione che invia i dati DSS al dispositivo modem. Dopo aver inviato i dati al dispositivo in modo asincrono, il driver client deve chiamare MbbDeviceSendServiceSessionDataComplete in modo che MBBCx possa liberare la memoria allocata per i dati.

Esempio

Nell'esempio seguente viene illustrato come un client potrebbe inviare dati DSS al dispositivo modem. La gestione degli errori è stata lasciata fuori da questo esempio per brevità e chiarezza.

VOID
MyEvtMbbDeviceSendServiceSessionData(
    _In_ WDFDEVICE Device,
    _In_ DSS_SESSION_ID SessionId,
    _In_ WDFMEMORY Data
)
{
    // Get the device context and NETADAPTER context
    PMY_DEVICE_CONTEXT deviceContext = GetMyDeviceContext(Device);

    // Set up a driver-defined DSS packet structure
    PMY_DSS_PACKET packet = NULL;

    // Get the data to send from the WDFMEMORY object
    size_t bufferSize = 0;
    PVOID buffer = WdfMemoryGetBuffer(Data, 
                                      &bufferSize);

    // Populate the DSS packet
    packet = MyAllocateDssPacket(Data,
                                buffer,
                                bufferSize,
                                SessionId);

    // Send the data asynchronously, which returns STATUS_PENDING when successful
    status = MyModemBusWriteData(deviceContext->BusHandle,
                                 packet);

    // Increment count of sent packets
    deviceContext->DSSPacketsSentCount++;

    // Clean up the memory
    MbbDeviceSendServiceSessionDataComplete(Data,
                                            status);
    MyCleanupDssPacket(packet);
}

Requisiti

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