home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / WINVER.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  10KB  |  296 lines

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