TracePuts

**Windows Server 2003:  **This API has been superseded by the Event Tracing API and will not be available beyond Windows Server 2003. New applications should use the Event Tracing API.

The TracePuts function is an efficient way to retrieve information associated with a registered service or application's identifier (dwTraceID). TracePuts also outputs the string literal passed as the function's second argument.

DWORD TracePuts(
  DWORD dwTraceID,
  LPCTSTR lpszString
);

Parameters

  • dwTraceID
    [in] Handle returned by the calling service or application's initial TraceRegister call.
  • lpszString
    [in] Specifies the string to be output.

Return Value

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

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

Remarks

TracePuts outputs the name associated with dwTraceID, the internal thread identifier used to identify the caller, the current time, and the literal string specified by lpszString. Since TracePuts performs no formatting on its arguments, it is more efficient than TracePrintf or TraceVprintf. To suppress the prefixes and prevent output from starting on a new line, see TracePutsEx.

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 TracePutsW (Unicode) and TracePutsA (ANSI).

See Also

About Tracing
Tracing Reference
TracePutsEx
TraceRegister
TraceDeregister
TracePrintf
TraceVprintf
TraceDump