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
(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
;
91 typedef unsigned __int64 DWORDLONG
;
92 typedef __int64 LONGLONG
;
93 typedef unsigned __int64 ULONGLONG
;
95 typedef struct _LARGE_INTEGER
{
99 typedef struct _ULARGE_INTEGER
{
103 typedef struct _SID_IDENTIFIER_AUTHORITY
{
105 } SID_IDENTIFIER_AUTHORITY
, *PSID_IDENTIFIER_AUTHORITY
;
107 typedef struct _SID
{
109 UCHAR SubAuthorityCount
;
110 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
111 [size_is(SubAuthorityCount
)] ULONG SubAuthority
[*];
114 typedef USHORT SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
116 typedef struct _ACL
{
125 typedef struct _SECURITY_DESCRIPTOR
{
128 SECURITY_DESCRIPTOR_CONTROL
Control;
133 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
135 typedef struct _SECURITY_ATTRIBUTES
138 LPVOID lpSecurityDescriptor
;
140 } SECURITY_ATTRIBUTES
, *PSECURITY_ATTRIBUTES
, *LPSECURITY_ATTRIBUTES
;
142 typedef struct tagSIZE
146 } SIZE
, *PSIZE
, *LPSIZE
;
147 typedef SIZE SIZEL
, *PSIZEL
, *LPSIZEL
;
149 typedef struct tagPOINT
153 } POINT
, *PPOINT
, *LPPOINT
;
155 typedef struct _POINTL
161 typedef struct tagRECT
167 } RECT
, *PRECT
, *LPRECT
;
168 typedef const RECT
*LPCRECT
;
170 typedef struct _RECTL
176 } RECTL
, *PRECTL
, *LPRECTL
;
177 typedef const RECTL
*LPCRECTL
;
179 typedef UINT_PTR WPARAM
;
180 typedef LONG_PTR LPARAM
;
182 cpp_quote
("#endif /* winnt.h */")
184 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
185 typedef double DOUBLE;
187 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
190 cpp_quote
("#ifndef _PALETTEENTRY_DEFINED")
191 cpp_quote
("#define _PALETTEENTRY_DEFINED")
192 typedef struct tagPALETTEENTRY
{
197 } PALETTEENTRY
, *PPALETTEENTRY
, *LPPALETTEENTRY
;
200 cpp_quote
("#ifndef _LOGPALETTE_DEFINED")
201 cpp_quote
("#define _LOGPALETTE_DEFINED")
202 typedef struct tagLOGPALETTE
206 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[*];
207 } LOGPALETTE
, *PLOGPALETTE
, *LPLOGPALETTE
;
210 cpp_quote
("#ifndef _FILETIME_")
211 cpp_quote
("#define _FILETIME_")
212 typedef struct _FILETIME
{
214 DWORD dwHighDateTime
;
215 } FILETIME
, *PFILETIME
, *LPFILETIME
;
218 cpp_quote
("#ifndef _TEXTMETRIC_DEFINED")
219 cpp_quote
("#define _TEXTMETRIC_DEFINED")
220 typedef struct tagTEXTMETRICA
225 LONG tmInternalLeading
;
226 LONG tmExternalLeading
;
231 LONG tmDigitizedAspectX
;
232 LONG tmDigitizedAspectY
;
240 BYTE tmPitchAndFamily
;
242 } TEXTMETRICA
, *LPTEXTMETRICA
, *PTEXTMETRICA
;
244 typedef struct tagTEXTMETRICW
249 LONG tmInternalLeading
;
250 LONG tmExternalLeading
;
255 LONG tmDigitizedAspectX
;
256 LONG tmDigitizedAspectY
;
264 BYTE tmPitchAndFamily
;
266 } TEXTMETRICW
, *LPTEXTMETRICW
, *PTEXTMETRICW
;
269 /******************** BASIC COM/OLE TYPES ********************/
271 typedef WCHAR OLECHAR
;
272 typedef [string] OLECHAR
*LPOLESTR
;
273 typedef [string] const OLECHAR
*LPCOLESTR
;
274 cpp_quote
("#ifndef __WINESRC__")
275 cpp_quote
("#define OLESTR(str) L##str")
280 typedef struct _COAUTHIDENTITY
{
281 [size_is(UserLength
+1)] USHORT
*User
;
283 [size_is(DomainLength
+1)] USHORT
*Domain
;
285 [size_is(PasswordLength
+1)] USHORT
*Password
;
286 ULONG PasswordLength
;
290 typedef struct _COAUTHINFO
{
293 LPWSTR pwszServerPrincName
;
295 DWORD dwImpersonationLevel
;
296 COAUTHIDENTITY
*pAuthIdentityData
;
297 DWORD dwCapabilities
;
300 typedef enum tagMEMCTX
{
303 MEMCTX_MACSYSTEM
= 3,
308 cpp_quote
("#ifndef _ROT_COMPARE_MAX_DEFINED")
309 cpp_quote
("#define _ROT_COMPARE_MAX_DEFINED")
310 cpp_quote
("#define ROT_COMPARE_MAX 2048")
313 cpp_quote
("#ifndef _ROTFLAGS_DEFINED")
314 cpp_quote
("#define _ROTFLAGS_DEFINED")
315 cpp_quote
("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
316 cpp_quote
("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
319 typedef enum tagCLSCTX
{
320 CLSCTX_INPROC_SERVER
= 0x1,
321 CLSCTX_INPROC_HANDLER
= 0x2,
322 CLSCTX_LOCAL_SERVER
= 0x4,
323 CLSCTX_INPROC_SERVER16
= 0x8,
324 CLSCTX_REMOTE_SERVER
= 0x10,
325 CLSCTX_INPROC_HANDLER16
= 0x20,
326 CLSCTX_INPROC_SERVERX86
= 0x40,
327 CLSCTX_INPROC_HANDLERX86
= 0x80,
328 CLSCTX_ESERVER_HANDLER
= 0x100,
329 CLSCTX_NO_CODE_DOWNLOAD
= 0x400,
330 CLSCTX_NO_CUSTOM_MARSHAL
= 0x1000,
331 CLSCTX_ENABLE_CODE_DOWNLOAD
= 0x2000,
332 CLSCTX_NO_FAILURE_LOG
= 0x4000,
333 CLSCTX_DISABLE_AAA
= 0x8000,
334 CLSCTX_ENABLE_AAA
= 0x10000,
335 CLSCTX_FROM_DEFAULT_CONTEXT
= 0x20000
338 cpp_quote
("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
339 cpp_quote
("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
340 cpp_quote
("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
342 typedef enum tagMSHLFLAGS
{
343 MSHLFLAGS_NORMAL
= 0,
344 MSHLFLAGS_TABLESTRONG
= 1,
345 MSHLFLAGS_TABLEWEAK
= 2,
349 typedef enum tagMSHCTX
{
351 MSHCTX_NOSHAREDMEM
= 1,
352 MSHCTX_DIFFERENTMACHINE
= 2,
357 /******************** BLOB TYPES ********************/
359 typedef struct _BYTE_BLOB
{
360 unsigned long clSize
;
361 [size_is(clSize
)] byte abData
[];
363 typedef [unique] BYTE_BLOB
*UP_BYTE_BLOB
;
365 typedef struct _FLAGGED_BYTE_BLOB
{
366 unsigned long fFlags
;
367 unsigned long clSize
;
368 [size_is(clSize
)] byte abData
[];
370 typedef [unique] FLAGGED_BYTE_BLOB
*UP_FLAGGED_BYTE_BLOB
;
372 typedef struct _FLAGGED_WORD_BLOB
{
373 unsigned long fFlags
;
374 unsigned long clSize
;
375 [size_is(clSize
)] unsigned short asData
[];
377 typedef [unique] FLAGGED_WORD_BLOB
*UP_FLAGGED_WORD_BLOB
;
379 typedef struct _BYTE_SIZEDARR
{
380 unsigned long clSize
;
381 [size_is(clSize
)] byte *pData
;
384 typedef struct _SHORT_SIZEDARR
{
385 unsigned long clSize
;
386 [size_is(clSize
)] unsigned short *pData
;
389 typedef struct _LONG_SIZEDARR
{
390 unsigned long clSize
;
391 [size_is(clSize
)] unsigned long *pData
;
394 typedef struct _HYPER_SIZEDARR
{
395 unsigned long clSize
;
396 [size_is(clSize
)] hyper *pData
;
399 /******************** GDI TYPES ********************/
401 const unsigned long WDT_INPROC_CALL
= 0x48746457;
402 const unsigned long WDT_REMOTE_CALL
= 0x52746457;
403 const unsigned long WDT_INPROC64_CALL
= 0x50746457;
405 typedef union _userCLIPFORMAT
switch(long fContext
) u
{
406 case WDT_INPROC_CALL
: DWORD dwValue
;
407 case WDT_REMOTE_CALL
: LPWSTR pwszName
;
410 typedef [unique] userCLIPFORMAT
*wireCLIPFORMAT
;
411 typedef [wire_marshal(wireCLIPFORMAT
)] WORD CLIPFORMAT
;
413 typedef struct tagRemHGLOBAL
{
415 unsigned long cbData
;
416 [size_is(cbData
)] byte data
[];
419 typedef union _userHGLOBAL
switch(long fContext
) u
{
420 case WDT_INPROC_CALL
: long hInproc
;
421 case WDT_REMOTE_CALL
: FLAGGED_BYTE_BLOB
*hRemote
;
422 default: long hGlobal;
425 typedef [unique] userHGLOBAL
*wireHGLOBAL
;
427 typedef struct tagRemHMETAFILEPICT
{
431 unsigned long cbData
;
432 [size_is(cbData
)] byte data
[];
435 typedef union _userHMETAFILE
switch(long fContext
) u
{
436 case WDT_INPROC_CALL
: long hInproc
;
437 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
438 default: long hGlobal;
441 typedef [unique] userHMETAFILE
*wireHMETAFILE
;
443 typedef struct _remoteMETAFILEPICT
{
448 } remoteMETAFILEPICT
;
450 typedef union _userHMETAFILEPICT
switch(long fContext
) u
{
451 case WDT_INPROC_CALL
: long hInproc
;
452 case WDT_REMOTE_CALL
: remoteMETAFILEPICT
*hRemote
;
453 default: long hGlobal;
456 typedef [unique] userHMETAFILEPICT
*wireHMETAFILEPICT
;
458 typedef struct tagRemHENHMETAFILE
{
459 unsigned long cbData
;
460 [size_is(cbData
)] byte data
[];
463 typedef union _userHENHMETAFILE
switch(long fContext
) u
{
464 case WDT_INPROC_CALL
: long hInproc
;
465 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
466 default: long hGlobal;
469 typedef [unique] userHENHMETAFILE
*wireHENHMETAFILE
;
471 typedef struct tagRemHBITMAP
473 unsigned long cbData
;
474 [size_is(cbData
)] byte data
[];
477 typedef struct _userBITMAP
{
485 [size_is(cbSize
)] byte pBuffer
[];
488 typedef union _userHBITMAP
switch(long fContext
) u
{
489 case WDT_INPROC_CALL
: long hInproc
;
490 case WDT_REMOTE_CALL
: userBITMAP
*hRemote
;
491 default: long hGlobal;
494 typedef [unique] userHBITMAP
*wireHBITMAP
;
496 typedef struct tagRemHPALETTE
{
497 unsigned long cbData
;
498 [size_is(cbData
)] byte data
[];
501 typedef struct tagrpcLOGPALETTE
{
504 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[];
507 typedef union _userHPALETTE
switch(long fContext
) u
{
508 case WDT_INPROC_CALL
: long hInproc
;
509 case WDT_REMOTE_CALL
: rpcLOGPALETTE
*hRemote
;
510 default: long hGlobal;
513 typedef [unique] userHPALETTE
*wireHPALETTE
;
516 DECLARE_WIREM_HANDLE
(HGLOBAL);
517 typedef HGLOBAL HLOCAL
;
518 DECLARE_WIREM_HANDLE
(HBITMAP);
519 DECLARE_WIREM_HANDLE
(HPALETTE);
520 DECLARE_WIREM_HANDLE
(HENHMETAFILE);
521 DECLARE_WIREM_HANDLE
(HMETAFILE);
523 DECLARE_WIREM_HANDLE
(HMETAFILEPICT
);
525 typedef union _RemotableHandle
switch (long fContext
) u
527 case WDT_INPROC_CALL
: long hInproc
;
528 case WDT_REMOTE_CALL
: long hRemote
;
531 typedef [unique] RemotableHandle
*wireHACCEL
;
532 typedef [unique] RemotableHandle
*wireHBRUSH
;
533 typedef [unique] RemotableHandle
*wireHDC
;
534 typedef [unique] RemotableHandle
*wireHFONT
;
535 typedef [unique] RemotableHandle
*wireHICON
;
536 typedef [unique] RemotableHandle
*wireHMENU
;
537 typedef [unique] RemotableHandle
*wireHWND
;
539 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
540 DECLARE_WIREM_HANDLE
(HACCEL
);
541 DECLARE_WIREM_HANDLE
(HBRUSH
);
542 DECLARE_WIREM_HANDLE
(HDC
);
543 DECLARE_WIREM_HANDLE
(HFONT
);
544 DECLARE_WIREM_HANDLE
(HICON
);
545 DECLARE_WIREM_HANDLE
(HMENU
);
546 DECLARE_WIREM_HANDLE
(HWND
);
548 typedef HICON HCURSOR
;
550 typedef struct tagMSG
558 } MSG
, *PMSG
, *NPMSG
, *LPMSG
;
562 /******************** GUID TYPES ********************/
564 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
565 typedef GUID
*REFGUID
;
567 typedef CLSID
*REFCLSID
;
568 typedef FMTID
*REFFMTID
;
571 /******************** MISC TYPES ********************/
573 typedef enum tagDVASPECT
{
574 DVASPECT_CONTENT
= 1,
575 DVASPECT_THUMBNAIL
= 2,
577 DVASPECT_DOCPRINT
= 8
580 typedef enum tagSTGC
{
583 STGC_ONLYIFCURRENT
= 2,
584 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
= 4,
588 typedef enum tagSTGMOVE
{
591 STGMOVE_SHALLOWCOPY
= 2
594 typedef enum tagSTATFLAG
{
595 STATFLAG_DEFAULT
= 0,
600 /******************** OLE Automation ********************/
602 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
605 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DATE;")
608 cpp_quote
("#if 0") /* for IDL only */
609 typedef struct tagCY
{
612 cpp_quote
("#else") /* C/C++ defs */
613 cpp_quote
("#ifndef _tagCY_DEFINED")
614 cpp_quote
("#define _tagCY_DEFINED")
615 cpp_quote
("typedef union tagCY {")
616 cpp_quote
(" struct {")
617 cpp_quote
("#ifdef WORDS_BIGENDIAN")
618 cpp_quote
(" LONG Hi;")
619 cpp_quote
(" ULONG Lo;")
621 cpp_quote
(" ULONG Lo;")
622 cpp_quote
(" LONG Hi;")
624 cpp_quote
(" } DUMMYSTRUCTNAME;")
625 cpp_quote
(" LONGLONG int64;")
632 cpp_quote
("#if 0") /* for IDL only */
633 typedef struct tagDEC
{
640 cpp_quote
("#else") /* C/C++ defs */
641 cpp_quote
("typedef struct tagDEC {")
642 cpp_quote
(" USHORT wReserved;")
643 cpp_quote
(" union {")
644 cpp_quote
(" struct {")
645 cpp_quote
(" BYTE scale;")
646 cpp_quote
(" BYTE sign;")
647 cpp_quote
(" } DUMMYSTRUCTNAME;")
648 cpp_quote
(" USHORT signscale;")
649 cpp_quote
(" } DUMMYUNIONNAME;")
650 cpp_quote
(" ULONG Hi32;")
651 cpp_quote
(" union {")
652 cpp_quote
(" struct {")
653 cpp_quote
("#ifdef WORDS_BIGENDIAN")
654 cpp_quote
(" ULONG Mid32;")
655 cpp_quote
(" ULONG Lo32;")
657 cpp_quote
(" ULONG Lo32;")
658 cpp_quote
(" ULONG Mid32;")
660 cpp_quote
(" } DUMMYSTRUCTNAME1;")
661 cpp_quote
(" ULONGLONG Lo64;")
662 cpp_quote
(" } DUMMYUNIONNAME1;")
663 cpp_quote
("} DECIMAL;")
665 cpp_quote
("#define DECIMAL_NEG ((BYTE)0x80)")
666 cpp_quote
("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
668 typedef DECIMAL
*LPDECIMAL
;
670 typedef [unique] FLAGGED_WORD_BLOB
*wireBSTR
;
671 typedef [wire_marshal(wireBSTR
)] OLECHAR
*BSTR;
672 typedef BSTR *LPBSTR
;
674 typedef short VARIANT_BOOL;
675 typedef VARIANT_BOOL _VARIANT_BOOL
;
676 cpp_quote
("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
677 cpp_quote
("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
679 typedef struct tagBSTRBLOB
{
681 [size_is(cbSize
)] BYTE *pData
;
682 } BSTRBLOB
, *LPBSTRBLOB
;
684 cpp_quote
("#ifndef _tagBLOB_DEFINED")
685 cpp_quote
("#define _tagBLOB_DEFINED")
686 cpp_quote
("#define _BLOB_DEFINED")
687 cpp_quote
("#define _LPBLOB_DEFINED")
688 typedef struct tagBLOB
{
690 [size_is(cbSize
)] BYTE *pBlobData
;
694 typedef struct tagCLIPDATA
{
697 [size_is(cbSize
-sizeof
(long))] BYTE *pClipData
;
699 cpp_quote
("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
701 typedef ULONG PROPID
;
703 /******************** VARTYPE ********************/
705 typedef unsigned short VARTYPE
;
745 VT_STREAMED_OBJECT
= 68,
746 VT_STORED_OBJECT
= 69,
750 VT_VERSIONED_STREAM
= 73,
751 VT_BSTR_BLOB
= 0x0fff,
755 VT_RESERVED
= 0x8000,
757 VT_ILLEGALMASKED
= 0x0fff,
761 typedef struct tagCSPLATFORM
766 DWORD dwProcessorArch
;
769 typedef struct tagQUERYCONTEXT
778 typedef [v1_enum] enum tagTYSPEC
789 typedef union switch(DWORD tyspec
)
795 case TYSPEC_MIMETYPE
:
799 case TYSPEC_FILENAME
:
801 case TYSPEC_PACKAGENAME
:
804 LPOLESTR pPackageName
;
807 case TYSPEC_OBJECTID
:
815 } /* interface IWinTypes */