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.

238 lines
4.8 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. ULONGLONG
  121. VrGetBinaryFileVersionA (
  122. IN PVRVALUE_ENUMA VrValueEnum
  123. );
  124. #define VrGetBinaryFileVersionW(VrValueEnum) VrGetBinaryFileVersionA((PVRVALUE_ENUMW)VrValueEnum)
  125. ULONGLONG
  126. VrGetBinaryProductVersionA (
  127. IN PVRVALUE_ENUMA VrValueEnum
  128. );
  129. #define VrGetBinaryProductVersionW(VrValueEnum) VrGetBinaryProductVersionA((PVRVALUE_ENUMW)VrValueEnum)
  130. DWORD
  131. VrGetBinaryFileDateLoA (
  132. IN PVRVALUE_ENUMA VrValueEnum
  133. );
  134. #define VrGetBinaryFileFileDateLoW(VrValueEnum) VrGetBinaryFileDateLoA((PVRVALUE_ENUMW)VrValueEnum)
  135. DWORD
  136. VrGetBinaryFileDateHiA (
  137. IN PVRVALUE_ENUMA VrValueEnum
  138. );
  139. #define VrGetBinaryFileFileDateHiW(VrValueEnum) VrGetBinaryFileDateHiA((PVRVALUE_ENUMW)VrValueEnum)
  140. DWORD
  141. VrGetBinaryOsVersionA (
  142. IN PVRVALUE_ENUMA VrValueEnum
  143. );
  144. #define VrGetBinaryOsVersionW(VrValueEnum) VrGetBinaryOsVersionA((PVRVALUE_ENUMW)VrValueEnum)
  145. DWORD
  146. VrGetBinaryFileTypeA (
  147. IN PVRVALUE_ENUMA VrValueEnum
  148. );
  149. #define VrGetBinaryFileFileTypeW(VrValueEnum) VrGetBinaryFileTypeA((PVRVALUE_ENUMW)VrValueEnum)
  150. #ifndef UNICODE
  151. #define VRVALUE_ENUM VRVALUE_ENUMA
  152. #define PVRVALUE_ENUM PVRVALUE_ENUMA
  153. #define VrCreateEnumStruct VrCreateEnumStructA
  154. #define VrDestroyEnumStruct VrDestroyEnumStructA
  155. #define VrEnumFirstValue VrEnumFirstValueA
  156. #define VrEnumNextValue VrEnumNextValueA
  157. #define VrGetBinaryFileVersion VrGetBinaryFileVersionA
  158. #define VrGetBinaryProductVersion VrGetBinaryProductVersionA
  159. #define VrGetBinaryFileDateLo VrGetBinaryFileDateLoA
  160. #define VrGetBinaryFileDateHi VrGetBinaryFileDateHiA
  161. #define VrGetBinaryOsVersion VrGetBinaryOsVersionA
  162. #define VrGetBinaryFileType VrGetBinaryFileTypeA
  163. #else
  164. #define VRVALUE_ENUM VRVALUE_ENUMW
  165. #define PVRVALUE_ENUM PVRVALUE_ENUMW
  166. #define VrCreateEnumStruct VrCreateEnumStructW
  167. #define VrDestroyEnumStruct VrDestroyEnumStructW
  168. #define VrEnumFirstValue VrEnumFirstValueW
  169. #define VrEnumNextValue VrEnumNextValueW
  170. #define VrGetBinaryFileVersion VrGetBinaryFileVersionW
  171. #define VrGetBinaryProductVersion VrGetBinaryProductVersionW
  172. #define VrGetBinaryFileDateLo VrGetBinaryFileDateLoW
  173. #define VrGetBinaryFileDateHi VrGetBinaryFileDateHiW
  174. #define VrGetBinaryOsVersion VrGetBinaryOsVersionW
  175. #define VrGetBinaryFileType VrGetBinaryFileTypeW
  176. #endif
  177. //
  178. // Macro expansion definition
  179. //
  180. // None