TRACELOGGING_DEFINE_PROVIDER macro (traceloggingprovider.h)

Allocates storage for a TraceLogging provider and creates a handle to the provider.

Syntax

void TRACELOGGING_DEFINE_PROVIDER(
   handleVariable,
   providerName,
   providerId,
   __VA_ARGS__
);

Parameters

handleVariable

A handle to a TraceLogging provider (TraceLoggingHProvider) created using TRACELOGGING_DECLARE_PROVIDER.

providerName

The name of the TraceLogging provider. This must be a string literal--do not use a variable.

providerId

The GUID for the provider.

__VA_ARGS__

Return value

None

Remarks

Before using this macro, you need to declare your TraceLogging provider using TRACELOGGING_DECLARE_PROVIDER. Once the provider is created, it is in the unregistered state. Before it can respond to any write calls, you need to register the provider using TraceLoggingRegister.

Use the TraceLoggingOptionGroup macro to specify the GUID of the provider group that the provider belongs to. A provider can be a member of no more than one group. The semantics of group membership are determined by the ETW controllers that subscribe a session to a group.

If your provider is a part of a group, add the options parameter.

Examples

TRACELOGGING_DEFINE_PROVIDER(
    g_hMyProvider,
    "MyProvider",
    (0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71));
TRACELOGGING_DEFINE_PROVIDER(
    g_hMyProvider,
    "MyProvider",
    (0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71),
    TraceLoggingOptionGroup(0xfaaf2f61, 0x9b26, 0x4591, 0x9b, 0xb1, 0xb9, 0xb8, 0xba, 0xe2, 0xd3, 0x4c));

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2012 R2
Target Platform Windows
Header traceloggingprovider.h