Condividi tramite


Funzione AcxStreamInitAssignAcxRequestPreprocessCallback (acxstreams.h)

La funzione AcxStreamInitAssignAcxRequestPreprocessCallback assegna un oggetto AcxRequestPreprocessCallback a un flusso.

Sintassi

NTSTATUS AcxStreamInitAssignAcxRequestPreprocessCallback(
  PACXSTREAM_INIT                   StreamInit,
  EVT_ACX_OBJECT_PREPROCESS_REQUEST EvtObjectAcxRequestPreprocess,
  ACXCONTEXT                        DriverContext,
  ACX_REQUEST_TYPE                  RequestType,
  const GUID                        *Set,
  ULONG                             Id
);

Parametri

StreamInit

Definito da un oggetto ACXSTREAM_INIT, utilizzato per definire l'inizializzazione del flusso. Per altre informazioni sugli oggetti ACX, vedere ACX - Summary of ACX Objects.

EvtObjectAcxRequestPreprocess

EvtObjectAcxRequestPreprocess che verrà chiamato dal framework ACX prima che venga eseguita una gestione interna della richiesta.

DriverContext

Oggetto ACXCONTEXT facoltativo che rappresenta il contesto del driver corrente.

RequestType

Enumerazione ACX_REQUEST_TYPE utilizzata per definire il tipo di richiesta. Se si specifica AcxRequestTypeAny, Verrà chiamato EvtObjectAcxRequestProcess per tutte le richieste.

Set

Puntatore a un GUID che rappresenta un SET KSPROPERTY, ad esempio KSPROPSETID_RtAudio. Se vengono specificati VALORI NULL o GUID_NULL, verrà chiamato EvtObjectAcxRequestPreprocess per ogni richiesta corrispondente a RequestType

Id

Valore che rappresenta un ID KSPROPERTY. Ad esempio, un KSPROPERTY_RTAUDIO_REGISTER_NOTIFICATION_EVENT che usa una struttura KSRTAUDIO_NOTIFICATION_EVENT_PROPERTY. Se si specifica AcxItemIdAny, verrà chiamato EvtObjectAcxRequestPreprocess per ogni proprietà per il set specificato.

Valore restituito

Restituisce STATUS_SUCCESS se la chiamata ha avuto esito positivo. In caso contrario, restituisce un codice di errore appropriato. Per altre informazioni, vedere Uso di valori NTSTATUS.

Osservazioni

AcxStreamInitAssignAcxRequestPreprocessCallback offre al driver la possibilità di gestire qualsiasi richiesta prima che ACX esegua la gestione del framework. Il driver può chiamare AcxStreamDispatchAcxRequest per consentire a ACX di gestire la richiesta. Se il driver gestisce la richiesta stessa, può chiamare WdfRequestComplete o WdfRequestCompleteWithInformation per completare la richiesta.

Il driver deve chiamare AcxStreamDispatchAcxRequest o WdfRequestComplete (o WdfRequestCompleteWithInformation). Il driver non deve chiamare più di una di queste API con la richiesta.

Il driver può registrare più di un AcxRequestPreprocessCallback. Il framework ACX chiamerà il primo AcxRequestPreprocessCallback assegnato che corrisponde a una richiesta.

Esempio

Di seguito è riportato un esempio di utilizzo.

    //
    // Intercept register and unregister events properties.
    //
    status = AcxStreamInitAssignAcxRequestPreprocessCallback(
                                            StreamInit, 
                                            EvtStreamRequestPreprocessRegisterNotificationEvent,
                                            (ACXCONTEXT)Circuit,
                                            AcxRequestTypeProperty,
                                            &KSPROPSETID_RtAudio, 
                                            KSPROPERTY_RTAUDIO_REGISTER_NOTIFICATION_EVENT);

    //
    // Intercept all other RtAudio properties - this must be after the above Assign call
    // since the above Assign call is more specific.
    //
    status = AcxStreamInitAssignAcxRequestPreprocessCallback(
                                            StreamInit, 
                                            EvtStreamRequestPreprocessRtAudio,
                                            (ACXCONTEXT)Circuit,
                                            AcxRequestTypeProperty,
                                            &KSPROPSETID_RtAudio, 
                                            AcxItemIdAny);

Requisiti ACX

versione minima di ACX: 1.0

Per altre informazioni sulle versioni di ACX, vedere panoramica della versione ACX.

Fabbisogno

Requisito Valore
intestazione acxstreams.h
IRQL PASSIVE_LEVEL

Vedere anche