TRACELOGGING_DECLARE_PROVIDER macro (traceloggingprovider.h)

Forward-declares a handle for a TraceLogging provider.

Syntax

void TRACELOGGING_DECLARE_PROVIDER(
  [in]  handleVariable
);

Parameters

[in] handleVariable

The handle name to forward-declare. This should be the name of a handle that has been defined in a .c or .cpp file using TRACELOGGING_DEFINE_PROVIDER.

Return value

None

Remarks

Use this macro as needed to forward-declare your TraceLogging provider handle, e.g. in a header file of your component. This macro does not allocate storage for the provider handle. In order to use the provider, you will need to use TRACELOGGING_DEFINE_PROVIDER to define the handle and TraceLoggingRegister to register it.

An invocation like TRACELOGGING_DECLARE_PROVIDER(MyProviderHandle) can be thought of as similar to code like:

extern "C" const TraceLoggingHProvider MyProviderHandle;

Note

The provider handle declared by TRACELOGGING_DECLARE_PROVIDER has module scope. It can be used as needed within the EXE, DLL, or SYS file but should not be shared with other DLLs in the same process. Each EXE, DLL, or SYS file should define its own provider handle and should perform its own Register and Unregister.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header traceloggingprovider.h

See also

TRACELOGGING_DEFINE_PROVIDER

TraceLoggingWrite

TraceLogging wrapper macros