[This is preliminary documentation and subject to change.]
Use the TraceRegister function to register services or applications with the tracing DLL. Its successful return value is an identifier that provides a handle to subsequent tracing functions available in Windows NT Routing and Remote Access Service. This function, or its extended functionality counterpart TraceRegisterEx, must be called before any other tracing functions are called. TraceDeregister or TraceDeregisterEx should be called when trace functions are no longer needed, in order to free resources.
DWORD TraceRegister(
IN LPCTSTR lpszCallerName //caller name
);
If successful, this function will return a DWORD to be used as the service or application's identifier (handle) for subsequent calls to tracing functions.
If the function fails, INVALID_TRACEID is returned. This indicates the caller could not be registered. Call GetLastError to retrieve the error code.
Upon successful execution of TraceRegister, configuration for the service or application calling TraceRegister will be created and kept in the registry path \System\CurrentControlSet\Services\Tracing\<lpszCallerName> under the HKEY_LOCAL_MACHINE key. Such configuration parameters are kept intact, even if the service or application is deregistered from tracing utilities by calling TraceDeregister. If the registry entries cannot be created, the call to TraceRegister will fail. There are certain values within this key that can be modified to change the behavior of trace output.
Windows NT: Use version 5.0 and later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in rtutils.h.
Import Library: Link with rtutils.lib.
TraceRegisterEx, TraceDeregister, TracePrintf, TraceVprintf, TracePuts, TraceDump, GetLastError