home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / VER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  10.1 KB  |  269 lines

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