wtypes.idl 20.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Basic types used by COM interfaces
 *
 * Copyright 2002 Ove Kaaven
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
19 20
 */

21 22 23
import "basetsd.h";
import "guiddef.h";

24 25 26 27 28
[
  uuid(D3980A60-910C-1068-9341-00DD010F2F1C),
  version(0.1),
  pointer_default(unique)
]
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
interface IWinTypes
{

/******************** BASIC WIN32 TYPES ********************/
cpp_quote("#if 0 /* winnt.h */") /* don't redefine these */

typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef long BOOL;
typedef unsigned char UCHAR;
typedef int INT;
typedef unsigned int UINT;
typedef short SHORT;
typedef unsigned short USHORT;
typedef long LONG;
typedef unsigned long ULONG;
typedef float FLOAT;

typedef void *PVOID, *LPVOID;

51 52
typedef DWORD *LPDWORD;

53 54 55 56 57 58 59 60 61 62
typedef char CHAR;
typedef [string] CHAR *LPSTR;
typedef [string] const CHAR *LPCSTR;

typedef wchar_t WCHAR;
typedef [string] WCHAR *LPWSTR;
typedef [string] const WCHAR *LPCWSTR;

typedef boolean BOOLEAN;

63 64
typedef DWORD COLORREF;

65 66 67 68
typedef void *HANDLE;
#define DECLARE_HANDLE(name) typedef void *name
#define DECLARE_WIREM_HANDLE(name) typedef [wire_marshal(wire##name)] void*name

69 70 71 72 73
DECLARE_HANDLE(HMODULE);
DECLARE_HANDLE(HINSTANCE);
DECLARE_HANDLE(HRGN);
DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HKEY);
74 75 76 77 78 79 80 81 82 83 84
DECLARE_HANDLE(HDESK);
DECLARE_HANDLE(HMF);
DECLARE_HANDLE(HEMF);
DECLARE_HANDLE(HPEN);
DECLARE_HANDLE(HRSRC);
DECLARE_HANDLE(HSTR);
DECLARE_HANDLE(HWINSTA);
DECLARE_HANDLE(HKL);
DECLARE_HANDLE(HGDIOBJ);

typedef HANDLE HDWP;
85

86 87
typedef LONG_PTR LRESULT;

88 89
typedef LONG HRESULT;
typedef DWORD LCID;
90
typedef USHORT LANGID;
91 92 93 94 95

typedef unsigned __int64 DWORDLONG;
typedef __int64 LONGLONG;
typedef unsigned __int64 ULONGLONG;

96 97 98 99 100 101 102 103
typedef struct _LARGE_INTEGER {
  LONGLONG QuadPart;
} LARGE_INTEGER;

typedef struct _ULARGE_INTEGER {
  ULONGLONG QuadPart;
} ULARGE_INTEGER;

104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
typedef struct _SID_IDENTIFIER_AUTHORITY {
  UCHAR Value[6];
} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;

typedef struct _SID {
  UCHAR Revision;
  UCHAR SubAuthorityCount;
  SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
  [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
} SID, *PSID;

typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;

typedef struct _ACL {
  UCHAR AclRevision;
  UCHAR Sbz1;
  USHORT AclSize;
  USHORT AceCount;
  USHORT Sbz2;
} ACL;
typedef ACL *PACL;

typedef struct _SECURITY_DESCRIPTOR {
  UCHAR Revision;
  UCHAR Sbz1;
  SECURITY_DESCRIPTOR_CONTROL Control;
  PSID Owner;
  PSID Group;
  PACL Sacl;
  PACL Dacl;
} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;

136 137 138
typedef struct _SECURITY_ATTRIBUTES
{
    DWORD nLength;
139
    [size_is(nLength)] LPVOID lpSecurityDescriptor;
140 141 142
    BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;

143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
typedef struct tagSIZE
{
    LONG cx;
    LONG cy;
} SIZE, *PSIZE, *LPSIZE;
typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;

typedef struct tagPOINT
{
    LONG  x;
    LONG  y;
} POINT, *PPOINT, *LPPOINT;

typedef struct _POINTL
{
    LONG x;
    LONG y;
160
} POINTL, *PPOINTL;
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182

typedef struct tagRECT
{
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECT, *PRECT, *LPRECT;
typedef const RECT *LPCRECT;

typedef struct _RECTL
{
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECTL, *PRECTL, *LPRECTL;
typedef const RECTL *LPCRECTL;

typedef UINT_PTR WPARAM;
typedef LONG_PTR LPARAM;

183 184
cpp_quote("#endif /* winnt.h */")

185
cpp_quote("#ifdef _MSC_VER") /* for IDL and MSVC only */
186
typedef double DOUBLE;
187 188 189
cpp_quote("#else")
cpp_quote("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
cpp_quote("#endif")
190

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
cpp_quote("#define _PALETTEENTRY_DEFINED")
typedef struct tagPALETTEENTRY {
  BYTE peRed;
  BYTE peGreen;
  BYTE peBlue;
  BYTE peFlags;
} PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
cpp_quote("#endif")

cpp_quote("#ifndef _LOGPALETTE_DEFINED")
cpp_quote("#define _LOGPALETTE_DEFINED")
typedef struct tagLOGPALETTE
{
  WORD palVersion;
  WORD palNumEntries;
  [size_is(palNumEntries)] PALETTEENTRY palPalEntry[*];
} LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
cpp_quote("#endif")

211 212 213 214 215 216 217 218 219 220 221 222 223 224
cpp_quote("#ifndef _SYSTEMTIME_")
cpp_quote("#define _SYSTEMTIME_")
typedef struct _SYSTEMTIME{
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
cpp_quote("#endif")

225 226 227 228 229 230 231 232
cpp_quote("#ifndef _FILETIME_")
cpp_quote("#define _FILETIME_")
typedef struct _FILETIME {
  DWORD dwLowDateTime;
  DWORD dwHighDateTime;
} FILETIME, *PFILETIME, *LPFILETIME;
cpp_quote("#endif")

233 234
cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
cpp_quote("#define _TEXTMETRIC_DEFINED")
235
typedef struct tagTEXTMETRICA
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
{
    LONG      tmHeight;
    LONG      tmAscent;
    LONG      tmDescent;
    LONG      tmInternalLeading;
    LONG      tmExternalLeading;
    LONG      tmAveCharWidth;
    LONG      tmMaxCharWidth;
    LONG      tmWeight;
    LONG      tmOverhang;
    LONG      tmDigitizedAspectX;
    LONG      tmDigitizedAspectY;
    BYTE      tmFirstChar;
    BYTE      tmLastChar;
    BYTE      tmDefaultChar;
    BYTE      tmBreakChar;
    BYTE      tmItalic;
    BYTE      tmUnderlined;
    BYTE      tmStruckOut;
    BYTE      tmPitchAndFamily;
    BYTE      tmCharSet;
} TEXTMETRICA, *LPTEXTMETRICA, *PTEXTMETRICA;

259
typedef struct tagTEXTMETRICW
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
{
    LONG      tmHeight;
    LONG      tmAscent;
    LONG      tmDescent;
    LONG      tmInternalLeading;
    LONG      tmExternalLeading;
    LONG      tmAveCharWidth;
    LONG      tmMaxCharWidth;
    LONG      tmWeight;
    LONG      tmOverhang;
    LONG      tmDigitizedAspectX;
    LONG      tmDigitizedAspectY;
    WCHAR     tmFirstChar;
    WCHAR     tmLastChar;
    WCHAR     tmDefaultChar;
    WCHAR     tmBreakChar;
    BYTE      tmItalic;
    BYTE      tmUnderlined;
    BYTE      tmStruckOut;
    BYTE      tmPitchAndFamily;
    BYTE      tmCharSet;
} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
cpp_quote("#endif")

284 285 286 287 288
/******************** BASIC COM/OLE TYPES ********************/

typedef WCHAR OLECHAR;
typedef [string] OLECHAR *LPOLESTR;
typedef [string] const OLECHAR *LPCOLESTR;
289
cpp_quote("#ifndef __WINESRC__")
290
cpp_quote("#define OLESTR(str) L##str")
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
cpp_quote("#endif")

typedef LONG SCODE;

typedef struct _COAUTHIDENTITY {
  [size_is(UserLength+1)] USHORT *User;
  ULONG UserLength;
  [size_is(DomainLength+1)] USHORT *Domain;
  ULONG DomainLength;
  [size_is(PasswordLength+1)] USHORT *Password;
  ULONG PasswordLength;
  ULONG Flags;
} COAUTHIDENTITY;

typedef struct _COAUTHINFO {
  DWORD dwAuthnSvc;
  DWORD dwAuthzSvc;
  LPWSTR pwszServerPrincName;
  DWORD dwAuthnLevel;
  DWORD dwImpersonationLevel;
  COAUTHIDENTITY *pAuthIdentityData;
  DWORD dwCapabilities;
} COAUTHINFO;

315 316 317 318 319 320 321 322
typedef enum tagMEMCTX {
  MEMCTX_TASK      = 1,
  MEMCTX_SHARED    = 2,
  MEMCTX_MACSYSTEM = 3,
  MEMCTX_UNKNOWN   = -1,
  MEMCTX_SAME      = -2
} MEMCTX;

323 324 325 326 327
cpp_quote("#ifndef _ROT_COMPARE_MAX_DEFINED")
cpp_quote("#define _ROT_COMPARE_MAX_DEFINED")
cpp_quote("#define ROT_COMPARE_MAX 2048")
cpp_quote("#endif")

328 329 330 331 332 333
cpp_quote("#ifndef _ROTFLAGS_DEFINED")
cpp_quote("#define _ROTFLAGS_DEFINED")
cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
cpp_quote("#endif")

334
typedef enum tagCLSCTX {
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
  CLSCTX_INPROC_SERVER        = 0x1,
  CLSCTX_INPROC_HANDLER       = 0x2,
  CLSCTX_LOCAL_SERVER         = 0x4,
  CLSCTX_INPROC_SERVER16      = 0x8,
  CLSCTX_REMOTE_SERVER        = 0x10,
  CLSCTX_INPROC_HANDLER16     = 0x20,
  CLSCTX_INPROC_SERVERX86     = 0x40,
  CLSCTX_INPROC_HANDLERX86    = 0x80,
  CLSCTX_ESERVER_HANDLER      = 0x100,
  CLSCTX_NO_CODE_DOWNLOAD     = 0x400,
  CLSCTX_NO_CUSTOM_MARSHAL    = 0x1000,
  CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
  CLSCTX_NO_FAILURE_LOG       = 0x4000,
  CLSCTX_DISABLE_AAA          = 0x8000,
  CLSCTX_ENABLE_AAA           = 0x10000,
  CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
} CLSCTX;

cpp_quote("#define CLSCTX_INPROC (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER)")
cpp_quote("#define CLSCTX_ALL (CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")
cpp_quote("#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)")

357
typedef enum tagMSHLFLAGS {
358 359 360 361 362 363
  MSHLFLAGS_NORMAL      = 0,
  MSHLFLAGS_TABLESTRONG = 1,
  MSHLFLAGS_TABLEWEAK   = 2,
  MSHLFLAGS_NOPING      = 4
} MSHLFLAGS;

364
typedef enum tagMSHCTX {
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
  MSHCTX_LOCAL            = 0,
  MSHCTX_NOSHAREDMEM      = 1,
  MSHCTX_DIFFERENTMACHINE = 2,
  MSHCTX_INPROC           = 3,
  MSHCTX_CROSSCTX         = 4
} MSHCTX;

/******************** BLOB TYPES ********************/

typedef struct _BYTE_BLOB {
  unsigned long clSize;
  [size_is(clSize)] byte abData[];
} BYTE_BLOB;
typedef [unique] BYTE_BLOB *UP_BYTE_BLOB;

380 381 382 383 384 385 386
typedef struct _FLAGGED_BYTE_BLOB {
  unsigned long fFlags;
  unsigned long clSize;
  [size_is(clSize)] byte abData[];
} FLAGGED_BYTE_BLOB;
typedef [unique] FLAGGED_BYTE_BLOB *UP_FLAGGED_BYTE_BLOB;

387 388 389 390 391 392 393
typedef struct _FLAGGED_WORD_BLOB {
  unsigned long fFlags;
  unsigned long clSize;
  [size_is(clSize)] unsigned short asData[];
} FLAGGED_WORD_BLOB;
typedef [unique] FLAGGED_WORD_BLOB *UP_FLAGGED_WORD_BLOB;

394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413
typedef struct _BYTE_SIZEDARR {
  unsigned long clSize;
  [size_is(clSize)] byte *pData;
} BYTE_SIZEDARR;

typedef struct _SHORT_SIZEDARR {
  unsigned long clSize;
  [size_is(clSize)] unsigned short *pData;
} WORD_SIZEDARR;

typedef struct _LONG_SIZEDARR {
  unsigned long clSize;
  [size_is(clSize)] unsigned long *pData;
} DWORD_SIZEDARR;

typedef struct _HYPER_SIZEDARR {
  unsigned long clSize;
  [size_is(clSize)] hyper *pData;
} HYPER_SIZEDARR;

414 415
/******************** GDI TYPES ********************/

416 417 418
const unsigned long WDT_INPROC_CALL   = 0x48746457;
const unsigned long WDT_REMOTE_CALL   = 0x52746457;
const unsigned long WDT_INPROC64_CALL = 0x50746457;
419

420
typedef union _userCLIPFORMAT switch(long fContext) u {
421
  case WDT_INPROC_CALL: DWORD dwValue;
422
  case WDT_REMOTE_CALL: LPWSTR pwszName;
423 424 425 426 427
} userCLIPFORMAT;

typedef [unique] userCLIPFORMAT *wireCLIPFORMAT;
typedef [wire_marshal(wireCLIPFORMAT)] WORD CLIPFORMAT;

428 429 430 431 432 433 434 435 436
typedef struct tagRemHGLOBAL {
  long fNullHGlobal;
  unsigned long cbData;
  [size_is(cbData)] byte data[];
} RemHGLOBAL;

typedef union _userHGLOBAL switch(long fContext) u {
  case WDT_INPROC_CALL: long               hInproc;
  case WDT_REMOTE_CALL: FLAGGED_BYTE_BLOB *hRemote;
437
  case WDT_INPROC64_CALL: __int64          hInproc64;
438 439 440 441
} userHGLOBAL;

typedef [unique] userHGLOBAL *wireHGLOBAL;

442 443 444 445 446 447 448 449
typedef struct tagRemHMETAFILEPICT {
  long mm;
  long xExt;
  long yExt;
  unsigned long cbData;
  [size_is(cbData)] byte data[];
} RemHMETAFILEPICT;

450
typedef union _userHMETAFILE switch(long fContext) u {
451 452
  case WDT_INPROC_CALL: long       hInproc;
  case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
453
  case WDT_INPROC64_CALL: __int64  hInproc64;
454 455 456 457 458 459 460 461 462 463 464
} userHMETAFILE;

typedef [unique] userHMETAFILE *wireHMETAFILE;

typedef struct _remoteMETAFILEPICT {
  long mm;
  long xExt;
  long yExt;
  userHMETAFILE *hMF;
} remoteMETAFILEPICT;

465
typedef union _userHMETAFILEPICT switch(long fContext) u {
466 467
  case WDT_INPROC_CALL: long                hInproc;
  case WDT_REMOTE_CALL: remoteMETAFILEPICT *hRemote;
468
  case WDT_INPROC64_CALL: __int64           hInproc64;
469 470 471 472
} userHMETAFILEPICT;

typedef [unique] userHMETAFILEPICT *wireHMETAFILEPICT;

473 474 475 476 477 478 479 480
typedef struct tagRemHENHMETAFILE {
  unsigned long cbData;
  [size_is(cbData)] byte data[];
} RemHENHMETAFILE;

typedef union _userHENHMETAFILE switch(long fContext) u {
  case WDT_INPROC_CALL: long       hInproc;
  case WDT_REMOTE_CALL: BYTE_BLOB *hRemote;
481
  case WDT_INPROC64_CALL: __int64  hInproc64;
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505
} userHENHMETAFILE;

typedef [unique] userHENHMETAFILE *wireHENHMETAFILE;

typedef struct tagRemHBITMAP
{
  unsigned long cbData;
  [size_is(cbData)] byte data[];
} RemHBITMAP;

typedef struct _userBITMAP {
  LONG bmType;
  LONG bmWidth;
  LONG bmHeight;
  LONG bmWidthBytes;
  WORD bmPlanes;
  WORD bmBitsPixel;
  ULONG cbSize;
  [size_is(cbSize)] byte pBuffer[];
} userBITMAP;

typedef union _userHBITMAP switch(long fContext) u {
  case WDT_INPROC_CALL: long        hInproc;
  case WDT_REMOTE_CALL: userBITMAP *hRemote;
506
  case WDT_INPROC64_CALL: __int64   hInproc64;
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
} userHBITMAP;

typedef [unique] userHBITMAP *wireHBITMAP;

typedef struct tagRemHPALETTE {
  unsigned long cbData;
  [size_is(cbData)] byte data[];
} RemHPALETTE;

typedef struct tagrpcLOGPALETTE {
  WORD palVersion;
  WORD palNumEntries;
  [size_is(palNumEntries)] PALETTEENTRY palPalEntry[];
} rpcLOGPALETTE;

typedef union _userHPALETTE switch(long fContext) u {
  case WDT_INPROC_CALL: long           hInproc;
  case WDT_REMOTE_CALL: rpcLOGPALETTE *hRemote;
525
  case WDT_INPROC64_CALL: __int64      hInproc64;
526 527 528 529
} userHPALETTE;

typedef [unique] userHPALETTE *wireHPALETTE;

530
cpp_quote("#if 0")
531 532 533 534 535
DECLARE_WIREM_HANDLE(HGLOBAL);
typedef HGLOBAL HLOCAL;
DECLARE_WIREM_HANDLE(HBITMAP);
DECLARE_WIREM_HANDLE(HPALETTE);
DECLARE_WIREM_HANDLE(HENHMETAFILE);
536 537 538 539
DECLARE_WIREM_HANDLE(HMETAFILE);
cpp_quote("#endif")
DECLARE_WIREM_HANDLE(HMETAFILEPICT);

540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
typedef union _RemotableHandle switch (long fContext) u
{
    case WDT_INPROC_CALL: long hInproc;
    case WDT_REMOTE_CALL: long hRemote;
} RemotableHandle;

typedef [unique] RemotableHandle *wireHACCEL;
typedef [unique] RemotableHandle *wireHBRUSH;
typedef [unique] RemotableHandle *wireHDC;
typedef [unique] RemotableHandle *wireHFONT;
typedef [unique] RemotableHandle *wireHICON;
typedef [unique] RemotableHandle *wireHMENU;
typedef [unique] RemotableHandle *wireHWND;

cpp_quote("#if 0") /* for IDL only (C/C++ defs are in windef.h) */
DECLARE_WIREM_HANDLE(HACCEL);
DECLARE_WIREM_HANDLE(HBRUSH);
DECLARE_WIREM_HANDLE(HDC);
DECLARE_WIREM_HANDLE(HFONT);
DECLARE_WIREM_HANDLE(HICON);
DECLARE_WIREM_HANDLE(HMENU);
DECLARE_WIREM_HANDLE(HWND);

typedef HICON HCURSOR;

typedef struct tagMSG
{
    HWND   hwnd;
    UINT   message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD  time;
    POINT  pt;
} MSG, *PMSG, *NPMSG, *LPMSG;

cpp_quote("#endif")

577 578 579 580 581
/******************** GUID TYPES ********************/

cpp_quote("#if 0") /* for IDL only (C/C++ defs are in guiddef.h) */
typedef GUID *REFGUID;
typedef IID *REFIID;
582 583
typedef CLSID *REFCLSID;
typedef FMTID *REFFMTID;
584 585 586 587
cpp_quote("#endif")

/******************** MISC TYPES ********************/

588
typedef enum tagDVASPECT {
589 590 591 592 593 594
  DVASPECT_CONTENT   = 1,
  DVASPECT_THUMBNAIL = 2,
  DVASPECT_ICON      = 4,
  DVASPECT_DOCPRINT  = 8
} DVASPECT;

595 596 597
typedef enum tagSTGC {
  STGC_DEFAULT       = 0,
  STGC_OVERWRITE     = 1,
598 599
  STGC_ONLYIFCURRENT = 2,
  STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
600
  STGC_CONSOLIDATE   = 8
601 602
} STGC;

603 604 605
typedef enum tagSTGMOVE {
  STGMOVE_MOVE        = 0,
  STGMOVE_COPY        = 1,
606 607 608
  STGMOVE_SHALLOWCOPY = 2
} STGMOVE;

609 610 611 612 613 614
typedef enum tagSTATFLAG {
  STATFLAG_DEFAULT = 0,
  STATFLAG_NONAME  = 1,
  STATFLAG_NOOPEN  = 2
} STATFLAG;

615 616
/******************** OLE Automation ********************/

617
cpp_quote("#ifdef _MSC_VER") /* for IDL and MSVC only */
618
typedef double DATE;
619 620 621
cpp_quote("#else")
cpp_quote("typedef double DECLSPEC_ALIGN(8) DATE;")
cpp_quote("#endif")
622

623 624 625 626 627
cpp_quote("#if 0") /* for IDL only */
typedef struct tagCY {
  LONGLONG int64;
} CY;
cpp_quote("#else") /* C/C++ defs */
628 629
cpp_quote("#ifndef _tagCY_DEFINED")
cpp_quote("#define _tagCY_DEFINED")
630 631 632 633 634 635 636 637 638 639 640 641 642
cpp_quote("typedef union tagCY {")
cpp_quote("    struct {")
cpp_quote("#ifdef WORDS_BIGENDIAN")
cpp_quote("        LONG  Hi;")
cpp_quote("        ULONG Lo;")
cpp_quote("#else")
cpp_quote("        ULONG Lo;")
cpp_quote("        LONG  Hi;")
cpp_quote("#endif")
cpp_quote("    } DUMMYSTRUCTNAME;")
cpp_quote("    LONGLONG int64;")
cpp_quote("} CY;")
cpp_quote("#endif")
643
cpp_quote("#endif")
644 645 646

typedef CY *LPCY;

647
cpp_quote("#if 0") /* for IDL only */
648 649 650 651 652 653 654
typedef struct tagDEC {
  USHORT wReserved;
  BYTE scale;
  BYTE sign;
  ULONG Hi32;
  ULONGLONG Lo64;
} DECIMAL;
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680
cpp_quote("#else") /* C/C++ defs */
cpp_quote("typedef struct tagDEC {")
cpp_quote("  USHORT wReserved;")
cpp_quote("  union {")
cpp_quote("    struct {")
cpp_quote("      BYTE scale;")
cpp_quote("      BYTE sign;")
cpp_quote("    } DUMMYSTRUCTNAME;")
cpp_quote("    USHORT signscale;")
cpp_quote("  } DUMMYUNIONNAME;")
cpp_quote("  ULONG Hi32;")
cpp_quote("  union {")
cpp_quote("    struct {")
cpp_quote("#ifdef WORDS_BIGENDIAN")
cpp_quote("      ULONG Mid32;")
cpp_quote("      ULONG Lo32;")
cpp_quote("#else")
cpp_quote("      ULONG Lo32;")
cpp_quote("      ULONG Mid32;")
cpp_quote("#endif")
cpp_quote("    } DUMMYSTRUCTNAME1;")
cpp_quote("    ULONGLONG Lo64;")
cpp_quote("  } DUMMYUNIONNAME1;")
cpp_quote("} DECIMAL;")
cpp_quote("#endif")
cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
681
cpp_quote("#define DECIMAL_SETZERO(d) do{ memset(((char*)&(d)) + sizeof(USHORT), 0, sizeof(ULONG) * 3u + sizeof(USHORT)); }while (0)")
682

683 684 685 686 687 688 689 690 691 692 693
typedef DECIMAL *LPDECIMAL;

typedef [unique] FLAGGED_WORD_BLOB *wireBSTR;
typedef [wire_marshal(wireBSTR)] OLECHAR *BSTR;
typedef BSTR *LPBSTR;

typedef short VARIANT_BOOL;
typedef VARIANT_BOOL _VARIANT_BOOL;
cpp_quote("#define VARIANT_TRUE  ((VARIANT_BOOL)0xFFFF)")
cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)")

694 695 696 697 698
typedef struct tagBSTRBLOB {
  ULONG cbSize;
  [size_is(cbSize)] BYTE *pData;
} BSTRBLOB, *LPBSTRBLOB;

699 700 701 702
cpp_quote("#ifndef _tagBLOB_DEFINED")
cpp_quote("#define _tagBLOB_DEFINED")
cpp_quote("#define _BLOB_DEFINED")
cpp_quote("#define _LPBLOB_DEFINED")
703 704 705 706
typedef struct tagBLOB {
  ULONG cbSize;
  [size_is(cbSize)] BYTE *pBlobData;
} BLOB, *LPBLOB;
707
cpp_quote("#endif")
708 709 710 711

typedef struct tagCLIPDATA {
  ULONG cbSize;
  long ulClipFmt;
712
  [size_is(cbSize-sizeof(long))] BYTE *pClipData;
713 714 715 716 717 718 719 720
} CLIPDATA;
cpp_quote("#define CBPCLIPDATA(cb) ((cb).cbSize - sizeof((cb).ulClipFmt))")

typedef ULONG PROPID;

/******************** VARTYPE ********************/

typedef unsigned short VARTYPE;
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753
enum VARENUM {
  VT_EMPTY           = 0,
  VT_NULL            = 1,
  VT_I2              = 2,
  VT_I4              = 3,
  VT_R4              = 4,
  VT_R8              = 5,
  VT_CY              = 6,
  VT_DATE            = 7,
  VT_BSTR            = 8,
  VT_DISPATCH        = 9,
  VT_ERROR           = 10,
  VT_BOOL            = 11,
  VT_VARIANT         = 12,
  VT_UNKNOWN         = 13,
  VT_DECIMAL         = 14,
  VT_I1              = 16,
  VT_UI1             = 17,
  VT_UI2             = 18,
  VT_UI4             = 19,
  VT_I8              = 20,
  VT_UI8             = 21,
  VT_INT             = 22,
  VT_UINT            = 23,
  VT_VOID            = 24,
  VT_HRESULT         = 25,
  VT_PTR             = 26,
  VT_SAFEARRAY       = 27,
  VT_CARRAY          = 28,
  VT_USERDEFINED     = 29,
  VT_LPSTR           = 30,
  VT_LPWSTR          = 31,
  VT_RECORD          = 36,
754 755
  VT_INT_PTR         = 37,
  VT_UINT_PTR        = 38,
756 757 758 759 760 761 762 763 764
  VT_FILETIME        = 64,
  VT_BLOB            = 65,
  VT_STREAM          = 66,
  VT_STORAGE         = 67,
  VT_STREAMED_OBJECT = 68,
  VT_STORED_OBJECT   = 69,
  VT_BLOB_OBJECT     = 70,
  VT_CF              = 71,
  VT_CLSID           = 72,
765
  VT_VERSIONED_STREAM= 73,
766 767 768 769 770 771 772 773 774
  VT_BSTR_BLOB       = 0x0fff,
  VT_VECTOR          = 0x1000,
  VT_ARRAY           = 0x2000,
  VT_BYREF           = 0x4000,
  VT_RESERVED        = 0x8000,
  VT_ILLEGAL         = 0xffff,
  VT_ILLEGALMASKED   = 0x0fff,
  VT_TYPEMASK        = 0x0fff
};
775

776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
typedef struct tagCSPLATFORM
{
    DWORD dwPlatformId;
    DWORD dwVersionHi;
    DWORD dwVersionLo;
    DWORD dwProcessorArch;
} CSPLATFORM;

typedef struct tagQUERYCONTEXT
{
    DWORD dwContext;
    CSPLATFORM Platform;
    LCID Locale;
    DWORD dwVersionHi;
    DWORD dwVersionLo;
} QUERYCONTEXT;

typedef [v1_enum] enum tagTYSPEC 
{
    TYSPEC_CLSID,
    TYSPEC_FILEEXT,
    TYSPEC_MIMETYPE,
    TYSPEC_PROGID,
    TYSPEC_FILENAME,
    TYSPEC_PACKAGENAME,
    TYSPEC_OBJECTID
} TYSPEC;

typedef union switch(DWORD tyspec)
{
    case TYSPEC_CLSID:
        CLSID clsid;
    case TYSPEC_FILEEXT:
        LPOLESTR pFileExt;
    case TYSPEC_MIMETYPE:
        LPOLESTR pMimeType;
    case TYSPEC_PROGID:
        LPOLESTR pProgId;
    case TYSPEC_FILENAME:
        LPOLESTR pFileName;
    case TYSPEC_PACKAGENAME:
        struct
        {
            LPOLESTR pPackageName;
            GUID PolicyId;
        } ByName;
    case TYSPEC_OBJECTID:
        struct
        {
            GUID ObjectId;
            GUID PolicyId;
        } ByObjectId;
} uCLSSPEC;

830 831 832 833 834 835 836 837 838
cpp_quote("#ifndef PROPERTYKEY_DEFINED")
cpp_quote("#define PROPERTYKEY_DEFINED")
typedef struct _tagpropertykey
{
    GUID fmtid;
    DWORD pid;
} PROPERTYKEY;
cpp_quote("#endif /*PROPERTYKEY_DEFINED*/")

839
} /* interface IWinTypes */