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, usato per definire l'inizializzazione del flusso. Per altre informazioni sugli oggetti ACX, vedere ACX - Riepilogo degli oggetti ACX.

EvtObjectAcxRequestPreprocess

Un processo 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 viene specificato AcxRequestTypeAny, EvtObjectAcxRequestProcess verrà chiamato per tutte le richieste.

Set

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

Id

Valore che rappresenta un ID KSPROPERTY. Ad esempio, un KSPROPERTY_RTAUDIO_REGISTER_NOTIFICATION_EVENT A che usa una struttura KSRTAUDIO_NOTIFICATION_EVENT_PROPERTY. Se viene specificato AcxItemIdAny, EvtObjectAcxRequestPreprocess verrà chiamato 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 dei valori NTSTATUS.

Commenti

AcxStreamInitAssignAcxRequestPreprocessCallback consente al driver di gestire eventuali richieste 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 l'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 ACX, vedere Panoramica della versione di ACX.

Requisiti

Requisito Valore
Intestazione acxstreams.h
IRQL PASSIVE_LEVEL

Vedi anche