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;
49 typedef void *PVOID, *LPVOID;
51 typedef DWORD *LPDWORD;
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;
66 #define DECLARE_HANDLE(name) typedef void *name
67 #define DECLARE_WIREM_HANDLE(name) typedef [wire_marshal(wire##name)] void*name
69 DECLARE_HANDLE(HACCEL);
71 DECLARE_HANDLE(HFONT);
73 DECLARE_HANDLE(HMENU);
74 DECLARE_HANDLE(HMODULE);
75 DECLARE_HANDLE(HINSTANCE);
77 DECLARE_HANDLE(HTASK);
79 DECLARE_HANDLE(HICON);
81 typedef LONG_PTR LRESULT;
86 typedef unsigned __int64 DWORDLONG;
87 typedef __int64 LONGLONG;
88 typedef unsigned __int64 ULONGLONG;
90 typedef struct _LARGE_INTEGER {
94 typedef struct _ULARGE_INTEGER {
98 typedef struct _SID_IDENTIFIER_AUTHORITY {
100 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
102 typedef struct _SID {
104 UCHAR SubAuthorityCount;
105 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
106 [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
109 typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
111 typedef struct _ACL {
120 typedef struct _SECURITY_DESCRIPTOR {
123 SECURITY_DESCRIPTOR_CONTROL Control;
128 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
130 typedef struct _SECURITY_ATTRIBUTES
133 LPVOID lpSecurityDescriptor;
135 } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
137 typedef struct tagSIZE
141 } SIZE, *PSIZE, *LPSIZE;
142 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
144 typedef struct tagPOINT
148 } POINT, *PPOINT, *LPPOINT;
150 typedef struct _POINTL
156 typedef struct tagRECT
162 } RECT, *PRECT, *LPRECT;
163 typedef const RECT *LPCRECT;
165 typedef struct _RECTL
171 } RECTL, *PRECTL, *LPRECTL;
172 typedef const RECTL *LPCRECTL;
174 typedef UINT_PTR WPARAM;
175 typedef LONG_PTR LPARAM;
177 typedef struct tagMSG
185 } MSG, *PMSG, *NPMSG, *LPMSG;
187 cpp_quote("#endif /* winnt.h */")
189 cpp_quote("#if 0") /* for IDL only */
190 typedef double DOUBLE;
192 cpp_quote("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
195 cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
196 cpp_quote("#define _PALETTEENTRY_DEFINED")
197 typedef struct tagPALETTEENTRY {
202 } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
205 cpp_quote("#ifndef _LOGPALETTE_DEFINED")
206 cpp_quote("#define _LOGPALETTE_DEFINED")
207 typedef struct tagLOGPALETTE
211 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[*];
212 } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
215 cpp_quote("#ifndef _FILETIME_")
216 cpp_quote("#define _FILETIME_")
217 typedef struct _FILETIME {
219 DWORD dwHighDateTime;
220 } FILETIME, *PFILETIME, *LPFILETIME;
223 cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
224 cpp_quote("#define _TEXTMETRIC_DEFINED")
225 typedef struct tagTEXTMETRICA
230 LONG tmInternalLeading;
231 LONG tmExternalLeading;
236 LONG tmDigitizedAspectX;
237 LONG tmDigitizedAspectY;
245 BYTE tmPitchAndFamily;
247 } TEXTMETRICA, *LPTEXTMETRICA, *PTEXTMETRICA;
249 typedef struct tagTEXTMETRICW
254 LONG tmInternalLeading;
255 LONG tmExternalLeading;
260 LONG tmDigitizedAspectX;
261 LONG tmDigitizedAspectY;
269 BYTE tmPitchAndFamily;
271 } TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
274 /******************** BASIC COM/OLE TYPES ********************/
276 typedef WCHAR OLECHAR;
277 typedef [string] OLECHAR *LPOLESTR;
278 typedef [string] const OLECHAR *LPCOLESTR;
279 cpp_quote("#ifndef __WINESRC__")
280 cpp_quote("#define OLESTR(str) L##str")
285 typedef struct _COAUTHIDENTITY {
286 [size_is(UserLength+1)] USHORT *User;
288 [size_is(DomainLength+1)] USHORT *Domain;
290 [size_is(PasswordLength+1)] USHORT *Password;
291 ULONG PasswordLength;
295 typedef struct _COAUTHINFO {
298 LPWSTR pwszServerPrincName;
300 DWORD dwImpersonationLevel;
301 COAUTHIDENTITY *pAuthIdentityData;
302 DWORD dwCapabilities;
305 /* FIXME: COSERVERINFO was in Wine's pre-WIDL wtypes.h, but should be in objidl.idl */
306 typedef struct _COSERVERINFO {
309 COAUTHINFO *pAuthInfo;
313 typedef enum tagMEMCTX {
316 MEMCTX_MACSYSTEM = 3,
321 cpp_quote("#ifndef _ROTFLAGS_DEFINED")
322 cpp_quote("#define _ROTFLAGS_DEFINED")
323 cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
324 cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
327 typedef enum tagCLSCTX {
328 CLSCTX_INPROC_SERVER = 0x1,
329 CLSCTX_INPROC_HANDLER = 0x2,
330 CLSCTX_LOCAL_SERVER = 0x4,
331 CLSCTX_INPROC_SERVER16 = 0x8,
332 CLSCTX_REMOTE_SERVER = 0x10,
333 CLSCTX_INPROC_HANDLER16 = 0x20,
334 CLSCTX_INPROC_SERVERX86 = 0x40,
335 CLSCTX_INPROC_HANDLERX86 = 0x80,
336 CLSCTX_ESERVER_HANDLER = 0x100,
337 CLSCTX_NO_CODE_DOWNLOAD = 0x400,
338 CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
339 CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
340 CLSCTX_NO_FAILURE_LOG = 0x4000,
341 CLSCTX_DISABLE_AAA = 0x8000,
342 CLSCTX_ENABLE_AAA = 0x10000,
343 CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
346 cpp_quote("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
347 cpp_quote("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
348 cpp_quote("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
350 typedef enum tagMSHLFLAGS {
351 MSHLFLAGS_NORMAL = 0,
352 MSHLFLAGS_TABLESTRONG = 1,
353 MSHLFLAGS_TABLEWEAK = 2,
357 typedef enum tagMSHCTX {
359 MSHCTX_NOSHAREDMEM = 1,
360 MSHCTX_DIFFERENTMACHINE = 2,
365 /******************** BLOB TYPES ********************/
367 typedef struct _BYTE_BLOB {
368 unsigned long clSize;
369 [size_is(clSize)] byte abData[];
371 typedef [unique] BYTE_BLOB *UP_BYTE_BLOB;
373 typedef struct _FLAGGED_BYTE_BLOB {
374 unsigned long fFlags;
375 unsigned long clSize;
376 [size_is(clSize)] byte abData[];
378 typedef [unique] FLAGGED_BYTE_BLOB *UP_FLAGGED_BYTE_BLOB;
380 typedef struct _FLAGGED_WORD_BLOB {
381 unsigned long fFlags;
382 unsigned long clSize;
383 [size_is(clSize)] unsigned short asData[];
385 typedef [unique] FLAGGED_WORD_BLOB *UP_FLAGGED_WORD_BLOB;
387 typedef struct _BYTE_SIZEDARR {
388 unsigned long clSize;
389 [size_is(clSize)] byte *pData;
392 typedef struct _SHORT_SIZEDARR {
393 unsigned long clSize;
394 [size_is(clSize)] unsigned short *pData;
397 typedef struct _LONG_SIZEDARR {
398 unsigned long clSize;
399 [size_is(clSize)] unsigned long *pData;
402 typedef struct _HYPER_SIZEDARR {
403 unsigned long clSize;
404 [size_is(clSize)] hyper *pData;
407 /******************** GDI TYPES ********************/
409 const unsigned long WDT_INPROC_CALL = 0x48746457;
410 const unsigned long WDT_REMOTE_CALL = 0x52746457;
412 typedef union _userCLIPFORMAT switch(long fContext) u {
413 case WDT_INPROC_CALL: DWORD dwValue;
414 case WDT_REMOTE_CALL: LPWSTR pwszName;
417 typedef [unique] userCLIPFORMAT *wireCLIPFORMAT;
418 typedef [wire_marshal(wireCLIPFORMAT)] WORD CLIPFORMAT;
420 typedef struct tagRemHGLOBAL {
422 unsigned long cbData;
423 [size_is(cbData)] byte data[];
426 typedef union _userHGLOBAL switch(long fContext) u {
427 case WDT_INPROC_CALL: long hInproc;
428 case WDT_REMOTE_CALL: FLAGGED_BYTE_BLOB *hRemote;
429 default: long hGlobal;
432 typedef [unique] userHGLOBAL *wireHGLOBAL;
434 typedef struct tagRemHMETAFILEPICT {
438 unsigned long cbData;
439 [size_is(cbData)] byte data[];
442 typedef union _userHMETAFILE switch(long fContext) u {
443 case WDT_INPROC_CALL: long hInproc;
444 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
445 default: long hGlobal;
448 typedef [unique] userHMETAFILE *wireHMETAFILE;
450 typedef struct _remoteMETAFILEPICT {
455 } remoteMETAFILEPICT;
457 typedef union _userHMETAFILEPICT switch(long fContext) u {
458 case WDT_INPROC_CALL: long hInproc;
459 case WDT_REMOTE_CALL: remoteMETAFILEPICT *hRemote;
460 default: long hGlobal;
463 typedef [unique] userHMETAFILEPICT *wireHMETAFILEPICT;
465 typedef struct tagRemHENHMETAFILE {
466 unsigned long cbData;
467 [size_is(cbData)] byte data[];
470 typedef union _userHENHMETAFILE switch(long fContext) u {
471 case WDT_INPROC_CALL: long hInproc;
472 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
473 default: long hGlobal;
476 typedef [unique] userHENHMETAFILE *wireHENHMETAFILE;
478 typedef struct tagRemHBITMAP
480 unsigned long cbData;
481 [size_is(cbData)] byte data[];
484 typedef struct _userBITMAP {
492 [size_is(cbSize)] byte pBuffer[];
495 typedef union _userHBITMAP switch(long fContext) u {
496 case WDT_INPROC_CALL: long hInproc;
497 case WDT_REMOTE_CALL: userBITMAP *hRemote;
498 default: long hGlobal;
501 typedef [unique] userHBITMAP *wireHBITMAP;
503 typedef struct tagRemHPALETTE {
504 unsigned long cbData;
505 [size_is(cbData)] byte data[];
508 typedef struct tagrpcLOGPALETTE {
511 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[];
514 typedef union _userHPALETTE switch(long fContext) u {
515 case WDT_INPROC_CALL: long hInproc;
516 case WDT_REMOTE_CALL: rpcLOGPALETTE *hRemote;
517 default: long hGlobal;
520 typedef [unique] userHPALETTE *wireHPALETTE;
523 DECLARE_WIREM_HANDLE(HGLOBAL);
524 typedef HGLOBAL HLOCAL;
525 DECLARE_WIREM_HANDLE(HBITMAP);
526 DECLARE_WIREM_HANDLE(HPALETTE);
527 DECLARE_WIREM_HANDLE(HENHMETAFILE);
528 DECLARE_WIREM_HANDLE(HMETAFILE);
530 DECLARE_WIREM_HANDLE(HMETAFILEPICT);
532 /******************** GUID TYPES ********************/
534 cpp_quote("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
535 typedef GUID *REFGUID;
537 typedef CLSID *REFCLSID;
538 typedef FMTID *REFFMTID;
541 /******************** MISC TYPES ********************/
543 typedef enum tagDVASPECT {
544 DVASPECT_CONTENT = 1,
545 DVASPECT_THUMBNAIL = 2,
547 DVASPECT_DOCPRINT = 8
550 typedef enum tagSTGC {
553 STGC_ONLYIFCURRENT = 2,
554 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
558 typedef enum tagSTGMOVE {
561 STGMOVE_SHALLOWCOPY = 2
564 typedef enum tagSTATFLAG {
565 STATFLAG_DEFAULT = 0,
570 /******************** OLE Automation ********************/
572 cpp_quote("#if 0") /* for IDL only */
575 cpp_quote("typedef double DECLSPEC_ALIGN(8) DATE;")
578 cpp_quote("#if 0") /* for IDL only */
579 typedef struct tagCY {
582 cpp_quote("#else") /* C/C++ defs */
583 cpp_quote("#ifndef _tagCY_DEFINED")
584 cpp_quote("#define _tagCY_DEFINED")
585 cpp_quote("typedef union tagCY {")
586 cpp_quote(" struct {")
587 cpp_quote("#ifdef WORDS_BIGENDIAN")
588 cpp_quote(" LONG Hi;")
589 cpp_quote(" ULONG Lo;")
591 cpp_quote(" ULONG Lo;")
592 cpp_quote(" LONG Hi;")
594 cpp_quote(" } DUMMYSTRUCTNAME;")
595 cpp_quote(" LONGLONG int64;")
602 cpp_quote("#if 0") /* for IDL only */
603 typedef struct tagDEC {
610 cpp_quote("#else") /* C/C++ defs */
611 cpp_quote("typedef struct tagDEC {")
612 cpp_quote(" USHORT wReserved;")
613 cpp_quote(" union {")
614 cpp_quote(" struct {")
615 cpp_quote(" BYTE scale;")
616 cpp_quote(" BYTE sign;")
617 cpp_quote(" } DUMMYSTRUCTNAME;")
618 cpp_quote(" USHORT signscale;")
619 cpp_quote(" } DUMMYUNIONNAME;")
620 cpp_quote(" ULONG Hi32;")
621 cpp_quote(" union {")
622 cpp_quote(" struct {")
623 cpp_quote("#ifdef WORDS_BIGENDIAN")
624 cpp_quote(" ULONG Mid32;")
625 cpp_quote(" ULONG Lo32;")
627 cpp_quote(" ULONG Lo32;")
628 cpp_quote(" ULONG Mid32;")
630 cpp_quote(" } DUMMYSTRUCTNAME1;")
631 cpp_quote(" ULONGLONG Lo64;")
632 cpp_quote(" } DUMMYUNIONNAME1;")
633 cpp_quote("} DECIMAL;")
635 cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
636 cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
638 typedef DECIMAL *LPDECIMAL;
640 typedef [unique] FLAGGED_WORD_BLOB *wireBSTR;
641 typedef [wire_marshal(wireBSTR)] OLECHAR *BSTR;
642 typedef BSTR *LPBSTR;
644 typedef short VARIANT_BOOL;
645 typedef VARIANT_BOOL _VARIANT_BOOL;
646 cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
647 cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
649 typedef struct tagBSTRBLOB {
651 [size_is(cbSize)] BYTE *pData;
652 } BSTRBLOB, *LPBSTRBLOB;
654 cpp_quote("#ifndef _tagBLOB_DEFINED")
655 cpp_quote("#define _tagBLOB_DEFINED")
656 cpp_quote("#define _BLOB_DEFINED")
657 cpp_quote("#define _LPBLOB_DEFINED")
658 typedef struct tagBLOB {
660 [size_is(cbSize)] BYTE *pBlobData;
664 typedef struct tagCLIPDATA {
667 [size_is(cbSize-sizeof(long))] BYTE *pClipData;
669 cpp_quote("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
671 typedef ULONG PROPID;
673 /******************** VARTYPE ********************/
675 typedef unsigned short VARTYPE;
715 VT_STREAMED_OBJECT = 68,
716 VT_STORED_OBJECT = 69,
720 VT_BSTR_BLOB = 0x0fff,
724 VT_RESERVED = 0x8000,
726 VT_ILLEGALMASKED = 0x0fff,
730 typedef struct tagCSPLATFORM
735 DWORD dwProcessorArch;
738 typedef struct tagQUERYCONTEXT
747 typedef [v1_enum] enum tagTYSPEC
758 typedef union switch(DWORD tyspec)
764 case TYSPEC_MIMETYPE:
768 case TYSPEC_FILENAME:
770 case TYSPEC_PACKAGENAME:
773 LPOLESTR pPackageName;
776 case TYSPEC_OBJECTID:
784 } /* interface IWinTypes */