New test.
[mono.git] / mono / io-layer / versioninfo.h
1 /*
2  * versioninfo.h:  Version info structures found in PE file resources
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_VERSIONINFO_H_
11 #define _WAPI_VERSIONINFO_H_
12
13 #include <glib.h>
14
15 /*
16  * VS_VERSIONINFO:
17  *
18  * 2 bytes: Length in bytes (this block, and all child blocks. does _not_ include alignment padding between blocks)
19  * 2 bytes: Length in bytes of VS_FIXEDFILEINFO struct
20  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
21  * Variable length unicode string (null terminated): Key (currently "VS_VERSION_INFO")
22  * Variable length padding to align VS_FIXEDFILEINFO on a 32-bit boundary
23  * VS_FIXEDFILEINFO struct
24  * Variable length padding to align Child struct on a 32-bit boundary
25  * Child struct (zero or one StringFileInfo structs, zero or one VarFileInfo structs)
26  */
27
28 /*
29  * StringFileInfo:
30  *
31  * 2 bytes: Length in bytes (includes this block, as well as all Child blocks)
32  * 2 bytes: Value length (always zero)
33  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
34  * Variable length unicode string: Key (currently "StringFileInfo")
35  * Variable length padding to align Child struct on a 32-bit boundary
36  * Child structs ( one or more StringTable structs.  Each StringTable struct's Key member indicates the appropriate language and code page for displaying the text in that StringTable struct.)
37  */
38
39 /*
40  * StringTable:
41  *
42  * 2 bytes: Length in bytes (includes this block as well as all Child blocks, but excludes any padding between String blocks)
43  * 2 bytes: Value length (always zero)
44  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
45  * Variable length unicode string: Key. An 8-digit hex number stored as a unicode string.  The four most significant digits represent the language identifier.  The four least significant digits represent the code page for which the data is formatted.
46  * Variable length padding to align Child struct on a 32-bit boundary
47  * Child structs (an array of one or more String structs (each aligned on a 32-bit boundary)
48  */
49
50 /*
51  * String:
52  *
53  * 2 bytes: Length in bytes (of this block)
54  * 2 bytes: Value length (the length in words of the Value member)
55  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
56  * Variable length unicode string: Key. arbitrary string, identifies data.
57  * Variable length padding to align Value on a 32-bit boundary
58  * Value: Variable length unicode string, holding data.
59  */
60
61 /*
62  * VarFileInfo:
63  *
64  * 2 bytes: Length in bytes (includes this block, as well as all Child blocks)
65  * 2 bytes: Value length (always zero)
66  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
67  * Variable length unicode string: Key (currently "VarFileInfo")
68  * Variable length padding to align Child struct on a 32-bit boundary
69  * Child structs (a Var struct)
70  */
71
72 /*
73  * Var:
74  *
75  * 2 bytes: Length in bytes of this block
76  * 2 bytes: Value length in bytes of the Value
77  * 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data)
78  * Variable length unicode string: Key ("Translation")
79  * Variable length padding to align Value on a 32-bit boundary
80  * Value: an array of one or more 4 byte values that are language and code page identifier pairs, low-order word containing a language identifier, and the high-order word containing a code page number.  Either word can be zero, indicating that the file is language or code page independent.
81  */
82
83 typedef struct
84 {
85         guint32 dwSignature;            /* Should contain 0xFEEF04BD
86                                          * on le machines */
87         guint32 dwStrucVersion;
88         guint32 dwFileVersionMS;
89         guint32 dwFileVersionLS;
90         guint32 dwProductVersionMS;
91         guint32 dwProductVersionLS;
92         guint32 dwFileFlagsMask;
93         guint32 dwFileFlags;
94         guint32 dwFileOS;
95         guint32 dwFileType;
96         guint32 dwFileSubtype;
97         guint32 dwFileDateMS;
98         guint32 dwFileDateLS;
99 } WapiFixedFileInfo;
100
101 #define VS_FF_DEBUG             0x0001
102 #define VS_FF_PRERELEASE        0x0002
103 #define VS_FF_PATCHED           0x0004
104 #define VS_FF_PRIVATEBUILD      0x0008
105 #define VS_FF_INFOINFERRED      0x0010
106 #define VS_FF_SPECIALBUILD      0x0020
107
108 #define VOS_UNKNOWN             0x00000000
109 #define VOS_DOS                 0x00010000
110 #define VOS_OS216               0x00020000
111 #define VOS_OS232               0x00030000
112 #define VOS_NT                  0x00040000
113 #define VOS__BASE               0x00000000
114 #define VOS__WINDOWS16          0x00000001
115 #define VOS__PM16               0x00000002
116 #define VOS__PM32               0x00000003
117 #define VOS__WINDOWS32          0x00000004
118 /* Should "embrace and extend" here with some entries for linux etc */
119
120 #define VOS_DOS_WINDOWS16       0x00010001
121 #define VOS_DOS_WINDOWS32       0x00010004
122 #define VOS_OS216_PM16          0x00020002
123 #define VOS_OS232_PM32          0x00030003
124 #define VOS_NT_WINDOWS32        0x00040004
125
126 #define VFT_UNKNOWN             0x0000
127 #define VFT_APP                 0x0001
128 #define VFT_DLL                 0x0002
129 #define VFT_DRV                 0x0003
130 #define VFT_FONT                0x0004
131 #define VFT_VXD                 0x0005
132 #define VFT_STATIC_LIB          0x0007
133
134 #define VFT2_UNKNOWN            0x0000
135 #define VFT2_DRV_PRINTER        0x0001
136 #define VFT2_DRV_KEYBOARD       0x0002
137 #define VFT2_DRV_LANGUAGE       0x0003
138 #define VFT2_DRV_DISPLAY        0x0004
139 #define VFT2_DRV_MOUSE          0x0005
140 #define VFT2_DRV_NETWORK        0x0006
141 #define VFT2_DRV_SYSTEM         0x0007
142 #define VFT2_DRV_INSTALLABLE    0x0008
143 #define VFT2_DRV_SOUND          0x0009
144 #define VFT2_DRV_COMM           0x000a
145 #define VFT2_DRV_INPUTMETHOD    0x000b
146 #define VFT2_FONT_RASTER        0x0001
147 #define VFT2_FONT_VECTOR        0x0002
148 #define VFT2_FONT_TRUETYPE      0x0003
149
150 #if G_BYTE_ORDER != G_LITTLE_ENDIAN
151 #define VS_FFI_SIGNATURE        0xbd04effe
152 #define VS_FFI_STRUCVERSION     0x00000100
153 #else
154 #define VS_FFI_SIGNATURE        0xfeef04bd
155 #define VS_FFI_STRUCVERSION     0x00010000
156 #endif
157
158 #define VS_FFI_FILEFLAGSMASK    0x3f
159
160 #endif /* _WAPI_VERSIONINFO_H_ */