TracePrintfEx

[This Tracing API is available for use in the operating systems listed in the Requirements section. It may be altered or unavailable in subsequent versions. Instead use the Event Tracing API.]

The TracePrintfEx function outputs tracing information. TracePrintfEx differentiates itself from TracePrintf by offering extended options implemented through non-zero dwFlags values. Output generated by TracePrintfEx includes the following: calling service or application name, the current time, and tracing information in the format specified by the optional included in lpszFormat.

DWORD TracePrintfEx(
  DWORD dwTraceID,
  DWORD dwFlags,
  LPCTSTR lpszFormat,
   ...
);

Parameters

  • dwTraceID
    [in] Specifies the handle returned by the calling service or application's initial TraceRegister call.

  • dwFlags
    [in] Specifies optional flags that control appearance of TracePrintfEx output. Ensure dwFlags is one or more of the following:

    • TRACE_NO_STDINFO
      Suppresses output of the standard information associated with dwTraceID.
    • TRACE_USE_MASK
      Determines whether file and/or console output is generated by comparing the high-order word of dwFlags against registry values FileTracingMask and ConsoleTracingMask.

    If dwFlags is zero, TracePrintfEx behaves exactly as TracePrintf.

  • lpszFormat
    [in] Pointer to a null-terminated string that contains format control information. For more information, see the Remarks section of the wsprintf function.

  • ...
    [in] Specifies one or more optional arguments that depends on the format control specified in lpszFormat.

Return Value

If the function is successful, TracePrintfEx returns the number of characters output, excluding the terminating null-character.

If the function fails, the return value is zero. This may indicate that tracing is disabled in the registry. See Tracing Configuration for more information.

Requirements

Server Requires Windows Server 2003 or Windows 2000 Server.
Redistributable Requires RRAS download on Windows NT Server 4.0 SP3 and later.
Header

Declared in Rtutils.h.

Library

Use Rtutils.lib.

DLL Requires Rtutils.dll.
Unicode

Implemented as TracePrintfExW (Unicode) and TracePrintfExA (ANSI).

See Also

About Tracing
Tracing Reference
TracePrintf
TraceRegisterEx
TraceVprintfEx
TracePutsEx
TraceDumpEx