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;
63 #define DECLARE_HANDLE(name) typedef void *name
64 #define DECLARE_WIREM_HANDLE(name) typedef [wire_marshal(wire##name)] void*name
66 DECLARE_HANDLE(HACCEL);
68 DECLARE_HANDLE(HFONT);
70 DECLARE_HANDLE(HMENU);
71 DECLARE_HANDLE(HMODULE);
72 DECLARE_HANDLE(HINSTANCE);
74 DECLARE_HANDLE(HTASK);
77 typedef LONG_PTR LRESULT;
83 typedef unsigned __int64 DWORDLONG;
84 typedef __int64 LONGLONG;
85 typedef unsigned __int64 ULONGLONG;
87 typedef struct _LARGE_INTEGER {
91 typedef struct _ULARGE_INTEGER {
95 typedef struct _SID_IDENTIFIER_AUTHORITY {
97 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
101 UCHAR SubAuthorityCount;
102 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
103 [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
106 typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
108 typedef struct _ACL {
117 typedef struct _SECURITY_DESCRIPTOR {
120 SECURITY_DESCRIPTOR_CONTROL Control;
125 } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
127 typedef struct tagSIZE
131 } SIZE, *PSIZE, *LPSIZE;
132 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
134 typedef struct tagPOINT
138 } POINT, *PPOINT, *LPPOINT;
140 typedef struct _POINTL
146 typedef struct tagRECT
152 } RECT, *PRECT, *LPRECT;
153 typedef const RECT *LPCRECT;
155 typedef struct _RECTL
161 } RECTL, *PRECTL, *LPRECTL;
162 typedef const RECTL *LPCRECTL;
164 typedef UINT_PTR WPARAM;
165 typedef LONG_PTR LPARAM;
167 typedef struct tagMSG
175 } MSG, *PMSG, *NPMSG, *LPMSG;
177 cpp_quote("#endif /* winnt.h */")
179 cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
180 cpp_quote("#define _PALETTEENTRY_DEFINED")
181 typedef struct tagPALETTEENTRY {
186 } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
189 cpp_quote("#ifndef _LOGPALETTE_DEFINED")
190 cpp_quote("#define _LOGPALETTE_DEFINED")
191 typedef struct tagLOGPALETTE
195 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[*];
196 } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
199 cpp_quote("#ifndef _FILETIME_")
200 cpp_quote("#define _FILETIME_")
201 typedef struct _FILETIME {
203 DWORD dwHighDateTime;
204 } FILETIME, *PFILETIME, *LPFILETIME;
207 cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
208 cpp_quote("#define _TEXTMETRIC_DEFINED")
214 LONG tmInternalLeading;
215 LONG tmExternalLeading;
220 LONG tmDigitizedAspectX;
221 LONG tmDigitizedAspectY;
229 BYTE tmPitchAndFamily;
231 } TEXTMETRICA, *LPTEXTMETRICA, *PTEXTMETRICA;
238 LONG tmInternalLeading;
239 LONG tmExternalLeading;
244 LONG tmDigitizedAspectX;
245 LONG tmDigitizedAspectY;
253 BYTE tmPitchAndFamily;
255 } TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
258 /******************** BASIC COM/OLE TYPES ********************/
260 typedef WCHAR OLECHAR;
261 typedef [string] OLECHAR *LPOLESTR;
262 typedef [string] const OLECHAR *LPCOLESTR;
263 cpp_quote("#ifndef __WINESRC__")
264 cpp_quote("#define OLESTR(str) WINE_UNICODE_TEXT(str)")
267 /* from Wine's pre-WIDL wtypes.h */
268 /* FIXME: does not belong here */
269 typedef CHAR OLECHAR16;
270 typedef LPSTR LPOLESTR16;
271 typedef LPCSTR LPCOLESTR16;
272 /* quoted because if BSTR16 is ever used in IDL files,
273 * it'll probably need some wire_marshal stuff too,
274 * and quoting these will detect any such necessity */
275 cpp_quote("typedef OLECHAR16 *BSTR16;")
276 cpp_quote("typedef BSTR16 *LPBSTR16;")
277 cpp_quote("#define OLESTR16(x) x")
281 typedef struct _COAUTHIDENTITY {
282 [size_is(UserLength+1)] USHORT *User;
284 [size_is(DomainLength+1)] USHORT *Domain;
286 [size_is(PasswordLength+1)] USHORT *Password;
287 ULONG PasswordLength;
291 typedef struct _COAUTHINFO {
294 LPWSTR pwszServerPrincName;
296 DWORD dwImpersonationLevel;
297 COAUTHIDENTITY *pAuthIdentityData;
298 DWORD dwCapabilities;
301 /* FIXME: COSERVERINFO was in Wine's pre-WIDL wtypes.h, but should be in objidl.idl */
302 typedef struct _COSERVERINFO {
305 COAUTHINFO *pAuthInfo;
309 typedef enum tagMEMCTX {
312 MEMCTX_MACSYSTEM = 3,
317 cpp_quote("#ifndef _ROTFLAGS_DEFINED")
318 cpp_quote("#define _ROTFLAGS_DEFINED")
319 cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
320 cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
323 typedef enum tagCLSCTX {
324 CLSCTX_INPROC_SERVER = 0x1,
325 CLSCTX_INPROC_HANDLER = 0x2,
326 CLSCTX_LOCAL_SERVER = 0x4,
327 CLSCTX_INPROC_SERVER16 = 0x8,
328 CLSCTX_REMOTE_SERVER = 0x10,
329 CLSCTX_INPROC_HANDLER16 = 0x20,
330 CLSCTX_INPROC_SERVERX86 = 0x40,
331 CLSCTX_INPROC_HANDLERX86 = 0x80,
332 CLSCTX_ESERVER_HANDLER = 0x100,
333 CLSCTX_NO_CODE_DOWNLOAD = 0x400,
334 CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
335 CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
336 CLSCTX_NO_FAILURE_LOG = 0x4000,
337 CLSCTX_DISABLE_AAA = 0x8000,
338 CLSCTX_ENABLE_AAA = 0x10000,
339 CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
342 cpp_quote("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
343 cpp_quote("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
344 cpp_quote("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
346 typedef enum tagMSHLFLAGS {
347 MSHLFLAGS_NORMAL = 0,
348 MSHLFLAGS_TABLESTRONG = 1,
349 MSHLFLAGS_TABLEWEAK = 2,
353 typedef enum tagMSHCTX {
355 MSHCTX_NOSHAREDMEM = 1,
356 MSHCTX_DIFFERENTMACHINE = 2,
361 /******************** BLOB TYPES ********************/
363 typedef struct _BYTE_BLOB {
364 unsigned long clSize;
365 [size_is(clSize)] byte abData[];
367 typedef [unique] BYTE_BLOB *UP_BYTE_BLOB;
369 typedef struct _FLAGGED_BYTE_BLOB {
370 unsigned long fFlags;
371 unsigned long clSize;
372 [size_is(clSize)] byte abData[];
374 typedef [unique] FLAGGED_BYTE_BLOB *UP_FLAGGED_BYTE_BLOB;
376 typedef struct _FLAGGED_WORD_BLOB {
377 unsigned long fFlags;
378 unsigned long clSize;
379 [size_is(clSize)] unsigned short asData[];
381 typedef [unique] FLAGGED_WORD_BLOB *UP_FLAGGED_WORD_BLOB;
383 typedef struct _BYTE_SIZEDARR {
384 unsigned long clSize;
385 [size_is(clSize)] byte *pData;
388 typedef struct _SHORT_SIZEDARR {
389 unsigned long clSize;
390 [size_is(clSize)] unsigned short *pData;
393 typedef struct _LONG_SIZEDARR {
394 unsigned long clSize;
395 [size_is(clSize)] unsigned long *pData;
398 typedef struct _HYPER_SIZEDARR {
399 unsigned long clSize;
400 [size_is(clSize)] hyper *pData;
403 /******************** GDI TYPES ********************/
405 const unsigned long WDT_INPROC_CALL = 0x48746457;
406 const unsigned long WDT_REMOTE_CALL = 0x52746457;
408 typedef union _userCLIPFORMAT switch(long fContext) u {
409 case WDT_INPROC_CALL: DWORD dwValue;
410 case WDT_REMOTE_CALL: LPWSTR pwszName;
413 typedef [unique] userCLIPFORMAT *wireCLIPFORMAT;
414 typedef [wire_marshal(wireCLIPFORMAT)] WORD CLIPFORMAT;
416 typedef struct tagRemHGLOBAL {
418 unsigned long cbData;
419 [size_is(cbData)] byte data[];
422 typedef union _userHGLOBAL switch(long fContext) u {
423 case WDT_INPROC_CALL: long hInproc;
424 case WDT_REMOTE_CALL: FLAGGED_BYTE_BLOB *hRemote;
425 default: long hGlobal;
428 typedef [unique] userHGLOBAL *wireHGLOBAL;
430 typedef struct tagRemHMETAFILEPICT {
434 unsigned long cbData;
435 [size_is(cbData)] byte data[];
438 typedef union _userHMETAFILE switch(long fContext) u {
439 case WDT_INPROC_CALL: long hInproc;
440 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
441 default: long hGlobal;
444 typedef [unique] userHMETAFILE *wireHMETAFILE;
446 typedef struct _remoteMETAFILEPICT {
451 } remoteMETAFILEPICT;
453 typedef union _userHMETAFILEPICT switch(long fContext) u {
454 case WDT_INPROC_CALL: long hInproc;
455 case WDT_REMOTE_CALL: remoteMETAFILEPICT *hRemote;
456 default: long hGlobal;
459 typedef [unique] userHMETAFILEPICT *wireHMETAFILEPICT;
461 typedef struct tagRemHENHMETAFILE {
462 unsigned long cbData;
463 [size_is(cbData)] byte data[];
466 typedef union _userHENHMETAFILE switch(long fContext) u {
467 case WDT_INPROC_CALL: long hInproc;
468 case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
469 default: long hGlobal;
472 typedef [unique] userHENHMETAFILE *wireHENHMETAFILE;
474 typedef struct tagRemHBITMAP
476 unsigned long cbData;
477 [size_is(cbData)] byte data[];
480 typedef struct _userBITMAP {
488 [size_is(cbSize)] byte pBuffer[];
491 typedef union _userHBITMAP switch(long fContext) u {
492 case WDT_INPROC_CALL: long hInproc;
493 case WDT_REMOTE_CALL: userBITMAP *hRemote;
494 default: long hGlobal;
497 typedef [unique] userHBITMAP *wireHBITMAP;
499 typedef struct tagRemHPALETTE {
500 unsigned long cbData;
501 [size_is(cbData)] byte data[];
504 typedef struct tagrpcLOGPALETTE {
507 [size_is(palNumEntries)] PALETTEENTRY palPalEntry[];
510 typedef union _userHPALETTE switch(long fContext) u {
511 case WDT_INPROC_CALL: long hInproc;
512 case WDT_REMOTE_CALL: rpcLOGPALETTE *hRemote;
513 default: long hGlobal;
516 typedef [unique] userHPALETTE *wireHPALETTE;
519 DECLARE_WIREM_HANDLE(HGLOBAL);
520 typedef HGLOBAL HLOCAL;
521 DECLARE_WIREM_HANDLE(HBITMAP);
522 DECLARE_WIREM_HANDLE(HPALETTE);
523 DECLARE_WIREM_HANDLE(HENHMETAFILE);
524 DECLARE_WIREM_HANDLE(HMETAFILE);
526 DECLARE_WIREM_HANDLE(HMETAFILEPICT);
528 /******************** GUID TYPES ********************/
530 cpp_quote("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
531 typedef GUID *REFGUID;
533 typedef CLSID *REFCLSID;
534 typedef FMTID *REFFMTID;
537 /******************** MISC TYPES ********************/
539 typedef enum tagDVASPECT {
540 DVASPECT_CONTENT = 1,
541 DVASPECT_THUMBNAIL = 2,
543 DVASPECT_DOCPRINT = 8
546 typedef enum tagSTGC {
549 STGC_ONLYIFCURRENT = 2,
550 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
554 typedef enum tagSTGMOVE {
557 STGMOVE_SHALLOWCOPY = 2
560 typedef enum tagSTATFLAG {
561 STATFLAG_DEFAULT = 0,
566 /******************** OLE Automation ********************/
568 cpp_quote("#if 0") /* for IDL only */
569 typedef struct tagCY {
572 cpp_quote("#else") /* C/C++ defs */
573 cpp_quote("typedef union tagCY {")
574 cpp_quote(" struct {")
575 cpp_quote("#ifdef WORDS_BIGENDIAN")
576 cpp_quote(" LONG Hi;")
577 cpp_quote(" ULONG Lo;")
579 cpp_quote(" ULONG Lo;")
580 cpp_quote(" LONG Hi;")
582 cpp_quote(" } DUMMYSTRUCTNAME;")
583 cpp_quote(" LONGLONG int64;")
589 cpp_quote("#if 0") /* for IDL only */
590 typedef struct tagDEC {
597 cpp_quote("#else") /* C/C++ defs */
598 cpp_quote("typedef struct tagDEC {")
599 cpp_quote(" USHORT wReserved;")
600 cpp_quote(" union {")
601 cpp_quote(" struct {")
602 cpp_quote(" BYTE scale;")
603 cpp_quote(" BYTE sign;")
604 cpp_quote(" } DUMMYSTRUCTNAME;")
605 cpp_quote(" USHORT signscale;")
606 cpp_quote(" } DUMMYUNIONNAME;")
607 cpp_quote(" ULONG Hi32;")
608 cpp_quote(" union {")
609 cpp_quote(" struct {")
610 cpp_quote("#ifdef WORDS_BIGENDIAN")
611 cpp_quote(" ULONG Mid32;")
612 cpp_quote(" ULONG Lo32;")
614 cpp_quote(" ULONG Lo32;")
615 cpp_quote(" ULONG Mid32;")
617 cpp_quote(" } DUMMYSTRUCTNAME1;")
618 cpp_quote(" ULONGLONG Lo64;")
619 cpp_quote(" } DUMMYUNIONNAME1;")
620 cpp_quote("} DECIMAL;")
622 cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
623 cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u); }while (0)")
625 typedef DECIMAL *LPDECIMAL;
627 typedef [unique] FLAGGED_WORD_BLOB *wireBSTR;
628 typedef [wire_marshal(wireBSTR)] OLECHAR *BSTR;
629 typedef BSTR *LPBSTR;
631 typedef short VARIANT_BOOL;
632 typedef VARIANT_BOOL _VARIANT_BOOL;
633 cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
634 cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
636 typedef struct tagBSTRBLOB {
638 [size_is(cbSize)] BYTE *pData;
639 } BSTRBLOB, *LPBSTRBLOB;
641 typedef struct tagBLOB {
643 [size_is(cbSize)] BYTE *pBlobData;
646 typedef struct tagCLIPDATA {
649 [size_is(cbSize-sizeof(long))] BYTE *pClipData;
651 cpp_quote("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
653 typedef ULONG PROPID;
655 /******************** VARTYPE ********************/
657 typedef unsigned short VARTYPE;
697 VT_STREAMED_OBJECT = 68,
698 VT_STORED_OBJECT = 69,
702 VT_BSTR_BLOB = 0x0fff,
706 VT_RESERVED = 0x8000,
708 VT_ILLEGALMASKED = 0x0fff,
712 } /* interface IWinTypes */