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