EcOpenSubscription function

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

Syntax


EC_HANDLE WINAPI EcOpenSubscription(
  _In_ LPCWSTR SubscriptionName,
  _In_ DWORD   AccessMask,
  _In_ DWORD   Flags
);

Parameters

SubscriptionName [in]

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

AccessMask [in]

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.

Flags [in]

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 an handle (EC_HANDLE) to a new subscription object. Returns NULL otherwise, in which case use the GetLastError function to obtain the error code.

Examples

For example code using the EcOpenSubscription function, see Displaying the Properties of an Event Collector Subscription.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Evcoll.h

Library

Wecapi.lib

DLL

Wecapi.dll

See also

Windows Event Collector Functions

 

 

Show: