' ########################################################################################
' Microsoft Windows
' File: evcoll.inc
' Contents: Event Collector API
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_EvColl_PBI)
#DEFINE PBX_EvColl_PBI
%EVCOLL_INC = 1
'typedef HANDLE EC_HANDLE;
'typedef HANDLE EC_OBJECT_ARRAY_PROPERTY_HANDLE;
'//
'// Access Control Permissions
'//
'/*--------------------------------------------------------------------------
' Subscription Definitions
' --------------------------------------------------------------------------*/
' enum EC_SUBSCRIPTION_PROPERTY_ID
%EcSubscriptionEnabled = 0 ' // EcVarTypeBoolean
%EcSubscriptionEventSources = 1 ' // EcVarObjectArrayPropertyHandle
%EcSubscriptionEventSourceAddress = 2 ' // EcVarTypeString
%EcSubscriptionEventSourceEnabled = 3 ' // EcVarTypeBoolean
%EcSubscriptionEventSourceUserName = 4 ' // EcVarTypeString
%EcSubscriptionEventSourcePassword = 5 ' // EcVarTypeString
%EcSubscriptionDescription = 6 ' // EcVarTypeString
%EcSubscriptionURI = 7 ' // EcVarTypeString
%EcSubscriptionConfigurationMode = 8 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CONFIGURATION_MODE
%EcSubscriptionExpires = 9 ' // EcVarTypeDateTime
%EcSubscriptionQuery = 10 ' // EcVarTypeString
%EcSubscriptionTransportName = 11 ' // EcVarTypeString
%EcSubscriptionTransportPort = 12 ' // EcVarTypeUInt32
%EcSubscriptionDeliveryMode = 13 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_DELIVERY_MODE
%EcSubscriptionDeliveryMaxItems = 14 ' // EcVarTypeUInt32
%EcSubscriptionDeliveryMaxLatencyTime = 15 ' // EcVarTypeUInt32
%EcSubscriptionHeartbeatInterval = 16 ' // EcVarTypeUInt32
%EcSubscriptionLocale = 17 ' // EcVarTypeString
%EcSubscriptionContentFormat = 18 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CONTENT_FORMAT
%EcSubscriptionLogFile = 19 ' // EcVarTypeString
%EcSubscriptionPublisherName = 20 ' // EcVarTypeString
%EcSubscriptionCredentialsType = 21 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CREDENTIALS_TYPE
%EcSubscriptionCommonUserName = 22 ' // EcVarTypeString
%EcSubscriptionCommonPassword = 23 ' // EcVarTypeString
%EcSubscriptionHostName = 24 ' // EcVarTypeString
%EcSubscriptionReadExistingEvents = 25 ' // EcVarTypeBoolean
%EcSubscriptionDialect = 26 ' // EcVarTypeString
%EcSubscriptionType = 27 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_TYPE
%EcSubscriptionAllowedIssuerCAs = 28 ' // EcVarTypeString | EcArrayBitMask
%EcSubscriptionAllowedSubjects = 29 ' // EcVarTypeString | EcArrayBitMask
%EcSubscriptionDeniedSubjects = 30 ' // EcVarTypeString | EcArrayBitMask
%EcSubscriptionAllowedSourceDomainComputers = 31 ' // EcVarTypeString SDDL
%EcSubscriptionPropertyIdEND = 32
' enum EC_SUBSCRIPTION_CREDENTIALS_TYPE
%EcSubscriptionCredDefault = 0
%EcSubscriptionCredNegotiate = 1
%EcSubscriptionCredDigest = 2
%EcSubscriptionCredBasic = 3
%EcSubscriptionCredLocalMachine = 4
' enum EC_SUBSCRIPTION_TYPE {
%EcSubscriptionTypeSourceInitiated = 0
%EcSubscriptionTypeCollectorInitiated = 1
' enum EC_SUBSCRIPTION_RUNTIME_STATUS_INFO_ID
%EcSubscriptionRunTimeStatusActive = 0 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_RUNTIME_STATUS_ACTIVE_STATUS
%EcSubscriptionRunTimeStatusLastError = 1 ' // EcVarTypeUInt32
%EcSubscriptionRunTimeStatusLastErrorMessage = 2 ' // EcVarTypeString
%EcSubscriptionRunTimeStatusLastErrorTime = 3 ' // EcVarTypeDateTime
%EcSubscriptionRunTimeStatusNextRetryTime = 4 ' // EcVarTypeDateTime
%EcSubscriptionRunTimeStatusEventSources = 5 ' // EcVarTypeString | ArrayBitMask
%EcSubscriptionRunTimeStatusLastHeartbeatTime = 6 ' // EcVarTypeDateTime
%EcSubscriptionRunTimeStatusInfoIdEND = 7
' enum EC_VARIANT_TYPE
%EcVarTypeNull = 0
%EcVarTypeBoolean = 1
%EcVarTypeUInt32 = 2
%EcVarTypeDateTime = 3
%EcVarTypeString = 4
%EcVarObjectArrayPropertyHandle = 5
%EC_VARIANT_TYPE_MASK = &H7f
%EC_VARIANT_TYPE_ARRAY = 128
UNION EC_VARIANT_UNION
 BooleanVal AS LONG
 UInt32Val AS DWORD ' UINT32
 DateTimeVal AS QUAD ' ULONGLONG
 StringVal AS WSTRINGZ PTR
 BinaryVal AS BYTE PTR
 BooleanArr AS LONG PTR ' BOOL *
 Int32Arr AS LONG PTR ' INT32 *
 StringArr AS WSTRINGZ PTR ' LPWSTR *
 PropertyHandleVal AS DWORD ' EC_OBJECT_ARRAY_PROPERTY_HANDLE
END UNION
TYPE EC_VARIANT
 EC_VARIANT_UNION
 ount AS DWORD ' DWORD // number of elements not length in bytes. Used for arrays and binary/string types.
 Type AS DWORD
END TYPE
%EC_READ_ACCESS = 1
%EC_WRITE_ACCESS = 2
%EC_OPEN_ALWAYS = 0
%EC_CREATE_NEW = 1
%EC_OPEN_EXISTING = 2
' enum EC_SUBSCRIPTION_CONFIGURATION_MODE
%EcConfigurationModeNormal = 0
%EcConfigurationModeCustom = 1
%EcConfigurationModeMinLatency = 2
%EcConfigurationModeMinBandwidth = 3
' enum EC_SUBSCRIPTION_DELIVERY_MODE
%EcDeliveryModePull = 1
%EcDeliveryModePush = 2
' enum EC_SUBSCRIPTION_CONTENT_FORMAT
%EcContentFormatEvents = 1
%EcContentFormatRenderedText = 2
' enum EC_SUBSCRIPTION_RUNTIME_STATUS_ACTIVE_STATUS
%EcRuntimeStatusActiveStatusDisabled = 1
%EcRuntimeStatusActiveStatusActive = 2
%EcRuntimeStatusActiveStatusInactive = 3
%EcRuntimeStatusActiveStatusTrying = 4
DECLARE FUNCTION EcOpenSubscriptionEnum LIB "wecapi.dll" ALIAS "EcOpenSubscriptionEnum" ( BYVAL Flags AS QUAD ) AS QUAD ' EC_HANDLE
DECLARE FUNCTION EcEnumNextSubscription LIB "wecapi.dll" ALIAS "EcEnumNextSubscription" ( BYVAL SubscriptionEnum AS QUAD , BYVAL SubscriptionNameBufferSize AS QUAD , BYREF SubscriptionNameBuffer AS WSTRINGZ , BYREF SubscriptionNameBufferUsed AS QUAD ) AS LONG
DECLARE FUNCTION EcOpenSubscription LIB "wecapi.dll" ALIAS "EcOpenSubscription" ( BYREF SubscriptionName AS WSTRINGZ , BYVAL AccessMask AS DWORD , BYVAL Flags AS DWORD ) AS DWORD ' EC_HANDLE
DECLARE FUNCTION EcSetSubscriptionProperty LIB "wecapi.dll" ALIAS "EcSetSubscriptionProperty" ( BYVAL Subscription AS QUAD , BYVAL PropertyId AS LONG , BYVAL Flags AS QUAD , BYREF PropertyValue AS EC_VARIANT ) AS LONG
DECLARE FUNCTION EcGetSubscriptionProperty LIB "wecapi.dll" ALIAS "EcGetSubscriptionProperty" ( BYVAL Subscription AS QUAD , BYVAL PropertyId AS LONG , BYVAL Flags AS DWORD , BYVAL PropertyValueBufferSize AS DWORD , BYREF PropertyValueBuffer AS EC_VARIANT , BYREF PropertyValueBufferUsed AS DWORD ) AS LONG
DECLARE FUNCTION EcSaveSubscription LIB "wecapi.dll" ALIAS "EcSaveSubscription" ( BYVAL Subscription AS DWORD , BYVAL Flags AS DWORD ) AS LONG
DECLARE FUNCTION EcDeleteSubscription LIB "wecapi.dll" ALIAS "EcDeleteSubscription" ( BYREF SubscriptionName AS WSTRINGZ , BYVAL Flags AS DWORD ) AS LONG
DECLARE FUNCTION EcGetObjectArraySize LIB "wecapi.dll" ALIAS "EcGetObjectArraySize" ( BYVAL ObjectArray AS DWORD , BYREF ObjectArraySize AS DWORD ) AS LONG
DECLARE FUNCTION EcSetObjectArrayProperty LIB "wecapi.dll" ALIAS "EcSetObjectArrayProperty" ( BYVAL ObjectArray AS DWORD , BYVAL PropertyId AS LONG , BYVAL ArrayIndex AS DWORD , BYVAL Flags AS DWORD , BYREF PropertyValue AS EC_VARIANT ) AS LONG
DECLARE FUNCTION EcGetObjectArrayProperty LIB "wecapi.dll" ALIAS "EcGetObjectArrayProperty" ( BYVAL ObjectArray AS DWORD , BYVAL PropertyId AS LONG , BYVAL ArrayIndex AS DWORD , BYVAL Flags AS DWORD , BYVAL PropertyValueBufferSize AS DWORD , BYREF PropertyValueBuffer AS EC_VARIANT , BYREF PropertyValueBufferUsed AS DWORD ) AS LONG
DECLARE FUNCTION EcInsertObjectArrayElement LIB "wecapi.dll" ALIAS "EcInsertObjectArrayElement" ( BYVAL ObjectArray AS DWORD , BYVAL ArrayIndex AS DWORD ) AS LONG
DECLARE FUNCTION EcRemoveObjectArrayElement LIB "wecapi.dll" ALIAS "EcRemoveObjectArrayElement" ( BYVAL ObjectArray AS DWORD , BYVAL ArrayIndex AS DWORD ) AS LONG
DECLARE FUNCTION EcGetSubscriptionRunTimeStatus LIB "wecapi.dll" ALIAS "EcGetSubscriptionRunTimeStatus" ( BYREF SubscriptionName AS WSTRINGZ , BYVAL StatusInfoId AS LONG , BYREF EventSourceName AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL StatusValueBufferSize AS DWORD , BYREF StatusValueBuffer AS EC_VARIANT , BYREF StatusValueBufferUsed AS DWORD ) AS LONG
DECLARE FUNCTION EcRetrySubscription LIB "wecapi.dll" ALIAS "EcRetrySubscription" ( BYREF SubscriptionName AS WSTRINGZ , BYREF EventSourceName AS WSTRINGZ , BYVAL Flags AS DWORD ) AS LONG
DECLARE FUNCTION EcClose LIB "wecapi.dll" ALIAS "EcClose" ( BYVAL Object AS DWORD ) AS LONG