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.

303 lines
9.2 KiB

  1. /*****************************************************************************\
  2. * *
  3. * winver.h - Version management functions, types, and definitions *
  4. * *
  5. * Include file for VER.DLL. This library is *
  6. * designed to allow version stamping of Windows executable files*
  7. * and of special .VER files for DOS executable files. *
  8. * *
  9. * Copyright (c) Microsoft Corporation. All rights reserved. *
  10. * *
  11. \*****************************************************************************/
  12. #ifndef VER_H
  13. #define VER_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* ----- Symbols ----- */
  18. #define VS_FILE_INFO RT_VERSION
  19. #define VS_VERSION_INFO 1
  20. #define VS_USER_DEFINED 100
  21. /* ----- VS_VERSION.dwFileFlags ----- */
  22. #ifndef _MAC
  23. #define VS_FFI_SIGNATURE 0xFEEF04BDL
  24. #else
  25. #define VS_FFI_SIGNATURE 0xBD04EFFEL
  26. #endif
  27. #define VS_FFI_STRUCVERSION 0x00010000L
  28. #define VS_FFI_FILEFLAGSMASK 0x0000003FL
  29. /* ----- VS_VERSION.dwFileFlags ----- */
  30. #define VS_FF_DEBUG 0x00000001L
  31. #define VS_FF_PRERELEASE 0x00000002L
  32. #define VS_FF_PATCHED 0x00000004L
  33. #define VS_FF_PRIVATEBUILD 0x00000008L
  34. #define VS_FF_INFOINFERRED 0x00000010L
  35. #define VS_FF_SPECIALBUILD 0x00000020L
  36. /* ----- VS_VERSION.dwFileOS ----- */
  37. #define VOS_UNKNOWN 0x00000000L
  38. #define VOS_DOS 0x00010000L
  39. #define VOS_OS216 0x00020000L
  40. #define VOS_OS232 0x00030000L
  41. #define VOS_NT 0x00040000L
  42. #define VOS__BASE 0x00000000L
  43. #define VOS__WINDOWS16 0x00000001L
  44. #define VOS__PM16 0x00000002L
  45. #define VOS__PM32 0x00000003L
  46. #define VOS__WINDOWS32 0x00000004L
  47. #define VOS_DOS_WINDOWS16 0x00010001L
  48. #define VOS_DOS_WINDOWS32 0x00010004L
  49. #define VOS_OS216_PM16 0x00020002L
  50. #define VOS_OS232_PM32 0x00030003L
  51. #define VOS_NT_WINDOWS32 0x00040004L
  52. /* ----- VS_VERSION.dwFileType ----- */
  53. #define VFT_UNKNOWN 0x00000000L
  54. #define VFT_APP 0x00000001L
  55. #define VFT_DLL 0x00000002L
  56. #define VFT_DRV 0x00000003L
  57. #define VFT_FONT 0x00000004L
  58. #define VFT_VXD 0x00000005L
  59. #define VFT_STATIC_LIB 0x00000007L
  60. /* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_DRV ----- */
  61. #define VFT2_UNKNOWN 0x00000000L
  62. #define VFT2_DRV_PRINTER 0x00000001L
  63. #define VFT2_DRV_KEYBOARD 0x00000002L
  64. #define VFT2_DRV_LANGUAGE 0x00000003L
  65. #define VFT2_DRV_DISPLAY 0x00000004L
  66. #define VFT2_DRV_MOUSE 0x00000005L
  67. #define VFT2_DRV_NETWORK 0x00000006L
  68. #define VFT2_DRV_SYSTEM 0x00000007L
  69. #define VFT2_DRV_INSTALLABLE 0x00000008L
  70. #define VFT2_DRV_SOUND 0x00000009L
  71. #define VFT2_DRV_COMM 0x0000000AL
  72. #define VFT2_DRV_INPUTMETHOD 0x0000000BL
  73. #define VFT2_DRV_VERSIONED_PRINTER 0x0000000CL
  74. /* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT ----- */
  75. #define VFT2_FONT_RASTER 0x00000001L
  76. #define VFT2_FONT_VECTOR 0x00000002L
  77. #define VFT2_FONT_TRUETYPE 0x00000003L
  78. /* ----- VerFindFile() flags ----- */
  79. #define VFFF_ISSHAREDFILE 0x0001
  80. #define VFF_CURNEDEST 0x0001
  81. #define VFF_FILEINUSE 0x0002
  82. #define VFF_BUFFTOOSMALL 0x0004
  83. /* ----- VerInstallFile() flags ----- */
  84. #define VIFF_FORCEINSTALL 0x0001
  85. #define VIFF_DONTDELETEOLD 0x0002
  86. #define VIF_TEMPFILE 0x00000001L
  87. #define VIF_MISMATCH 0x00000002L
  88. #define VIF_SRCOLD 0x00000004L
  89. #define VIF_DIFFLANG 0x00000008L
  90. #define VIF_DIFFCODEPG 0x00000010L
  91. #define VIF_DIFFTYPE 0x00000020L
  92. #define VIF_WRITEPROT 0x00000040L
  93. #define VIF_FILEINUSE 0x00000080L
  94. #define VIF_OUTOFSPACE 0x00000100L
  95. #define VIF_ACCESSVIOLATION 0x00000200L
  96. #define VIF_SHARINGVIOLATION 0x00000400L
  97. #define VIF_CANNOTCREATE 0x00000800L
  98. #define VIF_CANNOTDELETE 0x00001000L
  99. #define VIF_CANNOTRENAME 0x00002000L
  100. #define VIF_CANNOTDELETECUR 0x00004000L
  101. #define VIF_OUTOFMEMORY 0x00008000L
  102. #define VIF_CANNOTREADSRC 0x00010000L
  103. #define VIF_CANNOTREADDST 0x00020000L
  104. #define VIF_BUFFTOOSMALL 0x00040000L
  105. #define VIF_CANNOTLOADLZ32 0x00080000L
  106. #define VIF_CANNOTLOADCABINET 0x00100000L
  107. #ifndef RC_INVOKED /* RC doesn't need to see the rest of this */
  108. /* ----- Types and structures ----- */
  109. typedef struct tagVS_FIXEDFILEINFO
  110. {
  111. DWORD dwSignature; /* e.g. 0xfeef04bd */
  112. DWORD dwStrucVersion; /* e.g. 0x00000042 = "0.42" */
  113. DWORD dwFileVersionMS; /* e.g. 0x00030075 = "3.75" */
  114. DWORD dwFileVersionLS; /* e.g. 0x00000031 = "0.31" */
  115. DWORD dwProductVersionMS; /* e.g. 0x00030010 = "3.10" */
  116. DWORD dwProductVersionLS; /* e.g. 0x00000031 = "0.31" */
  117. DWORD dwFileFlagsMask; /* = 0x3F for version "0.42" */
  118. DWORD dwFileFlags; /* e.g. VFF_DEBUG | VFF_PRERELEASE */
  119. DWORD dwFileOS; /* e.g. VOS_DOS_WINDOWS16 */
  120. DWORD dwFileType; /* e.g. VFT_DRIVER */
  121. DWORD dwFileSubtype; /* e.g. VFT2_DRV_KEYBOARD */
  122. DWORD dwFileDateMS; /* e.g. 0 */
  123. DWORD dwFileDateLS; /* e.g. 0 */
  124. } VS_FIXEDFILEINFO;
  125. /* ----- Function prototypes ----- */
  126. DWORD
  127. APIENTRY
  128. VerFindFileA(
  129. DWORD uFlags,
  130. LPSTR szFileName,
  131. LPSTR szWinDir,
  132. LPSTR szAppDir,
  133. LPSTR szCurDir,
  134. PUINT lpuCurDirLen,
  135. LPSTR szDestDir,
  136. PUINT lpuDestDirLen
  137. );
  138. DWORD
  139. APIENTRY
  140. VerFindFileW(
  141. DWORD uFlags,
  142. LPWSTR szFileName,
  143. LPWSTR szWinDir,
  144. LPWSTR szAppDir,
  145. LPWSTR szCurDir,
  146. PUINT lpuCurDirLen,
  147. LPWSTR szDestDir,
  148. PUINT lpuDestDirLen
  149. );
  150. #ifdef UNICODE
  151. #define VerFindFile VerFindFileW
  152. #else
  153. #define VerFindFile VerFindFileA
  154. #endif // !UNICODE
  155. DWORD
  156. APIENTRY
  157. VerInstallFileA(
  158. DWORD uFlags,
  159. LPSTR szSrcFileName,
  160. LPSTR szDestFileName,
  161. LPSTR szSrcDir,
  162. LPSTR szDestDir,
  163. LPSTR szCurDir,
  164. LPSTR szTmpFile,
  165. PUINT lpuTmpFileLen
  166. );
  167. DWORD
  168. APIENTRY
  169. VerInstallFileW(
  170. DWORD uFlags,
  171. LPWSTR szSrcFileName,
  172. LPWSTR szDestFileName,
  173. LPWSTR szSrcDir,
  174. LPWSTR szDestDir,
  175. LPWSTR szCurDir,
  176. LPWSTR szTmpFile,
  177. PUINT lpuTmpFileLen
  178. );
  179. #ifdef UNICODE
  180. #define VerInstallFile VerInstallFileW
  181. #else
  182. #define VerInstallFile VerInstallFileA
  183. #endif // !UNICODE
  184. /* Returns size of version info in bytes */
  185. DWORD
  186. APIENTRY
  187. GetFileVersionInfoSizeA(
  188. LPSTR lptstrFilename, /* Filename of version stamped file */
  189. LPDWORD lpdwHandle
  190. ); /* Information for use by GetFileVersionInfo */
  191. /* Returns size of version info in bytes */
  192. DWORD
  193. APIENTRY
  194. GetFileVersionInfoSizeW(
  195. LPWSTR lptstrFilename, /* Filename of version stamped file */
  196. LPDWORD lpdwHandle
  197. ); /* Information for use by GetFileVersionInfo */
  198. #ifdef UNICODE
  199. #define GetFileVersionInfoSize GetFileVersionInfoSizeW
  200. #else
  201. #define GetFileVersionInfoSize GetFileVersionInfoSizeA
  202. #endif // !UNICODE
  203. /* Read version info into buffer */
  204. BOOL
  205. APIENTRY
  206. GetFileVersionInfoA(
  207. LPSTR lptstrFilename, /* Filename of version stamped file */
  208. DWORD dwHandle, /* Information from GetFileVersionSize */
  209. DWORD dwLen, /* Length of buffer for info */
  210. LPVOID lpData
  211. ); /* Buffer to place the data structure */
  212. /* Read version info into buffer */
  213. BOOL
  214. APIENTRY
  215. GetFileVersionInfoW(
  216. LPWSTR lptstrFilename, /* Filename of version stamped file */
  217. DWORD dwHandle, /* Information from GetFileVersionSize */
  218. DWORD dwLen, /* Length of buffer for info */
  219. LPVOID lpData
  220. ); /* Buffer to place the data structure */
  221. #ifdef UNICODE
  222. #define GetFileVersionInfo GetFileVersionInfoW
  223. #else
  224. #define GetFileVersionInfo GetFileVersionInfoA
  225. #endif // !UNICODE
  226. DWORD
  227. APIENTRY
  228. VerLanguageNameA(
  229. DWORD wLang,
  230. LPSTR szLang,
  231. DWORD nSize
  232. );
  233. DWORD
  234. APIENTRY
  235. VerLanguageNameW(
  236. DWORD wLang,
  237. LPWSTR szLang,
  238. DWORD nSize
  239. );
  240. #ifdef UNICODE
  241. #define VerLanguageName VerLanguageNameW
  242. #else
  243. #define VerLanguageName VerLanguageNameA
  244. #endif // !UNICODE
  245. BOOL
  246. APIENTRY
  247. VerQueryValueA(
  248. const LPVOID pBlock,
  249. LPSTR lpSubBlock,
  250. LPVOID * lplpBuffer,
  251. PUINT puLen
  252. );
  253. BOOL
  254. APIENTRY
  255. VerQueryValueW(
  256. const LPVOID pBlock,
  257. LPWSTR lpSubBlock,
  258. LPVOID * lplpBuffer,
  259. PUINT puLen
  260. );
  261. #ifdef UNICODE
  262. #define VerQueryValue VerQueryValueW
  263. #else
  264. #define VerQueryValue VerQueryValueA
  265. #endif // !UNICODE
  266. #endif /* !RC_INVOKED */
  267. #ifdef __cplusplus
  268. }
  269. #endif
  270. #endif /* !VER_H */