EcOpenSubscription function (evcoll.h)

The EcOpenSubscription function is used to open an existing subscription or create a new subscription according to the flag value specified.

Syntax

EC_HANDLE EcOpenSubscription(
  [in] LPCWSTR SubscriptionName,
  [in] DWORD   AccessMask,
  [in] DWORD   Flags
);

Parameters

[in] SubscriptionName

Specifies the name of the subscription. The value provided for this parameter should be unique within the computer's scope.

[in] AccessMask

An access mask that specifies the desired access rights to the subscription. Use the EC_READ_ACCESS or EC_WRITE_ACCESS constants to specify the access rights. The function fails if the security descriptor of the subscription does not permit the requested access for the calling process.

[in] Flags

A value specifying whether a new or existing subscription will be opened. Use the EC_CREATE_NEW, EC_OPEN_ALWAYS, or EC_OPEN_EXISTING constants.

Return value

If the function succeeds, it returns a handle (EC_HANDLE) to a new subscription object. Returns NULL otherwise, in which case use the GetLastError function to obtain the error code.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header evcoll.h
Library Wecapi.lib
DLL Wecapi.dll

See also

Windows Event Collector Functions