' ########################################################################################
' Microsoft Windows
' File: FunctionDiscoveryAPI.inc
' 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_functiondiscoveryapi_PBI)
#DEFINE PBX_functiondiscoveryapi_PBI
%EQUATE `FUNCTIONDISVOERYAPI_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
#INCLUDE ONCE "Legacy/System/propsys.inc"
'enum tagPropertyConstraint
' { QC_EQUALS = 0,
' QC_NOTEQUAL = 1,
' QC_LESSTHAN = 2,
' QC_LESSTHANOREQUAL = 3,
' QC_GREATERTHAN = 4,
' QC_GREATERTHANOREQUAL = 5,
' QC_STARTSWITH = 6,
' QC_EXISTS = 7,
' QC_DOESNOTEXIST = 8,
' QC_CONTAINS = 9
' } PropertyConstraint;
'//#if ( WINVER >= 0x0600 )
'#ifndef FD_LONGHORN
'#define FD_LONGHORN 1
'#endif
'#ifndef FDPropertyConstraint
'#define FDPropertyConstraint
'#endif
#IF NOT %DEF(%FDPropertyConstraint)
%EQUATE `FDPropertyConstraint = 1
' enum PropertyConstraint alias tagQueryUpdateAction
%EQUATE `QC_EQUALS = 0
%EQUATE `QC_NOTEQUAL = 1
%EQUATE `QC_LESSTHAN = 2
%EQUATE `QC_LESSTHANOREQUAL = 3
%EQUATE `QC_GREATERTHAN = 4
%EQUATE `QC_GREATERTHANOREQUAL = 5
%EQUATE `QC_STARTSWITH = 6 ' // Strings only
%EQUATE `QC_EXISTS = 7
%EQUATE `QC_DOESNOTEXIST = 8
%EQUATE `QC_CONTAINS = 9 ' // Strings and VT_VECTOR only
#ENDIF
#INCLUDE ONCE "Legacy/System/functiondiscoverycategories.inc"
#INCLUDE ONCE "Legacy/System/functiondiscoveryerror.inc"
#INCLUDE ONCE "Legacy/System/functiondiscoverykeys.inc"
#INCLUDE ONCE "Legacy/System/functiondiscoveryserviceids.inc"
#INCLUDE ONCE "Legacy/System/functiondiscoveryconstraints.inc"
'typedef DWORDLONG FDQUERYCONTEXT;
' enum SystemVisibilityFlags
%EQUATE `SVF_SYSTEM = 0
%EQUATE `SVF_USER = 1
' enum QueryUpdateAction
%EQUATE `QUA_ADD = 0
%EQUATE `QUA_REMOVE = 1
%EQUATE `QUA_CHANGE = 2
' enum QueryCategoryType
%EQUATE `QCT_PROVIDER = 0
%EQUATE `QCT_LAYERED = 1
$IID_IFunctionDiscovery = GUID$("{4DF99B70-E148-4432-B004-4C9EEB535A5E}")
$IID_IFunctionDiscoveryNotification = GUID$("{5F6C1BA8-5330-422E-A368-572B244D3F87}")
$IID_IFunctionInstance = GUID$("{33591C10-0BED-4F02-B0AB-1530D5533EE9}")
$IID_IFunctionInstanceCollection = GUID$("{F0A3D895-855C-42A2-948D-2F97D450ECB1}")
$IID_IFunctionInstanceCollectionQuery = GUID$("{57CC6FD2-C09A-4289-BB72-25F04142058E}")
$IID_IFunctionInstanceQuery = GUID$("{6242BC6B-90EC-4B37-BB46-E229FD84ED95}")
$IID_IPropertyStoreCollection = GUID$("{D14D9C30-12D2-42D8-BCE4-C60C2BB226FA}")
' ########################################################################################
' Interface name = IFunctionDiscoveryNotification
' IID = 5F6C1BA8-5330-422E-A368-572B244D3F87
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFunctionDiscoveryNotification_INTERFACE_DEFINED)
 %IFunctionDiscoveryNotification_INTERFACE_DEFINED = 1
INTERFACE IFunctionDiscoveryNotification $IID_IFunctionDiscoveryNotification
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnUpdate ( ' VTable offset = 12
 BYVAL enumQueryUpdateAction AS LONG
 , BYVAL fdqcQueryContext AS QUAD
 , BYVAL pIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD OnError ( ' VTable offset = 16
 BYVAL hr AS LONG
 , BYVAL fdqcQueryContext AS QUAD
 , BYREF pszProvider AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD OnEvent ( ' VTable offset = 20
 BYVAL dwEventID AS DWORD
 , BYVAL fdqcQueryContext AS QUAD
 , BYREF pszProvider AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionDiscoveryNotification_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IFunctionDiscovery
' IID = 4DF99B70-E148-4432-B004-4C9EEB535A5E
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFunctionDiscovery_INTERFACE_DEFINED)
 %IFunctionDiscovery_INTERFACE_DEFINED = 1
INTERFACE IFunctionDiscovery $IID_IFunctionDiscovery
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetInstanceCollection ( ' VTable offset = 12
 BYREF pszCategory AS WSTRINGZ
 , BYREF pszSubCategory AS WSTRINGZ
 , BYVAL fIncludeAllSubCategories AS LONG
 , BYREF ppIFunctionInstanceCollection AS IFunctionInstanceCollection
 ) AS LONG
 ' =====================================================================================
 METHOD GetInstance ( ' VTable offset = 16
 BYREF pszFunctionInstanceIdentity AS WSTRINGZ
 , BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD CreateInstanceCollectionQuery ( ' VTable offset = 20
 BYREF pszCategory AS WSTRINGZ
 , BYREF pszSubCategory AS WSTRINGZ
 , BYVAL fIncludeAllSubCategories AS LONG
 , BYVAL pIFunctionDiscoveryNotification AS IFunctionDiscoveryNotification
 , BYREF pfdqcQueryContext AS QUAD
 , BYREF ppIFunctionInstanceCollectionQuery AS IFunctionInstanceCollectionQuery
 ) AS LONG
 ' =====================================================================================
 METHOD CreateInstanceQuery ( ' VTable offset = 24
 BYREF pszFunctionInstanceIdentity AS WSTRINGZ
 , BYVAL pIFunctionDiscoveryNotification AS IFunctionDiscoveryNotification
 , BYREF pfdqcQueryContext AS QUAD
 , BYREF ppIFunctionInstanceQuery AS IFunctionInstanceQuery
 ) AS LONG
 ' =====================================================================================
 METHOD AddInstance ( ' VTable offset = 28
 BYVAL enumSystemVisibility AS LONG
 , BYREF pszCategory AS WSTRINGZ
 , BYREF pszSubCategory AS WSTRINGZ
 , BYREF pszCategoryIdentity AS WSTRINGZ
 , BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveInstance ( ' VTable offset = 32
 BYVAL enumSystemVisibility AS LONG
 , BYREF pszCategory AS WSTRINGZ
 , BYREF pszSubCategory AS WSTRINGZ
 , BYREF pszCategoryIdentity AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionDiscovery_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IFunctionInstance
' IID = 33591C10-0BED-4F02-B0AB-1530D5533EE9
' Inherited interface = IServiceProvider
' ########################################################################################
#IF NOT %DEF(%IFunctionInstance_INTERFACE_DEFINED)
 %IFunctionInstance_INTERFACE_DEFINED = 1
INTERFACE IFunctionInstance $IID_IFunctionInstance
 INHERIT IUnknown
 ' =====================================================================================
 ' IServiceProvider Methods
 ' =====================================================================================
 METHOD QueryService ( ' VTable offset = 12
 BYREF guidService AS GUID
 , BYREF riid AS GUID
 , BYREF ppvObject AS IUnknown
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IFunctionInstance Methods
 ' =====================================================================================
 METHOD GetID ( ' VTable offset = 16
 BYREF ppszCoMemIdentity AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD GetProviderInstanceID ( ' VTable offset = 20
 BYREF ppszCoMemProviderInstanceIdentity AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD OpenPropertyStore ( ' VTable offset = 24
 BYVAL dwStgAccess AS DWORD
 , BYREF ppIPropertyStore AS IPropertyStore
 ) AS LONG
 ' =====================================================================================
 METHOD GetCategory ( ' VTable offset = 28
 BYREF ppszCoMemCategory AS WSTRINGZ
 , BYREF ppszCoMemSubCategory AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionInstance_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IFunctionInstanceCollection
' IID = F0A3D895-855C-42A2-948D-2F97D450ECB1
' Attributes = 512 [&H200] [Restricted]
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFunctionInstanceCollection_INTERFACE_DEFINED)
 %IFunctionInstanceCollection_INTERFACE_DEFINED = 1
INTERFACE IFunctionInstanceCollection $IID_IFunctionInstanceCollection
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetCount ( ' VTable offset = 12
 BYREF pdwCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Get ( ' VTable offset = 16
 BYREF pszInstanceIdentity AS WSTRINGZ
 , BYREF pdwIndex AS DWORD
 , BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD Item ( ' VTable offset = 20
 BYVAL dwIndex AS DWORD
 , BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD Add ( ' VTable offset = 24
 BYVAL pIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD Remove ( ' VTable offset = 28
 BYVAL dwIndex AS DWORD
 , BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
 METHOD Delete ( ' VTable offset = 32
 BYVAL dwIndex AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteAll ( ' VTable offset = 36
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionInstanceCollection_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IPropertyStoreCollection
' IID = D14D9C30-12D2-42D8-BCE4-C60C2BB226FA
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IPropertyStoreCollection_INTERFACE_DEFINED)
 %IPropertyStoreCollection_INTERFACE_DEFINED = 1
INTERFACE IPropertyStoreCollection $IID_IPropertyStoreCollection
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetCount ( ' VTable offset = 12
 BYREF pdwCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Get ( ' VTable offset = 16
 BYREF pszInstanceIdentity AS WSTRINGZ
 , BYREF pdwIndex AS DWORD
 , BYREF ppIPropertyStore AS IPropertyStore
 ) AS LONG
 ' =====================================================================================
 METHOD Item ( ' VTable offset = 20
 BYVAL dwIndex AS DWORD
 , BYREF ppIPropertyStore AS IPropertyStore
 ) AS LONG
 ' =====================================================================================
 METHOD Add ( ' VTable offset = 24
 BYVAL pIPropertyStore AS IPropertyStore
 ) AS LONG
 ' =====================================================================================
 METHOD Remove ( ' VTable offset = 28
 BYVAL dwIndex AS DWORD
 , BYREF pIPropertyStore AS IPropertyStore
 ) AS LONG
 ' =====================================================================================
 METHOD Delete ( ' VTable offset = 32
 BYVAL dwIndex AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteAll ( ' VTable offset = 36
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IPropertyStoreCollection_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IFunctionInstanceQuery
' IID = 6242BC6B-90EC-4B37-BB46-E229FD84ED95
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFunctionInstanceQuery_INTERFACE_DEFINED)
 %IFunctionInstanceQuery_INTERFACE_DEFINED = 1
INTERFACE IFunctionInstanceQuery $IID_IFunctionInstanceQuery
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Execute ( ' VTable offset = 12
 BYREF ppIFunctionInstance AS IFunctionInstance
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionInstanceCollection_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IFunctionInstanceCollectionQuery
' IID = 57CC6FD2-C09A-4289-BB72-25F04142058E
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFunctionInstanceCollectionQuery_INTERFACE_DEFINED)
 %IFunctionInstanceCollectionQuery_INTERFACE_DEFINED = 1
INTERFACE IFunctionInstanceCollectionQuery $IID_IFunctionInstanceCollectionQuery
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AddQueryConstraint ( ' VTable offset = 12
 BYREF pszConstraintName AS WSTRINGZ
 , BYREF pszConstraintValue AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD AddPropertyConstraint ( ' VTable offset = 16
 BYREF key AS PROPERTYKEY
 , BYREF pv AS PROPVARIANT
 , BYVAL enumPropertyConstraint AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD Execute ( ' VTable offset = 20
 BYREF ppIFunctionInstanceCollection AS IFunctionInstanceCollection
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFunctionInstanceCollectionQuery_INTERFACE_DEFINED__ */
'#INCLUDE ONCE "FunctionDiscoveryNotification.inc"
#ENDIF
