Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
9.0 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ver.h - Version management functions, types, and definitions *
  4. * *
  5. * Include file for VER.DLL and VER.LIB. These libraries are *
  6. * designed to allow version stamping of Windows executable files*
  7. * and of special .VER files for DOS executable files. *
  8. * *
  9. * The API is unchanged for LIB and DLL versions. *
  10. * *
  11. * Copyright (c) 1992-1994, Microsoft Corp. All rights reserved *
  12. * *
  13. *******************************************************************************
  14. *
  15. * #define LIB - To be used with VER.LIB (default is for VER.DLL)
  16. *
  17. \*****************************************************************************/
  18. #ifndef _INC_VER
  19. #define _INC_VER
  20. #ifndef RC_INVOKED
  21. #pragma pack(1) /* Assume byte packing throughout */
  22. #endif /* RC_INVOKED */
  23. #ifdef __cplusplus
  24. extern "C" { /* Assume C declarations for C++ */
  25. #endif /* __cplusplus */
  26. /*
  27. * If .lib version is being used, declare types used in this file.
  28. */
  29. #ifdef LIB
  30. #ifndef WINAPI /* don't declare if they're already declared */
  31. #define WINAPI _far _pascal
  32. #define NEAR _near
  33. #define FAR _far
  34. #define PASCAL _pascal
  35. typedef int BOOL;
  36. #define TRUE 1
  37. #define FALSE 0
  38. typedef unsigned char BYTE;
  39. typedef unsigned short WORD;
  40. typedef unsigned int UINT;
  41. typedef signed long LONG;
  42. typedef unsigned long DWORD;
  43. typedef char far* LPSTR;
  44. typedef const char far* LPCSTR;
  45. typedef int HFILE;
  46. #define OFSTRUCT void /* Not used by the .lib version */
  47. #define LOWORD(l) ((WORD)(l))
  48. #define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  49. #define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i)))
  50. #endif /* WINAPI */
  51. #else /* LIB */
  52. /* If .dll version is being used and we're being included with
  53. * the 3.0 windows.h, #define compatible type aliases.
  54. * If included with the 3.0 windows.h, #define compatible aliases
  55. */
  56. #ifndef _INC_WINDOWS
  57. #define UINT WORD
  58. #define LPCSTR LPSTR
  59. #define HFILE int
  60. #endif /* !_INC_WINDOWS */
  61. #endif /* !LIB */
  62. /* ----- RC defines ----- */
  63. #ifdef RC_INVOKED
  64. #define ID(id) id
  65. #else
  66. #define ID(id) MAKEINTRESOURCE(id)
  67. #endif
  68. /* ----- Symbols ----- */
  69. #define VS_FILE_INFO ID(16) /* Version stamp res type */
  70. #define VS_VERSION_INFO ID(1) /* Version stamp res ID */
  71. #define VS_USER_DEFINED ID(100) /* User-defined res IDs */
  72. /* ----- VS_VERSION.dwFileFlags ----- */
  73. #define VS_FFI_SIGNATURE 0xFEEF04BDL
  74. #define VS_FFI_STRUCVERSION 0x00010000L
  75. #define VS_FFI_FILEFLAGSMASK 0x0000003FL
  76. /* ----- VS_VERSION.dwFileFlags ----- */
  77. #define VS_FF_DEBUG 0x00000001L
  78. #define VS_FF_PRERELEASE 0x00000002L
  79. #define VS_FF_PATCHED 0x00000004L
  80. #define VS_FF_PRIVATEBUILD 0x00000008L
  81. #define VS_FF_INFOINFERRED 0x00000010L
  82. #define VS_FF_SPECIALBUILD 0x00000020L
  83. /* ----- VS_VERSION.dwFileOS ----- */
  84. #define VOS_UNKNOWN 0x00000000L
  85. #define VOS_DOS 0x00010000L
  86. #define VOS_OS216 0x00020000L
  87. #define VOS_OS232 0x00030000L
  88. #define VOS_NT 0x00040000L
  89. #define VOS__BASE 0x00000000L
  90. #define VOS__WINDOWS16 0x00000001L
  91. #define VOS__PM16 0x00000002L
  92. #define VOS__PM32 0x00000003L
  93. #define VOS__WINDOWS32 0x00000004L
  94. #define VOS_DOS_WINDOWS16 0x00010001L
  95. #define VOS_DOS_WINDOWS32 0x00010004L
  96. #define VOS_OS216_PM16 0x00020002L
  97. #define VOS_OS232_PM32 0x00030003L
  98. #define VOS_NT_WINDOWS32 0x00040004L
  99. /* ----- VS_VERSION.dwFileType ----- */
  100. #define VFT_UNKNOWN 0x00000000L
  101. #define VFT_APP 0x00000001L
  102. #define VFT_DLL 0x00000002L
  103. #define VFT_DRV 0x00000003L
  104. #define VFT_FONT 0x00000004L
  105. #define VFT_VXD 0x00000005L
  106. #define VFT_STATIC_LIB 0x00000007L
  107. /* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_DRV ----- */
  108. #define VFT2_UNKNOWN 0x00000000L
  109. #define VFT2_DRV_PRINTER 0x00000001L
  110. #define VFT2_DRV_KEYBOARD 0x00000002L
  111. #define VFT2_DRV_LANGUAGE 0x00000003L
  112. #define VFT2_DRV_DISPLAY 0x00000004L
  113. #define VFT2_DRV_MOUSE 0x00000005L
  114. #define VFT2_DRV_NETWORK 0x00000006L
  115. #define VFT2_DRV_SYSTEM 0x00000007L
  116. #define VFT2_DRV_INSTALLABLE 0x00000008L
  117. #define VFT2_DRV_SOUND 0x00000009L
  118. #define VFT2_DRV_COMM 0x0000000AL
  119. #define VFT2_DRV_INPUTMETHOD 0x0000000BL
  120. /* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT ----- */
  121. #define VFT2_FONT_RASTER 0x00000001L
  122. #define VFT2_FONT_VECTOR 0x00000002L
  123. #define VFT2_FONT_TRUETYPE 0x00000003L
  124. /* ----- VerFindFile() flags ----- */
  125. #define VFFF_ISSHAREDFILE 0x0001
  126. #define VFF_CURNEDEST 0x0001
  127. #define VFF_FILEINUSE 0x0002
  128. #define VFF_BUFFTOOSMALL 0x0004
  129. /* ----- VerInstallFile() flags ----- */
  130. #define VIFF_FORCEINSTALL 0x0001
  131. #define VIFF_DONTDELETEOLD 0x0002
  132. #define VIF_TEMPFILE 0x00000001L
  133. #define VIF_MISMATCH 0x00000002L
  134. #define VIF_SRCOLD 0x00000004L
  135. #define VIF_DIFFLANG 0x00000008L
  136. #define VIF_DIFFCODEPG 0x00000010L
  137. #define VIF_DIFFTYPE 0x00000020L
  138. #define VIF_WRITEPROT 0x00000040L
  139. #define VIF_FILEINUSE 0x00000080L
  140. #define VIF_OUTOFSPACE 0x00000100L
  141. #define VIF_ACCESSVIOLATION 0x00000200L
  142. #define VIF_SHARINGVIOLATION 0x00000400L
  143. #define VIF_CANNOTCREATE 0x00000800L
  144. #define VIF_CANNOTDELETE 0x00001000L
  145. #define VIF_CANNOTRENAME 0x00002000L
  146. #define VIF_CANNOTDELETECUR 0x00004000L
  147. #define VIF_OUTOFMEMORY 0x00008000L
  148. #define VIF_CANNOTREADSRC 0x00010000L
  149. #define VIF_CANNOTREADDST 0x00020000L
  150. #define VIF_BUFFTOOSMALL 0x00040000L
  151. #ifndef RC_INVOKED /* RC doesn't need to see the rest of this */
  152. /* ----- Types and structures ----- */
  153. typedef signed short int SHORT;
  154. typedef struct tagVS_FIXEDFILEINFO
  155. {
  156. DWORD dwSignature; /* e.g. 0xfeef04bd */
  157. DWORD dwStrucVersion; /* e.g. 0x00000042 = "0.42" */
  158. DWORD dwFileVersionMS; /* e.g. 0x00030075 = "3.75" */
  159. DWORD dwFileVersionLS; /* e.g. 0x00000031 = "0.31" */
  160. DWORD dwProductVersionMS; /* e.g. 0x00030010 = "3.10" */
  161. DWORD dwProductVersionLS; /* e.g. 0x00000031 = "0.31" */
  162. DWORD dwFileFlagsMask; /* = 0x3F for version "0.42" */
  163. DWORD dwFileFlags; /* e.g. VFF_DEBUG | VFF_PRERELEASE */
  164. DWORD dwFileOS; /* e.g. VOS_DOS_WINDOWS16 */
  165. DWORD dwFileType; /* e.g. VFT_DRIVER */
  166. DWORD dwFileSubtype; /* e.g. VFT2_DRV_KEYBOARD */
  167. DWORD dwFileDateMS; /* e.g. 0 */
  168. DWORD dwFileDateLS; /* e.g. 0 */
  169. } VS_FIXEDFILEINFO;
  170. /* ----- Function prototypes ----- */
  171. UINT WINAPI VerFindFile(UINT uFlags, LPCSTR szFileName,
  172. LPCSTR szWinDir, LPCSTR szAppDir,
  173. LPSTR szCurDir, UINT FAR* lpuCurDirLen,
  174. LPSTR szDestDir, UINT FAR* lpuDestDirLen);
  175. DWORD WINAPI VerInstallFile(UINT uFlags,
  176. LPCSTR szSrcFileName, LPCSTR szDestFileName, LPCSTR szSrcDir,
  177. LPCSTR szDestDir, LPCSTR szCurDir, LPSTR szTmpFile, UINT FAR* lpuTmpFileLen);
  178. /* Returns size of version info in bytes */
  179. DWORD WINAPI GetFileVersionInfoSize(
  180. LPCSTR lpstrFilename, /* Filename of version stamped file */
  181. DWORD FAR *lpdwHandle); /* Information for use by GetFileVersionInfo */
  182. /* Read version info into buffer */
  183. BOOL WINAPI GetFileVersionInfo(
  184. LPCSTR lpstrFilename, /* Filename of version stamped file */
  185. DWORD dwHandle, /* Information from GetFileVersionSize */
  186. DWORD dwLen, /* Length of buffer for info */
  187. void FAR* lpData); /* Buffer to place the data structure */
  188. /* Returns size of resource in bytes */
  189. DWORD WINAPI GetFileResourceSize(
  190. LPCSTR lpstrFilename, /* Filename of version stamped file */
  191. LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
  192. LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
  193. DWORD FAR *lpdwFileOffset); /* Returns file offset of resource */
  194. /* Reads file resource into buffer */
  195. BOOL WINAPI GetFileResource(
  196. LPCSTR lpstrFilename, /* Filename of version stamped file */
  197. LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
  198. LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
  199. DWORD dwFileOffset, /* File offset or NULL */
  200. DWORD dwResLen, /* Length of resource to read or NULL */
  201. void FAR* lpData); /* Pointer to data buffer */
  202. UINT WINAPI VerLanguageName(UINT wLang, LPSTR szLang, UINT nSize);
  203. #ifdef LIB
  204. UINT WINAPI GetWindowsDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
  205. UINT WINAPI GetSystemDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
  206. #endif /* LIB */
  207. BOOL WINAPI VerQueryValue(const void FAR* pBlock, LPCSTR lpSubBlock,
  208. void FAR* FAR* lplpBuffer, UINT FAR* lpuLen);
  209. #ifdef __cplusplus
  210. }
  211. #endif /* __cplusplus */
  212. #pragma pack()
  213. #endif /* !RC_INVOKED */
  214. #endif /* !_INC_VER */