' ########################################################################################
' 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
%EQUATE `EVCOLL_INC = 1
'typedef HANDLE EC_HANDLE;
'typedef HANDLE EC_OBJECT_ARRAY_PROPERTY_HANDLE;
'//
'// Access Control Permissions
'//
'/*--------------------------------------------------------------------------
' Subscription Definitions
' --------------------------------------------------------------------------*/
' enum EC_SUBSCRIPTION_PROPERTY_ID
%EQUATE `EcSubscriptionEnabled = 0 ' // EcVarTypeBoolean
%EQUATE `EcSubscriptionEventSources = 1 ' // EcVarObjectArrayPropertyHandle
%EQUATE `EcSubscriptionEventSourceAddress = 2 ' // EcVarTypeString
%EQUATE `EcSubscriptionEventSourceEnabled = 3 ' // EcVarTypeBoolean
%EQUATE `EcSubscriptionEventSourceUserName = 4 ' // EcVarTypeString
%EQUATE `EcSubscriptionEventSourcePassword = 5 ' // EcVarTypeString
%EQUATE `EcSubscriptionDescription = 6 ' // EcVarTypeString
%EQUATE `EcSubscriptionURI = 7 ' // EcVarTypeString
%EQUATE `EcSubscriptionConfigurationMode = 8 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CONFIGURATION_MODE
%EQUATE `EcSubscriptionExpires = 9 ' // EcVarTypeDateTime
%EQUATE `EcSubscriptionQuery = 10 ' // EcVarTypeString
%EQUATE `EcSubscriptionTransportName = 11 ' // EcVarTypeString
%EQUATE `EcSubscriptionTransportPort = 12 ' // EcVarTypeUInt32
%EQUATE `EcSubscriptionDeliveryMode = 13 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_DELIVERY_MODE
%EQUATE `EcSubscriptionDeliveryMaxItems = 14 ' // EcVarTypeUInt32
%EQUATE `EcSubscriptionDeliveryMaxLatencyTime = 15 ' // EcVarTypeUInt32
%EQUATE `EcSubscriptionHeartbeatInterval = 16 ' // EcVarTypeUInt32
%EQUATE `EcSubscriptionLocale = 17 ' // EcVarTypeString
%EQUATE `EcSubscriptionContentFormat = 18 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CONTENT_FORMAT
%EQUATE `EcSubscriptionLogFile = 19 ' // EcVarTypeString
%EQUATE `EcSubscriptionPublisherName = 20 ' // EcVarTypeString
%EQUATE `EcSubscriptionCredentialsType = 21 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_CREDENTIALS_TYPE
%EQUATE `EcSubscriptionCommonUserName = 22 ' // EcVarTypeString
%EQUATE `EcSubscriptionCommonPassword = 23 ' // EcVarTypeString
%EQUATE `EcSubscriptionHostName = 24 ' // EcVarTypeString
%EQUATE `EcSubscriptionReadExistingEvents = 25 ' // EcVarTypeBoolean
%EQUATE `EcSubscriptionDialect = 26 ' // EcVarTypeString
%EQUATE `EcSubscriptionType = 27 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_TYPE
%EQUATE `EcSubscriptionAllowedIssuerCAs = 28 ' // EcVarTypeString | EcArrayBitMask
%EQUATE `EcSubscriptionAllowedSubjects = 29 ' // EcVarTypeString | EcArrayBitMask
%EQUATE `EcSubscriptionDeniedSubjects = 30 ' // EcVarTypeString | EcArrayBitMask
%EQUATE `EcSubscriptionAllowedSourceDomainComputers = 31 ' // EcVarTypeString SDDL
%EQUATE `EcSubscriptionPropertyIdEND = 32
' enum EC_SUBSCRIPTION_CREDENTIALS_TYPE
%EQUATE `EcSubscriptionCredDefault = 0
%EQUATE `EcSubscriptionCredNegotiate = 1
%EQUATE `EcSubscriptionCredDigest = 2
%EQUATE `EcSubscriptionCredBasic = 3
%EQUATE `EcSubscriptionCredLocalMachine = 4
' enum EC_SUBSCRIPTION_TYPE {
%EQUATE `EcSubscriptionTypeSourceInitiated = 0
%EQUATE `EcSubscriptionTypeCollectorInitiated = 1
' enum EC_SUBSCRIPTION_RUNTIME_STATUS_INFO_ID
%EQUATE `EcSubscriptionRunTimeStatusActive = 0 ' // EcVarTypeUInt32 EC_SUBSCRIPTION_RUNTIME_STATUS_ACTIVE_STATUS
%EQUATE `EcSubscriptionRunTimeStatusLastError = 1 ' // EcVarTypeUInt32
%EQUATE `EcSubscriptionRunTimeStatusLastErrorMessage = 2 ' // EcVarTypeString
%EQUATE `EcSubscriptionRunTimeStatusLastErrorTime = 3 ' // EcVarTypeDateTime
%EQUATE `EcSubscriptionRunTimeStatusNextRetryTime = 4 ' // EcVarTypeDateTime
%EQUATE `EcSubscriptionRunTimeStatusEventSources = 5 ' // EcVarTypeString | ArrayBitMask
%EQUATE `EcSubscriptionRunTimeStatusLastHeartbeatTime = 6 ' // EcVarTypeDateTime
%EQUATE `EcSubscriptionRunTimeStatusInfoIdEND = 7
' enum EC_VARIANT_TYPE
%EQUATE `EcVarTypeNull = 0
%EQUATE `EcVarTypeBoolean = 1
%EQUATE `EcVarTypeUInt32 = 2
%EQUATE `EcVarTypeDateTime = 3
%EQUATE `EcVarTypeString = 4
%EQUATE `EcVarObjectArrayPropertyHandle = 5
%EQUATE `EC_VARIANT_TYPE_MASK = &H7f
%EQUATE `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
%EQUATE `EC_READ_ACCESS = 1
%EQUATE `EC_WRITE_ACCESS = 2
%EQUATE `EC_OPEN_ALWAYS = 0
%EQUATE `EC_CREATE_NEW = 1
%EQUATE `EC_OPEN_EXISTING = 2
' enum EC_SUBSCRIPTION_CONFIGURATION_MODE
%EQUATE `EcConfigurationModeNormal = 0
%EQUATE `EcConfigurationModeCustom = 1
%EQUATE `EcConfigurationModeMinLatency = 2
%EQUATE `EcConfigurationModeMinBandwidth = 3
' enum EC_SUBSCRIPTION_DELIVERY_MODE
%EQUATE `EcDeliveryModePull = 1
%EQUATE `EcDeliveryModePush = 2
' enum EC_SUBSCRIPTION_CONTENT_FORMAT
%EQUATE `EcContentFormatEvents = 1
%EQUATE `EcContentFormatRenderedText = 2
' enum EC_SUBSCRIPTION_RUNTIME_STATUS_ACTIVE_STATUS
%EQUATE `EcRuntimeStatusActiveStatusDisabled = 1
%EQUATE `EcRuntimeStatusActiveStatusActive = 2
%EQUATE `EcRuntimeStatusActiveStatusInactive = 3
%EQUATE `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
#ENDIF
