TracePrintf

[This is preliminary documentation and subject to change.]

The TracePrintf function outputs tracing information, including the following: calling service or application's name, the current time, and tracing information in the format specified by the optional argument or arguments included in lpszFormat. See the note below for an example of TracePrintf results.

DWORD TracePrintf(
  IN DWORD dwTraceID,     // handle from initial TraceRegister call
  IN LPCTSTR lpszFormat,  // printf()-style formatting information
  IN ...OPTIONAL          // one or more optional arguments
);
 

Parameters

dwTraceID
The handle returned by the calling service or application's initial TraceRegister call.
lpszFormat
Pointer to a null-terminated string containing printf-style format control information.
...
One or more optional arguments, depending on the format control specified in lpszFormat.

Return Values

Successful execution of TracePrintf returns the number of characters output, excluding the terminating null-character.

Failure returns zero. The error code can be retrieved by calling GetLastError.

Remarks

The following is an example for the output from TracePrintf. In the following example, the service or application calling TracePrintf is IPRIP, and its associated Thread identifier for use with the RRAS tracing functionality is129:

[IPRIP:129] 21:01:20: new entry: dest=0.0.0.0, nexthop=157.55.80.1, metric=1, protocol=2
[IPRIP:129] 21:01:20: received RIP v1 response from 157.55.84.244 on address 157.55.94.40
 

To suppress the prefixes, use TracePrintfEx.

QuickInfo

  Windows NT: Use version 5.0 and later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in rtutils.h.
  Import Library: Link with rtutils.lib.

See Also

TracePrintfEx, TraceRegister, TraceDeregister, TraceVprintf, TracePuts, TraceDump, GetLastError