' ########################################################################################
' Microsoft Windows
' File: WinVer.inc
' Contents: Include file for VER.DLL. This library is designed to allow version stamping
' of Windows executable files* and of special .VER files for DOS executable files.
' Copyright (c) 2010 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_WinVer_PBI)
#DEFINE PBX_WinVer_PBI
%EQUATE `WINVER_INC = 1
#INCLUDE ONCE "Legacy/System/VerRsrc.inc"
#INCLUDE ONCE "Core/Windows.inc"
'/* ----- Function prototypes ----- */
DECLARE FUNCTION VerFindFileA LIB "version.dll" ALIAS "VerFindFileA" ( BYVAL uFlags AS QUAD , BYREF szFileName AS ASCIIZ , BYREF szWinDir AS ASCIIZ , BYREF szAppDir AS ASCIIZ , BYREF szCurDir AS ASCIIZ , BYREF lpuCurDirLen AS QUAD , BYREF szDestDir AS ASCIIZ , BYREF lpuDestDirLen AS QUAD ) AS QUAD
DECLARE FUNCTION VerFindFileW LIB "version.dll" ALIAS "VerFindFileW" ( BYVAL uFlags AS QUAD
 , BYREF szFileName AS WSTRINGZ
 , BYREF szWinDir AS WSTRINGZ
 , BYREF szAppDir AS WSTRINGZ
 , BYREF szCurDir AS WSTRINGZ
 , BYREF lpuCurDirLen AS DWORD
 , BYREF szDestDir AS WSTRINGZ
 , BYREF lpuDestDirLen AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO VerFindFile = VerFindFileW
#ELSE
 MACRO VerFindFile = VerFindFileA
#ENDIF
DECLARE FUNCTION VerInstallFileA LIB "version.dll" ALIAS "VerInstallFileA" ( BYVAL uFlags AS QUAD , BYREF szSrcFileName AS ASCIIZ , BYREF szDestFileName AS ASCIIZ , BYREF szSrcDir AS ASCIIZ , BYREF szDestDir AS ASCIIZ , BYREF szCurDir AS ASCIIZ , BYREF szTmpFile AS ASCIIZ , BYREF lpuTmpFileLen AS QUAD ) AS QUAD
DECLARE FUNCTION VerInstallFileW LIB "version.dll" ALIAS "VerInstallFileW" ( BYVAL uFlags AS QUAD
 , BYREF szSrcFileName AS WSTRINGZ
 , BYREF szDestFileName AS WSTRINGZ
 , BYREF szSrcDir AS WSTRINGZ
 , BYREF szDestDir AS WSTRINGZ
 , BYREF szCurDir AS WSTRINGZ
 , BYREF szTmpFile AS WSTRINGZ
 , BYREF lpuTmpFileLen AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO VerInstallFile = VerInstallFileW
#ELSE
 MACRO VerInstallFile = VerInstallFileA
#ENDIF
'/* Returns size of version info in bytes */
DECLARE FUNCTION GetFileVersionInfoSizeA LIB "version.dll" ALIAS "GetFileVersionInfoSizeA" ( BYREF lptstrFilename AS ASCIIZ , OPTIONAL BYREF lpdwHandle AS QUAD ) AS QUAD
'/* Returns size of version info in bytes */
DECLARE FUNCTION GetFileVersionInfoSizeW LIB "version.dll" ALIAS "GetFileVersionInfoSizeW" ( BYREF lptstrFilename AS WSTRINGZ , OPTIONAL BYREF lpdwHandle AS QUAD ) AS QUAD
#IF %DEF(%UNICODE)
 MACRO GetFileVersionInfoSize = GetFileVersionInfoSizeW
#ELSE
 MACRO GetFileVersionInfoSize = GetFileVersionInfoSizeA
#ENDIF
DECLARE FUNCTION GetFileVersionInfoA LIB "version.dll" ALIAS "GetFileVersionInfoA" ( BYREF lptstrFilename AS ASCIIZ , BYVAL dwHandle AS QUAD , BYVAL dwLen AS QUAD , BYREF lpData AS ANY ) AS LONG
DECLARE FUNCTION GetFileVersionInfoW LIB "version.dll" ALIAS "GetFileVersionInfoW" ( BYREF lptstrFilename AS WSTRINGZ
 , BYVAL dwHandle AS DWORD
 , BYVAL dwLen AS DWORD
 , BYREF lpData AS ANY
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetFileVersionInfo = GetFileVersionInfoW
#ELSE
 MACRO GetFileVersionInfo = GetFileVersionInfoA
#ENDIF
DECLARE FUNCTION GetFileVersionInfoSizeExA LIB "version.dll" ALIAS "GetFileVersionInfoSizeExA" ( BYVAL dwFlags AS QUAD , BYREF lptstrFilename AS ASCIIZ , OPTIONAL BYREF lpdwHandle AS QUAD ) AS QUAD
DECLARE FUNCTION GetFileVersionInfoSizeExW LIB "version.dll" ALIAS "GetFileVersionInfoSizeExW" ( BYVAL dwFlags AS QUAD
 , BYREF lptstrFilename AS WSTRINGZ
 , OPTIONAL BYREF lpdwHandle AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO GetFileVersionInfoSizeEx = GetFileVersionInfoSizeExW
#ELSE
 MACRO GetFileVersionInfoSizeEx = GetFileVersionInfoSizeExA
#ENDIF
DECLARE FUNCTION VerLanguageNameA LIB "kernel32.dll" ALIAS "VerLanguageNameA" ( BYVAL wLang AS QUAD , BYREF szLang AS ASCIIZ , BYVAL nSize AS QUAD ) AS QUAD
DECLARE FUNCTION VerLanguageNameW LIB "kernel32.dll" ALIAS "VerLanguageNameW" ( BYVAL wLang AS QUAD
 , BYREF szLang AS WSTRINGZ
 , BYVAL nSize AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO VerLanguageName = VerLanguageNameW
#ELSE
 MACRO VerLanguageName = VerLanguageNameA
#ENDIF
DECLARE FUNCTION VerQueryValueA LIB "version.dll" ALIAS "VerQueryValueA" ( BYVAL pBlock AS QUAD , BYREF lpSubBlock AS ASCIIZ , BYREF lplpBuffer AS ANY , BYREF puLen AS QUAD ) AS LONG
DECLARE FUNCTION VerQueryValueW LIB "version.dll" ALIAS "VerQueryValueW" ( BYVAL pBlock AS QUAD
 , BYREF lpSubBlock AS WSTRINGZ
 , BYREF lplpBuffer AS ANY
 , BYREF puLen AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO VerQueryValue = VerQueryValueW
#ELSE
 MACRO VerQueryValue = VerQueryValueA
#ENDIF
#ENDIF
