WppRecorderLogBuat makro (wpprecorder.h)

Metode WppRecorderLogCreate membuat buffer untuk berisi log perekam.

Sintaks

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

Parameter

[in] CreateParams

Penunjuk ke struktur RECORDER_LOG_CREATE_PARAMS .

[out] RecorderLog

Handel untuk log perekam.

Nilai kembali

Tidak ada

Keterangan

Mengembalikan NTSTATUS yang menunjukkan apakah driver dapat menggunakan handel RecorderLog untuk pengelogan.

Sebelum memanggil WppRecorderLogCreate, alokasikan struktur RECORDER_LOG_CREATE_PARAMS dan inisialisasi dengan memanggil RECORDER_LOG_CREATE_PARAMS_INIT.

Anda harus terlebih dahulu memanggil WPP_INIT_TRACING sebelum memanggil WppRecorderLogCreate. Nilai default digunakan kecuali anggota CreateParams dimodifikasi sebelum memanggil WppRecorderLogCreate.

Jika NTSTATUS yang berhasil dikembalikan, driver dapat menggunakan handel RecorderLog untuk pengelogan.

Jika NTSTATUS yang berhasil tidak dikembalikan, driver harus menggunakan handel RECORDER_LOG ke log default. Selain itu, driver tidak boleh mencoba untuk masuk atau menghapus handel yang diacu oleh RecorderLog.

Catatan

Metode ini mengalokasikan memori untuk buffer log dari kumpulan non-halaman.

Contoh

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

Untuk informasi selengkapnya tentang tanda waktu dalam entri log WPP termasuk contoh output log, lihat Inflight Trace Recorder (IFR) untuk mencatat jejak.

Persyaratan

Persyaratan Nilai
Target Platform Windows
Header wpprecorder.h

Lihat juga

struktur RECORDER_LOG_CREATE_PARAMS