' ########################################################################################
' Microsoft Windows
' File: Wscapi.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_Wscapi_PBI)
#DEFINE PBX_Wscapi_PBI
%WSCAPI_INC = 1
'#if(_WIN32_WINNT >= 0x0600)
' enum WSC_SECURITY_PROVIDER
'// Represents the aggregation of all firewalls for this computer.
%WSC_SECURITY_PROVIDER_FIREWALL = &H1
'// Represents the Automatic updating settings for this computer.
%WSC_SECURITY_PROVIDER_AUTOUPDATE_SETTINGS = &H2
'// Represents the aggregation of all antivirus products for this comptuer.
%WSC_SECURITY_PROVIDER_ANTIVIRUS = &H4
'// Represents the aggregation of all antispyware products for this comptuer.
%WSC_SECURITY_PROVIDER_ANTISPYWARE = &H8
'// Represents the settings that restrict the access of web sites in each of the internet zones.
%WSC_SECURITY_PROVIDER_INTERNET_SETTINGS = &H10
'// Represents the User Account Control settings on this machine.
%WSC_SECURITY_PROVIDER_USER_ACCOUNT_CONTROL = &H20
'// Represents the running state of the Security Center service on this machine.
%WSC_SECURITY_PROVIDER_SERVICE = &H40
%WSC_SECURITY_PROVIDER_NONE = 0
'// Aggregates all of the items that Security Center monitors.
%WSC_SECURITY_PROVIDER_ALL = %WSC_SECURITY_PROVIDER_FIREWALL OR %WSC_SECURITY_PROVIDER_AUTOUPDATE_SETTINGS OR %WSC_SECURITY_PROVIDER_ANTIVIRUS OR %WSC_SECURITY_PROVIDER_ANTISPYWARE OR %WSC_SECURITY_PROVIDER_INTERNET_SETTINGS OR %WSC_SECURITY_PROVIDER_USER_ACCOUNT_CONTROL OR %WSC_SECURITY_PROVIDER_SERVICE
' enum WSC_SECURITY_PROVIDER_HEALTH
%WSC_SECURITY_PROVIDER_HEALTH_GOOD = 0 ' // Green pillar in English locales
%WSC_SECURITY_PROVIDER_HEALTH_NOTMONITORED = 1 ' // Yellow pillar in English locales
%WSC_SECURITY_PROVIDER_HEALTH_POOR = 2 ' // Red pillar in English locales
%WSC_SECURITY_PROVIDER_HEALTH_SNOOZE = 3 ' // Yellow pillar in English locales
'// The WscRegisterForChanges function registers a callback function to be run when Windows Security Center (WSC) detects
'// a change that could affect the health of one of the security providers.
'//
'// Parameters:
'// Reserved [in]: Reserved. Must be NULL.
'// phCallbackRegistration [out]: A pointer to a handle to the callback registration. When you are finished using
'// the callback function, unregister it by calling the WscUnRegisterChanges function.
'// lpCallbackAddress [in]: A pointer to the application-defined function to be called when a change to the WSC
'// service occurs. This function is also called when the WSC service is started or stopped.
'// pContext [in]: A pointer to a variable to be passed as the lpParameter parameter to the function pointed to by the
'// lpCallbackAddress parameter.
'//
'// Return Values:
'// Returns S_OK if the function succeeds, otherwise returns an error code.
'//
'// Remarks:
'// When you want to cease receiving notification to your callback method, you can unregister it by calling the
'// WscUnRegisterChanges function.
DECLARE FUNCTION WscRegisterForChanges LIB "wscapi.dll" ALIAS "WscRegisterForChanges" ( BYVAL Reserved AS QUAD , BYREF phCallbackRegistration AS QUAD , BYVAL lpCallbackAddress AS QUAD , BYVAL pContext AS QUAD ) AS LONG
'// The WscUnRegisterChanges function cancels a callback registration that was made by a call to the WscRegisterForChanges
'// function.
'//
'// Parameters:
'// hRegistrationHandle [in]: The handle to the registration context returned as the phCallbackRegistration of the
'// WscRegisterForChanges function.
'//
'// Return Values:
'// Returns S_OK if the function succeeds, otherwise returns an error code.
DECLARE FUNCTION WscUnRegisterChanges LIB "wscapi.dll" ALIAS "WscUnRegisterChanges" ( BYVAL hRegistrationHandle AS QUAD ) AS LONG
'// The WscGetSecurityProviderHealth function gets the aggregate health state of the security provider categories represented
'// by the specified WSC_SECURITY_PROVIDER enumeration values.
'//
'// Parameters:
'// Providers [in]: One or more of the values in the WSC_SECURITY_PROVIDER enumeration. To specify more than one value,
'// combine the individual values by performing a bitwise OR operation.
'// pHealth [out]: A pointer to a variable that takes the value of one of the members of the WSC_SECURITY_PROVIDER_HEALTH
'// enumeration. If more than one provider is specified in the Providers parameter, the value of this parameter
'// is the health of the least healthy of the specified provider categories.
'//
'// Return values:
'// Returns S_OK if the function succeeds, otherwise returns an error code. If the WSC service is not running, the return value
'// is always S_FALSE and the pHealth out parameter is always set to WSC_SECURITY_PROVIDER_HEALTH_POOR.
'//
DECLARE FUNCTION WscGetSecurityProviderHealth LIB "wscapi.dll" ALIAS "WscGetSecurityProviderHealth" ( BYVAL Providers AS QUAD , BYREF pHealth AS LONG ) AS LONG
'#endif