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.

274 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. version.h
  5. Abstract:
  6. This file implements a set of enumeration routines to access
  7. version info in a Win32 binary.
  8. Author:
  9. Jim Schmidt (jimschm) 03-Dec-1997
  10. Revision History:
  11. calinn 03-Sep-1999 Moved over from Win9xUpg project.
  12. --*/
  13. #pragma once
  14. //
  15. // Includes
  16. //
  17. // None
  18. //
  19. // Debug constants
  20. //
  21. // None
  22. //
  23. // Strings
  24. //
  25. // None
  26. //
  27. // Constants
  28. //
  29. #define MAX_TRANSLATION 32
  30. //
  31. // Macros
  32. //
  33. // None
  34. //
  35. // Types
  36. //
  37. typedef struct {
  38. WORD CodePage;
  39. WORD Language;
  40. } TRANSLATION, *PTRANSLATION;
  41. typedef struct {
  42. GROWBUFFER GrowBuf;
  43. PBYTE VersionBuffer;
  44. PTRANSLATION Translations;
  45. PBYTE StringBuffer;
  46. UINT Size;
  47. DWORD Handle;
  48. VS_FIXEDFILEINFO *FixedInfo;
  49. UINT FixedInfoSize;
  50. CHAR TranslationStr[MAX_TRANSLATION];
  51. UINT MaxTranslations;
  52. UINT CurrentTranslation;
  53. UINT CurrentDefaultTranslation;
  54. PCSTR FileSpec;
  55. PCSTR VersionField;
  56. } VRVALUE_ENUMA, *PVRVALUE_ENUMA;
  57. typedef struct {
  58. GROWBUFFER GrowBuf;
  59. PBYTE VersionBuffer;
  60. PTRANSLATION Translations;
  61. PBYTE StringBuffer;
  62. UINT Size;
  63. DWORD Handle;
  64. VS_FIXEDFILEINFO *FixedInfo;
  65. UINT FixedInfoSize;
  66. WCHAR TranslationStr[MAX_TRANSLATION];
  67. UINT MaxTranslations;
  68. UINT CurrentTranslation;
  69. UINT CurrentDefaultTranslation;
  70. PCWSTR FileSpec;
  71. PCWSTR VersionField;
  72. } VRVALUE_ENUMW, *PVRVALUE_ENUMW;
  73. //
  74. // Globals
  75. //
  76. // None
  77. //
  78. // Macro expansion list
  79. //
  80. // None
  81. //
  82. // Function prototypes
  83. //
  84. BOOL
  85. VrCreateEnumStructA (
  86. OUT PVRVALUE_ENUMA VrValueEnum,
  87. IN PCSTR FileSpec
  88. );
  89. BOOL
  90. VrCreateEnumStructW (
  91. OUT PVRVALUE_ENUMW VrValueEnum,
  92. IN PCWSTR FileSpec
  93. );
  94. VOID
  95. VrDestroyEnumStructA (
  96. IN PVRVALUE_ENUMA VrValueEnum
  97. );
  98. VOID
  99. VrDestroyEnumStructW (
  100. IN PVRVALUE_ENUMW VrValueEnum
  101. );
  102. PCSTR
  103. VrEnumFirstValueA (
  104. IN OUT PVRVALUE_ENUMA VrValueEnum,
  105. IN PCSTR VersionField
  106. );
  107. PCWSTR
  108. VrEnumFirstValueW (
  109. IN OUT PVRVALUE_ENUMW VrValueEnum,
  110. IN PCWSTR VersionField
  111. );
  112. PCSTR
  113. VrEnumNextValueA (
  114. IN OUT PVRVALUE_ENUMA VrValueEnum
  115. );
  116. PCWSTR
  117. VrEnumNextValueW (
  118. IN OUT PVRVALUE_ENUMW VrValueEnum
  119. );
  120. BOOL
  121. VrCheckVersionValueA (
  122. IN PVRVALUE_ENUMA VrValueEnum,
  123. IN PCSTR VersionName,
  124. IN PCSTR VersionValue
  125. );
  126. BOOL
  127. VrCheckFileVersionA (
  128. IN PCSTR FileName,
  129. IN PCSTR NameToCheck,
  130. IN PCSTR ValueToCheck
  131. );
  132. BOOL
  133. VrCheckFileVersionW (
  134. IN PCWSTR FileName,
  135. IN PCWSTR NameToCheck,
  136. IN PCWSTR ValueToCheck
  137. );
  138. BOOL
  139. VrCheckVersionValueW (
  140. IN PVRVALUE_ENUMW VrValueEnum,
  141. IN PCWSTR VersionName,
  142. IN PCWSTR VersionValue
  143. );
  144. ULONGLONG
  145. VrGetBinaryFileVersionA (
  146. IN PVRVALUE_ENUMA VrValueEnum
  147. );
  148. #define VrGetBinaryFileVersionW(VrValueEnum) VrGetBinaryFileVersionA((PVRVALUE_ENUMA)VrValueEnum)
  149. ULONGLONG
  150. VrGetBinaryProductVersionA (
  151. IN PVRVALUE_ENUMA VrValueEnum
  152. );
  153. #define VrGetBinaryProductVersionW(VrValueEnum) VrGetBinaryProductVersionA((PVRVALUE_ENUMA)VrValueEnum)
  154. DWORD
  155. VrGetBinaryFileDateLoA (
  156. IN PVRVALUE_ENUMA VrValueEnum
  157. );
  158. #define VrGetBinaryFileDateLoW(VrValueEnum) VrGetBinaryFileDateLoA((PVRVALUE_ENUMA)VrValueEnum)
  159. DWORD
  160. VrGetBinaryFileDateHiA (
  161. IN PVRVALUE_ENUMA VrValueEnum
  162. );
  163. #define VrGetBinaryFileDateHiW(VrValueEnum) VrGetBinaryFileDateHiA((PVRVALUE_ENUMA)VrValueEnum)
  164. DWORD
  165. VrGetBinaryOsVersionA (
  166. IN PVRVALUE_ENUMA VrValueEnum
  167. );
  168. #define VrGetBinaryOsVersionW(VrValueEnum) VrGetBinaryOsVersionA((PVRVALUE_ENUMA)VrValueEnum)
  169. DWORD
  170. VrGetBinaryFileTypeA (
  171. IN PVRVALUE_ENUMA VrValueEnum
  172. );
  173. #define VrGetBinaryFileTypeW(VrValueEnum) VrGetBinaryFileTypeA((PVRVALUE_ENUMA)VrValueEnum)
  174. //
  175. // Macro expansion definition
  176. //
  177. // None
  178. //
  179. // TCHAR mappings
  180. //
  181. #ifndef UNICODE
  182. #define VRVALUE_ENUM VRVALUE_ENUMA
  183. #define PVRVALUE_ENUM PVRVALUE_ENUMA
  184. #define VrCreateEnumStruct VrCreateEnumStructA
  185. #define VrDestroyEnumStruct VrDestroyEnumStructA
  186. #define VrEnumFirstValue VrEnumFirstValueA
  187. #define VrEnumNextValue VrEnumNextValueA
  188. #define VrCheckFileVersion VrCheckFileVersionA
  189. #define VrCheckVersionValue VrCheckVersionValueA
  190. #define VrGetBinaryFileVersion VrGetBinaryFileVersionA
  191. #define VrGetBinaryProductVersion VrGetBinaryProductVersionA
  192. #define VrGetBinaryFileDateLo VrGetBinaryFileDateLoA
  193. #define VrGetBinaryFileDateHi VrGetBinaryFileDateHiA
  194. #define VrGetBinaryOsVersion VrGetBinaryOsVersionA
  195. #define VrGetBinaryFileType VrGetBinaryFileTypeA
  196. #else
  197. #define VRVALUE_ENUM VRVALUE_ENUMW
  198. #define PVRVALUE_ENUM PVRVALUE_ENUMW
  199. #define VrCreateEnumStruct VrCreateEnumStructW
  200. #define VrDestroyEnumStruct VrDestroyEnumStructW
  201. #define VrEnumFirstValue VrEnumFirstValueW
  202. #define VrEnumNextValue VrEnumNextValueW
  203. #define VrCheckFileVersion VrCheckFileVersionW
  204. #define VrCheckVersionValue VrCheckVersionValueW
  205. #define VrGetBinaryFileVersion VrGetBinaryFileVersionW
  206. #define VrGetBinaryProductVersion VrGetBinaryProductVersionW
  207. #define VrGetBinaryFileDateLo VrGetBinaryFileDateLoW
  208. #define VrGetBinaryFileDateHi VrGetBinaryFileDateHiW
  209. #define VrGetBinaryOsVersion VrGetBinaryOsVersionW
  210. #define VrGetBinaryFileType VrGetBinaryFileTypeW
  211. #endif