module win32.ansi.winver;

// Translated from Microsoft Platform SDK August 2001 Edition
// by Y.Tomino (demoonlit@inter7.jp)

import win32.ansi.winuser;

// #ifndef VER_H
// #define VER_H

// #ifdef __cplusplus
// extern "C" {
// #endif

alias RT_VERSION VS_FILE_INFO;
enum : uint { VS_VERSION_INFO = 1 }
enum : uint { VS_USER_DEFINED = 100 }

// #ifndef _MAC
enum : uint { VS_FFI_SIGNATURE = 0xFEEF04BD }
// #else
// #...
// #endif
enum : uint { VS_FFI_STRUCVERSION = 0x00010000 }
enum : uint { VS_FFI_FILEFLAGSMASK = 0x0000003F }

enum : uint { VS_FF_DEBUG = 0x00000001 }
enum : uint { VS_FF_PRERELEASE = 0x00000002 }
enum : uint { VS_FF_PATCHED = 0x00000004 }
enum : uint { VS_FF_PRIVATEBUILD = 0x00000008 }
enum : uint { VS_FF_INFOINFERRED = 0x00000010 }
enum : uint { VS_FF_SPECIALBUILD = 0x00000020 }

enum : uint { VOS_UNKNOWN = 0x00000000 }
enum : uint { VOS_DOS = 0x00010000 }
enum : uint { VOS_OS216 = 0x00020000 }
enum : uint { VOS_OS232 = 0x00030000 }
enum : uint { VOS_NT = 0x00040000 }

enum : uint { VOS__BASE = 0x00000000 }
enum : uint { VOS__WINDOWS16 = 0x00000001 }
enum : uint { VOS__PM16 = 0x00000002 }
enum : uint { VOS__PM32 = 0x00000003 }
enum : uint { VOS__WINDOWS32 = 0x00000004 }

enum : uint { VOS_DOS_WINDOWS16 = 0x00010001 }
enum : uint { VOS_DOS_WINDOWS32 = 0x00010004 }
enum : uint { VOS_OS216_PM16 = 0x00020002 }
enum : uint { VOS_OS232_PM32 = 0x00030003 }
enum : uint { VOS_NT_WINDOWS32 = 0x00040004 }

enum : uint { VFT_UNKNOWN = 0x00000000 }
enum : uint { VFT_APP = 0x00000001 }
enum : uint { VFT_DLL = 0x00000002 }
enum : uint { VFT_DRV = 0x00000003 }
enum : uint { VFT_FONT = 0x00000004 }
enum : uint { VFT_VXD = 0x00000005 }
enum : uint { VFT_STATIC_LIB = 0x00000007 }

enum : uint { VFT2_UNKNOWN = 0x00000000 }
enum : uint { VFT2_DRV_PRINTER = 0x00000001 }
enum : uint { VFT2_DRV_KEYBOARD = 0x00000002 }
enum : uint { VFT2_DRV_LANGUAGE = 0x00000003 }
enum : uint { VFT2_DRV_DISPLAY = 0x00000004 }
enum : uint { VFT2_DRV_MOUSE = 0x00000005 }
enum : uint { VFT2_DRV_NETWORK = 0x00000006 }
enum : uint { VFT2_DRV_SYSTEM = 0x00000007 }
enum : uint { VFT2_DRV_INSTALLABLE = 0x00000008 }
enum : uint { VFT2_DRV_SOUND = 0x00000009 }
enum : uint { VFT2_DRV_COMM = 0x0000000A }
enum : uint { VFT2_DRV_INPUTMETHOD = 0x0000000B }
enum : uint { VFT2_DRV_VERSIONED_PRINTER = 0x0000000C }

enum : uint { VFT2_FONT_RASTER = 0x00000001 }
enum : uint { VFT2_FONT_VECTOR = 0x00000002 }
enum : uint { VFT2_FONT_TRUETYPE = 0x00000003 }

enum : uint { VFFF_ISSHAREDFILE = 0x0001 }

enum : uint { VFF_CURNEDEST = 0x0001 }
enum : uint { VFF_FILEINUSE = 0x0002 }
enum : uint { VFF_BUFFTOOSMALL = 0x0004 }

enum : uint { VIFF_FORCEINSTALL = 0x0001 }
enum : uint { VIFF_DONTDELETEOLD = 0x0002 }

enum : uint { VIF_TEMPFILE = 0x00000001 }
enum : uint { VIF_MISMATCH = 0x00000002 }
enum : uint { VIF_SRCOLD = 0x00000004 }

enum : uint { VIF_DIFFLANG = 0x00000008 }
enum : uint { VIF_DIFFCODEPG = 0x00000010 }
enum : uint { VIF_DIFFTYPE = 0x00000020 }

enum : uint { VIF_WRITEPROT = 0x00000040 }
enum : uint { VIF_FILEINUSE = 0x00000080 }
enum : uint { VIF_OUTOFSPACE = 0x00000100 }
enum : uint { VIF_ACCESSVIOLATION = 0x00000200 }
enum : uint { VIF_SHARINGVIOLATION = 0x00000400 }
enum : uint { VIF_CANNOTCREATE = 0x00000800 }
enum : uint { VIF_CANNOTDELETE = 0x00001000 }
enum : uint { VIF_CANNOTRENAME = 0x00002000 }
enum : uint { VIF_CANNOTDELETECUR = 0x00004000 }
enum : uint { VIF_OUTOFMEMORY = 0x00008000 }

enum : uint { VIF_CANNOTREADSRC = 0x00010000 }
enum : uint { VIF_CANNOTREADDST = 0x00020000 }

enum : uint { VIF_BUFFTOOSMALL = 0x00040000 }
enum : uint { VIF_CANNOTLOADLZ32 = 0x00080000 }
enum : uint { VIF_CANNOTLOADCABINET = 0x00100000 }

// #ifndef RC_INVOKED              /* RC doesn't need to see the rest of this */

struct tagVS_FIXEDFILEINFO {
  DWORD dwSignature;
  DWORD dwStrucVersion;
  DWORD dwFileVersionMS;
  DWORD dwFileVersionLS;
  DWORD dwProductVersionMS;
  DWORD dwProductVersionLS;
  DWORD dwFileFlagsMask;
  DWORD dwFileFlags;
  DWORD dwFileOS;
  DWORD dwFileType;
  DWORD dwFileSubtype;
  DWORD dwFileDateMS;
  DWORD dwFileDateLS;
}
alias tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO;

extern(Windows) export DWORD VerFindFileA(
  DWORD uFlags,
  LPSTR szFileName,
  LPSTR szWinDir,
  LPSTR szAppDir,
  LPSTR szCurDir,
  PUINT lpuCurDirLen,
  LPSTR szDestDir,
  PUINT lpuDestDirLen);
extern(Windows) export DWORD VerFindFileW(
  DWORD uFlags,
  LPWSTR szFileName,
  LPWSTR szWinDir,
  LPWSTR szAppDir,
  LPWSTR szCurDir,
  PUINT lpuCurDirLen,
  LPWSTR szDestDir,
  PUINT lpuDestDirLen);
// #ifdef UNICODE
// #...
// #else
alias VerFindFileA VerFindFile;
// #endif // !UNICODE

extern(Windows) export DWORD VerInstallFileA(
  DWORD uFlags,
  LPSTR szSrcFileName,
  LPSTR szDestFileName,
  LPSTR szSrcDir,
  LPSTR szDestDir,
  LPSTR szCurDir,
  LPSTR szTmpFile,
  PUINT lpuTmpFileLen);
extern(Windows) export DWORD VerInstallFileW(
  DWORD uFlags,
  LPWSTR szSrcFileName,
  LPWSTR szDestFileName,
  LPWSTR szSrcDir,
  LPWSTR szDestDir,
  LPWSTR szCurDir,
  LPWSTR szTmpFile,
  PUINT lpuTmpFileLen);
// #ifdef UNICODE
// #...
// #else
alias VerInstallFileA VerInstallFile;
// #endif // !UNICODE

extern(Windows) export DWORD GetFileVersionInfoSizeA(
  LPSTR lptstrFilename, 
  LPDWORD lpdwHandle);

extern(Windows) export DWORD GetFileVersionInfoSizeW(
  LPWSTR lptstrFilename, 
  LPDWORD lpdwHandle);
// #ifdef UNICODE
// #...
// #else
alias GetFileVersionInfoSizeA GetFileVersionInfoSize;
// #endif // !UNICODE

extern(Windows) export BOOL GetFileVersionInfoA(
  LPSTR lptstrFilename, 
  DWORD dwHandle, 
  DWORD dwLen, 
  LPVOID lpData);

extern(Windows) export BOOL GetFileVersionInfoW(
  LPWSTR lptstrFilename, 
  DWORD dwHandle, 
  DWORD dwLen, 
  LPVOID lpData);
// #ifdef UNICODE
// #...
// #else
alias GetFileVersionInfoA GetFileVersionInfo;
// #endif // !UNICODE

extern(Windows) export DWORD VerLanguageNameA(
  DWORD wLang,
  LPSTR szLang,
  DWORD nSize);
extern(Windows) export DWORD VerLanguageNameW(
  DWORD wLang,
  LPWSTR szLang,
  DWORD nSize);
// #ifdef UNICODE
// #...
// #else
alias VerLanguageNameA VerLanguageName;
// #endif // !UNICODE

extern(Windows) export BOOL VerQueryValueA(
  LPVOID pBlock,
  LPSTR lpSubBlock,
  LPVOID * lplpBuffer,
  PUINT puLen);
extern(Windows) export BOOL VerQueryValueW(
  LPVOID pBlock,
  LPWSTR lpSubBlock,
  LPVOID * lplpBuffer,
  PUINT puLen);
// #ifdef UNICODE
// #...
// #else
alias VerQueryValueA VerQueryValue;
// #endif // !UNICODE

// #endif  /* !RC_INVOKED */

// #ifdef __cplusplus
// }
// #endif

// #endif  /* !VER_H */

