EventRegister function (evntprov.h)
Registers the provider.
Syntax
ULONG EVNTAPI EventRegister(
LPCGUID ProviderId,
PENABLECALLBACK EnableCallback,
PVOID CallbackContext,
PREGHANDLE RegHandle
);
Parameters
ProviderId
GUID that uniquely identifies the provider.
EnableCallback
Callback that ETW calls to notify you when a session enables or disables your provider. Can be NULL.
CallbackContext
Provider-defined context data to pass to the callback when the provider is enabled or disabled. Can be NULL.
RegHandle
Registration handle. The handle is used by most provider function calls. Before your provider exits, you must pass this handle to EventUnregister to free the handle.
Return value
Returns ERROR_SUCCESS if successful.
Remarks
Use this function to register your provider if you call EventWrite to write your events.
A process can register up to 1,024 provider GUIDs; however, you should limit the number of providers that your process registers to one or two. This limit includes those registered using this function and the RegisterTraceGuids function.
Prior to Windows Vista: There is no limit to the number of providers that a process can register.
Requirements
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | evntprov.h |
Library | Advapi32.lib |
DLL | Advapi32.dll |