1 /***********************************************************************\
2 *                                winver.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.winver;
12 
13 private import win32.windef;
14 
15 // FIXME: type weirdness
16 enum {
17 	VS_FILE_INFO    =  16,
18 	VS_VERSION_INFO =   1,
19 	VS_USER_DEFINED = 100
20 }
21 
22 enum {
23 	VS_FFI_SIGNATURE     = 0xFEEF04BD,
24 	VS_FFI_STRUCVERSION  =    0x10000,
25 	VS_FFI_FILEFLAGSMASK =       0x3F
26 }
27 
28 enum {
29 	VS_FF_DEBUG        =  1,
30 	VS_FF_PRERELEASE   =  2,
31 	VS_FF_PATCHED      =  4,
32 	VS_FF_PRIVATEBUILD =  8,
33 	VS_FF_INFOINFERRED = 16,
34 	VS_FF_SPECIALBUILD = 32
35 }
36 
37 enum {
38 	VOS_UNKNOWN       =       0,
39 	VOS_DOS           = 0x10000,
40 	VOS_OS216         = 0x20000,
41 	VOS_OS232         = 0x30000,
42 	VOS_NT            = 0x40000,
43 	VOS__BASE         =       0,
44 	VOS__WINDOWS16    =       1,
45 	VOS__PM16         =       2,
46 	VOS__PM32         =       3,
47 	VOS__WINDOWS32    =       4,
48 	VOS_DOS_WINDOWS16 = 0x10001,
49 	VOS_DOS_WINDOWS32 = 0x10004,
50 	VOS_OS216_PM16    = 0x20002,
51 	VOS_OS232_PM32    = 0x30003,
52 	VOS_NT_WINDOWS32  = 0x40004
53 }
54 
55 enum {
56 	VFT_UNKNOWN    = 0,
57 	VFT_APP        = 1,
58 	VFT_DLL        = 2,
59 	VFT_DRV        = 3,
60 	VFT_FONT       = 4,
61 	VFT_VXD        = 5,
62 	VFT_STATIC_LIB = 7
63 }
64 
65 enum {
66 	VFT2_UNKNOWN         =  0,
67 	VFT2_DRV_PRINTER     =  1,
68 	VFT2_DRV_KEYBOARD    =  2,
69 	VFT2_DRV_LANGUAGE    =  3,
70 	VFT2_DRV_DISPLAY     =  4,
71 	VFT2_DRV_MOUSE       =  5,
72 	VFT2_DRV_NETWORK     =  6,
73 	VFT2_DRV_SYSTEM      =  7,
74 	VFT2_DRV_INSTALLABLE =  8,
75 	VFT2_DRV_SOUND       =  9,
76 	VFT2_DRV_COMM        = 10,
77 	VFT2_DRV_INPUTMETHOD = 11,
78 	VFT2_FONT_RASTER     =  1,
79 	VFT2_FONT_VECTOR     =  2,
80 	VFT2_FONT_TRUETYPE   =  3
81 }
82 
83 enum : DWORD {
84 	VFFF_ISSHAREDFILE = 1
85 }
86 
87 enum : DWORD {
88 	VFF_CURNEDEST    = 1,
89 	VFF_FILEINUSE    = 2,
90 	VFF_BUFFTOOSMALL = 4
91 }
92 
93 enum : DWORD {
94 	VIFF_FORCEINSTALL  = 1,
95 	VIFF_DONTDELETEOLD
96 }
97 
98 enum {
99 	VIF_TEMPFILE         = 0x00001,
100 	VIF_MISMATCH         = 0x00002,
101 	VIF_SRCOLD           = 0x00004,
102 	VIF_DIFFLANG         = 0x00008,
103 	VIF_DIFFCODEPG       = 0x00010,
104 	VIF_DIFFTYPE         = 0x00020,
105 	VIF_WRITEPROT        = 0x00040,
106 	VIF_FILEINUSE        = 0x00080,
107 	VIF_OUTOFSPACE       = 0x00100,
108 	VIF_ACCESSVIOLATION  = 0x00200,
109 	VIF_SHARINGVIOLATION = 0x00400,
110 	VIF_CANNOTCREATE     = 0x00800,
111 	VIF_CANNOTDELETE     = 0x01000,
112 	VIF_CANNOTRENAME     = 0x02000,
113 	VIF_CANNOTDELETECUR  = 0x04000,
114 	VIF_OUTOFMEMORY      = 0x08000,
115 	VIF_CANNOTREADSRC    = 0x10000,
116 	VIF_CANNOTREADDST    = 0x20000,
117 	VIF_BUFFTOOSMALL     = 0x40000
118 }
119 
120 struct VS_FIXEDFILEINFO {
121 	DWORD dwSignature;
122 	DWORD dwStrucVersion;
123 	DWORD dwFileVersionMS;
124 	DWORD dwFileVersionLS;
125 	DWORD dwProductVersionMS;
126 	DWORD dwProductVersionLS;
127 	DWORD dwFileFlagsMask;
128 	DWORD dwFileFlags;
129 	DWORD dwFileOS;
130 	DWORD dwFileType;
131 	DWORD dwFileSubtype;
132 	DWORD dwFileDateMS;
133 	DWORD dwFileDateLS;
134 }
135 
136 extern (Windows) {
137 	DWORD VerFindFileA(DWORD, LPCSTR, LPCSTR, LPCSTR, LPSTR, PUINT, LPSTR,
138 	  PUINT);
139 	DWORD VerFindFileW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, PUINT, LPWSTR,
140 	  PUINT);
141 	DWORD VerInstallFileA(DWORD, LPCSTR, LPCSTR, LPCSTR, LPCSTR, LPCSTR, LPSTR,
142 	  PUINT);
143 	DWORD VerInstallFileW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR,
144 	  LPWSTR, PUINT);
145 	DWORD GetFileVersionInfoSizeA(LPCSTR, PDWORD);
146 	DWORD GetFileVersionInfoSizeW(LPCWSTR, PDWORD);
147 	BOOL GetFileVersionInfoA(LPCSTR, DWORD, DWORD, PVOID);
148 	BOOL GetFileVersionInfoW(LPCWSTR, DWORD, DWORD, PVOID);
149 	DWORD VerLanguageNameA(DWORD, LPSTR, DWORD);
150 	DWORD VerLanguageNameW(DWORD, LPWSTR, DWORD);
151 	BOOL VerQueryValueA(LPCVOID, LPCSTR, LPVOID*, PUINT);
152 	BOOL VerQueryValueW(LPCVOID, LPCWSTR, LPVOID*, PUINT);
153 }
154 
155 version (Unicode) {
156 	alias VerFindFileW VerFindFile;
157 	alias VerQueryValueW VerQueryValue;
158 	alias VerInstallFileW VerInstallFile;
159 	alias GetFileVersionInfoSizeW GetFileVersionInfoSize;
160 	alias GetFileVersionInfoW GetFileVersionInfo;
161 	alias VerLanguageNameW VerLanguageName;
162 	alias VerQueryValueW VerQueryValue;
163 } else {
164 	alias VerQueryValueA VerQueryValue;
165 	alias VerFindFileA VerFindFile;
166 	alias VerInstallFileA VerInstallFile;
167 	alias GetFileVersionInfoSizeA GetFileVersionInfoSize;
168 	alias GetFileVersionInfoA GetFileVersionInfo;
169 	alias VerLanguageNameA VerLanguageName;
170 	alias VerQueryValueA VerQueryValue;
171 }