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
;
52 typedef [string] CHAR *LPSTR
;
53 typedef [string] const CHAR *LPCSTR
;
55 typedef wchar_t WCHAR
;
56 typedef [string] WCHAR
*LPWSTR
;
57 typedef [string] const WCHAR
*LPCWSTR
;
59 typedef boolean BOOLEAN;
61 typedef DWORD COLORREF
;
64 #define DECLARE_HANDLE
(name
) typedef void *name
65 #define DECLARE_WIREM_HANDLE
(name
) typedef [wire_marshal(wire##name
)] void*name
67 DECLARE_HANDLE
(HACCEL
);
69 DECLARE_HANDLE
(HFONT
);
71 DECLARE_HANDLE
(HMENU
);
72 DECLARE_HANDLE
(HMODULE
);
73 DECLARE_HANDLE
(HINSTANCE
);
75 DECLARE_HANDLE
(HTASK
);
77 DECLARE_HANDLE
(HICON
);
79 typedef LONG_PTR LRESULT
;
84 typedef unsigned __int64 DWORDLONG
;
85 typedef __int64 LONGLONG
;
86 typedef unsigned __int64 ULONGLONG
;
88 typedef struct _LARGE_INTEGER
{
92 typedef struct _ULARGE_INTEGER
{
96 typedef struct _SID_IDENTIFIER_AUTHORITY
{
98 } SID_IDENTIFIER_AUTHORITY
, *PSID_IDENTIFIER_AUTHORITY
;
100 typedef struct _SID
{
102 UCHAR SubAuthorityCount
;
103 SID_IDENTIFIER_AUTHORITY IdentifierAuthority
;
104 [size_is(SubAuthorityCount
)] ULONG SubAuthority
[*];
107 typedef USHORT SECURITY_DESCRIPTOR_CONTROL
, *PSECURITY_DESCRIPTOR_CONTROL
;
109 typedef struct _ACL
{
118 typedef struct _SECURITY_DESCRIPTOR
{
121 SECURITY_DESCRIPTOR_CONTROL
Control;
126 } SECURITY_DESCRIPTOR
, *PSECURITY_DESCRIPTOR
;
128 typedef struct _SECURITY_ATTRIBUTES
131 LPVOID lpSecurityDescriptor
;
133 } SECURITY_ATTRIBUTES
, *PSECURITY_ATTRIBUTES
, *LPSECURITY_ATTRIBUTES
;
135 typedef struct tagSIZE
139 } SIZE
, *PSIZE
, *LPSIZE
;
140 typedef SIZE SIZEL
, *PSIZEL
, *LPSIZEL
;
142 typedef struct tagPOINT
146 } POINT
, *PPOINT
, *LPPOINT
;
148 typedef struct _POINTL
154 typedef struct tagRECT
160 } RECT
, *PRECT
, *LPRECT
;
161 typedef const RECT
*LPCRECT
;
163 typedef struct _RECTL
169 } RECTL
, *PRECTL
, *LPRECTL
;
170 typedef const RECTL
*LPCRECTL
;
172 typedef UINT_PTR WPARAM
;
173 typedef LONG_PTR LPARAM
;
175 typedef struct tagMSG
183 } MSG
, *PMSG
, *NPMSG
, *LPMSG
;
185 cpp_quote
("#endif /* winnt.h */")
187 typedef double DOUBLE;
189 cpp_quote
("#ifndef _PALETTEENTRY_DEFINED")
190 cpp_quote
("#define _PALETTEENTRY_DEFINED")
191 typedef struct tagPALETTEENTRY
{
196 } PALETTEENTRY
, *PPALETTEENTRY
, *LPPALETTEENTRY
;
199 cpp_quote
("#ifndef _LOGPALETTE_DEFINED")
200 cpp_quote
("#define _LOGPALETTE_DEFINED")
201 typedef struct tagLOGPALETTE
205 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[*];
206 } LOGPALETTE
, *PLOGPALETTE
, *LPLOGPALETTE
;
209 cpp_quote
("#ifndef _FILETIME_")
210 cpp_quote
("#define _FILETIME_")
211 typedef struct _FILETIME
{
213 DWORD dwHighDateTime
;
214 } FILETIME
, *PFILETIME
, *LPFILETIME
;
217 cpp_quote
("#ifndef _TEXTMETRIC_DEFINED")
218 cpp_quote
("#define _TEXTMETRIC_DEFINED")
224 LONG tmInternalLeading
;
225 LONG tmExternalLeading
;
230 LONG tmDigitizedAspectX
;
231 LONG tmDigitizedAspectY
;
239 BYTE tmPitchAndFamily
;
241 } TEXTMETRICA
, *LPTEXTMETRICA
, *PTEXTMETRICA
;
248 LONG tmInternalLeading
;
249 LONG tmExternalLeading
;
254 LONG tmDigitizedAspectX
;
255 LONG tmDigitizedAspectY
;
263 BYTE tmPitchAndFamily
;
265 } TEXTMETRICW
, *LPTEXTMETRICW
, *PTEXTMETRICW
;
268 /******************** BASIC COM/OLE TYPES ********************/
270 typedef WCHAR OLECHAR
;
271 typedef [string] OLECHAR
*LPOLESTR
;
272 typedef [string] const OLECHAR
*LPCOLESTR
;
273 cpp_quote
("#ifndef __WINESRC__")
274 cpp_quote
("#define OLESTR(str) L##str")
279 typedef struct _COAUTHIDENTITY
{
280 [size_is(UserLength
+1)] USHORT
*User
;
282 [size_is(DomainLength
+1)] USHORT
*Domain
;
284 [size_is(PasswordLength
+1)] USHORT
*Password
;
285 ULONG PasswordLength
;
289 typedef struct _COAUTHINFO
{
292 LPWSTR pwszServerPrincName
;
294 DWORD dwImpersonationLevel
;
295 COAUTHIDENTITY
*pAuthIdentityData
;
296 DWORD dwCapabilities
;
299 /* FIXME: COSERVERINFO was in Wine's pre-WIDL wtypes.h, but should be in objidl.idl */
300 typedef struct _COSERVERINFO
{
303 COAUTHINFO
*pAuthInfo
;
307 typedef enum tagMEMCTX
{
310 MEMCTX_MACSYSTEM
= 3,
315 cpp_quote
("#ifndef _ROTFLAGS_DEFINED")
316 cpp_quote
("#define _ROTFLAGS_DEFINED")
317 cpp_quote
("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
318 cpp_quote
("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
321 typedef enum tagCLSCTX
{
322 CLSCTX_INPROC_SERVER
= 0x1,
323 CLSCTX_INPROC_HANDLER
= 0x2,
324 CLSCTX_LOCAL_SERVER
= 0x4,
325 CLSCTX_INPROC_SERVER16
= 0x8,
326 CLSCTX_REMOTE_SERVER
= 0x10,
327 CLSCTX_INPROC_HANDLER16
= 0x20,
328 CLSCTX_INPROC_SERVERX86
= 0x40,
329 CLSCTX_INPROC_HANDLERX86
= 0x80,
330 CLSCTX_ESERVER_HANDLER
= 0x100,
331 CLSCTX_NO_CODE_DOWNLOAD
= 0x400,
332 CLSCTX_NO_CUSTOM_MARSHAL
= 0x1000,
333 CLSCTX_ENABLE_CODE_DOWNLOAD
= 0x2000,
334 CLSCTX_NO_FAILURE_LOG
= 0x4000,
335 CLSCTX_DISABLE_AAA
= 0x8000,
336 CLSCTX_ENABLE_AAA
= 0x10000,
337 CLSCTX_FROM_DEFAULT_CONTEXT
= 0x20000
340 cpp_quote
("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
341 cpp_quote
("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
342 cpp_quote
("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
344 typedef enum tagMSHLFLAGS
{
345 MSHLFLAGS_NORMAL
= 0,
346 MSHLFLAGS_TABLESTRONG
= 1,
347 MSHLFLAGS_TABLEWEAK
= 2,
351 typedef enum tagMSHCTX
{
353 MSHCTX_NOSHAREDMEM
= 1,
354 MSHCTX_DIFFERENTMACHINE
= 2,
359 /******************** BLOB TYPES ********************/
361 typedef struct _BYTE_BLOB
{
362 unsigned long clSize
;
363 [size_is(clSize
)] byte abData
[];
365 typedef [unique] BYTE_BLOB
*UP_BYTE_BLOB
;
367 typedef struct _FLAGGED_BYTE_BLOB
{
368 unsigned long fFlags
;
369 unsigned long clSize
;
370 [size_is(clSize
)] byte abData
[];
372 typedef [unique] FLAGGED_BYTE_BLOB
*UP_FLAGGED_BYTE_BLOB
;
374 typedef struct _FLAGGED_WORD_BLOB
{
375 unsigned long fFlags
;
376 unsigned long clSize
;
377 [size_is(clSize
)] unsigned short asData
[];
379 typedef [unique] FLAGGED_WORD_BLOB
*UP_FLAGGED_WORD_BLOB
;
381 typedef struct _BYTE_SIZEDARR
{
382 unsigned long clSize
;
383 [size_is(clSize
)] byte *pData
;
386 typedef struct _SHORT_SIZEDARR
{
387 unsigned long clSize
;
388 [size_is(clSize
)] unsigned short *pData
;
391 typedef struct _LONG_SIZEDARR
{
392 unsigned long clSize
;
393 [size_is(clSize
)] unsigned long *pData
;
396 typedef struct _HYPER_SIZEDARR
{
397 unsigned long clSize
;
398 [size_is(clSize
)] hyper *pData
;
401 /******************** GDI TYPES ********************/
403 const unsigned long WDT_INPROC_CALL
= 0x48746457;
404 const unsigned long WDT_REMOTE_CALL
= 0x52746457;
406 typedef union _userCLIPFORMAT
switch(long fContext
) u
{
407 case WDT_INPROC_CALL
: DWORD dwValue
;
408 case WDT_REMOTE_CALL
: LPWSTR pwszName
;
411 typedef [unique] userCLIPFORMAT
*wireCLIPFORMAT
;
412 typedef [wire_marshal(wireCLIPFORMAT
)] WORD CLIPFORMAT
;
414 typedef struct tagRemHGLOBAL
{
416 unsigned long cbData
;
417 [size_is(cbData
)] byte data
[];
420 typedef union _userHGLOBAL
switch(long fContext
) u
{
421 case WDT_INPROC_CALL
: long hInproc
;
422 case WDT_REMOTE_CALL
: FLAGGED_BYTE_BLOB
*hRemote
;
423 default: long hGlobal;
426 typedef [unique] userHGLOBAL
*wireHGLOBAL
;
428 typedef struct tagRemHMETAFILEPICT
{
432 unsigned long cbData
;
433 [size_is(cbData
)] byte data
[];
436 typedef union _userHMETAFILE
switch(long fContext
) u
{
437 case WDT_INPROC_CALL
: long hInproc
;
438 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
439 default: long hGlobal;
442 typedef [unique] userHMETAFILE
*wireHMETAFILE
;
444 typedef struct _remoteMETAFILEPICT
{
449 } remoteMETAFILEPICT
;
451 typedef union _userHMETAFILEPICT
switch(long fContext
) u
{
452 case WDT_INPROC_CALL
: long hInproc
;
453 case WDT_REMOTE_CALL
: remoteMETAFILEPICT
*hRemote
;
454 default: long hGlobal;
457 typedef [unique] userHMETAFILEPICT
*wireHMETAFILEPICT
;
459 typedef struct tagRemHENHMETAFILE
{
460 unsigned long cbData
;
461 [size_is(cbData
)] byte data
[];
464 typedef union _userHENHMETAFILE
switch(long fContext
) u
{
465 case WDT_INPROC_CALL
: long hInproc
;
466 case WDT_REMOTE_CALL
: BYTE_BLOB
*hRemote
;
467 default: long hGlobal;
470 typedef [unique] userHENHMETAFILE
*wireHENHMETAFILE
;
472 typedef struct tagRemHBITMAP
474 unsigned long cbData
;
475 [size_is(cbData
)] byte data
[];
478 typedef struct _userBITMAP
{
486 [size_is(cbSize
)] byte pBuffer
[];
489 typedef union _userHBITMAP
switch(long fContext
) u
{
490 case WDT_INPROC_CALL
: long hInproc
;
491 case WDT_REMOTE_CALL
: userBITMAP
*hRemote
;
492 default: long hGlobal;
495 typedef [unique] userHBITMAP
*wireHBITMAP
;
497 typedef struct tagRemHPALETTE
{
498 unsigned long cbData
;
499 [size_is(cbData
)] byte data
[];
502 typedef struct tagrpcLOGPALETTE
{
505 [size_is(palNumEntries
)] PALETTEENTRY palPalEntry
[];
508 typedef union _userHPALETTE
switch(long fContext
) u
{
509 case WDT_INPROC_CALL
: long hInproc
;
510 case WDT_REMOTE_CALL
: rpcLOGPALETTE
*hRemote
;
511 default: long hGlobal;
514 typedef [unique] userHPALETTE
*wireHPALETTE
;
517 DECLARE_WIREM_HANDLE
(HGLOBAL);
518 typedef HGLOBAL HLOCAL
;
519 DECLARE_WIREM_HANDLE
(HBITMAP);
520 DECLARE_WIREM_HANDLE
(HPALETTE);
521 DECLARE_WIREM_HANDLE
(HENHMETAFILE);
522 DECLARE_WIREM_HANDLE
(HMETAFILE);
524 DECLARE_WIREM_HANDLE
(HMETAFILEPICT
);
526 /******************** GUID TYPES ********************/
528 cpp_quote
("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
529 typedef GUID
*REFGUID
;
531 typedef CLSID
*REFCLSID
;
532 typedef FMTID
*REFFMTID
;
535 /******************** MISC TYPES ********************/
537 typedef enum tagDVASPECT
{
538 DVASPECT_CONTENT
= 1,
539 DVASPECT_THUMBNAIL
= 2,
541 DVASPECT_DOCPRINT
= 8
544 typedef enum tagSTGC
{
547 STGC_ONLYIFCURRENT
= 2,
548 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
= 4,
552 typedef enum tagSTGMOVE
{
555 STGMOVE_SHALLOWCOPY
= 2
558 typedef enum tagSTATFLAG
{
559 STATFLAG_DEFAULT
= 0,
564 /******************** 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 + sizeof(USHORT)); }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 cpp_quote
("#ifndef _tagBLOB_DEFINED")
642 cpp_quote
("#define _tagBLOB_DEFINED")
643 cpp_quote
("#define _BLOB_DEFINED")
644 cpp_quote
("#define _LPBLOB_DEFINED")
645 typedef struct tagBLOB
{
647 [size_is(cbSize
)] BYTE *pBlobData
;
651 typedef struct tagCLIPDATA
{
654 [size_is(cbSize
-sizeof
(long))] BYTE *pClipData
;
656 cpp_quote
("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")
658 typedef ULONG PROPID
;
660 /******************** VARTYPE ********************/
662 typedef unsigned short VARTYPE
;
702 VT_STREAMED_OBJECT
= 68,
703 VT_STORED_OBJECT
= 69,
707 VT_BSTR_BLOB
= 0x0fff,
711 VT_RESERVED
= 0x8000,
713 VT_ILLEGALMASKED
= 0x0fff,
717 } /* interface IWinTypes */