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.

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