1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7  * Source: $(DRUNTIMESRC core/sys/windows/_wtypes.d)
8  */
9 /// Automatically imported and edited from the druntime module
10 /// core.sys.windows.wtypes for the auto-generated win32 package.
11 module win32.wtypes;
12 //version (Windows):
13 @system:
14 
15 import win32.rpc, win32.rpcndr;
16 import win32.windef;
17 import win32.uuid; // for GUID_NULL
18 
19 alias GUID_NULL IID_NULL, CLSID_NULL;
20 
21 enum ROTFLAGS_REGISTRATIONKEEPSALIVE = 0x01;
22 enum ROTFLAGS_ALLOWANYCLIENT         = 0x02;
23 
24 // also in winsock2.h
25 struct BLOB {
26     ULONG cbSize;
27     BYTE* pBlobData;
28 }
29 alias BLOB* PBLOB, LPBLOB;
30 
31 enum DVASPECT {
32     DVASPECT_CONTENT   = 1,
33     DVASPECT_THUMBNAIL = 2,
34     DVASPECT_ICON      = 4,
35     DVASPECT_DOCPRINT  = 8
36 }
37 
38 enum DVASPECT2 {
39     DVASPECT_OPAQUE      = 16,
40     DVASPECT_TRANSPARENT = 32
41 }
42 
43 enum STATFLAG {
44     STATFLAG_DEFAULT = 0,
45     STATFLAG_NONAME  = 1
46 }
47 
48 enum MEMCTX {
49     MEMCTX_LOCAL = 0,
50     MEMCTX_TASK,
51     MEMCTX_SHARED,
52     MEMCTX_MACSYSTEM,
53     MEMCTX_UNKNOWN = -1,
54     MEMCTX_SAME = -2
55 }
56 
57 enum MSHCTX {
58     MSHCTX_LOCAL = 0,
59     MSHCTX_NOSHAREDMEM,
60     MSHCTX_DIFFERENTMACHINE,
61     MSHCTX_INPROC,
62     MSHCTX_CROSSCTX
63 }
64 
65 enum CLSCTX {
66     CLSCTX_INPROC_SERVER    = 0x1,
67     CLSCTX_INPROC_HANDLER   = 0x2,
68     CLSCTX_LOCAL_SERVER     = 0x4,
69     CLSCTX_INPROC_SERVER16  = 0x8,
70     CLSCTX_REMOTE_SERVER    = 0x10,
71     CLSCTX_INPROC_HANDLER16 = 0x20,
72     CLSCTX_INPROC_SERVERX86 = 0x40,
73     CLSCTX_INPROC_HANDLERX86 = 0x80,
74 }
75 
76 enum MSHLFLAGS {
77     MSHLFLAGS_NORMAL,
78     MSHLFLAGS_TABLESTRONG,
79     MSHLFLAGS_TABLEWEAK
80 }
81 
82 struct FLAGGED_WORD_BLOB {
83     uint fFlags;
84     uint clSize;
85     ushort[1] asData;
86 }
87 
88 alias WCHAR OLECHAR;
89 alias LPWSTR LPOLESTR;
90 alias LPCWSTR LPCOLESTR;
91 
92 alias ushort VARTYPE;
93 alias short VARIANT_BOOL;
94 alias VARIANT_BOOL _VARIANT_BOOL;
95 enum VARIANT_BOOL VARIANT_TRUE = -1; // 0xffff;
96 enum VARIANT_BOOL VARIANT_FALSE = 0;
97 
98 alias OLECHAR* BSTR;
99 alias FLAGGED_WORD_BLOB* wireBSTR;
100 alias BSTR* LPBSTR;
101 //alias LONG SCODE; // also in winerror
102 mixin DECLARE_HANDLE!("HCONTEXT");
103 mixin DECLARE_HANDLE!("HMETAFILEPICT");
104 
105 union CY {
106     struct {
107         uint Lo;
108         int Hi;
109     }
110     LONGLONG int64;
111 }
112 
113 alias double DATE;
114 struct  BSTRBLOB {
115     ULONG cbSize;
116     PBYTE pData;
117 }
118 alias BSTRBLOB* LPBSTRBLOB;
119 
120 // Used only in the PROPVARIANT structure
121 // According to the 2003 SDK, this should be in propidl.h, not here.
122 struct CLIPDATA {
123     ULONG cbSize;
124     int ulClipFmt;
125     PBYTE pClipData;
126 }
127 
128 enum STGC {
129     STGC_DEFAULT,
130     STGC_OVERWRITE,
131     STGC_ONLYIFCURRENT,
132     STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
133 }
134 
135 enum STGMOVE {
136     STGMOVE_MOVE,
137     STGMOVE_COPY,
138     STGMOVE_SHALLOWCOPY
139 }
140 
141 enum VARENUM {
142     VT_EMPTY,
143     VT_NULL,
144     VT_I2,
145     VT_I4,
146     VT_R4,
147     VT_R8,
148     VT_CY,
149     VT_DATE,
150     VT_BSTR,
151     VT_DISPATCH,
152     VT_ERROR,
153     VT_BOOL,
154     VT_VARIANT,
155     VT_UNKNOWN,
156     VT_DECIMAL,
157     VT_I1 = 16,
158     VT_UI1,
159     VT_UI2,
160     VT_UI4,
161     VT_I8,
162     VT_UI8,
163     VT_INT,
164     VT_UINT,
165     VT_VOID,
166     VT_HRESULT,
167     VT_PTR,
168     VT_SAFEARRAY,
169     VT_CARRAY,
170     VT_USERDEFINED,
171     VT_LPSTR,
172     VT_LPWSTR,
173     VT_RECORD   = 36,
174     VT_INT_PTR  = 37,
175     VT_UINT_PTR = 38,
176     VT_FILETIME = 64,
177     VT_BLOB,
178     VT_STREAM,
179     VT_STORAGE,
180     VT_STREAMED_OBJECT,
181     VT_STORED_OBJECT,
182     VT_BLOB_OBJECT,
183     VT_CF,
184     VT_CLSID,
185     VT_BSTR_BLOB     = 0xfff,
186     VT_VECTOR        = 0x1000,
187     VT_ARRAY         = 0x2000,
188     VT_BYREF         = 0x4000,
189     VT_RESERVED      = 0x8000,
190     VT_ILLEGAL       = 0xffff,
191     VT_ILLEGALMASKED = 0xfff,
192     VT_TYPEMASK      = 0xfff
193 }
194 
195 struct BYTE_SIZEDARR {
196     uint clSize;
197     byte* pData;
198 }
199 
200 struct WORD_SIZEDARR {
201     uint clSize;
202     ushort* pData;
203 }
204 
205 struct DWORD_SIZEDARR {
206 uint clSize;
207 uint* pData;
208 }
209 
210 struct HYPER_SIZEDARR {
211     uint clSize;
212     hyper* pData;
213 }
214 
215 alias double DOUBLE;
216 
217 
218 struct DECIMAL {
219     USHORT wReserved;
220     union {
221         struct {
222             ubyte scale; // valid values are 0 to 28
223             ubyte sign; // 0 for positive, DECIMAL_NEG for negatives.
224             enum ubyte DECIMAL_NEG = 0x80;
225         }
226         USHORT signscale;
227     }
228     ULONG Hi32;
229     union {
230         struct {
231             ULONG Lo32;
232             ULONG Mid32;
233         }
234         ULONGLONG Lo64;
235     }
236     // #define DECIMAL_SETZERO(d) {(d).Lo64=(d).Hi32=(d).signscale=0;}
237     void setZero()() { Lo64 = 0; Hi32 = 0; signscale = 0; }
238 }