' ########################################################################################
' Microsoft Windows
' File: LoadPerf.inc
' Contents: Header file for the Performance Monitor counter string installation and
' removal functions.
' 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_LoadPerf_PBI)
#DEFINE PBX_LoadPerf_PBI
%EQUATE `LOADPERF_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
'// function prototypes for perf counter name string load & unload functions
'// provided in LOADPERF.DLL
'#ifdef __LOADPERF__
'#define LOADPERF_FUNCTION DWORD __stdcall
'#else
'#define LOADPERF_FUNCTION __declspec(dllimport) DWORD __stdcall
'#endif
'// flags for dwFlags Argument
%EQUATE `LOADPERF_FLAGS_DELETE_MOF_ON_EXIT = 1 ' ((ULONG_PTR) 1)
%EQUATE `LOADPERF_FLAGS_LOAD_REGISTRY_ONLY = 2 ' ((ULONG_PTR) 2)
%EQUATE `LOADPERF_FLAGS_CREATE_MOF_ONLY = 4 ' ((ULONG_PTR) 4)
%EQUATE `LOADPERF_FLAGS_DISPLAY_USER_MSGS = 8 ' ((ULONG_PTR) 8)
DECLARE FUNCTION InstallPerfDllW LIB "loadperf.dll" ALIAS "InstallPerfDllW" ( BYREF szComputerName AS WSTRINGZ , BYREF lpIniFile AS WSTRINGZ , BYVAL dwFlags AS QUAD ) AS QUAD ' LOADPERF_FUNCTION
DECLARE FUNCTION InstallPerfDllA LIB "loadperf.dll" ALIAS "InstallPerfDllA" ( BYREF szComputerName AS ASCIIZ , BYREF lpIniFile AS ASCIIZ , BYVAL dwFlags AS QUAD ) AS QUAD ' LOADPERF_FUNCTION
#IF %DEF(%UNICODE)
 MACRO InstallPerfDll = InstallPerfDllW
#ELSE
 MACRO InstallPerfDll = InstallPerfDllA
#ENDIF
DECLARE FUNCTION LoadPerfCounterTextStringsA LIB "loadperf.dll" ALIAS "LoadPerfCounterTextStringsA" ( BYREF lpCommandLine AS ASCIIZ , BYVAL bQuietModeArg AS LONG ) AS QUAD ' LOADPERF_FUNCTION
DECLARE FUNCTION LoadPerfCounterTextStringsW LIB "loadperf.dll" ALIAS "LoadPerfCounterTextStringsW" ( BYREF lpCommandLine AS WSTRINGZ , BYVAL bQuietModeArg AS LONG ) AS QUAD ' LOADPERF_FUNCTION
#IF %DEF(%UNICODE)
 MACRO LoadPerfCounterTextStrings = LoadPerfCounterTextStringsW
#ELSE
 MACRO LoadPerfCounterTextStrings = LoadPerfCounterTextStringsA
#ENDIF
DECLARE FUNCTION UnloadPerfCounterTextStringsW LIB "loadperf.dll" ALIAS "UnloadPerfCounterTextStringsW" ( BYREF lpCommandLine AS WSTRINGZ , BYVAL bQuietModeArg AS LONG ) AS QUAD ' LOADPERF_FUNCTION
DECLARE FUNCTION UnloadPerfCounterTextStringsA LIB "loadperf.dll" ALIAS "UnloadPerfCounterTextStringsA" ( BYREF lpCommandLine AS ASCIIZ , BYVAL bQuietModeArg AS LONG ) AS QUAD ' LOADPERF_FUNCTION
#IF %DEF(%UNICODE)
 MACRO UnloadPerfCounterTextStrings = UnloadPerfCounterTextStringsW
#ELSE
 MACRO UnloadPerfCounterTextStrings = UnloadPerfCounterTextStringsA
#ENDIF
DECLARE FUNCTION UpdatePerfNameFilesA LIB "loadperf.dll" ALIAS "UpdatePerfNameFilesA" ( BYREF szNewCtrFilePath AS ASCIIZ , BYREF szNewHlpFilePath AS ASCIIZ , BYREF szLanguageID AS ASCIIZ , BYVAL dwFlags AS QUAD ) AS QUAD ' LOADPERF_FUNCTION
DECLARE FUNCTION UpdatePerfNameFilesW LIB "loadperf.dll" ALIAS "UpdatePerfNameFilesW" ( BYREF szNewCtrFilePath AS WSTRINGZ , BYREF szNewHlpFilePath AS WSTRINGZ , BYVAL szLanguageID AS QUAD , BYVAL dwFlags AS QUAD ) AS QUAD ' LOADPERF_FUNCTION
#IF %DEF(%UNICODE)
 MACRO UpdatePerfNameFiles = UpdatePerfNameFilesW
#ELSE
 MACRO UpdatePerfNameFiles = UpdatePerfNameFilesA
#ENDIF
DECLARE FUNCTION SetServiceAsTrustedA LIB "loadperf.dll" ALIAS "SetServiceAsTrustedA" ( BYREF szReserved AS ASCIIZ , BYREF szServiceName AS ASCIIZ ) AS QUAD ' LOADPERF_FUNCTION
DECLARE FUNCTION SetServiceAsTrustedW LIB "loadperf.dll" ALIAS "SetServiceAsTrustedW" ( BYREF szReserved AS WSTRINGZ , BYREF szServiceName AS WSTRINGZ ) AS QUAD ' LOADPERF_FUNCTION
#IF %DEF(%UNICODE)
 MACRO SetServiceAsTrusted = SetServiceAsTrustedW
#ELSE
 MACRO SetServiceAsTrusted = SetServiceAsTrustedA
#ENDIF
DECLARE FUNCTION BackupPerfRegistryToFileW LIB "loadperf.dll" ALIAS "BackupPerfRegistryToFileW" ( BYREF szFileName AS WSTRINGZ , BYREF szCommentString AS WSTRINGZ ) AS QUAD
MACRO BackupPerfRegistryToFile = BackupPerfRegistryToFileW
DECLARE FUNCTION RestorePerfRegistryFromFileW LIB "loadperf.dll" ALIAS "RestorePerfRegistryFromFileW" ( BYREF szFileName AS WSTRINGZ , BYREF szLangId AS WSTRINGZ ) AS QUAD
MACRO RestorePerfRegistryFromFile = RestorePerfRegistryFromFileW
#ENDIF
