Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventRegister function

Registers the provider.

Syntax


ULONG EventRegister(
  _In_     LPCGUID         ProviderId,
  _In_opt_ PENABLECALLBACK EnableCallback,
  _In_opt_ PVOID           CallbackContext,
  _Out_    PREGHANDLE      RegHandle
);

Parameters

ProviderId [in]

GUID that uniquely identifies the provider.

EnableCallback [in, optional]

Callback that ETW calls to notify you when a session enables or disables your provider. Can be NULL.

CallbackContext [in, optional]

Provider-defined context data to pass to the callback when the provider is enabled or disabled. Can be NULL.

RegHandle [out]

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 | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8

Header

Evntprov.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

EnableCallback
EventUnregister

 

 

Show:
© 2016 Microsoft