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 */
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
[*];
117 typedef USHORT SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
119 typedef struct _ACL
{
128 typedef struct _SECURITY_DESCRIPTOR
{
131 SECURITY_DESCRIPTOR_CONTROL
Control;
136 } SECURITY_DESCRIPTOR
, *PISECURITY_DESCRIPTOR
;
138 typedef struct _SECURITY_ATTRIBUTES
141 [size_is(nLength
)] LPVOID lpSecurityDescriptor
;
143 } SECURITY_ATTRIBUTES
, *PSECURITY_ATTRIBUTES
, *LPSECURITY_ATTRIBUTES
;
145 typedef struct tagSIZE
149 } SIZE
, *PSIZE
, *LPSIZE
;
150 typedef SIZE SIZEL
, *PSIZEL
, *LPSIZEL
;
152 typedef struct tagPOINT
156 } POINT
, *PPOINT
, *LPPOINT
;
158 typedef struct _POINTL
164 typedef struct tagRECT
170 } RECT
, *PRECT
, *LPRECT
;
171 typedef const RECT
*LPCRECT
;
173 typedef struct _RECTL
179 } RECTL
, *PRECTL
, *LPRECTL
;
180 typedef const RECTL
*LPCRECTL
;
182 typedef UINT_PTR WPARAM
;
183 typedef LONG_PTR LPARAM
;
185 cpp_quote
("#endif /* winnt.h */")
187 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
188 typedef double DOUBLE;
190 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
193 cpp_quote
("#ifndef _PALETTEENTRY_DEFINED")
194 cpp_quote
("#define _PALETTEENTRY_DEFINED")
195 typedef struct tagPALETTEENTRY
{
200 } PALETTEENTRY
, *PPALETTEENTRY
, *LPPALETTEENTRY
;
203 cpp_quote
("#ifndef _LOGPALETTE_DEFINED")
204 cpp_quote
("#define _LOGPALETTE_DEFINED")
205 typedef struct tagLOGPALETTE
209 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[*];
210 } LOGPALETTE
, *PLOGPALETTE
, *LPLOGPALETTE
;
213 cpp_quote
("#ifndef _SYSTEMTIME_")
214 cpp_quote
("#define _SYSTEMTIME_")
215 typedef struct _SYSTEMTIME
{
224 } SYSTEMTIME
, *PSYSTEMTIME
, *LPSYSTEMTIME
;
227 cpp_quote
("#ifndef _FILETIME_")
228 cpp_quote
("#define _FILETIME_")
229 typedef struct _FILETIME
{
231 DWORD dwHighDateTime
;
232 } FILETIME
, *PFILETIME
, *LPFILETIME
;
235 cpp_quote
("#ifndef _TEXTMETRIC_DEFINED")
236 cpp_quote
("#define _TEXTMETRIC_DEFINED")
237 typedef struct tagTEXTMETRICA
242 LONG tmInternalLeading
;
243 LONG tmExternalLeading
;
248 LONG tmDigitizedAspectX
;
249 LONG tmDigitizedAspectY
;
257 BYTE tmPitchAndFamily
;
259 } TEXTMETRICA
, *LPTEXTMETRICA
, *PTEXTMETRICA
;
261 typedef struct tagTEXTMETRICW
266 LONG tmInternalLeading
;
267 LONG tmExternalLeading
;
272 LONG tmDigitizedAspectX
;
273 LONG tmDigitizedAspectY
;
281 BYTE tmPitchAndFamily
;
283 } TEXTMETRICW
, *LPTEXTMETRICW
, *PTEXTMETRICW
;
286 /******************** BASIC COM/OLE TYPES ********************/
288 typedef WCHAR OLECHAR
;
289 typedef [string] OLECHAR
*LPOLESTR
;
290 typedef [string] const OLECHAR
*LPCOLESTR
;
291 cpp_quote
("#ifndef __WINESRC__")
292 cpp_quote
("# ifdef WINE_UNICODE_NATIVE")
293 cpp_quote
("# define OLESTR(str) L##str")
295 cpp_quote
("# define OLESTR(str) u##str")
301 typedef struct _COAUTHIDENTITY
{
302 [size_is(UserLength
+1)] USHORT
*User
;
304 [size_is(DomainLength
+1)] USHORT
*Domain
;
306 [size_is(PasswordLength
+1)] USHORT
*Password
;
307 ULONG PasswordLength
;
311 typedef struct _COAUTHINFO
{
314 LPWSTR pwszServerPrincName
;
316 DWORD dwImpersonationLevel
;
317 COAUTHIDENTITY
*pAuthIdentityData
;
318 DWORD dwCapabilities
;
321 typedef enum tagMEMCTX
{
324 MEMCTX_MACSYSTEM
= 3,
329 cpp_quote
("#ifndef _ROT_COMPARE_MAX_DEFINED")
330 cpp_quote
("#define _ROT_COMPARE_MAX_DEFINED")
331 cpp_quote
("#define ROT_COMPARE_MAX 2048")
334 cpp_quote
("#ifndef _ROTFLAGS_DEFINED")
335 cpp_quote
("#define _ROTFLAGS_DEFINED")
336 cpp_quote
("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
337 cpp_quote
("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
340 typedef enum tagCLSCTX
{
341 CLSCTX_INPROC_SERVER
= 0x00000001,
342 CLSCTX_INPROC_HANDLER
= 0x00000002,
343 CLSCTX_LOCAL_SERVER
= 0x00000004,
344 CLSCTX_INPROC_SERVER16
= 0x00000008,
345 CLSCTX_REMOTE_SERVER
= 0x00000010,
346 CLSCTX_INPROC_HANDLER16
= 0x00000020,
347 CLSCTX_INPROC_SERVERX86
= 0x00000040,
348 CLSCTX_INPROC_HANDLERX86
= 0x00000080,
349 CLSCTX_ESERVER_HANDLER
= 0x00000100,
350 CLSCTX_NO_CODE_DOWNLOAD
= 0x00000400,
351 CLSCTX_NO_CUSTOM_MARSHAL
= 0x00001000,
352 CLSCTX_ENABLE_CODE_DOWNLOAD
= 0x00002000,
353 CLSCTX_NO_FAILURE_LOG
= 0x00004000,
354 CLSCTX_DISABLE_AAA
= 0x00008000,
355 CLSCTX_ENABLE_AAA
= 0x00010000,
356 CLSCTX_FROM_DEFAULT_CONTEXT
= 0x00020000,
357 CLSCTX_ACTIVATE_X86_SERVER
= 0x00040000,
358 CLSCTX_ACTIVATE_32_BIT_SERVER
= CLSCTX_ACTIVATE_X86_SERVER
,
359 CLSCTX_ACTIVATE_64_BIT_SERVER
= 0x00080000,
360 CLSCTX_ENABLE_CLOAKING
= 0x00100000,
361 CLSCTX_APPCONTAINER
= 0x00400000,
362 CLSCTX_ACTIVATE_AAA_AS_IU
= 0x00800000,
363 CLSCTX_RESERVED6
= 0x01000000,
364 CLSCTX_ACTIVATE_ARM32_SERVER
= 0x02000000,
365 CLSCTX_PS_DLL
= 0x80000000,
368 cpp_quote
("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
369 cpp_quote
("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
370 cpp_quote
("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
372 typedef enum tagMSHLFLAGS
{
373 MSHLFLAGS_NORMAL
= 0,
374 MSHLFLAGS_TABLESTRONG
= 1,
375 MSHLFLAGS_TABLEWEAK
= 2,
379 typedef enum tagMSHCTX
{
381 MSHCTX_NOSHAREDMEM
= 1,
382 MSHCTX_DIFFERENTMACHINE
= 2,
387 /******************** BLOB TYPES ********************/
389 typedef struct _BYTE_BLOB
{
390 unsigned long clSize
;
391 [size_is(clSize
)] byte abData
[];
393 typedef [unique] BYTE_BLOB
*UP_BYTE_BLOB
;
395 typedef struct _FLAGGED_BYTE_BLOB
{
396 unsigned long fFlags
;
397 unsigned long clSize
;
398 [size_is(clSize
)] byte abData
[];
400 typedef [unique] FLAGGED_BYTE_BLOB
*UP_FLAGGED_BYTE_BLOB
;
402 typedef struct _FLAGGED_WORD_BLOB
{
403 unsigned long fFlags
;
404 unsigned long clSize
;
405 [size_is(clSize
)] unsigned short asData
[];
407 typedef [unique] FLAGGED_WORD_BLOB
*UP_FLAGGED_WORD_BLOB
;
409 typedef struct _BYTE_SIZEDARR
{
410 unsigned long clSize
;
411 [size_is(clSize
)] byte *pData
;
414 typedef struct _SHORT_SIZEDARR
{
415 unsigned long clSize
;
416 [size_is(clSize
)] unsigned short *pData
;
419 typedef struct _LONG_SIZEDARR
{
420 unsigned long clSize
;
421 [size_is(clSize
)] unsigned long *pData
;
424 typedef struct _HYPER_SIZEDARR
{
425 unsigned long clSize
;
426 [size_is(clSize
)] hyper *pData
;
429 /******************** GDI TYPES ********************/
431 const unsigned long WDT_INPROC_CALL
= 0x48746457;
432 const unsigned long WDT_REMOTE_CALL
= 0x52746457;
433 const unsigned long WDT_INPROC64_CALL
= 0x50746457;
435 typedef union _userCLIPFORMAT
switch(long fContext
) u
{
436 case WDT_INPROC_CALL
: DWORD dwValue
;
437 case WDT_REMOTE_CALL
: LPWSTR pwszName
;
440 typedef [unique] userCLIPFORMAT
*wireCLIPFORMAT
;
441 typedef [wire_marshal(wireCLIPFORMAT
)] WORD CLIPFORMAT
;
443 typedef struct tagRemHGLOBAL
{
445 unsigned long cbData
;
446 [size_is(cbData
)] byte data
[];
449 typedef union _userHGLOBAL
switch(long fContext
) u
{
450 case WDT_INPROC_CALL
: long hInproc
;
451 case WDT_REMOTE_CALL
: FLAGGED_BYTE_BLOB
*hRemote
;
452 case WDT_INPROC64_CALL
: __int64 hInproc64
;
455 typedef [unique] userHGLOBAL
*wireHGLOBAL
;
457 typedef struct tagRemHMETAFILEPICT
{
461 unsigned long cbData
;
462 [size_is(cbData
)] byte data
[];
465 typedef union _userHMETAFILE
switch(long fContext
) u
{
466 case WDT_INPROC_CALL
: long hInproc
;
467 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
468 case WDT_INPROC64_CALL
: __int64 hInproc64
;
471 typedef [unique] userHMETAFILE
*wireHMETAFILE
;
473 typedef struct _remoteMETAFILEPICT
{
478 } remoteMETAFILEPICT
;
480 typedef union _userHMETAFILEPICT
switch(long fContext
) u
{
481 case WDT_INPROC_CALL
: long hInproc
;
482 case WDT_REMOTE_CALL
: remoteMETAFILEPICT
*hRemote
;
483 case WDT_INPROC64_CALL
: __int64 hInproc64
;
486 typedef [unique] userHMETAFILEPICT
*wireHMETAFILEPICT
;
488 typedef struct tagRemHENHMETAFILE
{
489 unsigned long cbData
;
490 [size_is(cbData
)] byte data
[];
493 typedef union _userHENHMETAFILE
switch(long fContext
) u
{
494 case WDT_INPROC_CALL
: long hInproc
;
495 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
496 case WDT_INPROC64_CALL
: __int64 hInproc64
;
499 typedef [unique] userHENHMETAFILE
*wireHENHMETAFILE
;
501 typedef struct tagRemHBITMAP
503 unsigned long cbData
;
504 [size_is(cbData
)] byte data
[];
507 typedef struct _userBITMAP
{
515 [size_is(cbSize
)] byte pBuffer
[];
518 typedef union _userHBITMAP
switch(long fContext
) u
{
519 case WDT_INPROC_CALL
: long hInproc
;
520 case WDT_REMOTE_CALL
: userBITMAP
*hRemote
;
521 case WDT_INPROC64_CALL
: __int64 hInproc64
;
524 typedef [unique] userHBITMAP
*wireHBITMAP
;
526 typedef struct tagRemHPALETTE
{
527 unsigned long cbData
;
528 [size_is(cbData
)] byte data
[];
531 typedef struct tagrpcLOGPALETTE
{
534 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[];
537 typedef union _userHPALETTE
switch(long fContext
) u
{
538 case WDT_INPROC_CALL
: long hInproc
;
539 case WDT_REMOTE_CALL
: rpcLOGPALETTE
*hRemote
;
540 case WDT_INPROC64_CALL
: __int64 hInproc64
;
543 typedef [unique] userHPALETTE
*wireHPALETTE
;
546 DECLARE_WIREM_HANDLE
(HGLOBAL);
547 typedef HGLOBAL HLOCAL
;
548 DECLARE_WIREM_HANDLE
(HBITMAP);
549 DECLARE_WIREM_HANDLE
(HPALETTE);
550 DECLARE_WIREM_HANDLE
(HENHMETAFILE);
551 DECLARE_WIREM_HANDLE
(HMETAFILE);
553 DECLARE_WIREM_HANDLE
(HMETAFILEPICT
);
555 typedef union _RemotableHandle
switch (long fContext
) u
557 case WDT_INPROC_CALL
: long hInproc
;
558 case WDT_REMOTE_CALL
: long hRemote
;
561 typedef [unique] RemotableHandle
*wireHACCEL
;
562 typedef [unique] RemotableHandle
*wireHBRUSH
;
563 typedef [unique] RemotableHandle
*wireHDC
;
564 typedef [unique] RemotableHandle
*wireHFONT
;
565 typedef [unique] RemotableHandle
*wireHICON
;
566 typedef [unique] RemotableHandle
*wireHMENU
;
567 typedef [unique] RemotableHandle
*wireHWND
;
568 typedef [unique] RemotableHandle
*wireHMONITOR
;
570 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
571 DECLARE_WIREM_HANDLE
(HACCEL
);
572 DECLARE_WIREM_HANDLE
(HBRUSH
);
573 DECLARE_WIREM_HANDLE
(HDC
);
574 DECLARE_WIREM_HANDLE
(HFONT
);
575 DECLARE_WIREM_HANDLE
(HICON
);
576 DECLARE_WIREM_HANDLE
(HMENU
);
577 DECLARE_WIREM_HANDLE
(HWND
);
578 DECLARE_WIREM_HANDLE
(HMONITOR
);
580 typedef HICON HCURSOR
;
582 typedef struct tagMSG
590 } MSG
, *PMSG
, *NPMSG
, *LPMSG
;
594 /******************** GUID TYPES ********************/
596 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
597 typedef GUID
*REFGUID
;
599 typedef CLSID
*REFCLSID
;
600 typedef FMTID
*REFFMTID
;
603 /******************** MISC TYPES ********************/
605 typedef enum tagDVASPECT
{
606 DVASPECT_CONTENT
= 1,
607 DVASPECT_THUMBNAIL
= 2,
609 DVASPECT_DOCPRINT
= 8
612 typedef enum tagSTGC
{
615 STGC_ONLYIFCURRENT
= 2,
616 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
= 4,
620 typedef enum tagSTGMOVE
{
623 STGMOVE_SHALLOWCOPY
= 2
626 typedef enum tagSTATFLAG
{
627 STATFLAG_DEFAULT
= 0,
632 /******************** OLE Automation ********************/
634 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
637 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DATE;")
640 cpp_quote
("#if 0") /* for IDL only */
641 typedef struct tagCY
{
644 cpp_quote
("#else") /* C/C++ defs */
645 cpp_quote
("#ifndef _tagCY_DEFINED")
646 cpp_quote
("#define _tagCY_DEFINED")
647 cpp_quote
("typedef union tagCY {")
648 cpp_quote
(" struct {")
649 cpp_quote
(" ULONG Lo;")
650 cpp_quote
(" LONG Hi;")
651 cpp_quote
(" } DUMMYSTRUCTNAME;")
652 cpp_quote
(" LONGLONG int64;")
659 cpp_quote
("#if 0") /* for IDL only */
660 typedef struct tagDEC
{
667 cpp_quote
("#else") /* C/C++ defs */
668 cpp_quote
("typedef struct tagDEC {")
669 cpp_quote
(" USHORT wReserved;")
670 cpp_quote
(" union {")
671 cpp_quote
(" struct {")
672 cpp_quote
(" BYTE scale;")
673 cpp_quote
(" BYTE sign;")
674 cpp_quote
(" } DUMMYSTRUCTNAME;")
675 cpp_quote
(" USHORT signscale;")
676 cpp_quote
(" } DUMMYUNIONNAME;")
677 cpp_quote
(" ULONG Hi32;")
678 cpp_quote
(" union {")
679 cpp_quote
(" struct {")
680 cpp_quote
(" ULONG Lo32;")
681 cpp_quote
(" ULONG Mid32;")
682 cpp_quote
(" } DUMMYSTRUCTNAME1;")
683 cpp_quote
(" ULONGLONG Lo64;")
684 cpp_quote
(" } DUMMYUNIONNAME1;")
685 cpp_quote
("} DECIMAL;")
687 cpp_quote
("#define DECIMAL_NEG ((BYTE)0x80)")
688 cpp_quote
("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
690 typedef DECIMAL
*LPDECIMAL
;
692 typedef [unique] FLAGGED_WORD_BLOB
*wireBSTR
;
693 typedef [wire_marshal(wireBSTR
)] OLECHAR
*BSTR;
694 typedef BSTR *LPBSTR
;
696 typedef short VARIANT_BOOL;
697 typedef VARIANT_BOOL _VARIANT_BOOL
;
698 cpp_quote
("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
699 cpp_quote
("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
701 typedef struct tagBSTRBLOB
{
703 [size_is(cbSize
)] BYTE *pData
;
704 } BSTRBLOB
, *LPBSTRBLOB
;
706 cpp_quote
("#ifndef _tagBLOB_DEFINED")
707 cpp_quote
("#define _tagBLOB_DEFINED")
708 cpp_quote
("#define _BLOB_DEFINED")
709 cpp_quote
("#define _LPBLOB_DEFINED")
710 typedef struct tagBLOB
{
712 [size_is(cbSize
)] BYTE *pBlobData
;
716 typedef struct tagCLIPDATA
{
719 [size_is(cbSize
-sizeof
(long))] BYTE *pClipData
;
721 cpp_quote
("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
723 typedef ULONG PROPID
;
725 /******************** VARTYPE ********************/
727 typedef unsigned short VARTYPE
;
767 VT_STREAMED_OBJECT
= 68,
768 VT_STORED_OBJECT
= 69,
772 VT_VERSIONED_STREAM
= 73,
773 VT_BSTR_BLOB
= 0x0fff,
777 VT_RESERVED
= 0x8000,
779 VT_ILLEGALMASKED
= 0x0fff,
783 typedef struct tagCSPLATFORM
788 DWORD dwProcessorArch
;
791 typedef struct tagQUERYCONTEXT
800 typedef [v1_enum] enum tagTYSPEC
811 typedef union switch(DWORD tyspec
)
817 case TYSPEC_MIMETYPE
:
821 case TYSPEC_FILENAME
:
823 case TYSPEC_PACKAGENAME
:
826 LPOLESTR pPackageName
;
829 case TYSPEC_OBJECTID
:
837 cpp_quote
("#ifndef PROPERTYKEY_DEFINED")
838 cpp_quote
("#define PROPERTYKEY_DEFINED")
839 typedef struct _tagpropertykey
844 cpp_quote
("#endif /*PROPERTYKEY_DEFINED*/")
846 } /* interface IWinTypes */