WppRecorderLogCreate macro (wpprecorder.h)
The WppRecorderLogCreate method creates a buffer to contain the recorder log.
Syntax
__drv_maxIRQL(DISPATCH_LEVEL)
NTSTATUS WppRecorderLogCreate(
[In] PRECORDER_LOG_CREATE_PARAMS CreateParams,
[Out] RECORDER_LOG * RecorderLog
);
Parameters
[in] CreateParams
A pointer to a RECORDER_LOG_CREATE_PARAMS structure.
[out] RecorderLog
A handle for the recorder log.
Return value
None
Remarks
Returns NTSTATUS that indicates if the driver can use the RecorderLog handle for logging.
Before calling WppRecorderLogCreate, allocate a RECORDER_LOG_CREATE_PARAMS structure and initialize by calling RECORDER_LOG_CREATE_PARAMS_INIT.
You must first call WPP_INIT_TRACING before calling WppRecorderLogCreate. Default values are used unless the members of CreateParams are modified before calling WppRecorderLogCreate.
If a successful NTSTATUS is returned, the driver can use the RecorderLog handle for logging.
If a successful NTSTATUS is not returned, the driver must use a RECORDER_LOG handle to the default log. Also, the driver must not attempt to log to or delete the handle pointed to by RecorderLog.
Note
This method allocates memory for the log buffer from the non-paged pool.
Example
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);
For more info about timestamps in WPP log entries including sample log output, see Inflight Trace Recorder (IFR) for logging traces.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | wpprecorder.h |
See also
RECORDER_LOG_CREATE_PARAMS structure