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