' ########################################################################################
' Microsoft Windows
' File: ActivProf.inc
' Contents: Declarations for ActiveX Scripting profiling.
' 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_activprof_PBI)
#DEFINE PBX_activprof_PBI
%EQUATE `ACTIVPROF_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/Unknwn.inc"
%EQUATE `ACTIVPROF_E_PROFILER_PRESENT = &H80040200& ' MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0200);
%EQUATE `ACTIVPROF_E_PROFILER_ABSENT = &H80040201& ' MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201);
%EQUATE `ACTIVPROF_E_UNABLE_TO_APPLY_ACTION = &H80040202& ' MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0202);
' Enum PROFILER_SCRIPT_TYPE
MACRO PROFILER_SCRIPT_TYPE_ENUM = LONG
%EQUATE `PROFILER_SCRIPT_TYPE_USER = 0
%EQUATE `PROFILER_SCRIPT_TYPE_DYNAMIC = %PROFILER_SCRIPT_TYPE_USER + 1
%EQUATE `PROFILER_SCRIPT_TYPE_NATIVE = %PROFILER_SCRIPT_TYPE_DYNAMIC + 1
' Enum PROFILER_EVENT_MASK
%EQUATE `PROFILER_EVENT_MASK_TRACE_SCRIPT_FUNCTION_CALL = &H1
%EQUATE `PROFILER_EVENT_MASK_TRACE_NATIVE_FUNCTION_CALL = &H2
%EQUATE `PROFILER_EVENT_MASK_TRACE_ALL = %PROFILER_EVENT_MASK_TRACE_SCRIPT_FUNCTION_CALL OR %PROFILER_EVENT_MASK_TRACE_NATIVE_FUNCTION_CALL
'typedef LONG PROFILER_TOKEN;
MACRO PROFILER_TOKEN = LONG
' ########################################################################################
' Interface name = IActiveScriptProfilerControl
' IID = 784b5ff0-69b0-47d1-a7dc-2518f4230e90
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IActiveScriptProfilerControl_INTERFACE_DEFINED)
 %IActiveScriptProfilerControl_INTERFACE_DEFINED = 1
$IID_IActiveScriptProfilerControl = GUID$("{784b5ff0-69b0-47d1-a7dc-2518f4230e90}")
INTERFACE IActiveScriptProfilerControl $IID_IActiveScriptProfilerControl
 INHERIT IUnknown
 ' =====================================================================================
 METHOD StartProfiling ( ' VTable offset = 12
 BYREF clsidProfilerObject AS GUID
 , BYVAL dwEventMask AS DWORD
 , BYVAL dwContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetProfilerEventMask ( ' VTable offset = 16
 BYVAL dwEventMask AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD StopProfiling ( ' VTable offset = 20
 BYVAL hrShutdownReason AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IActiveScriptProfilerControl_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IActiveScriptProfilerCallback
' IID = 740eca23-7d9d-42e5-ba9d-f8b24b1c7a9b
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IActiveScriptProfilerCallback_INTERFACE_DEFINED)
 %IActiveScriptProfilerCallback_INTERFACE_DEFINED = 1
$IID_IActiveScriptProfilerCallback = GUID$("{740eca23-7d9d-42e5-ba9d-f8b24b1c7a9b}")
INTERFACE IActiveScriptProfilerCallback $IID_IActiveScriptProfilerCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL dwContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Shutdown ( ' VTable offset = 16
 BYVAL hrReason AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD ScriptCompiled ( ' VTable offset = 20
 BYVAL scriptId AS PROFILER_TOKEN
 , BYVAL type AS PROFILER_SCRIPT_TYPE_ENUM
 , BYVAL pIDebugDocumentContext AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD FunctionCompiled ( ' VTable offset = 24
 BYVAL functionId AS PROFILER_TOKEN
 , BYVAL scriptId AS PROFILER_TOKEN
 , BYREF pwszFunctionName AS WSTRINGZ
 , BYREF pwszFunctionNameHint AS WSTRINGZ
 , BYVAL pIDebugDocumentContext AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD OnFunctionEnter ( ' VTable offset = 28
 BYVAL scriptId AS PROFILER_TOKEN
 , BYVAL functionId AS PROFILER_TOKEN
 ) AS LONG
 ' =====================================================================================
 METHOD OnFunctionExit ( ' VTable offset = 32
 BYVAL scriptId AS PROFILER_TOKEN
 , BYVAL functionId AS PROFILER_TOKEN
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IActiveScriptProfilerCallback_INTERFACE_DEFINED__ */
#ENDIF
