EventActivityIdControl function

Creates, queries, and sets the current activity identifier used by the EventWriteTransfer function.

Syntax

ULONG EVNTAPI EventActivityIdControl(
  ULONG  ControlCode,
  LPGUID ActivityId
);

Parameters

ControlCode

A control code that specifies if you want to create, query or set the current activity identifier. You can specify one of the following codes.

Value Meaning
EVENT_ACTIVITY_CTRL_GET_ID
Sets the ActivityId parameter to the current identifier value from thread local storage.
EVENT_ACTIVITY_CTRL_SET_ID
Uses the identifier in the ActivityId parameter to set the value of the current identifier in the thread local storage.
EVENT_ACTIVITY_CTRL_CREATE_ID
Creates a new identifier and sets the ActivityId parameter to the value of the new identifier.
EVENT_ACTIVITY_CTRL_GET_SET_ID
Performs the following:
  • Copies the current identifier from thread local storage.
  • Sets the current identifier in thread local storage to the new identifier specified in the ActivityId parameter.
  • Sets the ActivityId parameter to the copy of the previous current identifier.
EVENT_ACTIVITY_CTRL_CREATE_SET_ID
Performs the following:
  • Copies the current identifier from thread local storage.
  • Creates a new identifier and sets the current identifier in thread local storage to the new identifier.
  • Sets the ActivityId parameter to the copy of the previous current identifier.

ActivityId

A GUID that uniquely identifies the activity. To determine when this parameter is an input parameter, an output parameter or both, see the descriptions for the ControlCodes parameter.

Return Value

Returns ERROR_SUCCESS if successful.

Remarks

The EVENT_ACTIVITY_CTRL_GET_ID control code returns a GUID with all zeros (GUID_NULL) if the identifier has not been set.

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

See Also

EventWriteTransfer