Condividi tramite


Macro WppRecorderLogCreate (wpprecorder.h)

Il metodo WppRecorderLogCreate crea un buffer per contenere il log del registratore.

Sintassi

__drv_maxIRQL(DISPATCH_LEVEL)
NTSTATUS WppRecorderLogCreate(
    [In]        PRECORDER_LOG_CREATE_PARAMS CreateParams,
    [Out]       RECORDER_LOG *              RecorderLog
    );

Parametri

[in] CreateParams

Puntatore a una struttura RECORDER_LOG_CREATE_PARAMS .

[out] RecorderLog

Handle per il log del registratore.

Valore restituito

nessuno

Osservazioni

Restituisce NTSTATUS che indica se il driver può usare l'handle RecorderLog per la registrazione.

Prima di chiamare WppRecorderLogCreate, allocare una struttura RECORDER_LOG_CREATE_PARAMS e inizializzare chiamando RECORDER_LOG_CREATE_PARAMS_INIT.

È necessario chiamare WPP_INIT_TRACING prima di chiamare WppRecorderLogCreate. I valori predefiniti vengono usati a meno che i membri di CreateParams non vengano modificati prima di chiamare WppRecorderLogCreate.

Se viene restituito un NTSTATUS con esito positivo, il driver può usare l'handle RecorderLog per la registrazione.

Se non viene restituito un NTSTATUS con esito positivo, il driver deve usare un handle RECORDER_LOG per il log predefinito. Inoltre, il driver non deve tentare di accedere o eliminare l'handle a cui punta RecorderLog.

Nota

Questo metodo alloca memoria per il buffer di log dal pool non di paging.

Esempio

RECORDER_LOG_CREATE_PARAMS  recorderCreate; 
RECORDER_LOG                logHandle;
 
RECORDER_LOG_CREATE_PARAMS_INIT(&recorderCreate, "Log #1");
recorderCreate.TotalBufferSize = 1024 * 8;
// Optionally use the following line to get timestamps in WPP log entries
recorderCreate.UseTimeStamp    = WppRecorderTrue;
// Use this line if you would like more precise timestamps (ten millionths of a second). This is valid only if you have set UseTimeStamp = WppRecorderTrue.
// recorderCreate.PreciseTimeStamp = WppRecorderTrue
status = WppRecorderLogCreate(&recorderCreate, &logHandle);

Per altre informazioni sui timestamp nelle voci di log WPP, incluso l'output del log di esempio, vedere Registrazione traccia in corso (IFR) per la registrazione delle tracce.

Requisiti

Requisito Valore
Piattaforma di destinazione Windows
Intestazione wpprecorder.h

Vedi anche

struttura RECORDER_LOG_CREATE_PARAMS