' ########################################################################################
' Microsoft Windows
' File: Winineti.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_Winineti_PBI)
#DEFINE PBX_Winineti_PBI
%EQUATE `WININETI_INC = 1
#INCLUDE ONCE "Legacy/Platform/WinInet.inc"
#INCLUDE ONCE "Legacy/System/IEDial.inc"
#INCLUDE ONCE "Legacy/Security/schannel.inc"
%EQUATE `SECURITY_WIN32 = 1
#INCLUDE ONCE "Legacy/System/Sspi.inc"
'#if !defined(_WININETEX_)
'#define _WININETEX_
%EQUATE `MAX_CACHE_ENTRY_INFO_SIZE = 4096
'//
'// These two flags should really be included in a new mask called INTERNET_FLAGS_INTERNAL_MASK.
'// Since BGUPDATE is included in INTERNET_FLAGS_MASK already it will cause compile
'// errors when used without winineti.h. FTP_FOLDER_VIEW is not being included
'// so as to not compound the problem.
'//
%EQUATE `INTERNET_FLAG_BGUPDATE = &H00000008
%EQUATE `INTERNET_FLAG_FTP_FOLDER_VIEW = &H00000004
%EQUATE `INTERNET_FLAGS_MASK_INTERNAL = %INTERNET_FLAGS_MASK OR %INTERNET_FLAG_FTP_FOLDER_VIEW
'//
'// INTERNET_PREFETCH_STATUS -
'//
' // Size = 8 bytes
TYPE INTERNET_PREFETCH_STATUS DWORD
 ' // dwStatus - status of download. See INTERNET_PREFETCH_ flags
 dwStatus AS DWORD
 ' // dwSize - size of file downloaded so far
 dwSize AS DWORD
END TYPE
'//
'// INTERNET_PREFETCH_STATUS - dwStatus values
'//
%EQUATE `INTERNET_PREFETCH_PROGRESS = 0
%EQUATE `INTERNET_PREFETCH_COMPLETE = 1
%EQUATE `INTERNET_PREFETCH_ABORTED = 2
MACRO INTERNET_ONLINE_OFFLINE_INFO = INTERNET_CONNECTED_INFO
'#define dwOfflineState dwConnectedState
%EQUATE `ISO_FORCE_OFFLINE = %ISO_FORCE_DISCONNECTED
'// These flags keep track of security errors on a cached certificate entry
'// from WinVerify that was ignored in order to complete the security handshake.
'// These flags should not use the same bits as any other SECURITY_FLAGS.
%EQUATE `DLG_FLAGS_INVALID_CA = &H01000000
%EQUATE `DLG_FLAGS_SEC_CERT_CN_INVALID = &H02000000
%EQUATE `DLG_FLAGS_SEC_CERT_DATE_INVALID = &H04000000
%EQUATE `DLG_FLAGS_SEC_CERT_REV_FAILED = &H00800000
'#ifdef __WINCRYPT_H__
'#ifdef ALGIDDEF
'//
'// INTERNET_SECURITY_INFO - contains information about certificate
'// and encryption settings for a connection.
'//
'#define INTERNET_SECURITY_INFO_DEFINED
%EQUATE `INTERNET_SECURITY_INFO_DEFINED = 1
' // Size = 732 bytes
TYPE INTERNET_SECURITY_INFO DWORD
 ' // dwSize - Size of INTERNET_SECURITY_INFO structure.
 dwSize AS DWORD
 ' // pCertificate - Cert context pointing to leaf of certificate chain.
 pCertificate AS CERT_CONTEXT PTR ' PCCERT_CONTEXT
 ' // pcCertChain - Certificate chain for the certificate
 pcCertChain AS CERT_CHAIN_CONTEXT PTR ' PCCERT_CHAIN_CONTEXT
 ' // SECPKG_ATTR_CONNECTION_INFO
 connectionInfo AS SecPkgContext_ConnectionInfo
 ' // SECPKG_ATTR_CIPHER_INFO (Supported on >= LH)
 cipherInfo AS SecPkgContext_CipherInfo
 ' // pcUnverifiedCertChain - Cert chain from initial WinVerifyTrust state
 pcUnverifiedCertChain AS CERT_CHAIN_CONTEXT PTR ' PCCERT_CHAIN_CONTEXT
 ' // Channel Binding Token
 channelBindingToken AS SecPkgContext_Bindings
END TYPE
' // Size = 716 bytes
TYPE INTERNET_SECURITY_CONNECTION_INFO DWORD
 ' // dwSize - size of INTERNET_SECURITY_CONNECTION_INFO
 dwSize AS DWORD
 ' // fSecure - Is this a secure connection.
 fSecure AS LONG
 ' // SECPKG_ATTR_CONNECTION_INFO
 connectionInfo AS SecPkgContext_ConnectionInfo
 ' // SECPKG_ATTR_CIPHER_INFO (Supported on >= LH)
 cipherInfo AS SecPkgContext_CipherInfo
END TYPE
DECLARE FUNCTION InternetAlgIdToStringA LIB "wininet.dll" ALIAS "InternetAlgIdToStringA" ( BYVAL ai AS QUAD , BYREF lpstr AS ASCIIZ , BYREF lpdwBufferLength AS QUAD , BYVAL dwReserved AS QUAD ) AS LONG
DECLARE FUNCTION InternetAlgIdToStringW LIB "wininet.dll" ALIAS "InternetAlgIdToStringW" ( BYVAL ai AS QUAD
 , BYREF lpstr AS WSTRINGZ
 , BYREF lpdwBufferLength AS DWORD
 , BYVAL dwReserved AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InternetAlgIdToString = InternetAlgIdToStringW
#ELSE
 MACRO InternetAlgIdToString = InternetAlgIdToStringA
#ENDIF
DECLARE FUNCTION InternetSecurityProtocolToStringA LIB "wininet.dll" ALIAS "InternetSecurityProtocolToStringA" ( BYVAL dwProtocol AS QUAD , BYREF lpstr AS ASCIIZ , BYREF lpdwBufferLength AS QUAD , BYVAL dwReserved AS QUAD ) AS LONG
DECLARE FUNCTION InternetSecurityProtocolToStringW LIB "wininet.dll" ALIAS "InternetSecurityProtocolToStringW" ( BYVAL dwProtocol AS QUAD
 , BYREF lpstr AS WSTRINGZ
 , BYREF lpdwBufferLength AS DWORD
 , BYVAL dwReserved AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InternetSecurityProtocolToString = InternetSecurityProtocolToStringW
#ELSE
 MACRO InternetSecurityProtocolToString = InternetSecurityProtocolToStringA
#ENDIF
'#if (_WIN32_IE >= _WIN32_IE_IE70)
'//
'// This is an API for BrowseUI. It retrieves
'// security info based on a URL
'//
DECLARE FUNCTION InternetGetSecurityInfoByURLA LIB "wininet.dll" ALIAS "InternetGetSecurityInfoByURLA" ( BYREF lpszURL AS ASCIIZ , BYREF ppCertChain AS CERT_CHAIN_CONTEXT , BYREF pdwSecureFlags AS QUAD ) AS LONG
DECLARE FUNCTION InternetGetSecurityInfoByURLW LIB "wininet.dll" ALIAS "InternetGetSecurityInfoByURLW" ( BYREF lpszURL AS WSTRINGZ
 , BYREF ppCertChain AS CERT_CHAIN_CONTEXT
 , BYREF pdwSecureFlags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InternetGetSecurityInfoByURL = InternetGetSecurityInfoByURLW
#ELSE
 MACRO InternetGetSecurityInfoByURL = InternetGetSecurityInfoByURLA
#ENDIF
'#endif // _WIN32_IE >= _WIN32_IE_IE70
'#endif // ALGIDDEF
'#endif // __WINCRYPT_H__
'#ifdef INTERNET_SECURITY_INFO_DEFINED
DECLARE FUNCTION ShowSecurityInfo LIB "wininet.dll" ALIAS "ShowSecurityInfo" ( BYVAL hWndParent AS QUAD , BYREF pSecurityInfo AS INTERNET_SECURITY_INFO ) AS QUAD
'#endif // INTERNET_SECURITY_INFO_DEFINED
DECLARE FUNCTION ShowX509EncodedCertificate LIB "wininet.dll" ALIAS "ShowX509EncodedCertificate" ( BYVAL hWndParent AS QUAD , BYVAL lpCert AS BYTE PTR , BYVAL cbCert AS QUAD ) AS QUAD
DECLARE FUNCTION ShowClientAuthCerts LIB "wininet.dll" ALIAS "ShowClientAuthCerts" ( BYVAL hWndParent AS QUAD
 ) AS DWORD
DECLARE FUNCTION ParseX509EncodedCertificateForListBoxEntry LIB "wininet.dll" ALIAS "ParseX509EncodedCertificateForListBoxEntry" ( BYVAL lpCert AS BYTE PTR
 , BYVAL cbCert AS DWORD
 , BYREF lpszLitBoxEntry AS ASCIIZ
 , BYREF lpdwListBoxEntry AS DWORD
 ) AS DWORD
'//
'// This is a private API for Trident. It displays
'// security info based on a URL
'//
DECLARE FUNCTION InternetShowSecurityInfoByURLA LIB "wininet.dll" ALIAS "InternetShowSecurityInfoByURLA" ( BYREF lpszURL AS ASCIIZ , BYVAL hwndParent AS QUAD ) AS LONG
DECLARE FUNCTION InternetShowSecurityInfoByURLW LIB "wininet.dll" ALIAS "InternetShowSecurityInfoByURLW" ( BYREF lpszURL AS WSTRINGZ
 , BYVAL hwndParent AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InternetShowSecurityInfoByURL = InternetShowSecurityInfoByURLW
#ELSE
 MACRO InternetShowSecurityInfoByURL = InternetShowSecurityInfoByURLA
#ENDIF
'// The InternetGetCertByURL function was never declared in the wininet header
'// files. It is obsolete and deprecated. An attempt was made to add it for
'// completeness since it is still exported from wininet.dll. However other
'// code has declared it incorrectly. This causes compiler errors because
'// the function ends up with two different declarations in the same compilation
'// unit. It is again not included in the header as anything but this comment.
'//
'// INTERNETAPI_(BOOL) InternetGetCertByURL(
'// __in LPSTR lpszURL,
'// __inout_bcount(dwcbCertText) LPSTR lpszCertText,
'// __in_out DWORD dwcbCertText
'// );
'//Fortezza related exports. not public
'// The commands that InternetFortezzaCommand supports.
' enum FORTCMD
%EQUATE `FORTCMD_LOGON = 1
%EQUATE `FORTCMD_LOGOFF = 2
%EQUATE `FORTCMD_CHG_PERSONALITY = 3
DECLARE FUNCTION InternetFortezzaCommand LIB "wininet.dll" ALIAS "InternetFortezzaCommand" ( BYVAL dwCommand AS QUAD , BYVAL hwnd AS QUAD , BYVAL dwReserved AS QUAD ) AS LONG
' enum FORTSTAT
%EQUATE `FORTSTAT_INSTALLED = &H00000001
%EQUATE `FORTSTAT_LOGGEDON = &H00000002
DECLARE FUNCTION InternetQueryFortezzaStatus LIB "wininet.dll" ALIAS "InternetQueryFortezzaStatus" ( BYREF pdwStatus AS QUAD , BYVAL dwReserved AS QUAD ) AS LONG
DECLARE FUNCTION InternetDebugGetLocalTime LIB "wininet.dll" ALIAS "InternetDebugGetLocalTime" ( BYREF pstLocalTime AS SYSTEMTIME
 , BYREF pdwReserved AS DWORD
 ) AS LONG
'// causes InternetCreateUrlA to escape chars in authority components (user, pwd, host)
%EQUATE `ICU_ESCAPE_AUTHORITY = &H00002000
%EQUATE `INTERNET_SERVICE_URL = 0
'//
'// InternetConnectUrl() - a macro which allows you to specify an URL instead of
'// the component parts to InternetConnect(). If any API which uses the returned
'// connect handle specifies a NULL path then the URL-path part of the URL
'// specified in InternetConnectUrl() will be used
'//
'#define InternetConnectUrl(hInternet, lpszUrl, dwFlags, dwContext) \
' InternetConnect(hInternet, \
' lpszUrl, \
' INTERNET_INVALID_PORT_NUMBER, \
' NULL, \
' NULL, \
' INTERNET_SERVICE_URL, \
' dwFlags, \
' dwContext \
' )
FUNCTION InternetConnectUrlA (BYVAL hInternet AS DWORD, BYREF lpszUrl AS ASCIIZ, BYVAL dwFlags AS DWORD, BYVAL dwContext AS DWORD) AS DWORD
 FUNCTION = InternetConnectA(hInternet, lpszUrl, %INTERNET_INVALID_PORT_NUMBER, BYVAL %NULL, BYVAL %NULL, %INTERNET_SERVICE_URL, dwFlags, dwContext)
END FUNCTION
FUNCTION InternetConnectUrlW (BYVAL hInternet AS DWORD, BYREF lpszUrl AS WSTRINGZ, BYVAL dwFlags AS DWORD, BYVAL dwContext AS DWORD) AS DWORD
 FUNCTION = InternetConnectW(hInternet, lpszUrl, %INTERNET_INVALID_PORT_NUMBER, BYVAL %NULL, BYVAL %NULL, %INTERNET_SERVICE_URL, dwFlags, dwContext)
END FUNCTION
#IF %DEF(%UNICODE)
 MACRO InternetConnectUrl = InternetConnectUrlW
#ELSE
 MACRO InternetConnectUrl = InternetConnectUrlA
#ENDIF
DECLARE FUNCTION InternetWriteFileExA LIB "wininet.dll" ALIAS "InternetWriteFileExA" ( BYVAL hFile AS QUAD , BYREF lpBuffersIn AS INTERNET_BUFFERS , BYVAL dwFlags AS QUAD , BYVAL dwContext AS QUAD ) AS LONG
DECLARE FUNCTION InternetWriteFileExW LIB "wininet.dll" ALIAS "InternetWriteFileExW" ( BYVAL hFile AS QUAD
 , BYREF lpBuffersIn AS INTERNET_BUFFERSW
 , BYVAL dwFlags AS DWORD
 , BYVAL dwContext AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InternetWriteFileEx = InternetWriteFileExW
#ELSE
 MACRO InternetWriteFileEx = InternetWriteFileExA
#ENDIF
%EQUATE `INTERNET_OPTION_CONTEXT_VALUE_OLD = 10
%EQUATE `INTERNET_OPTION_NET_SPEED = 61
'// Pass in pointer to INTERNET_SECURITY_CONNECTION_INFO to be filled in.
%EQUATE `INTERNET_OPTION_SECURITY_CONNECTION_INFO = 66
%EQUATE `INTERNET_OPTION_DETECT_POST_SEND = 71
%EQUATE `INTERNET_OPTION_DISABLE_NTLM_PREAUTH = 72
%EQUATE `INTERNET_OPTION_ORIGINAL_CONNECT_FLAGS = 97
%EQUATE `INTERNET_OPTION_CERT_ERROR_FLAGS = 98
%EQUATE `INTERNET_OPTION_IGNORE_CERT_ERROR_FLAGS = 99
%EQUATE `INTERNET_OPTION_SESSION_START_TIME = 106
%EQUATE `INTERNET_OPTION_PROXY_CREDENTIALS = 107
%EQUATE `INTERNET_OPTION_EXTENDED_CALLBACKS = 108
%EQUATE `INTERNET_OPTION_PROXY_FROM_REQUEST = 109
%EQUATE `INTERNET_OPTION_ALLOW_FAILED_CONNECT_CONTENT = 110
%EQUATE `INTERNET_OPTION_CACHE_PARTITION = 111
%EQUATE `INTERNET_OPTION_AUTODIAL_HWND = 112
%EQUATE `INTERNET_OPTION_SERVER_CREDENTIALS = 113
%EQUATE `INTERNET_OPTION_WPAD_SLEEP = 114
%EQUATE `INTERNET_LAST_OPTION_INTERNAL = %INTERNET_OPTION_WPAD_SLEEP
%EQUATE `INTERNET_OPTION_OFFLINE_TIMEOUT = %INTERNET_OPTION_DISCONNECTED_TIMEOUT
%EQUATE `INTERNET_OPTION_LINE_STATE = %INTERNET_OPTION_CONNECTED_STATE
%EQUATE `AUTH_FLAG_RESET = &H00000000 ' /* let registry decide */
'//
'// Extended callbacks.
'//
'// They can happen outside the context of the registered session's API calls.
'//
%EQUATE `INTERNET_STATUS_PROXY_CREDENTIALS = 400
%EQUATE `INTERNET_STATUS_SERVER_CREDENTIALS = 401
%EQUATE `INTERNET_STATUS_SERVER_CONNECTION_STATE = 410
%EQUATE `INTERNET_STATUS_END_BROWSER_SESSION = 420
%EQUATE `INTERNET_STATUS_COOKIE = 430
'//
'// Extended callback data structures.
'//
' // Size = 32 bytes
TYPE INTERNET_SERVER_CONNECTION_STATE DWORD
 lpcwszHostName AS WSTRINGZ PTR
 fProxy AS LONG ' BOOL // Is this a proxy?
 dwCounter AS DWORD ' DWORD // Server connection state callback counter.
 dwConnectionLimit AS DWORD ' DWORD // Current Limit.
 dwAvailableCreates AS DWORD ' DWORD // Connections allowed to be created.
 dwAvailableKeepAlives AS DWORD ' DWORD // Keep alive connections available to be used.
 dwActiveConnections AS DWORD ' DWORD // Current number of active connections.
 dwWaiters AS DWORD ' DWORD // Number of request waiting on connections.
END TYPE
' // Size = 8 bytes
TYPE INTERNET_END_BROWSER_SESSION_DATA DWORD
 lpBuffer AS DWORD
 dwBufferLength AS DWORD
END TYPE
' // Size = 28 bytes
TYPE INTERNET_CALLBACK_COOKIE DWORD
 pcwszName AS WSTRINGZ PTR
 pcwszValue AS WSTRINGZ PTR
 pcwszDomain AS WSTRINGZ PTR
 pcwszPath AS WSTRINGZ PTR
 ftExpires AS FILETIME ' FILETIME
 dwFlags AS DWORD
END TYPE
' // Size = 8 bytes
TYPE INTERNET_CREDENTIALS_UNION_STRUCT DWORD
 lpcwszUserName AS WSTRINGZ PTR
 lpcwszPassword AS WSTRINGZ PTR
END TYPE
' // Size = 8 bytes
UNION INTERNET_CREDENTIALS_UNION DWORD
 INTERNET_CREDENTIALS_UNION_STRUCT
 pAuthIdentityOpaque AS DWORD
END UNION
' // Size = 32 bytes
TYPE INTERNET_CREDENTIALS DWORD
 lpcwszHostName AS WSTRINGZ PTR
 dwPort AS DWORD
 dwScheme AS DWORD
 lpcwszUrl AS WSTRINGZ PTR
 lpcwszRealm AS WSTRINGZ PTR
 fAuthIdentity AS LONG ' BOOL // TRUE if pAuthIdentityOpaque is used in below struct.
 INTERNET_CREDENTIALS_UNION
END TYPE
'//
'// !!! NOTE !!!
'//
'// these defines are needed beecause PREFAST donesn't understand enums in
'// range specifications. Make sue that these are always in sync with any
'// changes to the InternetCookieState enum, above.
'//
%EQUATE `COOKIE_STATE_LB = 0 ' // COOKIE_STATE_UNKNOWN
%EQUATE `COOKIE_STATE_UB = 5 ' // COOKIE_STATE_MAX
'/* maximum length of privacy-settings in Unicode characters */
%EQUATE `MaxPrivacySettings = &H4000
'// Utility for mapping P3P compact-policy tokens to unique indexes
DECLARE FUNCTION FindP3PPolicySymbol LIB "wininet.dll" ALIAS "FindP3PPolicySymbol" ( BYREF pszSymbol AS ASCIIZ ) AS LONG ' int
%EQUATE `INTERNET_STATE_ONLINE = %INTERNET_STATE_CONNECTED
%EQUATE `INTERNET_STATE_OFFLINE = %INTERNET_STATE_DISCONNECTED
%EQUATE `INTERNET_STATE_OFFLINE_USER = %INTERNET_STATE_DISCONNECTED_BY_USER
%EQUATE `INTERNET_LINE_STATE_MASK = %INTERNET_STATE_ONLINE OR %INTERNET_STATE_OFFLINE
%EQUATE `INTERNET_BUSY_STATE_MASK = %INTERNET_STATE_IDLE OR %INTERNET_STATE_BUSY
'//
'// the following are used with InternetSetOption(..., INTERNET_OPTION_CALLBACK_FILTER, ...)
'// to filter out unrequired callbacks. INTERNET_STATUS_REQUEST_COMPLETE cannot
'// be filtered out
'//
%EQUATE `INTERNET_STATUS_FILTER_RESOLVING = &H00000001
%EQUATE `INTERNET_STATUS_FILTER_RESOLVED = &H00000002
%EQUATE `INTERNET_STATUS_FILTER_CONNECTING = &H00000004
%EQUATE `INTERNET_STATUS_FILTER_CONNECTED = &H00000008
%EQUATE `INTERNET_STATUS_FILTER_SENDING = &H00000010
%EQUATE `INTERNET_STATUS_FILTER_SENT = &H00000020
%EQUATE `INTERNET_STATUS_FILTER_RECEIVING = &H00000040
%EQUATE `INTERNET_STATUS_FILTER_RECEIVED = &H00000080
%EQUATE `INTERNET_STATUS_FILTER_CLOSING = &H00000100
%EQUATE `INTERNET_STATUS_FILTER_CLOSED = &H00000200
%EQUATE `INTERNET_STATUS_FILTER_HANDLE_CREATED = &H00000400
%EQUATE `INTERNET_STATUS_FILTER_HANDLE_CLOSING = &H00000800
%EQUATE `INTERNET_STATUS_FILTER_PREFETCH = &H00001000
%EQUATE `INTERNET_STATUS_FILTER_REDIRECT = &H00002000
%EQUATE `INTERNET_STATUS_FILTER_STATE_CHANGE = &H00004000
'//
'// Note that adding any HTTP_QUERY_* codes here must be followed
'// by an equivlent line in wininet\http\hashgen\hashgen.cpp
'// please see that file for further information regarding
'// the addition of new HTTP headers
'//
'// These are not part of HTTP 1.1 yet. We will propose these to the
'// HTTP extensions working group. These are required for the client-caps support
'// we are doing in conjuntion with IIS.
' // Size = 36 bytes
TYPE INTERNET_COOKIE DWORD
 cbSize AS DWORD
 pszName AS ASCIIZ PTR
 pszData AS ASCIIZ PTR
 pszDomain AS ASCIIZ PTR
 pszPath AS ASCIIZ PTR
 pftExpires AS FILETIME PTR ' FILETIME *
 dwFlags AS DWORD
 pszUrl AS ASCIIZ PTR
 pszP3PPolicy AS ASCIIZ PTR
END TYPE
'//
'// Support for handling cookie policy
'//
' // Size = 28 bytes
TYPE COOKIE_DLG_INFO DWORD
 pszServer AS WSTRINGZ PTR
 pic AS INTERNET_COOKIE PTR ' PINTERNET_COOKIE
 dwStopWarning AS DWORD
 cx AS LONG ' INT
 cy AS LONG ' INT
 pszHeader AS WSTRINGZ PTR
 dwOperation AS DWORD
END TYPE
'// values returned from cookie UI, for dwStopWarning member
%EQUATE `COOKIE_DONT_ALLOW = 1
%EQUATE `COOKIE_ALLOW = 2
%EQUATE `COOKIE_ALLOW_ALL = 4
%EQUATE `COOKIE_DONT_ALLOW_ALL = 8
'// values for dwOperation member
%EQUATE `COOKIE_OP_SET = &H01
%EQUATE `COOKIE_OP_MODIFY = &H02
%EQUATE `COOKIE_OP_GET = &H04
%EQUATE `COOKIE_OP_SESSION = &H08
%EQUATE `COOKIE_OP_PERSISTENT = &H10
%EQUATE `COOKIE_OP_3RD_PARTY = &H20
'// INTERNET_COOKIE_RESTRICTED_ZONE is the same as INTERNET_FLAG_RESTRICTED_ZONE
%EQUATE `INTERNET_COOKIE_RESTRICTED_ZONE = &H00020000
%EQUATE `INTERNET_COOKIE_NO_CALLBACK = &H40000000
%EQUATE `INTERNET_COOKIE_ECTX_3RDPARTY = &H80000000
'//
'// DAV Detection
'//
DECLARE FUNCTION HttpCheckDavComplianceA LIB "wininet.dll" ALIAS "HttpCheckDavComplianceA" ( BYREF lpszUrl AS ASCIIZ , BYREF lpszComplianceToken AS ASCIIZ , BYREF lpfFound AS LONG , BYVAL hwnd AS QUAD , BYVAL lpvReserved AS QUAD ) AS LONG
'// INTERNET_COOKIE_RESTRICTED_ZONE is the same as INTERNET_FLAG_RESTRICTED_ZONE
%EQUATE `INTERNET_COOKIE_RESTRICTED_ZONE = &H00020000
%EQUATE `INTERNET_COOKIE_NO_CALLBACK = &H40000000
%EQUATE `INTERNET_COOKIE_ECTX_3RDPARTY = &H80000000
'//
'// DAV Detection
'//
DECLARE FUNCTION HttpCheckDavComplianceW LIB "wininet.dll" ALIAS "HttpCheckDavComplianceW" ( BYREF lpszUrl AS WSTRINGZ , BYREF lpszComplianceToken AS WSTRINGZ , BYREF lpfFound AS LONG , BYVAL hwnd AS QUAD , BYVAL lpvReserved AS QUAD ) AS LONG
#IF %DEF(%UNICODE)
 MACRO HttpCheckDavCompliance = HttpCheckDavComplianceW
#ELSE
 MACRO HttpCheckDavCompliance = HttpCheckDavComplianceA
#ENDIF
DECLARE FUNCTION HttpCheckCachedDavStatusA LIB "wininet.dll" ALIAS "HttpCheckCachedDavStatusA" ( BYREF lpszUrl AS ASCIIZ , BYREF lpdwStatus AS QUAD ) AS LONG
DECLARE FUNCTION HttpCheckCachedDavStatusW LIB "wininet.dll" ALIAS "HttpCheckCachedDavStatusW" ( BYREF lpszUrl AS WSTRINGZ
 , BYREF lpdwStatus AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO HttpCheckCachedDavStatus = HttpCheckCachedDavStatusW
#ELSE
 MACRO HttpCheckCachedDavStatus = HttpCheckCachedDavStatusA
#ENDIF
DECLARE FUNCTION HttpCheckDavCollectionA LIB "wininet.dll" ALIAS "HttpCheckDavCollectionA" ( BYREF lpszUrl AS ASCIIZ , BYREF lpfFound AS LONG , BYVAL hwnd AS QUAD , BYVAL lpvReserved AS QUAD ) AS LONG
DECLARE FUNCTION HttpCheckDavCollectionW LIB "wininet.dll" ALIAS "HttpCheckDavCollectionW" ( BYREF lpszUrl AS WSTRINGZ
 , BYREF lpfFound AS LONG
 , BYVAL hwnd AS DWORD
 , BYVAL lpvReserved AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO HttpCheckDavCollection = HttpCheckDavCollectionW
#ELSE
 MACRO HttpCheckDavCollection = HttpCheckDavCollectionA
#ENDIF
'// DAV detection defines
%EQUATE `DAV_LEVEL1_STATUS = &H00000001
%EQUATE `DAV_COLLECTION_STATUS = &H00004000
%EQUATE `DAV_DETECTION_REQUIRED = &H00008000
%EQUATE `FLAGS_ERROR_UI_SHOW_IDN_HOSTNAME = &H20
%EQUATE `ERROR_INTERNET_NO_NEW_CONTAINERS = %INTERNET_ERROR_BASE + 51
%EQUATE `ERROR_INTERNET_OFFLINE = %ERROR_INTERNET_DISCONNECTED
'//
'// internal error codes that are used to communicate specific information inside
'// of Wininet but which are meaningless at the interface
'//
%EQUATE `INTERNET_INTERNAL_ERROR_BASE = %INTERNET_ERROR_BASE + 900
%EQUATE `ERROR_INTERNET_INTERNAL_SOCKET_ERROR = %INTERNET_INTERNAL_ERROR_BASE + 1
%EQUATE `ERROR_INTERNET_CONNECTION_AVAILABLE = %INTERNET_INTERNAL_ERROR_BASE + 2
%EQUATE `ERROR_INTERNET_NO_KNOWN_SERVERS = %INTERNET_INTERNAL_ERROR_BASE + 3
%EQUATE `ERROR_INTERNET_PING_FAILED = %INTERNET_INTERNAL_ERROR_BASE + 4
%EQUATE `ERROR_INTERNET_NO_PING_SUPPORT = %INTERNET_INTERNAL_ERROR_BASE + 5
%EQUATE `ERROR_INTERNET_CACHE_SUCCESS = %INTERNET_INTERNAL_ERROR_BASE + 6
%EQUATE `ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION_EX = %INTERNET_INTERNAL_ERROR_BASE + 7
%EQUATE `HTTP_1_1_CACHE_ENTRY = &H00000040
%EQUATE `STATIC_CACHE_ENTRY = &H00000080
%EQUATE `MUST_REVALIDATE_CACHE_ENTRY = &H00000100
%EQUATE `SHORTPATH_CACHE_ENTRY = &H00000200
%EQUATE `COOKIE_ACCEPTED_CACHE_ENTRY = &H00001000
%EQUATE `COOKIE_LEASHED_CACHE_ENTRY = &H00002000
%EQUATE `COOKIE_DOWNGRADED_CACHE_ENTRY = &H00004000
%EQUATE `COOKIE_REJECTED_CACHE_ENTRY = &H00008000
%EQUATE `PRIVACY_MODE_CACHE_ENTRY = &H00020000
%EQUATE `XDR_CACHE_ENTRY = &H00040000
%EQUATE `PENDING_DELETE_CACHE_ENTRY = &H00400000
%EQUATE `OTHER_USER_CACHE_ENTRY = &H00800000
%EQUATE `PRIVACY_IMPACTED_CACHE_ENTRY = &H02000000
%EQUATE `POST_RESPONSE_CACHE_ENTRY = &H04000000
%EQUATE `INSTALLED_CACHE_ENTRY = &H10000000
%EQUATE `POST_CHECK_CACHE_ENTRY = &H20000000
%EQUATE `IDENTITY_CACHE_ENTRY = &H80000000
%EQUATE `ANY_CACHE_ENTRY = &HFFFFFFFF
'// We include some entry types even if app doesn't specifically ask for them.
%EQUATE `INCLUDE_BY_DEFAULT_CACHE_ENTRY = %HTTP_1_1_CACHE_ENTRY OR %STATIC_CACHE_ENTRY OR %MUST_REVALIDATE_CACHE_ENTRY OR %PRIVACY_IMPACTED_CACHE_ENTRY OR %POST_CHECK_CACHE_ENTRY OR %COOKIE_ACCEPTED_CACHE_ENTRY OR %COOKIE_LEASHED_CACHE_ENTRY OR %COOKIE_DOWNGRADED_CACHE_ENTRY OR %COOKIE_REJECTED_CACHE_ENTRY OR %SHORTPATH_CACHE_ENTRY
%EQUATE `CACHEGROUP_FLAG_VALID = &H00000007
'//
'// Well known sticky group ID
'//
%EQUATE `CACHEGROUP_ID_BUILTIN_STICKY = &H1000000000000007&&
'//
'// INTERNET_CACHE_CONFIG_PATH_ENTRY
'//
' // Size = 264 bytes
TYPE INTERNET_CACHE_CONFIG_PATH_ENTRYA DWORD
 CachePath AS ASCIIZ * %MAX_PATH ' CHAR
 dwCacheSize AS DWORD ' DWORD // in KBytes
END TYPE
MACRO INTERNET_CACHE_CONFIG_PATH_ENTRY = INTERNET_CACHE_CONFIG_PATH_ENTRYA
' // Size = 524 bytes
TYPE INTERNET_CACHE_CONFIG_PATH_ENTRYW DWORD
 CachePath AS WSTRINGZ * %MAX_PATH ' WCHAR
 dwCacheSize AS DWORD ' DWORD // in KBytes
END TYPE
'//
'// INTERNET_CACHE_CONFIG_INFO
'//
' // Size = 264 bytes
TYPE INTERNET_CACHE_CONFIG_INFOA_UNION_STRUCT DWORD
 CachePath AS ASCIIZ * %MAX_PATH ' CHAR
 dwCacheSize AS DWORD
END TYPE
' // Size = 264 bytes
UNION INTERNET_CACHE_CONFIG_INFOA_UNION DWORD
 INTERNET_CACHE_CONFIG_INFOA_UNION_STRUCT
 CachePaths(0) AS INTERNET_CACHE_CONFIG_PATH_ENTRYA
END UNION
' // Size = 300 bytes
TYPE INTERNET_CACHE_CONFIG_INFOA DWORD
 dwStructSize AS DWORD
 dwContainer AS DWORD
 dwQuota AS DWORD
 dwReserved4 AS DWORD
 fPerUser AS LONG
 dwSyncMode AS DWORD
 dwNumCachePaths AS DWORD
 INTERNET_CACHE_CONFIG_INFOA_UNION
 dwNormalUsage AS DWORD
 dwExemptUsage AS DWORD
END TYPE
MACRO INTERNET_CACHE_CONFIG_INFO = INTERNET_CACHE_CONFIG_INFOA
' // Size = 524 bytes
TYPE INTERNET_CACHE_CONFIG_INFOW_UNION_STRUCT DWORD
 CachePath AS WSTRINGZ * %MAX_PATH ' WCHAR
 dwCacheSize AS DWORD
END TYPE
' // Size = 524 bytes
UNION INTERNET_CACHE_CONFIG_INFOW_UNION DWORD
 INTERNET_CACHE_CONFIG_INFOW_UNION_STRUCT
 CachePaths(0) AS INTERNET_CACHE_CONFIG_PATH_ENTRYW
END UNION
' // Size = 560 bytes
TYPE INTERNET_CACHE_CONFIG_INFOW
 dwStructSize AS DWORD
 dwContainer AS DWORD
 dwQuota AS DWORD
 dwReserved4 AS DWORD
 fPerUser AS LONG
 dwSyncMode AS DWORD
 dwNumCachePaths AS DWORD
 INTERNET_CACHE_CONFIG_INFOW_UNION
 dwNormalUsage AS DWORD
 dwExemptUsage AS DWORD
END TYPE
DECLARE FUNCTION IsUrlCacheEntryExpiredA LIB "wininet.dll" ALIAS "IsUrlCacheEntryExpiredA" ( BYREF lpszUrlName AS ASCIIZ , BYVAL dwFlags AS QUAD , BYREF pftLastModified AS FILETIME ) AS LONG
DECLARE FUNCTION IsUrlCacheEntryExpiredW LIB "wininet.dll" ALIAS "IsUrlCacheEntryExpiredW" ( BYREF lpszUrlName AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYREF pftLastModified AS FILETIME
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsUrlCacheEntryExpired = IsUrlCacheEntryExpiredW
#ELSE
 MACRO IsUrlCacheEntryExpired = IsUrlCacheEntryExpiredA
#ENDIF
%EQUATE `INTERNET_CACHE_FLAG_ALLOW_COLLISIONS = &H00000100
%EQUATE `INTERNET_CACHE_FLAG_INSTALLED_ENTRY = &H00000200
%EQUATE `INTERNET_CACHE_FLAG_ENTRY_OR_MAPPING = &H00000400
%EQUATE `INTERNET_CACHE_FLAG_ADD_FILENAME_ONLY = &H00000800
%EQUATE `INTERNET_CACHE_FLAG_GET_STRUCT_ONLY = &H00001000
%EQUATE `CACHE_ENTRY_TYPE_FC = &H00001000
%EQUATE `CACHE_ENTRY_MODIFY_DATA_FC = &H80000000 ' // this appears unused
'// Flags for CreateContainer
%EQUATE `INTERNET_CACHE_CONTAINER_NOSUBDIRS = &H1
%EQUATE `INTERNET_CACHE_CONTAINER_AUTODELETE = &H2
%EQUATE `INTERNET_CACHE_CONTAINER_RESERVED1 = &H4
%EQUATE `INTERNET_CACHE_CONTAINER_NODESKTOPINIT = &H8
%EQUATE `INTERNET_CACHE_CONTAINER_MAP_ENABLED = &H10
DECLARE FUNCTION CreateUrlCacheContainerA LIB "wininet.dll" ALIAS "CreateUrlCacheContainerA" ( BYREF Name AS ASCIIZ , BYREF lpCachePrefix AS ASCIIZ , BYREF lpszCachePath AS ASCIIZ , BYVAL KBCacheLimit AS QUAD , BYVAL dwContainerType AS QUAD , BYVAL dwOptions AS QUAD , BYVAL pvBuffer AS QUAD , BYVAL cbBuffer AS QUAD ) AS LONG
DECLARE FUNCTION CreateUrlCacheContainerW LIB "wininet.dll" ALIAS "CreateUrlCacheContainerW" ( BYREF Name AS WSTRINGZ
 , BYREF lpCachePrefix AS WSTRINGZ
 , BYREF lpszCachePath AS WSTRINGZ
 , BYVAL KBCacheLimit AS DWORD
 , BYVAL dwContainerType AS DWORD
 , BYVAL dwOptions AS DWORD
 , BYVAL pvBuffer AS DWORD
 , BYVAL cbBuffer AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO CreateUrlCacheContainer = CreateUrlCacheContainerW
#ELSE
 MACRO CreateUrlCacheContainer = CreateUrlCacheContainerA
#ENDIF
DECLARE FUNCTION DeleteUrlCacheContainerA LIB "wininet.dll" ALIAS "DeleteUrlCacheContainerA" ( BYREF Name AS ASCIIZ , BYVAL dwOptions AS QUAD ) AS LONG
DECLARE FUNCTION DeleteUrlCacheContainerW LIB "wininet.dll" ALIAS "DeleteUrlCacheContainerW" ( BYREF Name AS WSTRINGZ
 , BYVAL dwOptions AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeleteUrlCacheContainer = DeleteUrlCacheContainerW
#ELSE
 MACRO DeleteUrlCacheContainer = DeleteUrlCacheContainerA
#ENDIF
'//
'// INTERNET_CACHE_ENTRY_INFO -
'//
' // Size = 20 bytes
TYPE INTERNET_CACHE_CONTAINER_INFOA DWORD
 dwCacheVersion AS DWORD ' DWORD // version of software
 lpszName AS ASCIIZ PTR ' LPSTR // embedded pointer to the container name string.
 lpszCachePrefix AS ASCIIZ PTR ' LPSTR // embedded pointer to the container URL prefix
 lpszVolumeLabel AS ASCIIZ PTR ' LPSTR // embedded pointer to the container volume label if any.
 lpszVolumeTitle AS ASCIIZ PTR ' LPSTR // embedded pointer to the container volume title if any.
END TYPE
MACRO INTERNET_CACHE_CONTAINER_INFO = INTERNET_CACHE_CONTAINER_INFOA
' // Size = 20 bytes
TYPE INTERNET_CACHE_CONTAINER_INFOW DWORD
 dwCacheVersion AS DWORD ' DWORD // version of software
 lpszName AS WSTRINGZ PTR ' LPWSTR // embedded pointer to the container name string.
 lpszCachePrefix AS WSTRINGZ PTR ' LPWSTR // embedded pointer to the container URL prefix
 lpszVolumeLabel AS WSTRINGZ PTR ' LPWSTR // embedded pointer to the container volume label if any.
 lpszVolumeTitle AS WSTRINGZ PTR ' LPWSTR // embedded pointer to the container volume title if any.
END TYPE
'// FindFirstContainer options
%EQUATE `CACHE_FIND_CONTAINER_RETURN_NOCHANGE = &H1
DECLARE FUNCTION FindFirstUrlCacheContainerA LIB "wininet.dll" ALIAS "FindFirstUrlCacheContainerA" ( BYREF pdwModified AS QUAD , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOA , BYREF lpcbContainerInfo AS QUAD , BYVAL dwOptions AS QUAD ) AS QUAD
DECLARE FUNCTION FindFirstUrlCacheContainerW LIB "wininet.dll" ALIAS "FindFirstUrlCacheContainerW" ( BYREF pdwModified AS QUAD
 , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOW
 , BYREF lpcbContainerInfo AS DWORD
 , BYVAL dwOptions AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO FindFirstUrlCacheContainer = FindFirstUrlCacheContainerW
#ELSE
 MACRO FindFirstUrlCacheContainer = FindFirstUrlCacheContainerA
#ENDIF
DECLARE FUNCTION FindNextUrlCacheContainerA LIB "wininet.dll" ALIAS "FindNextUrlCacheContainerA" ( BYVAL hEnumHandle AS QUAD , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOA , BYREF lpcbContainerInfo AS QUAD ) AS LONG
DECLARE FUNCTION FindNextUrlCacheContainerW LIB "wininet.dll" ALIAS "FindNextUrlCacheContainerW" ( BYVAL hEnumHandle AS QUAD
 , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOW
 , BYREF lpcbContainerInfo AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO FindNextUrlCacheContainer = FindNextUrlCacheContainerW
#ELSE
 MACRO FindNextUrlCacheContainer = FindNextUrlCacheContainerA
#ENDIF
' enum WININET_SYNC_MODE
%EQUATE `SYNC_MODE_NEVER = 0
%EQUATE `SYNC_MODE_ON_EXPIRY = 1 ' // bogus
%EQUATE `SYNC_MODE_ONCE_PER_SESSION = 2
%EQUATE `SYNC_MODE_ALWAYS = 3
%EQUATE `SYNC_MODE_AUTOMATIC = 4
%EQUATE `SYNC_MODE_DEFAULT = %SYNC_MODE_AUTOMATIC
DECLARE FUNCTION FreeUrlCacheSpaceA LIB "wininet.dll" ALIAS "FreeUrlCacheSpaceA" ( BYREF lpszCachePath AS ASCIIZ , BYVAL dwSize AS QUAD , BYVAL dwFilter AS QUAD ) AS LONG
DECLARE FUNCTION FreeUrlCacheSpaceW LIB "wininet.dll" ALIAS "FreeUrlCacheSpaceW" ( BYREF lpszCachePath AS WSTRINGZ
 , BYVAL dwSize AS DWORD
 , BYVAL dwFilter AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO FreeUrlCacheSpace = FreeUrlCacheSpaceW
#ELSE
 MACRO FreeUrlCacheSpace = FreeUrlCacheSpaceA
#ENDIF
'//
'// config APIs.
'//
%EQUATE `CACHE_CONFIG_FORCE_CLEANUP_FC = &H00000020
%EQUATE `CACHE_CONFIG_DISK_CACHE_PATHS_FC = &H00000040
%EQUATE `CACHE_CONFIG_SYNC_MODE_FC = &H00000080
%EQUATE `CACHE_CONFIG_CONTENT_PATHS_FC = &H00000100
%EQUATE `CACHE_CONFIG_COOKIES_PATHS_FC = &H00000200
%EQUATE `CACHE_CONFIG_HISTORY_PATHS_FC = &H00000400
%EQUATE `CACHE_CONFIG_QUOTA_FC = &H00000800
%EQUATE `CACHE_CONFIG_USER_MODE_FC = &H00001000
%EQUATE `CACHE_CONFIG_CONTENT_USAGE_FC = &H00002000
%EQUATE `CACHE_CONFIG_STICKY_CONTENT_USAGE_FC = &H00004000
DECLARE FUNCTION GetUrlCacheConfigInfoA LIB "wininet.dll" ALIAS "GetUrlCacheConfigInfoA" ( BYREF lpCacheConfigInfo AS INTERNET_CACHE_CONFIG_INFOA , BYVAL lpcbCacheConfigInfo AS QUAD , BYVAL dwFieldControl AS QUAD ) AS LONG
DECLARE FUNCTION GetUrlCacheConfigInfoW LIB "wininet.dll" ALIAS "GetUrlCacheConfigInfoW" ( BYREF lpCacheConfigInfo AS INTERNET_CACHE_CONFIG_INFOW
 , BYVAL lpcbCacheConfigInfo AS DWORD
 , BYVAL dwFieldControl AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetUrlCacheConfigInfo = GetUrlCacheConfigInfoW
#ELSE
 MACRO GetUrlCacheConfigInfo = GetUrlCacheConfigInfoA
#ENDIF
DECLARE FUNCTION SetUrlCacheConfigInfoA LIB "wininet.dll" ALIAS "SetUrlCacheConfigInfoA" ( BYREF lpCacheConfigInfo AS INTERNET_CACHE_CONFIG_INFOA , BYVAL dwFieldControl AS QUAD ) AS LONG
DECLARE FUNCTION SetUrlCacheConfigInfoW LIB "wininet.dll" ALIAS "SetUrlCacheConfigInfoW" ( BYREF lpCacheConfigInfo AS INTERNET_CACHE_CONFIG_INFOW
 , BYVAL dwFieldControl AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetUrlCacheConfigInfo = SetUrlCacheConfigInfoW
#ELSE
 MACRO SetUrlCacheConfigInfo = SetUrlCacheConfigInfoA
#ENDIF
DECLARE FUNCTION RunOnceUrlCache LIB "wininet.dll" ALIAS "RunOnceUrlCache" ( BYVAL hwnd AS QUAD , BYVAL hinst AS QUAD , BYREF lpszCmd AS ASCIIZ , BYVAL nCmdShow AS LONG ) AS QUAD
DECLARE FUNCTION DeleteIE3Cache LIB "wininet.dll" ALIAS "DeleteIE3Cache" ( BYVAL hwnd AS QUAD
 , BYVAL hinst AS DWORD
 , BYREF lpszCmd AS ASCIIZ
 , BYVAL nCmdShow AS LONG
 ) AS DWORD
DECLARE FUNCTION UpdateUrlCacheContentPath LIB "wininet.dll" ALIAS "UpdateUrlCacheContentPath" ( BYREF szNewPath AS ASCIIZ
 ) AS DWORD
'// Cache header data defines.
%EQUATE `CACHE_HEADER_DATA_CURRENT_SETTINGS_VERSION = 0
%EQUATE `CACHE_HEADER_DATA_CONLIST_CHANGE_COUNT = 1
%EQUATE `CACHE_HEADER_DATA_COOKIE_CHANGE_COUNT = 2
%EQUATE `CACHE_HEADER_DATA_NOTIFICATION_HWND = 3
%EQUATE `CACHE_HEADER_DATA_NOTIFICATION_MESG = 4
%EQUATE `CACHE_HEADER_DATA_ROOTGROUP_OFFSET = 5
%EQUATE `CACHE_HEADER_DATA_GID_LOW = 6
%EQUATE `CACHE_HEADER_DATA_GID_HIGH = 7
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_8 = 8
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_9 = 9
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_10 = 10
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_11 = 11
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_12 = 12
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_13 = 13
%EQUATE `CACHE_HEADER_DATA_SSL_STATE_COUNT = 14
'// legacy alias for ssl state count
%EQUATE `CACHE_HEADER_DATA_DOWNLOAD_PARTIAL = %CACHE_HEADER_DATA_SSL_STATE_COUNT
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_15 = 15
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_16 = 16
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_17 = 17
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_18 = 18
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_19 = 19
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_20 = 20
%EQUATE `CACHE_HEADER_DATA_NOTIFICATION_FILTER = 21
%EQUATE `CACHE_HEADER_DATA_ROOT_LEAK_OFFSET = 22
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_23 = 23
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_24 = 24
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_25 = 25
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_26 = 26
%EQUATE `CACHE_HEADER_DATA_ROOT_GROUPLIST_OFFSET = 27 ' // offset to group list
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_28 = 28
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_29 = 29
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_30 = 30
%EQUATE `CACHE_HEADER_DATA_CACHE_RESERVED_31 = 31
%EQUATE `CACHE_HEADER_DATA_LAST = 31
'// options for cache notification filter
%EQUATE `CACHE_NOTIFY_ADD_URL = &H00000001
%EQUATE `CACHE_NOTIFY_DELETE_URL = &H00000002
%EQUATE `CACHE_NOTIFY_UPDATE_URL = &H00000004
%EQUATE `CACHE_NOTIFY_DELETE_ALL = &H00000008
%EQUATE `CACHE_NOTIFY_URL_SET_STICKY = &H00000010
%EQUATE `CACHE_NOTIFY_URL_UNSET_STICKY = &H00000020
%EQUATE `CACHE_NOTIFY_SET_ONLINE = &H00000100
%EQUATE `CACHE_NOTIFY_SET_OFFLINE = &H00000200
%EQUATE `CACHE_NOTIFY_FILTER_CHANGED = &H10000000
DECLARE FUNCTION RegisterUrlCacheNotification LIB "wininet.dll" ALIAS "RegisterUrlCacheNotification" ( BYVAL hWnd AS QUAD , BYVAL uMsg AS QUAD , BYVAL gid AS WORD , BYVAL dwOpsFilter AS QUAD , BYVAL dwReserved AS QUAD ) AS LONG
DECLARE FUNCTION GetUrlCacheHeaderData LIB "wininet.dll" ALIAS "GetUrlCacheHeaderData" ( BYVAL Idx AS QUAD
 , BYREF lpdwData AS DWORD
 ) AS LONG
DECLARE FUNCTION SetUrlCacheHeaderData LIB "wininet.dll" ALIAS "SetUrlCacheHeaderData" ( BYVAL nIdx AS DWORD
 , BYVAL dwData AS DWORD
 ) AS LONG
DECLARE FUNCTION IncrementUrlCacheHeaderData LIB "wininet.dll" ALIAS "IncrementUrlCacheHeaderData" ( BYVAL nIdx AS DWORD
 , BYREF lpdwData AS DWORD
 ) AS LONG
DECLARE FUNCTION LoadUrlCacheContent LIB "wininet.dll" ALIAS "LoadUrlCacheContent" ( ) AS LONG
DECLARE FUNCTION GetUrlCacheContainerInfoA LIB "wininet.dll" ALIAS "GetUrlCacheContainerInfoA" ( BYREF lpszUrlName AS ASCIIZ
 , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOA
 , BYREF lpdwContainerInfoBufferSize AS DWORD
 , BYVAL dwOptions AS DWORD
 ) AS LONG
DECLARE FUNCTION GetUrlCacheContainerInfoW LIB "wininet.dll" ALIAS "GetUrlCacheContainerInfoW" ( BYREF lpszUrlName AS WSTRINGZ
 , BYREF lpContainerInfo AS INTERNET_CACHE_CONTAINER_INFOW
 , BYREF lpdwContainerInfoBufferSize AS DWORD
 , BYVAL dwOptions AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetUrlCacheContainerInfo = GetUrlCacheContainerInfoW
#ELSE
 MACRO GetUrlCacheContainerInfo = GetUrlCacheContainerInfoA
#ENDIF
'//
'// Autodial APIs
'//
' Also declared in wininet.inc
'DECLARE FUNCTION InternetDialA LIB "wininet.dll" ALIAS "InternetDialA" ( ' BYVAL hwndParent AS DWORD
' , BYREF lpszConnectoid AS ASCIIZ
' , BYVAL dwFlags AS DWORD
' , BYREF lpdwConnection AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS DWORD
' Also declared in wininet.inc
'DECLARE FUNCTION InternetDialW LIB "wininet.dll" ALIAS "InternetDialW" ( ' BYVAL hwndParent AS DWORD
' , BYREF lpszConnectoid AS WSTRINGZ
' , BYVAL dwFlags AS DWORD
' , BYREF lpdwConnection AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS DWORD
' Also declared in wininet.inc
'// Flags for InternetDial - must not conflict with InternetAutodial flags
'// as they are valid here also.
'%INTERNET_DIAL_FORCE_PROMPT = &H2000
'%INTERNET_DIAL_SHOW_OFFLINE = &H4000
'%INTERNET_DIAL_UNATTENDED = &H8000
'DECLARE FUNCTION InternetHangUp LIB "wininet.dll" ALIAS "InternetHangUp" ( ' BYVAL dwConnection AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS DWORD
' Also declared in wininet.inc
'%INTERENT_GOONLINE_REFRESH = &H00000001
'%INTERENT_GOONLINE_MASK = &H00000001
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGoOnlineA LIB "wininet.dll" ALIAS "InternetGoOnlineA" ( ' BYREF lpszURL AS ASCIIZ
' , BYVAL hwndParent AS DWORD
' , BYVAL dwFlags AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGoOnlineW LIB "wininet.dll" ALIAS "InternetGoOnlineW" ( ' BYREF lpszURL AS WSTRINGZ
' , BYVAL hwndParent AS DWORD
' , BYVAL dwFlags AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'// Flags for InternetAutodial
'%INTERNET_AUTODIAL_FORCE_ONLINE = 1
'%INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
'%INTERNET_AUTODIAL_FAILIFSECURITYCHECK = 4
'%INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT = 8
'%INTERNET_AUTODIAL_FLAGS_MASK = %INTERNET_AUTODIAL_FORCE_ONLINE OR %INTERNET_AUTODIAL_FORCE_UNATTENDED OR %INTERNET_AUTODIAL_FAILIFSECURITYCHECK OR %INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT
' Also declared in wininet.inc
'DECLARE FUNCTION InternetAutodialHangup LIB "wininet.dll" ALIAS "InternetAutodialHangup" ( ' BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGetConnectedState LIB "wininet.dll" ALIAS "InternetGetConnectedState" ( ' BYREF lpdwFlags AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGetConnectedStateExA LIB "wininet.dll" ALIAS "InternetGetConnectedStateExA" ( ' BYREF lpdwFlags AS DWORD
' , BYREF lpszConnectionName AS ASCIIZ
' , BYVAL dwBufLen AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGetConnectedStateExW LIB "wininet.dll" ALIAS "InternetGetConnectedStateExW" ( ' BYREF lpdwFlags AS DWORD
' , BYREF lpszConnectionName AS WSTRINGZ
' , BYVAL dwBufLen AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
DECLARE FUNCTION InternetGetDialEngineW LIB "wininet.dll" ALIAS "InternetGetDialEngineW" ( BYREF pwzConnectoid AS WSTRINGZ
 , BYVAL pdes AS IDialEventSink
 , BYREF ppde AS IDialEngine
 ) AS LONG
MACRO InternetGetDialEngine = InternetGetDialEngineW
DECLARE FUNCTION InternetGetDialBrandingW LIB "wininet.dll" ALIAS "InternetGetDialBrandingW" ( BYREF pwzConnectoid AS WSTRINGZ , BYREF ppdb AS IDialBranding ) AS LONG
MACRO InternetGetDialBranding = InternetGetDialBrandingW
DECLARE FUNCTION ReadGuidsForConnectedNetworks LIB "wininet.dll" ALIAS "ReadGuidsForConnectedNetworks" ( BYREF pcNetworks AS QUAD , BYREF pppwszNetworkGuids AS QUAD , BYREF pppbstrNetworkNames AS WSTRING , BYREF pppwszGWMacs AS QUAD , BYREF pcGatewayMacs AS QUAD , BYREF pdwFlags AS QUAD ) AS LONG
'//
'// INTERNET_AUTOPROXY_INIT_FLAGS - Flags for InternetInitializeAutoProxyDll
'//
%EQUATE `INTERNET_AUTOPROXY_INIT_DEFAULT = &H1
%EQUATE `INTERNET_AUTOPROXY_INIT_DOWNLOADSYNC = &H2
%EQUATE `INTERNET_AUTOPROXY_INIT_QUERYSTATE = &H4
%EQUATE `INTERNET_AUTOPROXY_INIT_ONLYQUERY = &H8
%EQUATE `INTERNET_AUTOPROXY_INIT_MASK = %INTERNET_AUTOPROXY_INIT_DEFAULT OR %INTERNET_AUTOPROXY_INIT_DOWNLOADSYNC OR %INTERNET_AUTOPROXY_INIT_QUERYSTATE OR %INTERNET_AUTOPROXY_INIT_ONLYQUERY
' Also declared in wininet.inc
'DECLARE FUNCTION InternetInitializeAutoProxyDll LIB "jsproxy.dll" ALIAS "InternetInitializeAutoProxyDll" ( ' BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION DetectAutoProxyUrl LIB "wininet.dll" ALIAS "DetectAutoProxyUrl" ( ' BYREF AlpszAutoProxyUrl AS SCIIZ
' , BYVAL dwAutoProxyUrlLength AS DWORD
' , BYVAL dwDetectFlags AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION CreateMD5SSOHash LIB "wininet.dll" ALIAS "CreateMD5SSOHash" ( ' BYREF pszChallengeInfo AS WSTRINGZ
' , BYREF pwszRealm AS WSTRINGZ
' , BYREF pwszTarget AS WSTRINGZ
' , BYREF pbHexHash AS ANY
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGetConnectedStateEx LIB "wininet.dll" ALIAS "InternetGetConnectedStateEx" ( ' BYREF lpdwFlags AS DWORD
' , BYREF lpszConnectionName AS ASCIIZ
' , BYVAL dwBufLen AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetGetConnectedStateExW LIB "wininet.dll" ALIAS "InternetGetConnectedStateExW" ( ' BYREF lpdwFlags AS DWORD
' , BYREF lpszConnectionName AS WSTRINGZ
' , BYVAL dwBufLen AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'// Flags for InternetGetConnectedState and Ex
'%INTERNET_CONNECTION_MODEM = &H01
'%INTERNET_CONNECTION_LAN = &H02
'%INTERNET_CONNECTION_PROXY = &H04
'%INTERNET_CONNECTION_MODEM_BUSY = &H08 ' /* no longer used */
'%INTERNET_RAS_INSTALLED = &H10
'%INTERNET_CONNECTION_OFFLINE = &H20
'%INTERNET_CONNECTION_CONFIGURED = &H40
'//
'// Custom dial handler functions
'//
'// Custom dial handler prototype
'typedef DWORD (CALLBACK * PFN_DIAL_HANDLER) (HWND, LPCSTR, DWORD, LPDWORD);
' Also declared in wininet.inc
'// Flags for custom dial handler
'%INTERNET_CUSTOMDIAL_CONNECT = 0
'%INTERNET_CUSTOMDIAL_UNATTENDED = 1
'%INTERNET_CUSTOMDIAL_DISCONNECT = 2
'%INTERNET_CUSTOMDIAL_SHOWOFFLINE = 4
' Also declared in wininet.inc
'// Custom dial handler supported functionality flags
'%INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED = 1
'%INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE = 2
'%INTERNET_CUSTOMDIAL_CAN_HANGUP = 4
' Also declared in wininet.inc
'DECLARE FUNCTION InternetSetDialStateA LIB "wininet.dll" ALIAS "InternetSetDialStateA" ( ' BYREF lpszConnectoid AS ASCIIZ
' , BYVAL dwState AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetSetDialStateW LIB "wininet.dll" ALIAS "InternetSetDialStateW" ( ' BYREF lpszConnectoid AS WSTRINGZ
' , BYVAL dwState AS DWORD
' , BYVAL dwReserved AS DWORD
' ) AS LONG
' Also declared in wininet.inc
'// States for InternetSetDialState
'%INTERNET_DIALSTATE_DISCONNECTED = 1
'// Registry entries used by the dialing code
'// All of these entries are in:
'// HKCU\software\microsoft\windows\current version\internet settings
$REGSTR_DIAL_AUTOCONNECT = "AutoConnect"
'// Registry entries for legacy cookies
$REGSTR_LEASH_LEGACY_COOKIES = "LeashLegacyCookies"
'// Used by security manager.
DECLARE FUNCTION IsHostInProxyBypassList LIB "wininet.dll" ALIAS "IsHostInProxyBypassList" ( BYVAL tScheme AS LONG , BYREF lpszHost AS ASCIIZ , BYVAL cchHost AS QUAD ) AS LONG
'// Used by Shell to determine if anyone has loaded wininet yet
'// Shell code calls OpenMutex with this name and if no mutex is
'// obtained, we know that no copy of wininet has been loaded yet
'#if _WIN32_WINNT >= _WIN32_WINNT_WINXP
#IF %WINVER >= &H0501
'#define LOCAL_NAMESPACE_PREFIX "Local\\"
$LOCAL_NAMESPACE_PREFIX = "Local\"
#ELSE
$LOCAL_NAMESPACE_PREFIX = ""
'#define LOCAL_NAMESPACE_PREFIX
#ENDIF
$WININET_STARTUP_MUTEX = $LOCAL_NAMESPACE_PREFIX & "WininetStartupMutex"
'BOOL DoConnectoidsExist(void); // Returns TRUE if any RAS connectoids exist and FALSE otherwise
DECLARE FUNCTION DoConnectoidsExist LIB "wininet.dll" ALIAS "DoConnectoidsExist" ( ) AS LONG
DECLARE FUNCTION GetDiskInfo LIB "wininet.dll" ALIAS "GetDiskInfoA" ( BYREF pszPath AS ASCIIZ , BYREF pdwClusterSize AS QUAD
 , BYREF pdlAvail AS QUAD
 , BYREF pdlTotal AS QUAD
 ) AS LONG
'typedef BOOL (*CACHE_OPERATOR)(INTERNET_CACHE_ENTRY_INFO* pcei, PDWORD pcbcei, PVOID pOpData);
DECLARE FUNCTION PerformOperationOverUrlCacheA LIB "wininet.dll" ALIAS "PerformOperationOverUrlCacheA" ( BYREF pszUrlSearchPattern AS ASCIIZ , BYVAL dwFlags AS QUAD , BYVAL dwFilter AS QUAD , BYVAL GroupId AS WORD , BYVAL pReserved1 AS QUAD , BYVAL pdwReserved2 AS QUAD , BYVAL pReserved3 AS QUAD , BYVAL op AS QUAD , BYREF pOperatorData AS QUAD ) AS LONG
DECLARE FUNCTION IsProfilesEnabled LIB "wininet.dll" ALIAS "IsProfilesEnabled" ( ) AS LONG
DECLARE FUNCTION GetFileExtensionFromUrl LIB "wininet.dll" ALIAS "GetFileExtensionFromUrl" ( BYREF lpszUrl AS ASCIIZ
 , BYVAL dwFlags AS DWORD
 , BYREF lpszExt AS ASCIIZ
 , BYREF pcchExt AS DWORD
 ) AS LONG
DECLARE FUNCTION InternalInternetGetCookie LIB "wininet.dll" ALIAS "InternalInternetGetCookie" ( BYREF lpszUrl AS ASCIIZ
 , BYREF lpszCookieData AS ASCIIZ
 , BYREF lpdwDataSize AS DWORD
 ) AS LONG
'// in cookimp.cxx and cookexp.cxx
DECLARE FUNCTION ImportCookieFileA LIB "wininet.dll" ALIAS "ImportCookieFileA" ( BYREF szFilename AS ASCIIZ ) AS LONG
'// in cookimp.cxx and cookexp.cxx
DECLARE FUNCTION ImportCookieFileW LIB "wininet.dll" ALIAS "ImportCookieFileW" ( BYREF szFilename AS WSTRINGZ ) AS LONG
#IF %DEF(%UNICODE)
 MACRO ImportCookieFile = ImportCookieFileW
#ELSE
 MACRO ImportCookieFile = ImportCookieFileA
#ENDIF
DECLARE FUNCTION IsDomainLegalCookieDomainA LIB "wininet.dll" ALIAS "IsDomainLegalCookieDomainA" ( ' // in "wininet\http\cookie.cxx"
 BYREF pchDomain AS ASCIIZ
 , BYREF pchFullDomain AS ASCIIZ
 ) AS LONG
DECLARE FUNCTION IsDomainLegalCookieDomainW LIB "wininet.dll" ALIAS "IsDomainLegalCookieDomainW" ( ' // in "wininet\http\cookie.cxx"
 BYREF pchDomain AS WSTRINGZ
 , BYREF pchFullDomain AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsDomainLegalCookieDomain = IsDomainLegalCookieDomainW
#ELSE
 MACRO IsDomainLegalCookieDomain = IsDomainLegalCookieDomainA
#ENDIF
' Also declared in wininet.inc
'DECLARE FUNCTION InternetEnumPerSiteCookieDecisionA LIB "wininet.dll" ALIAS "InternetEnumPerSiteCookieDecisionA" ( ' BYREF pszSiteName AS ASCIIZ
' , BYREF pcSiteNameSize AS LONG
' , BYREF pdwDecision AS LONG
' , BYVAL dwIndex AS LONG
' ) AS LONG
' Also declared in wininet.inc
'DECLARE FUNCTION InternetEnumPerSiteCookieDecisionW LIB "wininet.dll" ALIAS "InternetEnumPerSiteCookieDecisionW" ( ' BYREF pszSiteName AS WSTRINGZ
' , BYREF pcSiteNameSize AS LONG
' , BYREF pdwDecision AS LONG
' , BYVAL dwIndex AS LONG
' ) AS LONG
%EQUATE `INTERNET_SUPPRESS_COOKIE_PERSIST = &H03
%EQUATE `INTERNET_SUPPRESS_COOKIE_PERSIST_RESET = &H04
' Also declared in wininet.inc
'//
'// Privacy settings values and APIs
'//
'%PRIVACY_TEMPLATE_NO_COOKIES = 0
'%PRIVACY_TEMPLATE_HIGH = 1
'%PRIVACY_TEMPLATE_MEDIUM_HIGH = 2
'%PRIVACY_TEMPLATE_MEDIUM = 3
'%PRIVACY_TEMPLATE_MEDIUM_LOW = 4
'%PRIVACY_TEMPLATE_LOW = 5
'%PRIVACY_TEMPLATE_CUSTOM = 100
'%PRIVACY_TEMPLATE_ADVANCED = 101
'%PRIVACY_TEMPLATE_MAX = %PRIVACY_TEMPLATE_LOW
'%PRIVACY_TYPE_FIRST_PARTY = 0
'%PRIVACY_TYPE_THIRD_PARTY = 1
'DECLARE FUNCTION PrivacySetZonePreferenceW LIB "wininet.dll" ALIAS "PrivacySetZonePreferenceW" ( ' BYVAL dwZone AS DWORD
' , BYVAL dwType AS DWORD
' , BYVAL dwTemplate AS DWORD
' , BYREF pszPreference AS WSTRINGZ
' ) AS DWORD
'DECLARE FUNCTION PrivacyGetZonePreferenceW LIB "wininet.dll" ALIAS "PrivacyGetZonePreferenceW" ( ' BYVAL dwZone AS DWORD
' , BYVAL dwType AS DWORD
' , BYREF pdwTemplate AS DWORD
' , BYREF pszBuffer AS WSTRINGZ
' , BYREF pdwBufferLength AS DWORD
' ) AS DWORD
'#define _P3PGLOBAL_H_
'typedef char P3PCHAR;
'typedef char *P3PURL;
'typedef char *P3PVERB;
'typedef const char *P3PCURL;
'typedef BSTR P3PCXSL;
'typedef void *P3PHANDLE;
%EQUATE `URL_LIMIT = %INTERNET_MAX_URL_LENGTH
' // Size = 20 bytes
TYPE P3PResource DWORD
 pszLocation AS ASCIIZ PTR ' P3PCURL
 pszVerb AS ASCIIZ PTR ' P3PVERB
 pszP3PHeaderRef AS ASCIIZ PTR ' P3PCURL
 pszLinkTagRef AS ASCIIZ PTR ' P3PCURL
 pContainer AS P3PResource PTR ' struct P3PResource *
END TYPE
' // Size = 20 bytes
TYPE P3PSignal DWORD
 ' /* Window handle for PostMessage and corresponding msg value */
 hwnd AS DWORD
 message AS DWORD ' unsigned int
 ' /* Event handle to signal */
 hEvent AS DWORD
 ' /* Application-defined context */
 pContext AS DWORD ' void *
 ' /* OUT: request handle */
 hRequest AS DWORD ' P3PHANDLE
END TYPE
' enum P3PStatus
%EQUATE `P3PStatus_Done = &H0
%EQUATE `P3PStatus_Success = &H0
%EQUATE `P3PStatus_NoPolicy = &H2
%EQUATE `P3PStatus_InProgress = &H3
%EQUATE `P3PStatus_Failed = &H4
%EQUATE `P3PStatus_NotFound = &H5
%EQUATE `P3PStatus_FormatErr = &H6
%EQUATE `P3PStatus_Cancelled = &H7
%EQUATE `P3PStatus_NotStarted = &H8
%EQUATE `P3PStatus_XMLError = &H9
%EQUATE `P3PStatus_Expired = &HA
%EQUATE `P3PStatus_Error = &HFF
DECLARE FUNCTION MapResourceToPolicy LIB "wininet.dll" ALIAS "MapResourceToPolicy" ( BYREF pResource AS P3PResource , BYREF pszPolicy AS ASCIIZ , BYVAL dwSize AS QUAD , BYREF pSignal AS P3PSignal ) AS LONG ' int
DECLARE FUNCTION GetP3PPolicy LIB "wininet.dll" ALIAS "GetP3PPolicy" ( BYREF pszPolicyURL AS ASCIIZ , BYVAL hDestination AS QUAD , BYVAL pszXSLtransform AS WSTRING , BYREF pSignal AS P3PSignal ) AS LONG ' int
DECLARE FUNCTION FreeP3PObject LIB "wininet.dll" ALIAS "FreeP3PObject" ( BYVAL hObject AS QUAD ) AS LONG ' int
DECLARE FUNCTION GetP3PRequestStatus LIB "wininet.dll" ALIAS "GetP3PRequestStatus" ( BYVAL hObject AS QUAD ) AS LONG ' int
#ENDIF
