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
25 uuid(D3980A60-910C-1068-9341-00DD010F2F1C),
27 pointer_default(unique)
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;
40 typedef unsigned char UCHAR;
42 typedef unsigned int UINT;
44 typedef unsigned short USHORT;
46 typedef unsigned long ULONG;
48 typedef double DOUBLE;
50 typedef void *PVOID, *LPVOID;
53 typedef [string] CHAR *LPSTR;
54 typedef [string] const CHAR *LPCSTR;
56 typedef wchar_t WCHAR;
57 typedef [string] WCHAR *LPWSTR;
58 typedef [string] const WCHAR *LPCWSTR;
60 typedef boolean BOOLEAN;
62 typedef DWORD COLORREF;
65 #define DECLARE_HANDLE(name) typedef void *name
66 #define DECLARE_WIREM_HANDLE(name) typedef [wire_marshal(wire##name)] void*name
68 DECLARE_HANDLE(HACCEL);
70 DECLARE_HANDLE(HFONT);
72 DECLARE_HANDLE(HMENU);
73 DECLARE_HANDLE(HMODULE);
74 DECLARE_HANDLE(HINSTANCE);
76 DECLARE_HANDLE(HTASK);
79 typedef LONG_PTR LRESULT;
85 typedef unsigned __int64 DWORDLONG;
86 typedef __int64 LONGLONG;
87 typedef unsigned __int64 ULONGLONG;
89 typedef struct _LARGE_INTEGER {
93 typedef struct _ULARGE_INTEGER {
97 typedef struct _SID_IDENTIFIER_AUTHORITY {
99 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
101 typedef struct _SID {
103 UCHAR SubAuthorityCount;
104 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
105 [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
108 typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
110 typedef struct _ACL {
119 typedef struct _SECURITY_DESCRIPTOR {
122 SECURITY_DESCRIPTOR_CONTROL Control;
127 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
129 typedef struct tagSIZE
133 } SIZE, *PSIZE, *LPSIZE;
134 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
136 typedef struct tagPOINT
140 } POINT, *PPOINT, *LPPOINT;
142 typedef struct _POINTL
148 typedef struct tagRECT
154 } RECT, *PRECT, *LPRECT;
155 typedef const RECT *LPCRECT;
157 typedef struct _RECTL
163 } RECTL, *PRECTL, *LPRECTL;
164 typedef const RECTL *LPCRECTL;
166 typedef UINT_PTR WPARAM;
167 typedef LONG_PTR LPARAM;
169 typedef struct tagMSG
177 } MSG, *PMSG, *NPMSG, *LPMSG;
179 cpp_quote("#endif /* winnt.h */")
181 cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
182 cpp_quote("#define _PALETTEENTRY_DEFINED")
183 typedef struct tagPALETTEENTRY {
188 } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
191 cpp_quote("#ifndef _LOGPALETTE_DEFINED")
192 cpp_quote("#define _LOGPALETTE_DEFINED")
193 typedef struct tagLOGPALETTE
197 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[*];
198 } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
201 cpp_quote("#ifndef _FILETIME_")
202 cpp_quote("#define _FILETIME_")
203 typedef struct _FILETIME {
205 DWORD dwHighDateTime;
206 } FILETIME, *PFILETIME, *LPFILETIME;
209 cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
210 cpp_quote("#define _TEXTMETRIC_DEFINED")
216 LONG tmInternalLeading;
217 LONG tmExternalLeading;
222 LONG tmDigitizedAspectX;
223 LONG tmDigitizedAspectY;
231 BYTE tmPitchAndFamily;
233 } TEXTMETRICA, *LPTEXTMETRICA, *PTEXTMETRICA;
240 LONG tmInternalLeading;
241 LONG tmExternalLeading;
246 LONG tmDigitizedAspectX;
247 LONG tmDigitizedAspectY;
255 BYTE tmPitchAndFamily;
257 } TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
260 /******************** BASIC COM/OLE TYPES ********************/
262 typedef WCHAR OLECHAR;
263 typedef [string] OLECHAR *LPOLESTR;
264 typedef [string] const OLECHAR *LPCOLESTR;
265 cpp_quote("#ifndef __WINESRC__")
266 cpp_quote("#define OLESTR(str) WINE_UNICODE_TEXT(str)")
269 /* from Wine's pre-WIDL wtypes.h */
270 /* FIXME: does not belong here */
271 typedef CHAR OLECHAR16;
272 typedef LPSTR LPOLESTR16;
273 typedef LPCSTR LPCOLESTR16;
274 /* quoted because if BSTR16 is ever used in IDL files,
275 * it'll probably need some wire_marshal stuff too,
276 * and quoting these will detect any such necessity */
277 cpp_quote("typedef OLECHAR16 *BSTR16;")
278 cpp_quote("typedef BSTR16 *LPBSTR16;")
279 cpp_quote("#define OLESTR16(x) x")
283 typedef struct _COAUTHIDENTITY {
284 [size_is(UserLength+1)] USHORT *User;
286 [size_is(DomainLength+1)] USHORT *Domain;
288 [size_is(PasswordLength+1)] USHORT *Password;
289 ULONG PasswordLength;
293 typedef struct _COAUTHINFO {
296 LPWSTR pwszServerPrincName;
298 DWORD dwImpersonationLevel;
299 COAUTHIDENTITY *pAuthIdentityData;
300 DWORD dwCapabilities;
303 /* FIXME: COSERVERINFO was in Wine's pre-WIDL wtypes.h, but should be in objidl.idl */
304 typedef struct _COSERVERINFO {
307 COAUTHINFO *pAuthInfo;
311 typedef enum tagMEMCTX {
314 MEMCTX_MACSYSTEM = 3,
319 cpp_quote("#ifndef _ROTFLAGS_DEFINED")
320 cpp_quote("#define _ROTFLAGS_DEFINED")
321 cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
322 cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
325 typedef enum tagCLSCTX {
326 CLSCTX_INPROC_SERVER = 0x1,
327 CLSCTX_INPROC_HANDLER = 0x2,
328 CLSCTX_LOCAL_SERVER = 0x4,
329 CLSCTX_INPROC_SERVER16 = 0x8,
330 CLSCTX_REMOTE_SERVER = 0x10,
331 CLSCTX_INPROC_HANDLER16 = 0x20,
332 CLSCTX_INPROC_SERVERX86 = 0x40,
333 CLSCTX_INPROC_HANDLERX86 = 0x80,
334 CLSCTX_ESERVER_HANDLER = 0x100,
335 CLSCTX_NO_CODE_DOWNLOAD = 0x400,
336 CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
337 CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
338 CLSCTX_NO_FAILURE_LOG = 0x4000,
339 CLSCTX_DISABLE_AAA = 0x8000,
340 CLSCTX_ENABLE_AAA = 0x10000,
341 CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
344 cpp_quote("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
345 cpp_quote("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
346 cpp_quote("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
348 typedef enum tagMSHLFLAGS {
349 MSHLFLAGS_NORMAL = 0,
350 MSHLFLAGS_TABLESTRONG = 1,
351 MSHLFLAGS_TABLEWEAK = 2,
355 typedef enum tagMSHCTX {
357 MSHCTX_NOSHAREDMEM = 1,
358 MSHCTX_DIFFERENTMACHINE = 2,
363 /******************** BLOB TYPES ********************/
365 typedef struct _BYTE_BLOB {
366 unsigned long clSize;
367 [size_is(clSize)] byte abData[];
369 typedef [unique] BYTE_BLOB *UP_BYTE_BLOB;
371 typedef struct _FLAGGED_BYTE_BLOB {
372 unsigned long fFlags;
373 unsigned long clSize;
374 [size_is(clSize)] byte abData[];
376 typedef [unique] FLAGGED_BYTE_BLOB *UP_FLAGGED_BYTE_BLOB;
378 typedef struct _FLAGGED_WORD_BLOB {
379 unsigned long fFlags;
380 unsigned long clSize;
381 [size_is(clSize)] unsigned short asData[];
383 typedef [unique] FLAGGED_WORD_BLOB *UP_FLAGGED_WORD_BLOB;
385 typedef struct _BYTE_SIZEDARR {
386 unsigned long clSize;
387 [size_is(clSize)] byte *pData;
390 typedef struct _SHORT_SIZEDARR {
391 unsigned long clSize;
392 [size_is(clSize)] unsigned short *pData;
395 typedef struct _LONG_SIZEDARR {
396 unsigned long clSize;
397 [size_is(clSize)] unsigned long *pData;
400 typedef struct _HYPER_SIZEDARR {
401 unsigned long clSize;
402 [size_is(clSize)] hyper *pData;
405 /******************** GDI TYPES ********************/
407 const unsigned long WDT_INPROC_CALL = 0x48746457;
408 const unsigned long WDT_REMOTE_CALL = 0x52746457;
410 typedef union _userCLIPFORMAT switch(long fContext) u {
411 case WDT_INPROC_CALL: DWORD dwValue;
412 case WDT_REMOTE_CALL: LPWSTR pwszName;
415 typedef [unique] userCLIPFORMAT *wireCLIPFORMAT;
416 typedef [wire_marshal(wireCLIPFORMAT)] WORD CLIPFORMAT;
418 typedef struct tagRemHGLOBAL {
420 unsigned long cbData;
421 [size_is(cbData)] byte data[];
424 typedef union _userHGLOBAL switch(long fContext) u {
425 case WDT_INPROC_CALL: long hInproc;
426 case WDT_REMOTE_CALL: FLAGGED_BYTE_BLOB *hRemote;
427 default: long hGlobal;
430 typedef [unique] userHGLOBAL *wireHGLOBAL;
432 typedef struct tagRemHMETAFILEPICT {
436 unsigned long cbData;
437 [size_is(cbData)] byte data[];
440 typedef union _userHMETAFILE switch(long fContext) u {
441 case WDT_INPROC_CALL: long hInproc;
442 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
443 default: long hGlobal;
446 typedef [unique] userHMETAFILE *wireHMETAFILE;
448 typedef struct _remoteMETAFILEPICT {
453 } remoteMETAFILEPICT;
455 typedef union _userHMETAFILEPICT switch(long fContext) u {
456 case WDT_INPROC_CALL: long hInproc;
457 case WDT_REMOTE_CALL: remoteMETAFILEPICT *hRemote;
458 default: long hGlobal;
461 typedef [unique] userHMETAFILEPICT *wireHMETAFILEPICT;
463 typedef struct tagRemHENHMETAFILE {
464 unsigned long cbData;
465 [size_is(cbData)] byte data[];
468 typedef union _userHENHMETAFILE switch(long fContext) u {
469 case WDT_INPROC_CALL: long hInproc;
470 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
471 default: long hGlobal;
474 typedef [unique] userHENHMETAFILE *wireHENHMETAFILE;
476 typedef struct tagRemHBITMAP
478 unsigned long cbData;
479 [size_is(cbData)] byte data[];
482 typedef struct _userBITMAP {
490 [size_is(cbSize)] byte pBuffer[];
493 typedef union _userHBITMAP switch(long fContext) u {
494 case WDT_INPROC_CALL: long hInproc;
495 case WDT_REMOTE_CALL: userBITMAP *hRemote;
496 default: long hGlobal;
499 typedef [unique] userHBITMAP *wireHBITMAP;
501 typedef struct tagRemHPALETTE {
502 unsigned long cbData;
503 [size_is(cbData)] byte data[];
506 typedef struct tagrpcLOGPALETTE {
509 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[];
512 typedef union _userHPALETTE switch(long fContext) u {
513 case WDT_INPROC_CALL: long hInproc;
514 case WDT_REMOTE_CALL: rpcLOGPALETTE *hRemote;
515 default: long hGlobal;
518 typedef [unique] userHPALETTE *wireHPALETTE;
521 DECLARE_WIREM_HANDLE(HGLOBAL);
522 typedef HGLOBAL HLOCAL;
523 DECLARE_WIREM_HANDLE(HBITMAP);
524 DECLARE_WIREM_HANDLE(HPALETTE);
525 DECLARE_WIREM_HANDLE(HENHMETAFILE);
526 DECLARE_WIREM_HANDLE(HMETAFILE);
528 DECLARE_WIREM_HANDLE(HMETAFILEPICT);
530 /******************** GUID TYPES ********************/
532 cpp_quote("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
533 typedef GUID *REFGUID;
535 typedef CLSID *REFCLSID;
536 typedef FMTID *REFFMTID;
539 /******************** MISC TYPES ********************/
541 typedef enum tagDVASPECT {
542 DVASPECT_CONTENT = 1,
543 DVASPECT_THUMBNAIL = 2,
545 DVASPECT_DOCPRINT = 8
548 typedef enum tagSTGC {
551 STGC_ONLYIFCURRENT = 2,
552 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
556 typedef enum tagSTGMOVE {
559 STGMOVE_SHALLOWCOPY = 2
562 typedef enum tagSTATFLAG {
563 STATFLAG_DEFAULT = 0,
568 /******************** OLE Automation ********************/
570 cpp_quote("#if 0") /* for IDL only */
571 typedef struct tagCY {
574 cpp_quote("#else") /* C/C++ defs */
575 cpp_quote("typedef union tagCY {")
576 cpp_quote(" struct {")
577 cpp_quote("#ifdef WORDS_BIGENDIAN")
578 cpp_quote(" LONG Hi;")
579 cpp_quote(" ULONG Lo;")
581 cpp_quote(" ULONG Lo;")
582 cpp_quote(" LONG Hi;")
584 cpp_quote(" } DUMMYSTRUCTNAME;")
585 cpp_quote(" LONGLONG int64;")
591 cpp_quote("#if 0") /* for IDL only */
592 typedef struct tagDEC {
599 cpp_quote("#else") /* C/C++ defs */
600 cpp_quote("typedef struct tagDEC {")
601 cpp_quote(" USHORT wReserved;")
602 cpp_quote(" union {")
603 cpp_quote(" struct {")
604 cpp_quote(" BYTE scale;")
605 cpp_quote(" BYTE sign;")
606 cpp_quote(" } DUMMYSTRUCTNAME;")
607 cpp_quote(" USHORT signscale;")
608 cpp_quote(" } DUMMYUNIONNAME;")
609 cpp_quote(" ULONG Hi32;")
610 cpp_quote(" union {")
611 cpp_quote(" struct {")
612 cpp_quote("#ifdef WORDS_BIGENDIAN")
613 cpp_quote(" ULONG Mid32;")
614 cpp_quote(" ULONG Lo32;")
616 cpp_quote(" ULONG Lo32;")
617 cpp_quote(" ULONG Mid32;")
619 cpp_quote(" } DUMMYSTRUCTNAME1;")
620 cpp_quote(" ULONGLONG Lo64;")
621 cpp_quote(" } DUMMYUNIONNAME1;")
622 cpp_quote("} DECIMAL;")
624 cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
625 cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
627 typedef DECIMAL *LPDECIMAL;
629 typedef [unique] FLAGGED_WORD_BLOB *wireBSTR;
630 typedef [wire_marshal(wireBSTR)] OLECHAR *BSTR;
631 typedef BSTR *LPBSTR;
633 typedef short VARIANT_BOOL;
634 typedef VARIANT_BOOL _VARIANT_BOOL;
635 cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
636 cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
638 typedef struct tagBSTRBLOB {
640 [size_is(cbSize)] BYTE *pData;
641 } BSTRBLOB, *LPBSTRBLOB;
643 typedef struct tagBLOB {
645 [size_is(cbSize)] BYTE *pBlobData;
648 typedef struct tagCLIPDATA {
651 [size_is(cbSize-sizeof(long))] BYTE *pClipData;
653 cpp_quote("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
655 typedef ULONG PROPID;
657 /******************** VARTYPE ********************/
659 typedef unsigned short VARTYPE;
699 VT_STREAMED_OBJECT = 68,
700 VT_STORED_OBJECT = 69,
704 VT_BSTR_BLOB = 0x0fff,
708 VT_RESERVED = 0x8000,
710 VT_ILLEGALMASKED = 0x0fff,
714 } /* interface IWinTypes */