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
;
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 [size_is(nLength
)] 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 _SYSTEMTIME_")
211 cpp_quote
("#define _SYSTEMTIME_")
212 typedef struct _SYSTEMTIME
{
221 } SYSTEMTIME
, *PSYSTEMTIME
, *LPSYSTEMTIME
;
224 cpp_quote
("#ifndef _FILETIME_")
225 cpp_quote
("#define _FILETIME_")
226 typedef struct _FILETIME
{
228 DWORD dwHighDateTime
;
229 } FILETIME
, *PFILETIME
, *LPFILETIME
;
232 cpp_quote
("#ifndef _TEXTMETRIC_DEFINED")
233 cpp_quote
("#define _TEXTMETRIC_DEFINED")
234 typedef struct tagTEXTMETRICA
239 LONG tmInternalLeading
;
240 LONG tmExternalLeading
;
245 LONG tmDigitizedAspectX
;
246 LONG tmDigitizedAspectY
;
254 BYTE tmPitchAndFamily
;
256 } TEXTMETRICA
, *LPTEXTMETRICA
, *PTEXTMETRICA
;
258 typedef struct tagTEXTMETRICW
263 LONG tmInternalLeading
;
264 LONG tmExternalLeading
;
269 LONG tmDigitizedAspectX
;
270 LONG tmDigitizedAspectY
;
278 BYTE tmPitchAndFamily
;
280 } TEXTMETRICW
, *LPTEXTMETRICW
, *PTEXTMETRICW
;
283 /******************** BASIC COM/OLE TYPES ********************/
285 typedef WCHAR OLECHAR
;
286 typedef [string] OLECHAR
*LPOLESTR
;
287 typedef [string] const OLECHAR
*LPCOLESTR
;
288 cpp_quote
("#ifndef __WINESRC__")
289 cpp_quote
("#define OLESTR(str) L##str")
294 typedef struct _COAUTHIDENTITY
{
295 [size_is(UserLength
+1)] USHORT
*User
;
297 [size_is(DomainLength
+1)] USHORT
*Domain
;
299 [size_is(PasswordLength
+1)] USHORT
*Password
;
300 ULONG PasswordLength
;
304 typedef struct _COAUTHINFO
{
307 LPWSTR pwszServerPrincName
;
309 DWORD dwImpersonationLevel
;
310 COAUTHIDENTITY
*pAuthIdentityData
;
311 DWORD dwCapabilities
;
314 typedef enum tagMEMCTX
{
317 MEMCTX_MACSYSTEM
= 3,
322 cpp_quote
("#ifndef _ROT_COMPARE_MAX_DEFINED")
323 cpp_quote
("#define _ROT_COMPARE_MAX_DEFINED")
324 cpp_quote
("#define ROT_COMPARE_MAX 2048")
327 cpp_quote
("#ifndef _ROTFLAGS_DEFINED")
328 cpp_quote
("#define _ROTFLAGS_DEFINED")
329 cpp_quote
("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
330 cpp_quote
("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
333 typedef enum tagCLSCTX
{
334 CLSCTX_INPROC_SERVER
= 0x1,
335 CLSCTX_INPROC_HANDLER
= 0x2,
336 CLSCTX_LOCAL_SERVER
= 0x4,
337 CLSCTX_INPROC_SERVER16
= 0x8,
338 CLSCTX_REMOTE_SERVER
= 0x10,
339 CLSCTX_INPROC_HANDLER16
= 0x20,
340 CLSCTX_INPROC_SERVERX86
= 0x40,
341 CLSCTX_INPROC_HANDLERX86
= 0x80,
342 CLSCTX_ESERVER_HANDLER
= 0x100,
343 CLSCTX_NO_CODE_DOWNLOAD
= 0x400,
344 CLSCTX_NO_CUSTOM_MARSHAL
= 0x1000,
345 CLSCTX_ENABLE_CODE_DOWNLOAD
= 0x2000,
346 CLSCTX_NO_FAILURE_LOG
= 0x4000,
347 CLSCTX_DISABLE_AAA
= 0x8000,
348 CLSCTX_ENABLE_AAA
= 0x10000,
349 CLSCTX_FROM_DEFAULT_CONTEXT
= 0x20000
352 cpp_quote
("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
353 cpp_quote
("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
354 cpp_quote
("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
356 typedef enum tagMSHLFLAGS
{
357 MSHLFLAGS_NORMAL
= 0,
358 MSHLFLAGS_TABLESTRONG
= 1,
359 MSHLFLAGS_TABLEWEAK
= 2,
363 typedef enum tagMSHCTX
{
365 MSHCTX_NOSHAREDMEM
= 1,
366 MSHCTX_DIFFERENTMACHINE
= 2,
371 /******************** BLOB TYPES ********************/
373 typedef struct _BYTE_BLOB
{
374 unsigned long clSize
;
375 [size_is(clSize
)] byte abData
[];
377 typedef [unique] BYTE_BLOB
*UP_BYTE_BLOB
;
379 typedef struct _FLAGGED_BYTE_BLOB
{
380 unsigned long fFlags
;
381 unsigned long clSize
;
382 [size_is(clSize
)] byte abData
[];
384 typedef [unique] FLAGGED_BYTE_BLOB
*UP_FLAGGED_BYTE_BLOB
;
386 typedef struct _FLAGGED_WORD_BLOB
{
387 unsigned long fFlags
;
388 unsigned long clSize
;
389 [size_is(clSize
)] unsigned short asData
[];
391 typedef [unique] FLAGGED_WORD_BLOB
*UP_FLAGGED_WORD_BLOB
;
393 typedef struct _BYTE_SIZEDARR
{
394 unsigned long clSize
;
395 [size_is(clSize
)] byte *pData
;
398 typedef struct _SHORT_SIZEDARR
{
399 unsigned long clSize
;
400 [size_is(clSize
)] unsigned short *pData
;
403 typedef struct _LONG_SIZEDARR
{
404 unsigned long clSize
;
405 [size_is(clSize
)] unsigned long *pData
;
408 typedef struct _HYPER_SIZEDARR
{
409 unsigned long clSize
;
410 [size_is(clSize
)] hyper *pData
;
413 /******************** GDI TYPES ********************/
415 const unsigned long WDT_INPROC_CALL
= 0x48746457;
416 const unsigned long WDT_REMOTE_CALL
= 0x52746457;
417 const unsigned long WDT_INPROC64_CALL
= 0x50746457;
419 typedef union _userCLIPFORMAT
switch(long fContext
) u
{
420 case WDT_INPROC_CALL
: DWORD dwValue
;
421 case WDT_REMOTE_CALL
: LPWSTR pwszName
;
424 typedef [unique] userCLIPFORMAT
*wireCLIPFORMAT
;
425 typedef [wire_marshal(wireCLIPFORMAT
)] WORD CLIPFORMAT
;
427 typedef struct tagRemHGLOBAL
{
429 unsigned long cbData
;
430 [size_is(cbData
)] byte data
[];
433 typedef union _userHGLOBAL
switch(long fContext
) u
{
434 case WDT_INPROC_CALL
: long hInproc
;
435 case WDT_REMOTE_CALL
: FLAGGED_BYTE_BLOB
*hRemote
;
436 default: long hGlobal;
439 typedef [unique] userHGLOBAL
*wireHGLOBAL
;
441 typedef struct tagRemHMETAFILEPICT
{
445 unsigned long cbData
;
446 [size_is(cbData
)] byte data
[];
449 typedef union _userHMETAFILE
switch(long fContext
) u
{
450 case WDT_INPROC_CALL
: long hInproc
;
451 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
452 default: long hGlobal;
455 typedef [unique] userHMETAFILE
*wireHMETAFILE
;
457 typedef struct _remoteMETAFILEPICT
{
462 } remoteMETAFILEPICT
;
464 typedef union _userHMETAFILEPICT
switch(long fContext
) u
{
465 case WDT_INPROC_CALL
: long hInproc
;
466 case WDT_REMOTE_CALL
: remoteMETAFILEPICT
*hRemote
;
467 default: long hGlobal;
470 typedef [unique] userHMETAFILEPICT
*wireHMETAFILEPICT
;
472 typedef struct tagRemHENHMETAFILE
{
473 unsigned long cbData
;
474 [size_is(cbData
)] byte data
[];
477 typedef union _userHENHMETAFILE
switch(long fContext
) u
{
478 case WDT_INPROC_CALL
: long hInproc
;
479 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
480 default: long hGlobal;
483 typedef [unique] userHENHMETAFILE
*wireHENHMETAFILE
;
485 typedef struct tagRemHBITMAP
487 unsigned long cbData
;
488 [size_is(cbData
)] byte data
[];
491 typedef struct _userBITMAP
{
499 [size_is(cbSize
)] byte pBuffer
[];
502 typedef union _userHBITMAP
switch(long fContext
) u
{
503 case WDT_INPROC_CALL
: long hInproc
;
504 case WDT_REMOTE_CALL
: userBITMAP
*hRemote
;
505 default: long hGlobal;
508 typedef [unique] userHBITMAP
*wireHBITMAP
;
510 typedef struct tagRemHPALETTE
{
511 unsigned long cbData
;
512 [size_is(cbData
)] byte data
[];
515 typedef struct tagrpcLOGPALETTE
{
518 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[];
521 typedef union _userHPALETTE
switch(long fContext
) u
{
522 case WDT_INPROC_CALL
: long hInproc
;
523 case WDT_REMOTE_CALL
: rpcLOGPALETTE
*hRemote
;
524 default: long hGlobal;
527 typedef [unique] userHPALETTE
*wireHPALETTE
;
530 DECLARE_WIREM_HANDLE
(HGLOBAL);
531 typedef HGLOBAL HLOCAL
;
532 DECLARE_WIREM_HANDLE
(HBITMAP);
533 DECLARE_WIREM_HANDLE
(HPALETTE);
534 DECLARE_WIREM_HANDLE
(HENHMETAFILE);
535 DECLARE_WIREM_HANDLE
(HMETAFILE);
537 DECLARE_WIREM_HANDLE
(HMETAFILEPICT
);
539 typedef union _RemotableHandle
switch (long fContext
) u
541 case WDT_INPROC_CALL
: long hInproc
;
542 case WDT_REMOTE_CALL
: long hRemote
;
545 typedef [unique] RemotableHandle
*wireHACCEL
;
546 typedef [unique] RemotableHandle
*wireHBRUSH
;
547 typedef [unique] RemotableHandle
*wireHDC
;
548 typedef [unique] RemotableHandle
*wireHFONT
;
549 typedef [unique] RemotableHandle
*wireHICON
;
550 typedef [unique] RemotableHandle
*wireHMENU
;
551 typedef [unique] RemotableHandle
*wireHWND
;
553 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
554 DECLARE_WIREM_HANDLE
(HACCEL
);
555 DECLARE_WIREM_HANDLE
(HBRUSH
);
556 DECLARE_WIREM_HANDLE
(HDC
);
557 DECLARE_WIREM_HANDLE
(HFONT
);
558 DECLARE_WIREM_HANDLE
(HICON
);
559 DECLARE_WIREM_HANDLE
(HMENU
);
560 DECLARE_WIREM_HANDLE
(HWND
);
562 typedef HICON HCURSOR
;
564 typedef struct tagMSG
572 } MSG
, *PMSG
, *NPMSG
, *LPMSG
;
576 /******************** GUID TYPES ********************/
578 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
579 typedef GUID
*REFGUID
;
581 typedef CLSID
*REFCLSID
;
582 typedef FMTID
*REFFMTID
;
585 /******************** MISC TYPES ********************/
587 typedef enum tagDVASPECT
{
588 DVASPECT_CONTENT
= 1,
589 DVASPECT_THUMBNAIL
= 2,
591 DVASPECT_DOCPRINT
= 8
594 typedef enum tagSTGC
{
597 STGC_ONLYIFCURRENT
= 2,
598 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
= 4,
602 typedef enum tagSTGMOVE
{
605 STGMOVE_SHALLOWCOPY
= 2
608 typedef enum tagSTATFLAG
{
609 STATFLAG_DEFAULT
= 0,
614 /******************** OLE Automation ********************/
616 cpp_quote
("#ifdef _MSC_VER") /* for IDL and MSVC only */
619 cpp_quote
("typedef double DECLSPEC_ALIGN(8) DATE;")
622 cpp_quote
("#if 0") /* for IDL only */
623 typedef struct tagCY
{
626 cpp_quote
("#else") /* C/C++ defs */
627 cpp_quote
("#ifndef _tagCY_DEFINED")
628 cpp_quote
("#define _tagCY_DEFINED")
629 cpp_quote
("typedef union tagCY {")
630 cpp_quote
(" struct {")
631 cpp_quote
("#ifdef WORDS_BIGENDIAN")
632 cpp_quote
(" LONG Hi;")
633 cpp_quote
(" ULONG Lo;")
635 cpp_quote
(" ULONG Lo;")
636 cpp_quote
(" LONG Hi;")
638 cpp_quote
(" } DUMMYSTRUCTNAME;")
639 cpp_quote
(" LONGLONG int64;")
646 cpp_quote
("#if 0") /* for IDL only */
647 typedef struct tagDEC
{
654 cpp_quote
("#else") /* C/C++ defs */
655 cpp_quote
("typedef struct tagDEC {")
656 cpp_quote
(" USHORT wReserved;")
657 cpp_quote
(" union {")
658 cpp_quote
(" struct {")
659 cpp_quote
(" BYTE scale;")
660 cpp_quote
(" BYTE sign;")
661 cpp_quote
(" } DUMMYSTRUCTNAME;")
662 cpp_quote
(" USHORT signscale;")
663 cpp_quote
(" } DUMMYUNIONNAME;")
664 cpp_quote
(" ULONG Hi32;")
665 cpp_quote
(" union {")
666 cpp_quote
(" struct {")
667 cpp_quote
("#ifdef WORDS_BIGENDIAN")
668 cpp_quote
(" ULONG Mid32;")
669 cpp_quote
(" ULONG Lo32;")
671 cpp_quote
(" ULONG Lo32;")
672 cpp_quote
(" ULONG Mid32;")
674 cpp_quote
(" } DUMMYSTRUCTNAME1;")
675 cpp_quote
(" ULONGLONG Lo64;")
676 cpp_quote
(" } DUMMYUNIONNAME1;")
677 cpp_quote
("} DECIMAL;")
679 cpp_quote
("#define DECIMAL_NEG ((BYTE)0x80)")
680 cpp_quote
("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
682 typedef DECIMAL
*LPDECIMAL
;
684 typedef [unique] FLAGGED_WORD_BLOB
*wireBSTR
;
685 typedef [wire_marshal(wireBSTR
)] OLECHAR
*BSTR;
686 typedef BSTR *LPBSTR
;
688 typedef short VARIANT_BOOL;
689 typedef VARIANT_BOOL _VARIANT_BOOL
;
690 cpp_quote
("#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)")
691 cpp_quote
("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")
693 typedef struct tagBSTRBLOB
{
695 [size_is(cbSize
)] BYTE *pData
;
696 } BSTRBLOB
, *LPBSTRBLOB
;
698 cpp_quote
("#ifndef _tagBLOB_DEFINED")
699 cpp_quote
("#define _tagBLOB_DEFINED")
700 cpp_quote
("#define _BLOB_DEFINED")
701 cpp_quote
("#define _LPBLOB_DEFINED")
702 typedef struct tagBLOB
{
704 [size_is(cbSize
)] BYTE *pBlobData
;
708 typedef struct tagCLIPDATA
{
711 [size_is(cbSize
-sizeof
(long))] BYTE *pClipData
;
713 cpp_quote
("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
715 typedef ULONG PROPID
;
717 /******************** VARTYPE ********************/
719 typedef unsigned short VARTYPE
;
759 VT_STREAMED_OBJECT
= 68,
760 VT_STORED_OBJECT
= 69,
764 VT_VERSIONED_STREAM
= 73,
765 VT_BSTR_BLOB
= 0x0fff,
769 VT_RESERVED
= 0x8000,
771 VT_ILLEGALMASKED
= 0x0fff,
775 typedef struct tagCSPLATFORM
780 DWORD dwProcessorArch
;
783 typedef struct tagQUERYCONTEXT
792 typedef [v1_enum] enum tagTYSPEC
803 typedef union switch(DWORD tyspec
)
809 case TYSPEC_MIMETYPE
:
813 case TYSPEC_FILENAME
:
815 case TYSPEC_PACKAGENAME
:
818 LPOLESTR pPackageName
;
821 case TYSPEC_OBJECTID
:
829 } /* interface IWinTypes */