TraceLoggingRegisterEx function (traceloggingprovider.h)

Registers a TraceLogging provider with callback so that it can be used for to log events.

Syntax

TLG_STATUS TraceLoggingRegisterEx(
  TraceLoggingHProvider hProvider,
  TLG_PENABLECALLBACK   pEnableCallback,
  PVOID                 pCallbackContext
);

Parameters

hProvider

pEnableCallback

pCallbackContext

Return value

If you call this function from user mode code, the function returns a HRESULT. Use the SUCCEEDED() macro to determine if the function succeeds.

If you call this function from kernel mode code, the function returns a NTSTATUS. Use the NT_SUCCESS() macro to determine if the function succeeds.

Remarks

Call this function to register your provider. You need to register before you can use it. If you attempt to register a provider that is already registered, the registration will fail. You can unregister a handler and the register it again if necessary. If registration does fail, all write and unregister commands will have no effect.

Use the SUCCEEDED macro to see if registration was successful.

This function will return an error on versions of Windows that do not support the Event Tracing for Windows (ETW) API, e.g. EventSetInformation.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2012 R2
Target Platform Windows
Header traceloggingprovider.h
Library Advapi32.lib
DLL N/A