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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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
(HMODULE
);
70 DECLARE_HANDLE
(HINSTANCE
);
72 DECLARE_HANDLE
(HTASK
);
74 DECLARE_HANDLE
(HDESK
);
78 DECLARE_HANDLE
(HRSRC
);
80 DECLARE_HANDLE
(HWINSTA
);
82 DECLARE_HANDLE
(HGDIOBJ
);
86 typedef LONG_PTR LRESULT
;
90 typedef USHORT LANGID
;
92 typedef unsigned __int64 DWORDLONG
;
93 typedef __int64 LONGLONG
;
94 typedef unsigned __int64 ULONGLONG
;
96 typedef struct _LARGE_INTEGER
{
100 typedef struct _ULARGE_INTEGER
{
104 typedef struct _SID_IDENTIFIER_AUTHORITY
{
106 } SID_IDENTIFIER_AUTHORITY
, *PSID_IDENTIFIER_AUTHORITY
;
108 typedef struct _SID
{
110 UCHAR SubAuthorityCount
;
111 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
112 [size_is(SubAuthorityCount
)] ULONG SubAuthority
[*];
115 typedef USHORT SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
117 typedef struct _ACL
{
126 typedef struct _SECURITY_DESCRIPTOR
{
129 SECURITY_DESCRIPTOR_CONTROL
Control;
134 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
136 typedef struct _SECURITY_ATTRIBUTES
139 [size_is(nLength
)] LPVOID lpSecurityDescriptor
;
141 } SECURITY_ATTRIBUTES
, *PSECURITY_ATTRIBUTES
, *LPSECURITY_ATTRIBUTES
;
143 typedef struct tagSIZE
147 } SIZE
, *PSIZE
, *LPSIZE
;
148 typedef SIZE SIZEL
, *PSIZEL
, *LPSIZEL
;
150 typedef struct tagPOINT
154 } POINT
, *PPOINT
, *LPPOINT
;
156 typedef struct _POINTL
162 typedef struct tagRECT
168 } RECT
, *PRECT
, *LPRECT
;
169 typedef const RECT
*LPCRECT
;
171 typedef struct _RECTL
177 } RECTL
, *PRECTL
, *LPRECTL
;
178 typedef const RECTL
*LPCRECTL
;
180 typedef UINT_PTR WPARAM
;
181 typedef LONG_PTR LPARAM
;
183 cpp_quote
("#endif /* winnt.h */")
185 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
186 typedef double DOUBLE;
188 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
191 cpp_quote
("#ifndef _PALETTEENTRY_DEFINED")
192 cpp_quote
("#define _PALETTEENTRY_DEFINED")
193 typedef struct tagPALETTEENTRY
{
198 } PALETTEENTRY
, *PPALETTEENTRY
, *LPPALETTEENTRY
;
201 cpp_quote
("#ifndef _LOGPALETTE_DEFINED")
202 cpp_quote
("#define _LOGPALETTE_DEFINED")
203 typedef struct tagLOGPALETTE
207 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[*];
208 } LOGPALETTE
, *PLOGPALETTE
, *LPLOGPALETTE
;
211 cpp_quote
("#ifndef _SYSTEMTIME_")
212 cpp_quote
("#define _SYSTEMTIME_")
213 typedef struct _SYSTEMTIME
{
222 } SYSTEMTIME
, *PSYSTEMTIME
, *LPSYSTEMTIME
;
225 cpp_quote
("#ifndef _FILETIME_")
226 cpp_quote
("#define _FILETIME_")
227 typedef struct _FILETIME
{
229 DWORD dwHighDateTime
;
230 } FILETIME
, *PFILETIME
, *LPFILETIME
;
233 cpp_quote
("#ifndef _TEXTMETRIC_DEFINED")
234 cpp_quote
("#define _TEXTMETRIC_DEFINED")
235 typedef struct tagTEXTMETRICA
240 LONG tmInternalLeading
;
241 LONG tmExternalLeading
;
246 LONG tmDigitizedAspectX
;
247 LONG tmDigitizedAspectY
;
255 BYTE tmPitchAndFamily
;
257 } TEXTMETRICA
, *LPTEXTMETRICA
, *PTEXTMETRICA
;
259 typedef struct tagTEXTMETRICW
264 LONG tmInternalLeading
;
265 LONG tmExternalLeading
;
270 LONG tmDigitizedAspectX
;
271 LONG tmDigitizedAspectY
;
279 BYTE tmPitchAndFamily
;
281 } TEXTMETRICW
, *LPTEXTMETRICW
, *PTEXTMETRICW
;
284 /******************** BASIC COM/OLE TYPES ********************/
286 typedef WCHAR OLECHAR
;
287 typedef [string] OLECHAR
*LPOLESTR
;
288 typedef [string] const OLECHAR
*LPCOLESTR
;
289 cpp_quote
("#ifndef __WINESRC__")
290 cpp_quote
("# ifdef WINE_UNICODE_NATIVE")
291 cpp_quote
("# define OLESTR(str) L##str")
293 cpp_quote
("# define OLESTR(str) u##str")
299 typedef struct _COAUTHIDENTITY
{
300 [size_is(UserLength
+1)] USHORT
*User
;
302 [size_is(DomainLength
+1)] USHORT
*Domain
;
304 [size_is(PasswordLength
+1)] USHORT
*Password
;
305 ULONG PasswordLength
;
309 typedef struct _COAUTHINFO
{
312 LPWSTR pwszServerPrincName
;
314 DWORD dwImpersonationLevel
;
315 COAUTHIDENTITY
*pAuthIdentityData
;
316 DWORD dwCapabilities
;
319 typedef enum tagMEMCTX
{
322 MEMCTX_MACSYSTEM
= 3,
327 cpp_quote
("#ifndef _ROT_COMPARE_MAX_DEFINED")
328 cpp_quote
("#define _ROT_COMPARE_MAX_DEFINED")
329 cpp_quote
("#define ROT_COMPARE_MAX 2048")
332 cpp_quote
("#ifndef _ROTFLAGS_DEFINED")
333 cpp_quote
("#define _ROTFLAGS_DEFINED")
334 cpp_quote
("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
335 cpp_quote
("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
338 typedef enum tagCLSCTX
{
339 CLSCTX_INPROC_SERVER
= 0x1,
340 CLSCTX_INPROC_HANDLER
= 0x2,
341 CLSCTX_LOCAL_SERVER
= 0x4,
342 CLSCTX_INPROC_SERVER16
= 0x8,
343 CLSCTX_REMOTE_SERVER
= 0x10,
344 CLSCTX_INPROC_HANDLER16
= 0x20,
345 CLSCTX_INPROC_SERVERX86
= 0x40,
346 CLSCTX_INPROC_HANDLERX86
= 0x80,
347 CLSCTX_ESERVER_HANDLER
= 0x100,
348 CLSCTX_NO_CODE_DOWNLOAD
= 0x400,
349 CLSCTX_NO_CUSTOM_MARSHAL
= 0x1000,
350 CLSCTX_ENABLE_CODE_DOWNLOAD
= 0x2000,
351 CLSCTX_NO_FAILURE_LOG
= 0x4000,
352 CLSCTX_DISABLE_AAA
= 0x8000,
353 CLSCTX_ENABLE_AAA
= 0x10000,
354 CLSCTX_FROM_DEFAULT_CONTEXT
= 0x20000
357 cpp_quote
("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
358 cpp_quote
("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
359 cpp_quote
("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
361 typedef enum tagMSHLFLAGS
{
362 MSHLFLAGS_NORMAL
= 0,
363 MSHLFLAGS_TABLESTRONG
= 1,
364 MSHLFLAGS_TABLEWEAK
= 2,
368 typedef enum tagMSHCTX
{
370 MSHCTX_NOSHAREDMEM
= 1,
371 MSHCTX_DIFFERENTMACHINE
= 2,
376 /******************** BLOB TYPES ********************/
378 typedef struct _BYTE_BLOB
{
379 unsigned long clSize
;
380 [size_is(clSize
)] byte abData
[];
382 typedef [unique] BYTE_BLOB
*UP_BYTE_BLOB
;
384 typedef struct _FLAGGED_BYTE_BLOB
{
385 unsigned long fFlags
;
386 unsigned long clSize
;
387 [size_is(clSize
)] byte abData
[];
389 typedef [unique] FLAGGED_BYTE_BLOB
*UP_FLAGGED_BYTE_BLOB
;
391 typedef struct _FLAGGED_WORD_BLOB
{
392 unsigned long fFlags
;
393 unsigned long clSize
;
394 [size_is(clSize
)] unsigned short asData
[];
396 typedef [unique] FLAGGED_WORD_BLOB
*UP_FLAGGED_WORD_BLOB
;
398 typedef struct _BYTE_SIZEDARR
{
399 unsigned long clSize
;
400 [size_is(clSize
)] byte *pData
;
403 typedef struct _SHORT_SIZEDARR
{
404 unsigned long clSize
;
405 [size_is(clSize
)] unsigned short *pData
;
408 typedef struct _LONG_SIZEDARR
{
409 unsigned long clSize
;
410 [size_is(clSize
)] unsigned long *pData
;
413 typedef struct _HYPER_SIZEDARR
{
414 unsigned long clSize
;
415 [size_is(clSize
)] hyper *pData
;
418 /******************** GDI TYPES ********************/
420 const unsigned long WDT_INPROC_CALL
= 0x48746457;
421 const unsigned long WDT_REMOTE_CALL
= 0x52746457;
422 const unsigned long WDT_INPROC64_CALL
= 0x50746457;
424 typedef union _userCLIPFORMAT
switch(long fContext
) u
{
425 case WDT_INPROC_CALL
: DWORD dwValue
;
426 case WDT_REMOTE_CALL
: LPWSTR pwszName
;
429 typedef [unique] userCLIPFORMAT
*wireCLIPFORMAT
;
430 typedef [wire_marshal(wireCLIPFORMAT
)] WORD CLIPFORMAT
;
432 typedef struct tagRemHGLOBAL
{
434 unsigned long cbData
;
435 [size_is(cbData
)] byte data
[];
438 typedef union _userHGLOBAL
switch(long fContext
) u
{
439 case WDT_INPROC_CALL
: long hInproc
;
440 case WDT_REMOTE_CALL
: FLAGGED_BYTE_BLOB
*hRemote
;
441 case WDT_INPROC64_CALL
: __int64 hInproc64
;
444 typedef [unique] userHGLOBAL
*wireHGLOBAL
;
446 typedef struct tagRemHMETAFILEPICT
{
450 unsigned long cbData
;
451 [size_is(cbData
)] byte data
[];
454 typedef union _userHMETAFILE
switch(long fContext
) u
{
455 case WDT_INPROC_CALL
: long hInproc
;
456 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
457 case WDT_INPROC64_CALL
: __int64 hInproc64
;
460 typedef [unique] userHMETAFILE
*wireHMETAFILE
;
462 typedef struct _remoteMETAFILEPICT
{
467 } remoteMETAFILEPICT
;
469 typedef union _userHMETAFILEPICT
switch(long fContext
) u
{
470 case WDT_INPROC_CALL
: long hInproc
;
471 case WDT_REMOTE_CALL
: remoteMETAFILEPICT
*hRemote
;
472 case WDT_INPROC64_CALL
: __int64 hInproc64
;
475 typedef [unique] userHMETAFILEPICT
*wireHMETAFILEPICT
;
477 typedef struct tagRemHENHMETAFILE
{
478 unsigned long cbData
;
479 [size_is(cbData
)] byte data
[];
482 typedef union _userHENHMETAFILE
switch(long fContext
) u
{
483 case WDT_INPROC_CALL
: long hInproc
;
484 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
485 case WDT_INPROC64_CALL
: __int64 hInproc64
;
488 typedef [unique] userHENHMETAFILE
*wireHENHMETAFILE
;
490 typedef struct tagRemHBITMAP
492 unsigned long cbData
;
493 [size_is(cbData
)] byte data
[];
496 typedef struct _userBITMAP
{
504 [size_is(cbSize
)] byte pBuffer
[];
507 typedef union _userHBITMAP
switch(long fContext
) u
{
508 case WDT_INPROC_CALL
: long hInproc
;
509 case WDT_REMOTE_CALL
: userBITMAP
*hRemote
;
510 case WDT_INPROC64_CALL
: __int64 hInproc64
;
513 typedef [unique] userHBITMAP
*wireHBITMAP
;
515 typedef struct tagRemHPALETTE
{
516 unsigned long cbData
;
517 [size_is(cbData
)] byte data
[];
520 typedef struct tagrpcLOGPALETTE
{
523 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[];
526 typedef union _userHPALETTE
switch(long fContext
) u
{
527 case WDT_INPROC_CALL
: long hInproc
;
528 case WDT_REMOTE_CALL
: rpcLOGPALETTE
*hRemote
;
529 case WDT_INPROC64_CALL
: __int64 hInproc64
;
532 typedef [unique] userHPALETTE
*wireHPALETTE
;
535 DECLARE_WIREM_HANDLE
(HGLOBAL);
536 typedef HGLOBAL HLOCAL
;
537 DECLARE_WIREM_HANDLE
(HBITMAP);
538 DECLARE_WIREM_HANDLE
(HPALETTE);
539 DECLARE_WIREM_HANDLE
(HENHMETAFILE);
540 DECLARE_WIREM_HANDLE
(HMETAFILE);
542 DECLARE_WIREM_HANDLE
(HMETAFILEPICT
);
544 typedef union _RemotableHandle
switch (long fContext
) u
546 case WDT_INPROC_CALL
: long hInproc
;
547 case WDT_REMOTE_CALL
: long hRemote
;
550 typedef [unique] RemotableHandle
*wireHACCEL
;
551 typedef [unique] RemotableHandle
*wireHBRUSH
;
552 typedef [unique] RemotableHandle
*wireHDC
;
553 typedef [unique] RemotableHandle
*wireHFONT
;
554 typedef [unique] RemotableHandle
*wireHICON
;
555 typedef [unique] RemotableHandle
*wireHMENU
;
556 typedef [unique] RemotableHandle
*wireHWND
;
558 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
559 DECLARE_WIREM_HANDLE
(HACCEL
);
560 DECLARE_WIREM_HANDLE
(HBRUSH
);
561 DECLARE_WIREM_HANDLE
(HDC
);
562 DECLARE_WIREM_HANDLE
(HFONT
);
563 DECLARE_WIREM_HANDLE
(HICON
);
564 DECLARE_WIREM_HANDLE
(HMENU
);
565 DECLARE_WIREM_HANDLE
(HWND
);
567 typedef HICON HCURSOR
;
569 typedef struct tagMSG
577 } MSG
, *PMSG
, *NPMSG
, *LPMSG
;
581 /******************** GUID TYPES ********************/
583 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
584 typedef GUID
*REFGUID
;
586 typedef CLSID
*REFCLSID
;
587 typedef FMTID
*REFFMTID
;
590 /******************** MISC TYPES ********************/
592 typedef enum tagDVASPECT
{
593 DVASPECT_CONTENT
= 1,
594 DVASPECT_THUMBNAIL
= 2,
596 DVASPECT_DOCPRINT
= 8
599 typedef enum tagSTGC
{
602 STGC_ONLYIFCURRENT
= 2,
603 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
= 4,
607 typedef enum tagSTGMOVE
{
610 STGMOVE_SHALLOWCOPY
= 2
613 typedef enum tagSTATFLAG
{
614 STATFLAG_DEFAULT
= 0,
619 /******************** OLE Automation ********************/
621 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
624 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DATE;")
627 cpp_quote
("#if 0") /* for IDL only */
628 typedef struct tagCY
{
631 cpp_quote
("#else") /* C/C++ defs */
632 cpp_quote
("#ifndef _tagCY_DEFINED")
633 cpp_quote
("#define _tagCY_DEFINED")
634 cpp_quote
("typedef union tagCY {")
635 cpp_quote
(" struct {")
636 cpp_quote
("#ifdef WORDS_BIGENDIAN")
637 cpp_quote
(" LONG Hi;")
638 cpp_quote
(" ULONG Lo;")
640 cpp_quote
(" ULONG Lo;")
641 cpp_quote
(" LONG Hi;")
643 cpp_quote
(" } DUMMYSTRUCTNAME;")
644 cpp_quote
(" LONGLONG int64;")
651 cpp_quote
("#if 0") /* for IDL only */
652 typedef struct tagDEC
{
659 cpp_quote
("#else") /* C/C++ defs */
660 cpp_quote
("typedef struct tagDEC {")
661 cpp_quote
(" USHORT wReserved;")
662 cpp_quote
(" union {")
663 cpp_quote
(" struct {")
664 cpp_quote
(" BYTE scale;")
665 cpp_quote
(" BYTE sign;")
666 cpp_quote
(" } DUMMYSTRUCTNAME;")
667 cpp_quote
(" USHORT signscale;")
668 cpp_quote
(" } DUMMYUNIONNAME;")
669 cpp_quote
(" ULONG Hi32;")
670 cpp_quote
(" union {")
671 cpp_quote
(" struct {")
672 cpp_quote
("#ifdef WORDS_BIGENDIAN")
673 cpp_quote
(" ULONG Mid32;")
674 cpp_quote
(" ULONG Lo32;")
676 cpp_quote
(" ULONG Lo32;")
677 cpp_quote
(" ULONG Mid32;")
679 cpp_quote
(" } DUMMYSTRUCTNAME1;")
680 cpp_quote
(" ULONGLONG Lo64;")
681 cpp_quote
(" } DUMMYUNIONNAME1;")
682 cpp_quote
("} DECIMAL;")
684 cpp_quote
("#define DECIMAL_NEG ((BYTE)0x80)")
685 cpp_quote
("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
687 typedef DECIMAL
*LPDECIMAL
;
689 typedef [unique] FLAGGED_WORD_BLOB
*wireBSTR
;
690 typedef [wire_marshal(wireBSTR
)] OLECHAR
*BSTR;
691 typedef BSTR *LPBSTR
;
693 typedef short VARIANT_BOOL;
694 typedef VARIANT_BOOL _VARIANT_BOOL
;
695 cpp_quote
("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
696 cpp_quote
("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
698 typedef struct tagBSTRBLOB
{
700 [size_is(cbSize
)] BYTE *pData
;
701 } BSTRBLOB
, *LPBSTRBLOB
;
703 cpp_quote
("#ifndef _tagBLOB_DEFINED")
704 cpp_quote
("#define _tagBLOB_DEFINED")
705 cpp_quote
("#define _BLOB_DEFINED")
706 cpp_quote
("#define _LPBLOB_DEFINED")
707 typedef struct tagBLOB
{
709 [size_is(cbSize
)] BYTE *pBlobData
;
713 typedef struct tagCLIPDATA
{
716 [size_is(cbSize
-sizeof
(long))] BYTE *pClipData
;
718 cpp_quote
("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
720 typedef ULONG PROPID
;
722 /******************** VARTYPE ********************/
724 typedef unsigned short VARTYPE
;
764 VT_STREAMED_OBJECT
= 68,
765 VT_STORED_OBJECT
= 69,
769 VT_VERSIONED_STREAM
= 73,
770 VT_BSTR_BLOB
= 0x0fff,
774 VT_RESERVED
= 0x8000,
776 VT_ILLEGALMASKED
= 0x0fff,
780 typedef struct tagCSPLATFORM
785 DWORD dwProcessorArch
;
788 typedef struct tagQUERYCONTEXT
797 typedef [v1_enum] enum tagTYSPEC
808 typedef union switch(DWORD tyspec
)
814 case TYSPEC_MIMETYPE
:
818 case TYSPEC_FILENAME
:
820 case TYSPEC_PACKAGENAME
:
823 LPOLESTR pPackageName
;
826 case TYSPEC_OBJECTID
:
834 cpp_quote
("#ifndef PROPERTYKEY_DEFINED")
835 cpp_quote
("#define PROPERTYKEY_DEFINED")
836 typedef struct _tagpropertykey
841 cpp_quote
("#endif /*PROPERTYKEY_DEFINED*/")
843 } /* interface IWinTypes */