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.

255 lines
8.9 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, 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. /* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT ----- */
  120. #define VFT2_FONT_RASTER 0x00000001L
  121. #define VFT2_FONT_VECTOR 0x00000002L
  122. #define VFT2_FONT_TRUETYPE 0x00000003L
  123. /* ----- VerFindFile() flags ----- */
  124. #define VFFF_ISSHAREDFILE 0x0001
  125. #define VFF_CURNEDEST 0x0001
  126. #define VFF_FILEINUSE 0x0002
  127. #define VFF_BUFFTOOSMALL 0x0004
  128. /* ----- VerInstallFile() flags ----- */
  129. #define VIFF_FORCEINSTALL 0x0001
  130. #define VIFF_DONTDELETEOLD 0x0002
  131. #define VIF_TEMPFILE 0x00000001L
  132. #define VIF_MISMATCH 0x00000002L
  133. #define VIF_SRCOLD 0x00000004L
  134. #define VIF_DIFFLANG 0x00000008L
  135. #define VIF_DIFFCODEPG 0x00000010L
  136. #define VIF_DIFFTYPE 0x00000020L
  137. #define VIF_WRITEPROT 0x00000040L
  138. #define VIF_FILEINUSE 0x00000080L
  139. #define VIF_OUTOFSPACE 0x00000100L
  140. #define VIF_ACCESSVIOLATION 0x00000200L
  141. #define VIF_SHARINGVIOLATION 0x00000400L
  142. #define VIF_CANNOTCREATE 0x00000800L
  143. #define VIF_CANNOTDELETE 0x00001000L
  144. #define VIF_CANNOTRENAME 0x00002000L
  145. #define VIF_CANNOTDELETECUR 0x00004000L
  146. #define VIF_OUTOFMEMORY 0x00008000L
  147. #define VIF_CANNOTREADSRC 0x00010000L
  148. #define VIF_CANNOTREADDST 0x00020000L
  149. #define VIF_BUFFTOOSMALL 0x00040000L
  150. #ifndef RC_INVOKED /* RC doesn't need to see the rest of this */
  151. /* ----- Types and structures ----- */
  152. typedef signed short int SHORT;
  153. typedef struct tagVS_FIXEDFILEINFO
  154. {
  155. DWORD dwSignature; /* e.g. 0xfeef04bd */
  156. DWORD dwStrucVersion; /* e.g. 0x00000042 = "0.42" */
  157. DWORD dwFileVersionMS; /* e.g. 0x00030075 = "3.75" */
  158. DWORD dwFileVersionLS; /* e.g. 0x00000031 = "0.31" */
  159. DWORD dwProductVersionMS; /* e.g. 0x00030010 = "3.10" */
  160. DWORD dwProductVersionLS; /* e.g. 0x00000031 = "0.31" */
  161. DWORD dwFileFlagsMask; /* = 0x3F for version "0.42" */
  162. DWORD dwFileFlags; /* e.g. VFF_DEBUG | VFF_PRERELEASE */
  163. DWORD dwFileOS; /* e.g. VOS_DOS_WINDOWS16 */
  164. DWORD dwFileType; /* e.g. VFT_DRIVER */
  165. DWORD dwFileSubtype; /* e.g. VFT2_DRV_KEYBOARD */
  166. DWORD dwFileDateMS; /* e.g. 0 */
  167. DWORD dwFileDateLS; /* e.g. 0 */
  168. } VS_FIXEDFILEINFO;
  169. /* ----- Function prototypes ----- */
  170. UINT WINAPI VerFindFile(UINT uFlags, LPCSTR szFileName,
  171. LPCSTR szWinDir, LPCSTR szAppDir,
  172. LPSTR szCurDir, UINT FAR* lpuCurDirLen,
  173. LPSTR szDestDir, UINT FAR* lpuDestDirLen);
  174. DWORD WINAPI VerInstallFile(UINT uFlags,
  175. LPCSTR szSrcFileName, LPCSTR szDestFileName, LPCSTR szSrcDir,
  176. LPCSTR szDestDir, LPCSTR szCurDir, LPSTR szTmpFile, UINT FAR* lpuTmpFileLen);
  177. /* Returns size of version info in bytes */
  178. DWORD WINAPI GetFileVersionInfoSize(
  179. LPCSTR lpstrFilename, /* Filename of version stamped file */
  180. DWORD FAR *lpdwHandle); /* Information for use by GetFileVersionInfo */
  181. /* Read version info into buffer */
  182. BOOL WINAPI GetFileVersionInfo(
  183. LPCSTR lpstrFilename, /* Filename of version stamped file */
  184. DWORD dwHandle, /* Information from GetFileVersionSize */
  185. DWORD dwLen, /* Length of buffer for info */
  186. void FAR* lpData); /* Buffer to place the data structure */
  187. /* Returns size of resource in bytes */
  188. DWORD WINAPI GetFileResourceSize(
  189. LPCSTR lpstrFilename, /* Filename of version stamped file */
  190. LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
  191. LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
  192. DWORD FAR *lpdwFileOffset); /* Returns file offset of resource */
  193. /* Reads file resource into buffer */
  194. BOOL WINAPI GetFileResource(
  195. LPCSTR lpstrFilename, /* Filename of version stamped file */
  196. LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
  197. LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
  198. DWORD dwFileOffset, /* File offset or NULL */
  199. DWORD dwResLen, /* Length of resource to read or NULL */
  200. void FAR* lpData); /* Pointer to data buffer */
  201. UINT WINAPI VerLanguageName(UINT wLang, LPSTR szLang, UINT nSize);
  202. UINT WINAPI GetWindowsDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
  203. UINT WINAPI GetSystemDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
  204. BOOL WINAPI VerQueryValue(const void FAR* pBlock, LPCSTR lpSubBlock,
  205. void FAR* FAR* lplpBuffer, UINT FAR* lpuLen);
  206. #ifdef __cplusplus
  207. }
  208. #endif /* __cplusplus */
  209. #pragma pack()
  210. #endif /* !RC_INVOKED */
  211. #endif /* !_INC_VER */