WppRecorderLogCreate 方法创建一个缓冲区来包含记录器日志。
语法
__drv_maxIRQL(DISPATCH_LEVEL)
NTSTATUS WppRecorderLogCreate(
[In] PRECORDER_LOG_CREATE_PARAMS CreateParams,
[Out] RECORDER_LOG * RecorderLog
);
参数
[in] CreateParams
指向 RECORDER_LOG_CREATE_PARAMS 结构的指针。
[out] RecorderLog
记录器日志的句柄。
返回值
没有
言论
返回 NTSTATUS,该值指示驱动程序是否可以使用 RecorderLog 句柄进行日志记录。
在调用 WppRecorderLogCreate之前,请通过调用 RECORDER_LOG_CREATE_PARAMS_INIT分配 RECORDER_LOG_CREATE_PARAMS 结构并初始化。
必须先调用 WPP_INIT_TRACING,然后才能调用 WppRecorderLogCreate。 除非在调用 WppRecorderLogCreate之前修改 CreateParams 的成员,否则使用默认值。
如果返回成功的 NTSTATUS,驱动程序可以使用 RecorderLog 句柄进行日志记录。
如果未返回成功的 NTSTATUS,驱动程序必须使用默认日志的 RECORDER_LOG 句柄。 此外,驱动程序不得尝试记录或删除 RecorderLog指向的句柄。
注意
此方法从非分页池中为日志缓冲区分配内存。
例
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);
有关 WPP 日志条目(包括示例日志输出)中的时间戳的详细信息,请参阅 登录跟踪记录器(IFR),了解日志记录跟踪。
要求
| 要求 | 价值 |
|---|---|
| 目标平台 | 窗户 |
| 标头 | wpprecorder.h |