Added more wtypes definitions, particularly for GDI/USER handles.
[wine.git] / include / wtypes.idl
blobf53e1bdc7d960e1ec70f090bbf5a4bf1c3f57691
1 /*
2 * Basic types used by COM interfaces
4 * Copyright 2002 Ove Kaaven
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 import "basetsd.h";
22 import "guiddef.h";
25 uuid(D3980A60-910C-1068-9341-00DD010F2F1C),
26 version(0.1),
27 pointer_default(unique)
30 interface IWinTypes
33 /******************** BASIC WIN32 TYPES ********************/
34 cpp_quote("#if 0 /* winnt.h */") /* don't redefine these */
36 typedef unsigned char BYTE;
37 typedef unsigned short WORD;
38 typedef unsigned long DWORD;
39 typedef long BOOL;
40 typedef unsigned char UCHAR;
41 typedef int INT;
42 typedef unsigned int UINT;
43 typedef short SHORT;
44 typedef unsigned short USHORT;
45 typedef long LONG;
46 typedef unsigned long ULONG;
47 typedef float FLOAT;
49 typedef void *PVOID, *LPVOID;
51 typedef DWORD *LPDWORD;
53 typedef char CHAR;
54 typedef [string] CHAR *LPSTR;
55 typedef [string] const CHAR *LPCSTR;
57 typedef wchar_t WCHAR;
58 typedef [string] WCHAR *LPWSTR;
59 typedef [string] const WCHAR *LPCWSTR;
61 typedef boolean BOOLEAN;
63 typedef DWORD COLORREF;
65 typedef void *HANDLE;
66 #define DECLARE_HANDLE(name) typedef void *name
67 #define DECLARE_WIREM_HANDLE(name) typedef [wire_marshal(wire##name)] void*name
69 DECLARE_HANDLE(HMODULE);
70 DECLARE_HANDLE(HINSTANCE);
71 DECLARE_HANDLE(HRGN);
72 DECLARE_HANDLE(HTASK);
73 DECLARE_HANDLE(HKEY);
74 DECLARE_HANDLE(HDESK);
75 DECLARE_HANDLE(HMF);
76 DECLARE_HANDLE(HEMF);
77 DECLARE_HANDLE(HPEN);
78 DECLARE_HANDLE(HRSRC);
79 DECLARE_HANDLE(HSTR);
80 DECLARE_HANDLE(HWINSTA);
81 DECLARE_HANDLE(HKL);
82 DECLARE_HANDLE(HGDIOBJ);
84 typedef HANDLE HDWP;
86 typedef LONG_PTR LRESULT;
88 typedef LONG HRESULT;
89 typedef DWORD LCID;
91 typedef unsigned __int64 DWORDLONG;
92 typedef __int64 LONGLONG;
93 typedef unsigned __int64 ULONGLONG;
95 typedef struct _LARGE_INTEGER {
96 LONGLONG QuadPart;
97 } LARGE_INTEGER;
99 typedef struct _ULARGE_INTEGER {
100 ULONGLONG QuadPart;
101 } ULARGE_INTEGER;
103 typedef struct _SID_IDENTIFIER_AUTHORITY {
104 UCHAR Value[6];
105 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
107 typedef struct _SID {
108 UCHAR Revision;
109 UCHAR SubAuthorityCount;
110 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
111 [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
112 } SID, *PSID;
114 typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
116 typedef struct _ACL {
117 UCHAR AclRevision;
118 UCHAR Sbz1;
119 USHORT AclSize;
120 USHORT AceCount;
121 USHORT Sbz2;
122 } ACL;
123 typedef ACL *PACL;
125 typedef struct _SECURITY_DESCRIPTOR {
126 UCHAR Revision;
127 UCHAR Sbz1;
128 SECURITY_DESCRIPTOR_CONTROL Control;
129 PSID Owner;
130 PSID Group;
131 PACL Sacl;
132 PACL Dacl;
133 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
135 typedef struct _SECURITY_ATTRIBUTES
137 DWORD nLength;
138 LPVOID lpSecurityDescriptor;
139 BOOL bInheritHandle;
140 } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
142 typedef struct tagSIZE
144 LONG cx;
145 LONG cy;
146 } SIZE, *PSIZE, *LPSIZE;
147 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
149 typedef struct tagPOINT
151 LONG x;
152 LONG y;
153 } POINT, *PPOINT, *LPPOINT;
155 typedef struct _POINTL
157 LONG x;
158 LONG y;
159 } POINTL, *PPOINTL;
161 typedef struct tagRECT
163 LONG left;
164 LONG top;
165 LONG right;
166 LONG bottom;
167 } RECT, *PRECT, *LPRECT;
168 typedef const RECT *LPCRECT;
170 typedef struct _RECTL
172 LONG left;
173 LONG top;
174 LONG right;
175 LONG bottom;
176 } RECTL, *PRECTL, *LPRECTL;
177 typedef const RECTL *LPCRECTL;
179 typedef UINT_PTR WPARAM;
180 typedef LONG_PTR LPARAM;
182 cpp_quote("#endif /* winnt.h */")
184 cpp_quote("#if 0") /* for IDL only */
185 typedef double DOUBLE;
186 cpp_quote("#else")
187 cpp_quote("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
188 cpp_quote("#endif")
190 cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
191 cpp_quote("#define _PALETTEENTRY_DEFINED")
192 typedef struct tagPALETTEENTRY {
193 BYTE peRed;
194 BYTE peGreen;
195 BYTE peBlue;
196 BYTE peFlags;
197 } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
198 cpp_quote("#endif")
200 cpp_quote("#ifndef _LOGPALETTE_DEFINED")
201 cpp_quote("#define _LOGPALETTE_DEFINED")
202 typedef struct tagLOGPALETTE
204 WORD palVersion;
205 WORD palNumEntries;
206 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[*];
207 } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
208 cpp_quote("#endif")
210 cpp_quote("#ifndef _FILETIME_")
211 cpp_quote("#define _FILETIME_")
212 typedef struct _FILETIME {
213 DWORD dwLowDateTime;
214 DWORD dwHighDateTime;
215 } FILETIME, *PFILETIME, *LPFILETIME;
216 cpp_quote("#endif")
218 cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
219 cpp_quote("#define _TEXTMETRIC_DEFINED")
220 typedef struct tagTEXTMETRICA
222 LONG tmHeight;
223 LONG tmAscent;
224 LONG tmDescent;
225 LONG tmInternalLeading;
226 LONG tmExternalLeading;
227 LONG tmAveCharWidth;
228 LONG tmMaxCharWidth;
229 LONG tmWeight;
230 LONG tmOverhang;
231 LONG tmDigitizedAspectX;
232 LONG tmDigitizedAspectY;
233 BYTE tmFirstChar;
234 BYTE tmLastChar;
235 BYTE tmDefaultChar;
236 BYTE tmBreakChar;
237 BYTE tmItalic;
238 BYTE tmUnderlined;
239 BYTE tmStruckOut;
240 BYTE tmPitchAndFamily;
241 BYTE tmCharSet;
242 } TEXTMETRICA, *LPTEXTMETRICA, *PTEXTMETRICA;
244 typedef struct tagTEXTMETRICW
246 LONG tmHeight;
247 LONG tmAscent;
248 LONG tmDescent;
249 LONG tmInternalLeading;
250 LONG tmExternalLeading;
251 LONG tmAveCharWidth;
252 LONG tmMaxCharWidth;
253 LONG tmWeight;
254 LONG tmOverhang;
255 LONG tmDigitizedAspectX;
256 LONG tmDigitizedAspectY;
257 WCHAR tmFirstChar;
258 WCHAR tmLastChar;
259 WCHAR tmDefaultChar;
260 WCHAR tmBreakChar;
261 BYTE tmItalic;
262 BYTE tmUnderlined;
263 BYTE tmStruckOut;
264 BYTE tmPitchAndFamily;
265 BYTE tmCharSet;
266 } TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
267 cpp_quote("#endif")
269 /******************** BASIC COM/OLE TYPES ********************/
271 typedef WCHAR OLECHAR;
272 typedef [string] OLECHAR *LPOLESTR;
273 typedef [string] const OLECHAR *LPCOLESTR;
274 cpp_quote("#ifndef __WINESRC__")
275 cpp_quote("#define OLESTR(str) L##str")
276 cpp_quote("#endif")
278 typedef LONG SCODE;
280 typedef struct _COAUTHIDENTITY {
281 [size_is(UserLength+1)] USHORT *User;
282 ULONG UserLength;
283 [size_is(DomainLength+1)] USHORT *Domain;
284 ULONG DomainLength;
285 [size_is(PasswordLength+1)] USHORT *Password;
286 ULONG PasswordLength;
287 ULONG Flags;
288 } COAUTHIDENTITY;
290 typedef struct _COAUTHINFO {
291 DWORD dwAuthnSvc;
292 DWORD dwAuthzSvc;
293 LPWSTR pwszServerPrincName;
294 DWORD dwAuthnLevel;
295 DWORD dwImpersonationLevel;
296 COAUTHIDENTITY *pAuthIdentityData;
297 DWORD dwCapabilities;
298 } COAUTHINFO;
300 typedef enum tagMEMCTX {
301 MEMCTX_TASK = 1,
302 MEMCTX_SHARED = 2,
303 MEMCTX_MACSYSTEM = 3,
304 MEMCTX_UNKNOWN = -1,
305 MEMCTX_SAME = -2
306 } MEMCTX;
308 cpp_quote("#ifndef _ROT_COMPARE_MAX_DEFINED")
309 cpp_quote("#define _ROT_COMPARE_MAX_DEFINED")
310 cpp_quote("#define ROT_COMPARE_MAX 2048")
311 cpp_quote("#endif")
313 cpp_quote("#ifndef _ROTFLAGS_DEFINED")
314 cpp_quote("#define _ROTFLAGS_DEFINED")
315 cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
316 cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
317 cpp_quote("#endif")
319 typedef enum tagCLSCTX {
320 CLSCTX_INPROC_SERVER = 0x1,
321 CLSCTX_INPROC_HANDLER = 0x2,
322 CLSCTX_LOCAL_SERVER = 0x4,
323 CLSCTX_INPROC_SERVER16 = 0x8,
324 CLSCTX_REMOTE_SERVER = 0x10,
325 CLSCTX_INPROC_HANDLER16 = 0x20,
326 CLSCTX_INPROC_SERVERX86 = 0x40,
327 CLSCTX_INPROC_HANDLERX86 = 0x80,
328 CLSCTX_ESERVER_HANDLER = 0x100,
329 CLSCTX_NO_CODE_DOWNLOAD = 0x400,
330 CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
331 CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
332 CLSCTX_NO_FAILURE_LOG = 0x4000,
333 CLSCTX_DISABLE_AAA = 0x8000,
334 CLSCTX_ENABLE_AAA = 0x10000,
335 CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
336 } CLSCTX;
338 cpp_quote("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
339 cpp_quote("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
340 cpp_quote("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
342 typedef enum tagMSHLFLAGS {
343 MSHLFLAGS_NORMAL = 0,
344 MSHLFLAGS_TABLESTRONG = 1,
345 MSHLFLAGS_TABLEWEAK = 2,
346 MSHLFLAGS_NOPING = 4
347 } MSHLFLAGS;
349 typedef enum tagMSHCTX {
350 MSHCTX_LOCAL = 0,
351 MSHCTX_NOSHAREDMEM = 1,
352 MSHCTX_DIFFERENTMACHINE = 2,
353 MSHCTX_INPROC = 3,
354 MSHCTX_CROSSCTX = 4
355 } MSHCTX;
357 /******************** BLOB TYPES ********************/
359 typedef struct _BYTE_BLOB {
360 unsigned long clSize;
361 [size_is(clSize)] byte abData[];
362 } BYTE_BLOB;
363 typedef [unique] BYTE_BLOB *UP_BYTE_BLOB;
365 typedef struct _FLAGGED_BYTE_BLOB {
366 unsigned long fFlags;
367 unsigned long clSize;
368 [size_is(clSize)] byte abData[];
369 } FLAGGED_BYTE_BLOB;
370 typedef [unique] FLAGGED_BYTE_BLOB *UP_FLAGGED_BYTE_BLOB;
372 typedef struct _FLAGGED_WORD_BLOB {
373 unsigned long fFlags;
374 unsigned long clSize;
375 [size_is(clSize)] unsigned short asData[];
376 } FLAGGED_WORD_BLOB;
377 typedef [unique] FLAGGED_WORD_BLOB *UP_FLAGGED_WORD_BLOB;
379 typedef struct _BYTE_SIZEDARR {
380 unsigned long clSize;
381 [size_is(clSize)] byte *pData;
382 } BYTE_SIZEDARR;
384 typedef struct _SHORT_SIZEDARR {
385 unsigned long clSize;
386 [size_is(clSize)] unsigned short *pData;
387 } WORD_SIZEDARR;
389 typedef struct _LONG_SIZEDARR {
390 unsigned long clSize;
391 [size_is(clSize)] unsigned long *pData;
392 } DWORD_SIZEDARR;
394 typedef struct _HYPER_SIZEDARR {
395 unsigned long clSize;
396 [size_is(clSize)] hyper *pData;
397 } HYPER_SIZEDARR;
399 /******************** GDI TYPES ********************/
401 const unsigned long WDT_INPROC_CALL = 0x48746457;
402 const unsigned long WDT_REMOTE_CALL = 0x52746457;
403 const unsigned long WDT_INPROC64_CALL = 0x50746457;
405 typedef union _userCLIPFORMAT switch(long fContext) u {
406 case WDT_INPROC_CALL: DWORD dwValue;
407 case WDT_REMOTE_CALL: LPWSTR pwszName;
408 } userCLIPFORMAT;
410 typedef [unique] userCLIPFORMAT *wireCLIPFORMAT;
411 typedef [wire_marshal(wireCLIPFORMAT)] WORD CLIPFORMAT;
413 typedef struct tagRemHGLOBAL {
414 long fNullHGlobal;
415 unsigned long cbData;
416 [size_is(cbData)] byte data[];
417 } RemHGLOBAL;
419 typedef union _userHGLOBAL switch(long fContext) u {
420 case WDT_INPROC_CALL: long hInproc;
421 case WDT_REMOTE_CALL: FLAGGED_BYTE_BLOB *hRemote;
422 default: long hGlobal;
423 } userHGLOBAL;
425 typedef [unique] userHGLOBAL *wireHGLOBAL;
427 typedef struct tagRemHMETAFILEPICT {
428 long mm;
429 long xExt;
430 long yExt;
431 unsigned long cbData;
432 [size_is(cbData)] byte data[];
433 } RemHMETAFILEPICT;
435 typedef union _userHMETAFILE switch(long fContext) u {
436 case WDT_INPROC_CALL: long hInproc;
437 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
438 default: long hGlobal;
439 } userHMETAFILE;
441 typedef [unique] userHMETAFILE *wireHMETAFILE;
443 typedef struct _remoteMETAFILEPICT {
444 long mm;
445 long xExt;
446 long yExt;
447 userHMETAFILE *hMF;
448 } remoteMETAFILEPICT;
450 typedef union _userHMETAFILEPICT switch(long fContext) u {
451 case WDT_INPROC_CALL: long hInproc;
452 case WDT_REMOTE_CALL: remoteMETAFILEPICT *hRemote;
453 default: long hGlobal;
454 } userHMETAFILEPICT;
456 typedef [unique] userHMETAFILEPICT *wireHMETAFILEPICT;
458 typedef struct tagRemHENHMETAFILE {
459 unsigned long cbData;
460 [size_is(cbData)] byte data[];
461 } RemHENHMETAFILE;
463 typedef union _userHENHMETAFILE switch(long fContext) u {
464 case WDT_INPROC_CALL: long hInproc;
465 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
466 default: long hGlobal;
467 } userHENHMETAFILE;
469 typedef [unique] userHENHMETAFILE *wireHENHMETAFILE;
471 typedef struct tagRemHBITMAP
473 unsigned long cbData;
474 [size_is(cbData)] byte data[];
475 } RemHBITMAP;
477 typedef struct _userBITMAP {
478 LONG bmType;
479 LONG bmWidth;
480 LONG bmHeight;
481 LONG bmWidthBytes;
482 WORD bmPlanes;
483 WORD bmBitsPixel;
484 ULONG cbSize;
485 [size_is(cbSize)] byte pBuffer[];
486 } userBITMAP;
488 typedef union _userHBITMAP switch(long fContext) u {
489 case WDT_INPROC_CALL: long hInproc;
490 case WDT_REMOTE_CALL: userBITMAP *hRemote;
491 default: long hGlobal;
492 } userHBITMAP;
494 typedef [unique] userHBITMAP *wireHBITMAP;
496 typedef struct tagRemHPALETTE {
497 unsigned long cbData;
498 [size_is(cbData)] byte data[];
499 } RemHPALETTE;
501 typedef struct tagrpcLOGPALETTE {
502 WORD palVersion;
503 WORD palNumEntries;
504 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[];
505 } rpcLOGPALETTE;
507 typedef union _userHPALETTE switch(long fContext) u {
508 case WDT_INPROC_CALL: long hInproc;
509 case WDT_REMOTE_CALL: rpcLOGPALETTE *hRemote;
510 default: long hGlobal;
511 } userHPALETTE;
513 typedef [unique] userHPALETTE *wireHPALETTE;
515 cpp_quote("#if 0")
516 DECLARE_WIREM_HANDLE(HGLOBAL);
517 typedef HGLOBAL HLOCAL;
518 DECLARE_WIREM_HANDLE(HBITMAP);
519 DECLARE_WIREM_HANDLE(HPALETTE);
520 DECLARE_WIREM_HANDLE(HENHMETAFILE);
521 DECLARE_WIREM_HANDLE(HMETAFILE);
522 cpp_quote("#endif")
523 DECLARE_WIREM_HANDLE(HMETAFILEPICT);
525 typedef union _RemotableHandle switch (long fContext) u
527 case WDT_INPROC_CALL: long hInproc;
528 case WDT_REMOTE_CALL: long hRemote;
529 } RemotableHandle;
531 typedef [unique] RemotableHandle *wireHACCEL;
532 typedef [unique] RemotableHandle *wireHBRUSH;
533 typedef [unique] RemotableHandle *wireHDC;
534 typedef [unique] RemotableHandle *wireHFONT;
535 typedef [unique] RemotableHandle *wireHICON;
536 typedef [unique] RemotableHandle *wireHMENU;
537 typedef [unique] RemotableHandle *wireHWND;
539 cpp_quote("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
540 DECLARE_WIREM_HANDLE(HACCEL);
541 DECLARE_WIREM_HANDLE(HBRUSH);
542 DECLARE_WIREM_HANDLE(HDC);
543 DECLARE_WIREM_HANDLE(HFONT);
544 DECLARE_WIREM_HANDLE(HICON);
545 DECLARE_WIREM_HANDLE(HMENU);
546 DECLARE_WIREM_HANDLE(HWND);
548 typedef HICON HCURSOR;
550 typedef struct tagMSG
552 HWND hwnd;
553 UINT message;
554 WPARAM wParam;
555 LPARAM lParam;
556 DWORD time;
557 POINT pt;
558 } MSG, *PMSG, *NPMSG, *LPMSG;
560 cpp_quote("#endif")
562 /******************** GUID TYPES ********************/
564 cpp_quote("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
565 typedef GUID *REFGUID;
566 typedef IID *REFIID;
567 typedef CLSID *REFCLSID;
568 typedef FMTID *REFFMTID;
569 cpp_quote("#endif")
571 /******************** MISC TYPES ********************/
573 typedef enum tagDVASPECT {
574 DVASPECT_CONTENT = 1,
575 DVASPECT_THUMBNAIL = 2,
576 DVASPECT_ICON = 4,
577 DVASPECT_DOCPRINT = 8
578 } DVASPECT;
580 typedef enum tagSTGC {
581 STGC_DEFAULT = 0,
582 STGC_OVERWRITE = 1,
583 STGC_ONLYIFCURRENT = 2,
584 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
585 STGC_CONSOLIDATE = 8
586 } STGC;
588 typedef enum tagSTGMOVE {
589 STGMOVE_MOVE = 0,
590 STGMOVE_COPY = 1,
591 STGMOVE_SHALLOWCOPY = 2
592 } STGMOVE;
594 typedef enum tagSTATFLAG {
595 STATFLAG_DEFAULT = 0,
596 STATFLAG_NONAME = 1,
597 STATFLAG_NOOPEN = 2
598 } STATFLAG;
600 /******************** OLE Automation ********************/
602 cpp_quote("#if 0") /* for IDL only */
603 typedef double DATE;
604 cpp_quote("#else")
605 cpp_quote("typedef double DECLSPEC_ALIGN(8) DATE;")
606 cpp_quote("#endif")
608 cpp_quote("#if 0") /* for IDL only */
609 typedef struct tagCY {
610 LONGLONG int64;
611 } CY;
612 cpp_quote("#else") /* C/C++ defs */
613 cpp_quote("#ifndef _tagCY_DEFINED")
614 cpp_quote("#define _tagCY_DEFINED")
615 cpp_quote("typedef union tagCY {")
616 cpp_quote(" struct {")
617 cpp_quote("#ifdef WORDS_BIGENDIAN")
618 cpp_quote(" LONG Hi;")
619 cpp_quote(" ULONG Lo;")
620 cpp_quote("#else")
621 cpp_quote(" ULONG Lo;")
622 cpp_quote(" LONG Hi;")
623 cpp_quote("#endif")
624 cpp_quote(" } DUMMYSTRUCTNAME;")
625 cpp_quote(" LONGLONG int64;")
626 cpp_quote("} CY;")
627 cpp_quote("#endif")
628 cpp_quote("#endif")
630 typedef CY *LPCY;
632 cpp_quote("#if 0") /* for IDL only */
633 typedef struct tagDEC {
634 USHORT wReserved;
635 BYTE scale;
636 BYTE sign;
637 ULONG Hi32;
638 ULONGLONG Lo64;
639 } DECIMAL;
640 cpp_quote("#else") /* C/C++ defs */
641 cpp_quote("typedef struct tagDEC {")
642 cpp_quote(" USHORT wReserved;")
643 cpp_quote(" union {")
644 cpp_quote(" struct {")
645 cpp_quote(" BYTE scale;")
646 cpp_quote(" BYTE sign;")
647 cpp_quote(" } DUMMYSTRUCTNAME;")
648 cpp_quote(" USHORT signscale;")
649 cpp_quote(" } DUMMYUNIONNAME;")
650 cpp_quote(" ULONG Hi32;")
651 cpp_quote(" union {")
652 cpp_quote(" struct {")
653 cpp_quote("#ifdef WORDS_BIGENDIAN")
654 cpp_quote(" ULONG Mid32;")
655 cpp_quote(" ULONG Lo32;")
656 cpp_quote("#else")
657 cpp_quote(" ULONG Lo32;")
658 cpp_quote(" ULONG Mid32;")
659 cpp_quote("#endif")
660 cpp_quote(" } DUMMYSTRUCTNAME1;")
661 cpp_quote(" ULONGLONG Lo64;")
662 cpp_quote(" } DUMMYUNIONNAME1;")
663 cpp_quote("} DECIMAL;")
664 cpp_quote("#endif")
665 cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
666 cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
668 typedef DECIMAL *LPDECIMAL;
670 typedef [unique] FLAGGED_WORD_BLOB *wireBSTR;
671 typedef [wire_marshal(wireBSTR)] OLECHAR *BSTR;
672 typedef BSTR *LPBSTR;
674 typedef short VARIANT_BOOL;
675 typedef VARIANT_BOOL _VARIANT_BOOL;
676 cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
677 cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
679 typedef struct tagBSTRBLOB {
680 ULONG cbSize;
681 [size_is(cbSize)] BYTE *pData;
682 } BSTRBLOB, *LPBSTRBLOB;
684 cpp_quote("#ifndef _tagBLOB_DEFINED")
685 cpp_quote("#define _tagBLOB_DEFINED")
686 cpp_quote("#define _BLOB_DEFINED")
687 cpp_quote("#define _LPBLOB_DEFINED")
688 typedef struct tagBLOB {
689 ULONG cbSize;
690 [size_is(cbSize)] BYTE *pBlobData;
691 } BLOB, *LPBLOB;
692 cpp_quote("#endif")
694 typedef struct tagCLIPDATA {
695 ULONG cbSize;
696 long ulClipFmt;
697 [size_is(cbSize-sizeof(long))] BYTE *pClipData;
698 } CLIPDATA;
699 cpp_quote("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
701 typedef ULONG PROPID;
703 /******************** VARTYPE ********************/
705 typedef unsigned short VARTYPE;
706 enum VARENUM {
707 VT_EMPTY = 0,
708 VT_NULL = 1,
709 VT_I2 = 2,
710 VT_I4 = 3,
711 VT_R4 = 4,
712 VT_R8 = 5,
713 VT_CY = 6,
714 VT_DATE = 7,
715 VT_BSTR = 8,
716 VT_DISPATCH = 9,
717 VT_ERROR = 10,
718 VT_BOOL = 11,
719 VT_VARIANT = 12,
720 VT_UNKNOWN = 13,
721 VT_DECIMAL = 14,
722 VT_I1 = 16,
723 VT_UI1 = 17,
724 VT_UI2 = 18,
725 VT_UI4 = 19,
726 VT_I8 = 20,
727 VT_UI8 = 21,
728 VT_INT = 22,
729 VT_UINT = 23,
730 VT_VOID = 24,
731 VT_HRESULT = 25,
732 VT_PTR = 26,
733 VT_SAFEARRAY = 27,
734 VT_CARRAY = 28,
735 VT_USERDEFINED = 29,
736 VT_LPSTR = 30,
737 VT_LPWSTR = 31,
738 VT_RECORD = 36,
739 VT_INT_PTR = 37,
740 VT_UINT_PTR = 38,
741 VT_FILETIME = 64,
742 VT_BLOB = 65,
743 VT_STREAM = 66,
744 VT_STORAGE = 67,
745 VT_STREAMED_OBJECT = 68,
746 VT_STORED_OBJECT = 69,
747 VT_BLOB_OBJECT = 70,
748 VT_CF = 71,
749 VT_CLSID = 72,
750 VT_VERSIONED_STREAM= 73,
751 VT_BSTR_BLOB = 0x0fff,
752 VT_VECTOR = 0x1000,
753 VT_ARRAY = 0x2000,
754 VT_BYREF = 0x4000,
755 VT_RESERVED = 0x8000,
756 VT_ILLEGAL = 0xffff,
757 VT_ILLEGALMASKED = 0x0fff,
758 VT_TYPEMASK = 0x0fff
761 typedef struct tagCSPLATFORM
763 DWORD dwPlatformId;
764 DWORD dwVersionHi;
765 DWORD dwVersionLo;
766 DWORD dwProcessorArch;
767 } CSPLATFORM;
769 typedef struct tagQUERYCONTEXT
771 DWORD dwContext;
772 CSPLATFORM Platform;
773 LCID Locale;
774 DWORD dwVersionHi;
775 DWORD dwVersionLo;
776 } QUERYCONTEXT;
778 typedef [v1_enum] enum tagTYSPEC
780 TYSPEC_CLSID,
781 TYSPEC_FILEEXT,
782 TYSPEC_MIMETYPE,
783 TYSPEC_PROGID,
784 TYSPEC_FILENAME,
785 TYSPEC_PACKAGENAME,
786 TYSPEC_OBJECTID
787 } TYSPEC;
789 typedef union switch(DWORD tyspec)
791 case TYSPEC_CLSID:
792 CLSID clsid;
793 case TYSPEC_FILEEXT:
794 LPOLESTR pFileExt;
795 case TYSPEC_MIMETYPE:
796 LPOLESTR pMimeType;
797 case TYSPEC_PROGID:
798 LPOLESTR pProgId;
799 case TYSPEC_FILENAME:
800 LPOLESTR pFileName;
801 case TYSPEC_PACKAGENAME:
802 struct
804 LPOLESTR pPackageName;
805 GUID PolicyId;
806 } ByName;
807 case TYSPEC_OBJECTID:
808 struct
810 GUID ObjectId;
811 GUID PolicyId;
812 } ByObjectId;
813 } uCLSSPEC;
815 } /* interface IWinTypes */