home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SDKRPC.PAK / WTYPES.IDL < prev   
Encoding:
Text File  |  1997-05-06  |  37.4 KB  |  1,305 lines

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. //  File: wtypes.idl
  7. //
  8. //  Contents: This interface definition contains typedefs for remotable
  9. //            data types.
  10. //
  11. //  History:  09-May-96  MikeHill  Updated VARENUM comments.
  12. //            22-May-96  MikeHill  Added FMTID defintions/macros.
  13. //            06-Jun-96  MikeHill  Added CBPCLIPDATA macro.
  14. //
  15. //--------------------------------------------------------------------------
  16.  
  17. cpp_quote("//+-------------------------------------------------------------------------")
  18. cpp_quote("//")
  19. cpp_quote("//  Microsoft Windows")
  20. cpp_quote("//  Copyright (C) Microsoft Corporation, 1992 - 1996.")
  21. cpp_quote("//")
  22. cpp_quote("//--------------------------------------------------------------------------")
  23.  
  24. [ uuid(D3980A60-910C-1068-9341-00DD010F2F1C),
  25.   version(0.1), pointer_default(unique) ]
  26.  
  27. interface IWinTypes
  28. {
  29.  
  30. typedef struct tagRemHGLOBAL
  31. {
  32.         long fNullHGlobal;
  33.         unsigned long cbData;
  34.         [size_is(cbData)] byte data[];
  35. } RemHGLOBAL;
  36.  
  37. typedef struct tagRemHMETAFILEPICT
  38. {
  39.         long        mm;
  40.         long        xExt;
  41.         long        yExt;
  42.         unsigned long cbData;
  43.         [size_is(cbData)] byte data[];
  44. } RemHMETAFILEPICT;
  45.  
  46.  
  47. typedef struct tagRemHENHMETAFILE
  48. {
  49.         unsigned long cbData;
  50.         [size_is(cbData)] byte data[];
  51. } RemHENHMETAFILE;
  52.  
  53. typedef struct tagRemHBITMAP
  54. {
  55.         unsigned long cbData;
  56.         [size_is(cbData)] byte data[];
  57. } RemHBITMAP;
  58.  
  59. typedef struct tagRemHPALETTE
  60. {
  61.         unsigned long cbData;
  62.         [size_is(cbData)] byte data[];
  63. } RemHPALETTE;
  64.  
  65. typedef struct tagRemBRUSH
  66. {
  67.         unsigned long cbData;
  68.         [size_is(cbData)] byte data[];
  69. } RemHBRUSH;
  70.  
  71. cpp_quote("#if !defined(_WIN32) && !defined(_MPPC_)" )
  72. cpp_quote("// The following code is for Win16 only")
  73.  
  74. cpp_quote("#ifndef WINAPI          // If not included with 3.1 headers...")
  75.  
  76. cpp_quote("#define FAR             _far")
  77. cpp_quote("#define PASCAL          _pascal")
  78. cpp_quote("#define CDECL           _cdecl")
  79.  
  80. cpp_quote("#define VOID            void")
  81. cpp_quote("#define WINAPI      FAR PASCAL")
  82. cpp_quote("#define CALLBACK    FAR PASCAL")
  83.  
  84.  
  85. cpp_quote("#ifndef FALSE")
  86. cpp_quote("#define FALSE 0")
  87. cpp_quote("#define TRUE 1")
  88. cpp_quote("#endif // !FALSE")
  89.  
  90. cpp_quote("#ifndef _BYTE_DEFINED")
  91. cpp_quote("#define _BYTE_DEFINED")
  92. typedef unsigned char BYTE;
  93. cpp_quote("#endif // !_BYTE_DEFINED")
  94.  
  95. cpp_quote("#ifndef _WORD_DEFINED")
  96. cpp_quote("#define _WORD_DEFINED")
  97. typedef unsigned short WORD;
  98. cpp_quote("#endif // !_WORD_DEFINED")
  99.  
  100. typedef unsigned int UINT;
  101. typedef int  INT;
  102. typedef long BOOL;
  103.  
  104. cpp_quote("#ifndef _LONG_DEFINED")
  105. cpp_quote("#define _LONG_DEFINED")
  106. typedef long LONG;
  107. cpp_quote("#endif // !_LONG_DEFINED")
  108.  
  109. cpp_quote("#ifndef _WPARAM_DEFINED")
  110. cpp_quote("#define _WPARAM_DEFINED")
  111. typedef UINT WPARAM;
  112. cpp_quote("#endif // _WPARAM_DEFINED")
  113.  
  114. cpp_quote("#ifndef _DWORD_DEFINED")
  115. cpp_quote("#define _DWORD_DEFINED")
  116. typedef unsigned long DWORD;
  117. cpp_quote("#endif // !_DWORD_DEFINED")
  118.  
  119. cpp_quote("#ifndef _LPARAM_DEFINED")
  120. cpp_quote("#define _LPARAM_DEFINED")
  121. typedef LONG LPARAM;//BUGBUG: this should be a discriminated union.
  122. cpp_quote("#endif // !_LPARAM_DEFINED")
  123.  
  124. cpp_quote("#ifndef _LRESULT_DEFINED")
  125. cpp_quote("#define _LRESULT_DEFINED")
  126. typedef LONG LRESULT;
  127. cpp_quote("#endif // !_LRESULT_DEFINED")
  128.  
  129. typedef void * HANDLE;
  130. #define DECLARE_WIREM_HANDLE(name)  \
  131.                              typedef [wire_marshal(wire ## name)] void * name
  132. #define DECLARE_HANDLE(name) typedef void * name
  133.  
  134. DECLARE_HANDLE(HMODULE);
  135. DECLARE_HANDLE(HINSTANCE);
  136. DECLARE_HANDLE(HRGN);
  137. DECLARE_HANDLE(HTASK);
  138. DECLARE_HANDLE(HKEY);
  139.  
  140. DECLARE_HANDLE(HDESK);
  141.  
  142. DECLARE_HANDLE(HMF);
  143. DECLARE_HANDLE(HEMF);
  144.  
  145. DECLARE_HANDLE(HPEN);
  146. DECLARE_HANDLE(HRSRC);
  147. DECLARE_HANDLE(HSTR);
  148. DECLARE_HANDLE(HWINSTA);
  149. DECLARE_HANDLE(HKL);
  150. DECLARE_HANDLE(HGDIOBJ);
  151.  
  152. typedef HANDLE HDWP;
  153.  
  154. cpp_quote("#ifndef _HFILE_DEFINED")
  155. cpp_quote("#define _HFILE_DEFINED")
  156. typedef INT HFILE;      /* Polymorphic with C runtime file handle type */
  157. cpp_quote("#endif // !_HFILE_DEFINED")
  158.  
  159.  
  160. cpp_quote("#ifndef _LPWORD_DEFINED")
  161. cpp_quote("#define _LPWORD_DEFINED")
  162. typedef WORD *LPWORD;
  163. cpp_quote("#endif // !_LPWORD_DEFINED")
  164.  
  165.  
  166. cpp_quote("#ifndef _LPDWORD_DEFINED")
  167. cpp_quote("#define _LPDWORD_DEFINED")
  168. typedef DWORD *LPDWORD;
  169. cpp_quote("#endif // !_LPDWORD_DEFINED")
  170.  
  171.  
  172. typedef char CHAR;
  173. typedef [string] CHAR *LPSTR;
  174. typedef [string] const CHAR *LPCSTR;
  175.  
  176.  
  177. cpp_quote("#ifndef _WCHAR_DEFINED")
  178. cpp_quote("#define _WCHAR_DEFINED")
  179. typedef wchar_t WCHAR;
  180. typedef WCHAR   TCHAR;
  181. cpp_quote("#endif // !_WCHAR_DEFINED")
  182.  
  183. typedef [string] WCHAR *LPWSTR;
  184.  
  185.  
  186. typedef [string] TCHAR *LPTSTR;
  187.  
  188. typedef [string] const WCHAR *LPCWSTR;
  189. typedef [string] const TCHAR *LPCTSTR;
  190.  
  191.  
  192. typedef struct tagPALETTEENTRY {
  193.     BYTE        peRed;
  194.     BYTE        peGreen;
  195.     BYTE        peBlue;
  196.     BYTE        peFlags;
  197. } PALETTEENTRY, *PPALETTEENTRY, *LPPALETTEENTRY;
  198.  
  199. // Logical Palette
  200. cpp_quote("#if 0")
  201.  
  202.     typedef struct tagLOGPALETTE {
  203.         WORD        palVersion;
  204.         WORD        palNumEntries;
  205.         [size_is(palNumEntries)] PALETTEENTRY        palPalEntry[];
  206.     } LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;
  207.  
  208. cpp_quote("#else")
  209. cpp_quote("typedef struct tagLOGPALETTE {")
  210. cpp_quote("    WORD        palVersion;")
  211. cpp_quote("    WORD        palNumEntries;")
  212. cpp_quote("    PALETTEENTRY        palPalEntry[1];")
  213. cpp_quote("} LOGPALETTE, *PLOGPALETTE, *LPLOGPALETTE;")
  214. cpp_quote("#endif")
  215.  
  216.  
  217. cpp_quote("#ifndef _COLORREF_DEFINED")
  218. cpp_quote("#define _COLORREF_DEFINED")
  219. typedef DWORD COLORREF;
  220. cpp_quote("#endif // !_COLORREF_DEFINED")
  221.  
  222. cpp_quote("#ifndef _LPCOLORREF_DEFINED")
  223. cpp_quote("#define _LPCOLORREF_DEFINED")
  224. typedef DWORD *LPCOLORREF;
  225. cpp_quote("#endif // !_LPCOLORREF_DEFINED")
  226.  
  227.  
  228. typedef HANDLE *LPHANDLE;
  229.  
  230. //typedefs for remotable types from wingdi.h
  231.  
  232. typedef struct _RECTL
  233. {
  234.     LONG    left;
  235.     LONG    top;
  236.     LONG    right;
  237.     LONG    bottom;
  238. } RECTL, *PRECTL, *LPRECTL;
  239.  
  240.  
  241. typedef struct tagPOINT
  242. {
  243.     LONG  x;
  244.     LONG  y;
  245. } POINT, *PPOINT, *LPPOINT;
  246.  
  247. typedef struct _POINTL
  248. {
  249.     LONG  x;
  250.     LONG  y;
  251. } POINTL, *PPOINTL;
  252.  
  253.  
  254. cpp_quote("#ifndef WIN16")
  255. typedef struct tagSIZE
  256. {
  257.     LONG        cx;
  258.     LONG        cy;
  259. } SIZE, *PSIZE, *LPSIZE;
  260. cpp_quote("#else // WIN16")
  261. cpp_quote("typedef struct tagSIZE")
  262. cpp_quote("{")
  263. cpp_quote("    INT cx;")
  264. cpp_quote("    INT cy;")
  265. cpp_quote("} SIZE, *PSIZE, *LPSIZE;")
  266. cpp_quote("#endif // WIN16")
  267.  
  268.  
  269. typedef struct tagSIZEL
  270. {
  271.     LONG cx;
  272.     LONG cy;
  273. } SIZEL, *PSIZEL, *LPSIZEL;
  274.  
  275.  
  276. cpp_quote("#endif  //WINAPI")
  277. cpp_quote("#endif  //!WIN32 && !MPPC")
  278.  
  279. cpp_quote("#if defined(_WIN32) && !defined(OLE2ANSI)")
  280.  
  281. typedef WCHAR                   OLECHAR;
  282. typedef [string] OLECHAR       *LPOLESTR;
  283. typedef [string] const OLECHAR *LPCOLESTR;
  284. cpp_quote("#define OLESTR(str) L##str")
  285.  
  286. cpp_quote("")
  287. cpp_quote("#else")
  288. cpp_quote("")
  289.  
  290. cpp_quote("typedef char      OLECHAR;")
  291. cpp_quote("typedef LPSTR     LPOLESTR;")
  292. cpp_quote("typedef LPCSTR    LPCOLESTR;")
  293. cpp_quote("#define OLESTR(str) str")
  294.  
  295. cpp_quote("#endif")
  296.  
  297.  
  298. // This block contains types that are normally defined by the nt sdk in WINDEF.H
  299. // but we need them here for definitions that follow in this file.  If WINDEF.H
  300. // hasn't been included then we need to define them now so that WTYPES.H
  301. // will compile.
  302. cpp_quote("#ifndef _WINDEF_")
  303. typedef const RECTL *LPCRECTL;
  304.  
  305. typedef void * PVOID, * LPVOID;
  306. typedef float   FLOAT;
  307.  
  308. typedef struct tagRECT
  309. {
  310.     LONG    left;
  311.     LONG    top;
  312.     LONG    right;
  313.     LONG    bottom;
  314. } RECT, *PRECT, *LPRECT;
  315. typedef const RECT *LPCRECT;
  316.  
  317. cpp_quote("#endif  //_WINDEF_")
  318.  
  319.  
  320. typedef unsigned char   UCHAR;
  321. typedef short           SHORT;
  322. typedef unsigned short  USHORT;
  323. typedef DWORD           ULONG;
  324. typedef double          DOUBLE;
  325.  
  326. cpp_quote("#ifndef _DWORDLONG_")
  327. typedef unsigned __int64 DWORDLONG;
  328. typedef DWORDLONG *PDWORDLONG;
  329. cpp_quote("#endif // !_DWORDLONG_")
  330.  
  331. //
  332. // __int64 is only supported by 2.0 and later midl.
  333. // __midl is set by the 2.0 midl and not by 1.0 midl.
  334. //
  335.  
  336. cpp_quote("#ifndef _ULONGLONG_")
  337.  
  338. #if (defined(__midl))
  339. typedef __int64 LONGLONG;
  340. typedef unsigned __int64 ULONGLONG;
  341. #else
  342. typedef double LONGLONG;
  343. typedef double ULONGLONG;
  344. #endif
  345.  
  346. typedef LONGLONG *PLONGLONG;
  347. typedef ULONGLONG *PULONGLONG;
  348. cpp_quote("#endif // _ULONGLONG_")
  349.  
  350. // just for local wtypes
  351. cpp_quote("#if 0")
  352.  
  353. typedef struct _LARGE_INTEGER {
  354.     LONGLONG QuadPart;
  355. } LARGE_INTEGER;
  356.  
  357. typedef LARGE_INTEGER *PLARGE_INTEGER;
  358.  
  359. typedef struct _ULARGE_INTEGER {
  360.     ULONGLONG QuadPart;
  361. } ULARGE_INTEGER;
  362.  
  363. // just for local wtypes
  364. cpp_quote("#endif // 0")
  365.  
  366.  
  367. cpp_quote("#ifndef _WINBASE_")
  368.  
  369. cpp_quote("#ifndef _FILETIME_")
  370. cpp_quote("#define _FILETIME_")
  371. typedef struct _FILETIME
  372. {
  373.     DWORD dwLowDateTime;
  374.     DWORD dwHighDateTime;
  375. } FILETIME, *PFILETIME, *LPFILETIME;
  376. cpp_quote("#endif // !_FILETIME")
  377.  
  378. cpp_quote("#ifndef _SYSTEMTIME_")
  379. cpp_quote("#define _SYSTEMTIME_")
  380. typedef struct _SYSTEMTIME {
  381.     WORD wYear;
  382.     WORD wMonth;
  383.     WORD wDayOfWeek;
  384.     WORD wDay;
  385.     WORD wHour;
  386.     WORD wMinute;
  387.     WORD wSecond;
  388.     WORD wMilliseconds;
  389. } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
  390.  
  391. cpp_quote("#endif // !_SYSTEMTIME")
  392.  
  393. cpp_quote("#ifndef _SECURITY_ATTRIBUTES_")
  394. cpp_quote("#define _SECURITY_ATTRIBUTES_")
  395. typedef struct _SECURITY_ATTRIBUTES {
  396.     DWORD nLength;
  397.     [size_is(nLength)] LPVOID lpSecurityDescriptor;
  398.     BOOL bInheritHandle;
  399. } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
  400. cpp_quote("#endif // !_SECURITY_ATTRIBUTES_")
  401.  
  402. cpp_quote("#ifndef SECURITY_DESCRIPTOR_REVISION")
  403.  
  404. typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
  405.  
  406. typedef PVOID PSID;     // winnt
  407.  
  408. typedef struct _ACL {
  409.     UCHAR AclRevision;
  410.     UCHAR Sbz1;
  411.     USHORT AclSize;
  412.     USHORT AceCount;
  413.     USHORT Sbz2;
  414. } ACL;
  415. typedef ACL *PACL;
  416.  
  417. typedef struct _SECURITY_DESCRIPTOR {
  418.     UCHAR Revision;
  419.     UCHAR Sbz1;
  420.     SECURITY_DESCRIPTOR_CONTROL Control;
  421.     PSID Owner;
  422.     PSID Group;
  423.     PACL Sacl;
  424.     PACL Dacl;
  425. } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
  426.  
  427. cpp_quote("#endif // !SECURITY_DESCRIPTOR_REVISION")
  428.  
  429. cpp_quote("#endif //_WINBASE_")
  430.  
  431. typedef struct _COAUTHIDENTITY
  432. {
  433.   [size_is(UserLength+1)] USHORT *      User;
  434.   ULONG                                 UserLength;
  435.   [size_is(DomainLength+1)] USHORT *    Domain;
  436.   ULONG                                 DomainLength;
  437.   [size_is(PasswordLength+1)] USHORT *  Password;
  438.   ULONG                                 PasswordLength;
  439.   ULONG                                 Flags;
  440. } COAUTHIDENTITY;
  441.  
  442. typedef struct _COAUTHINFO
  443. {
  444.     DWORD               dwAuthnSvc;
  445.     DWORD               dwAuthzSvc;
  446.     LPWSTR              pwszServerPrincName;
  447.     DWORD               dwAuthnLevel;
  448.     DWORD               dwImpersonationLevel;
  449.     COAUTHIDENTITY *    pAuthIdentityData;
  450.     DWORD               dwCapabilities;
  451. } COAUTHINFO;
  452.  
  453. typedef struct _COSERVERINFO
  454. {
  455.     DWORD           dwReserved1;
  456.     LPWSTR          pwszName;
  457.     COAUTHINFO *    pAuthInfo;
  458.     DWORD           dwReserved2;
  459. } COSERVERINFO;
  460.  
  461. //
  462. // SCODE, HRESULT
  463. //
  464. //
  465. //  Status values are 32 bit values layed out as follows:
  466. //
  467. //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  468. //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  469. //  +-+-----------------------------+-------------------------------+
  470. //  |S|       Facility              |               Code            |
  471. //  +-+-----------------------------+-------------------------------+
  472. //
  473. //  where
  474. //
  475. //      S - is the severity code
  476. //
  477. //          0 - Success
  478. //          1 - Error
  479. //
  480. //
  481. //      Facility - is the facility code
  482. //
  483. //      Code - is the facility's status code
  484. //
  485. // SCODE and HRESULT are mktyplib base types.
  486. //
  487. typedef LONG SCODE;
  488. cpp_quote("#ifndef _HRESULT_DEFINED")
  489. cpp_quote("#define _HRESULT_DEFINED")
  490. #if defined(_STRICT_HRESULT)
  491. typedef struct _HRESULT_STRUCT {
  492.         DWORD Data1;
  493. } HRESULT_STRUCT, *PHRESULT_STRUCT;
  494. typedef PHRESULT_STRUCT HRESULT;
  495. #else // defined(_STRICT_HRESULT)
  496. typedef LONG HRESULT;
  497. #endif // defined(_STRICT_HRESULT)
  498. cpp_quote("#endif // !_HRESULT_DEFINED")
  499.  
  500. typedef SCODE *PSCODE;
  501.  
  502.  
  503. cpp_quote("#ifndef GUID_DEFINED")
  504. cpp_quote("#define GUID_DEFINED")
  505. typedef struct _GUID
  506. {
  507.     DWORD Data1;
  508.     WORD  Data2;
  509.     WORD  Data3;
  510.     BYTE  Data4[8];
  511. } GUID;
  512. cpp_quote("#endif // !GUID_DEFINED")
  513.  
  514. cpp_quote("#if !defined( __LPGUID_DEFINED__ )")
  515. cpp_quote("#define __LPGUID_DEFINED__")
  516. typedef GUID *LPGUID;
  517. cpp_quote("#endif // !__LPGUID_DEFINED__")
  518.  
  519. cpp_quote("#ifndef __OBJECTID_DEFINED")
  520. cpp_quote("#define __OBJECTID_DEFINED")
  521. cpp_quote("#define _OBJECTID_DEFINED")
  522. typedef struct _OBJECTID     // NOTE!! Order of structure members is important for OFS
  523. {                            // enumeration.
  524.    GUID Lineage;             // Unique for objects copied from same original and copies of.
  525.    unsigned long Uniquifier; // Random, to provide uniqueness within small set with same
  526. } OBJECTID;                  // lineage id.
  527. cpp_quote("#endif // !_OBJECTID_DEFINED")
  528.  
  529.  
  530.  
  531.  
  532. cpp_quote("#if !defined( __IID_DEFINED__ )")
  533. cpp_quote("#define __IID_DEFINED__")
  534.  
  535. // Interface ID are just a kind of GUID
  536. typedef GUID IID;
  537. typedef IID *LPIID;
  538. cpp_quote("#define IID_NULL            GUID_NULL")
  539. cpp_quote("#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)")
  540.  
  541. // Class ID are just a kind of GUID
  542. typedef GUID CLSID;
  543. typedef              CLSID *LPCLSID;
  544. cpp_quote("#define CLSID_NULL          GUID_NULL")
  545. cpp_quote("#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)")
  546.  
  547. // Format ID are just a kind of GUID
  548. typedef GUID FMTID;
  549. typedef              FMTID *LPFMTID;
  550. cpp_quote("#define FMTID_NULL          GUID_NULL")
  551. cpp_quote("#define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2)")
  552.  
  553. //The following typedefs are used internally by MIDL.
  554. cpp_quote("#if 0")
  555. #if defined(__midl)
  556.     /* MIDL 2.0 definitions */
  557.     typedef GUID *REFGUID;
  558.     typedef IID *REFIID;
  559.     typedef CLSID *REFCLSID;
  560.     typedef FMTID *REFFMTID;
  561. #else
  562.     /* MIDL 1.1 definitions */
  563.     typedef GUID REFGUID;
  564.     typedef IID REFIID;
  565.     typedef CLSID REFCLSID;
  566.     typedef FMTID REFFMTID;
  567. #endif
  568. cpp_quote("#endif // 0")
  569.  
  570. cpp_quote("#if defined(__cplusplus)")
  571.  
  572. cpp_quote("#ifndef _REFGUID_DEFINED")
  573. cpp_quote("#define _REFGUID_DEFINED")
  574. cpp_quote("#define REFGUID             const GUID &")
  575. cpp_quote("#endif // !_REFGUID_DEFINED")
  576.  
  577. cpp_quote("#ifndef _REFIID_DEFINED")
  578. cpp_quote("#define _REFIID_DEFINED")
  579. cpp_quote("#define REFIID              const IID &")
  580. cpp_quote("#endif // !_REFIID_DEFINED")
  581.  
  582. cpp_quote("#ifndef _REFCLSID_DEFINED")
  583. cpp_quote("#define _REFCLSID_DEFINED")
  584. cpp_quote("#define REFCLSID            const CLSID &")
  585. cpp_quote("#endif // !_REFCLSID_DEFINED")
  586.  
  587. cpp_quote("#ifndef _REFFMTID_DEFINED")
  588. cpp_quote("#define _REFFMTID_DEFINED")
  589. cpp_quote("#define REFFMTID            const FMTID &")
  590. cpp_quote("#endif // !_REFFMTID_DEFINED")
  591.  
  592.  
  593. cpp_quote("#else // !__cplusplus")
  594.  
  595. cpp_quote("#ifndef _REFGUID_DEFINED")
  596. cpp_quote("#define _REFGUID_DEFINED")
  597. cpp_quote("#define REFGUID             const GUID * const")
  598. cpp_quote("#endif // !_REFGUID_DEFINED")
  599.  
  600. cpp_quote("#ifndef _REFIID_DEFINED")
  601. cpp_quote("#define _REFIID_DEFINED")
  602. cpp_quote("#define REFIID              const IID * const")
  603. cpp_quote("#endif // !_REFIID_DEFINED")
  604.  
  605.  
  606. cpp_quote("#ifndef _REFCLSID_DEFINED")
  607. cpp_quote("#define _REFCLSID_DEFINED")
  608. cpp_quote("#define REFCLSID            const CLSID * const")
  609. cpp_quote("#endif // !_REFCLSID_DEFINED")
  610.  
  611. cpp_quote("#ifndef _REFFMTID_DEFINED")
  612. cpp_quote("#define _REFFMTID_DEFINED")
  613. cpp_quote("#define REFFMTID            const FMTID * const")
  614. cpp_quote("#endif // !_REFFMTID_DEFINED")
  615.  
  616. cpp_quote("#endif // !__cplusplus")
  617.  
  618. cpp_quote("#endif // !__IID_DEFINED__")
  619.  
  620. /************************* Misc types ***********************************/
  621.  
  622. // Common typdefs used in API paramaters, gleamed from compobj.h
  623.  
  624. // memory context values; passed to CoGetMalloc
  625. typedef enum tagMEMCTX
  626. {
  627.     MEMCTX_TASK = 1,            // task (private) memory
  628.     MEMCTX_SHARED = 2,          // shared memory (between processes)
  629.     MEMCTX_MACSYSTEM = 3,       // on the mac, the system heap
  630.     // these are mostly for internal use...
  631.     MEMCTX_UNKNOWN = -1,        // unknown context (when asked about it)
  632.     MEMCTX_SAME = -2,           // same context (as some other pointer)
  633. } MEMCTX;
  634.  
  635.  
  636. // For IRunningObjectTable::Register
  637. cpp_quote("#ifndef _ROTFLAGS_DEFINED")
  638. cpp_quote("#define _ROTFLAGS_DEFINED")
  639. cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
  640. cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
  641. cpp_quote("#endif // !_ROTFLAGS_DEFINED")
  642.  
  643. // Maximum size of comparison buffer for IROTData::GetComparisonData
  644. cpp_quote("#ifndef _ROT_COMPARE_MAX_DEFINED")
  645. cpp_quote("#define _ROT_COMPARE_MAX_DEFINED")
  646. cpp_quote("#define ROT_COMPARE_MAX 2048")
  647. cpp_quote("#endif // !_ROT_COMPARE_MAX_DEFINED")
  648.  
  649.  
  650. // class context: used to determine what scope and kind of class object to use
  651. // NOTE: this is a bitwise enum
  652. typedef enum tagCLSCTX
  653. {
  654.     CLSCTX_INPROC_SERVER = 0x01,   // server dll (runs in same process as caller)
  655.     CLSCTX_INPROC_HANDLER = 0x02,  // handler dll (runs in same process as caller)
  656.     CLSCTX_LOCAL_SERVER = 0x04,    // server exe (runs on same machine; diff proc)
  657.     CLSCTX_INPROC_SERVER16 = 0x08, // 16-bit server dll (runs in same process as caller)
  658.     CLSCTX_REMOTE_SERVER = 0x10,    // remote server exe (runs on different machine)
  659.     CLSCTX_INPROC_HANDLER16 = 0x20, // 16-bit handler dll (runs in same process as caller)
  660.     CLSCTX_INPROC_SERVERX86 = 0x40, // Wx86 server dll (runs in same process as caller)
  661.     CLSCTX_INPROC_HANDLERX86 = 0x80, // Wx86 handler dll (runs in same process as caller)
  662. } CLSCTX;
  663.  
  664.  
  665.     // marshaling flags; passed to CoMarshalInterface
  666.     typedef enum tagMSHLFLAGS
  667.     {
  668.         MSHLFLAGS_NORMAL = 0,       // normal marshaling via proxy/stub
  669.         MSHLFLAGS_TABLESTRONG = 1,  // keep object alive; must explicitly release
  670.     MSHLFLAGS_TABLEWEAK = 2,    // doesn't hold object alive; still must release
  671.     MSHLFLAGS_NOPING = 4        // remote clients dont 'ping' to keep objects alive
  672.     } MSHLFLAGS;
  673.  
  674.  
  675. // marshal context: determines the destination context of the marshal operation
  676. typedef enum tagMSHCTX
  677. {
  678.     MSHCTX_LOCAL = 0,           // unmarshal context is local (eg.shared memory)
  679.     MSHCTX_NOSHAREDMEM = 1,     // unmarshal context has no shared memory access
  680.     MSHCTX_DIFFERENTMACHINE = 2,// unmarshal context is on a different machine
  681.     MSHCTX_INPROC = 3,          // unmarshal context is on different thread
  682. } MSHCTX;
  683.  
  684.  
  685. //
  686. // Common typedefs for paramaters used in data view API's, gleamed
  687. // from dvobj.h
  688. //
  689.  
  690. // Data/View aspect; specifies the desired aspect of the object when
  691. // drawing or getting data.
  692. typedef enum tagDVASPECT
  693. {
  694.     DVASPECT_CONTENT = 1,
  695.     DVASPECT_THUMBNAIL = 2,
  696.     DVASPECT_ICON = 4,
  697.     DVASPECT_DOCPRINT = 8
  698. } DVASPECT;
  699.  
  700. /****** Storage types *************************************************/
  701.  
  702.  
  703. /* Storage commit types */
  704. typedef enum tagSTGC
  705. {
  706.     STGC_DEFAULT        = 0,
  707.     STGC_OVERWRITE      = 1,
  708.     STGC_ONLYIFCURRENT  = 2,
  709.     STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4
  710. } STGC;
  711.  
  712.  
  713. typedef enum tagSTGMOVE
  714. {
  715.     STGMOVE_MOVE    = 0,
  716.     STGMOVE_COPY    = 1,
  717.     STGMOVE_SHALLOWCOPY = 2
  718. } STGMOVE;
  719.  
  720. typedef enum tagSTATFLAG
  721. {
  722.     STATFLAG_DEFAULT = 0,
  723.     STATFLAG_NONAME = 1,
  724.     STATFLAG_NOOPEN = 2
  725. } STATFLAG;
  726.  
  727.  
  728. typedef [context_handle] void *HCONTEXT;
  729.  
  730. /****** Critical Section Wrappers ***********************************/
  731.  
  732.  
  733. /* if not already picked up from olenls.h */
  734. cpp_quote("#ifndef _LCID_DEFINED")
  735. cpp_quote("#define _LCID_DEFINED")
  736. typedef DWORD LCID;
  737. cpp_quote("#endif // !_LCID_DEFINED")
  738.  
  739. // #######################################################################
  740. //
  741. //  User marshal support for Windows data types.
  742.  
  743. //
  744. //  Frequently used helpers: sized blobs
  745. //
  746. //      Never put [user_marshal] or [wire_marshal] on the helpers directly.
  747. //
  748.  
  749. // Simple blobs.
  750.  
  751. typedef struct _BYTE_BLOB {
  752.                         unsigned long   clSize;
  753.     [size_is(clSize)]   byte            abData[];
  754. } BYTE_BLOB;
  755.  
  756. typedef [unique] BYTE_BLOB * UP_BYTE_BLOB;
  757.  
  758. typedef struct _WORD_BLOB {
  759.                         unsigned long   clSize;
  760.     [size_is(clSize)]   unsigned short  asData[];
  761. } WORD_BLOB;
  762.  
  763. typedef [unique] WORD_BLOB * UP_WORD_BLOB;
  764.  
  765. typedef struct _DWORD_BLOB {
  766.                         unsigned long   clSize;
  767.     [size_is(clSize)]   unsigned long   alData[];
  768. } DWORD_BLOB;
  769.  
  770. typedef [unique] DWORD_BLOB * UP_DWORD_BLOB;
  771.  
  772. // Flagged blobs.
  773.  
  774. typedef struct _FLAGGED_BYTE_BLOB {
  775.                         unsigned long   fFlags;
  776.                         unsigned long   clSize;
  777.     [size_is(clSize)]   byte            abData[];
  778. } FLAGGED_BYTE_BLOB;
  779.  
  780. typedef [unique] FLAGGED_BYTE_BLOB * UP_FLAGGED_BYTE_BLOB;
  781.  
  782. typedef struct _FLAGGED_WORD_BLOB {
  783.                         unsigned long   fFlags;
  784.                         unsigned long   clSize;
  785.     [size_is(clSize)]   unsigned short  asData[];
  786. } FLAGGED_WORD_BLOB;
  787.  
  788. typedef [unique] FLAGGED_WORD_BLOB * UP_FLAGGED_WORD_BLOB;
  789.  
  790. // Frequently used helpers with sized pointers.
  791.  
  792. typedef struct _BYTE_SIZEDARR {
  793.                         unsigned long   clSize;
  794.     [size_is(clSize)]   byte     *      pData ;
  795. } BYTE_SIZEDARR;
  796.  
  797. typedef struct _SHORT_SIZEDARR {
  798.                         unsigned long   clSize;
  799.     [size_is(clSize)]   unsigned short* pData ;
  800. } WORD_SIZEDARR;
  801.  
  802. typedef struct _LONG_SIZEDARR {
  803.                         unsigned long   clSize;
  804.     [size_is(clSize)]   unsigned long * pData ;
  805. } DWORD_SIZEDARR;
  806.  
  807. typedef struct _HYPER_SIZEDARR {
  808.                         unsigned long   clSize;
  809.     [size_is(clSize)]   hyper         * pData ;
  810. } HYPER_SIZEDARR;
  811.  
  812.  
  813. // #########################################################################
  814. //
  815. //   Constants for the call context
  816. //
  817.  
  818. const unsigned long WDT_INPROC_CALL = 0x48746457;
  819. const unsigned long WDT_REMOTE_CALL = 0x52746457;
  820.  
  821.  
  822. // #########################################################################
  823. //
  824. //  CLIPFORMAT
  825. //
  826.  
  827. typedef union _userCLIPFORMAT switch(long fContext) u
  828. {
  829.     case WDT_INPROC_CALL:         DWORD     dwValue;
  830.     case WDT_REMOTE_CALL:   [string] wchar_t * pwszName;
  831. } userCLIPFORMAT;
  832.  
  833. typedef [unique] userCLIPFORMAT *  wireCLIPFORMAT;
  834.  
  835. typedef [wire_marshal(wireCLIPFORMAT)] WORD  CLIPFORMAT;
  836.  
  837.  
  838. // #########################################################################
  839. //
  840. //  Good for most of the gdi handles.
  841.  
  842. typedef union _GDI_NONREMOTE switch( long fContext ) u
  843. {
  844.     case WDT_INPROC_CALL:   long        hInproc;
  845.     case WDT_REMOTE_CALL:   DWORD_BLOB *hRemote;
  846. } GDI_NONREMOTE;
  847.  
  848. // #########################################################################
  849. //
  850. //  HGLOBAL
  851. //
  852. // A global may be Null or may be non-NULL with 0 length.
  853.  
  854. typedef union _userHGLOBAL switch( long fContext ) u
  855. {
  856.     case WDT_INPROC_CALL:   long            hInproc;
  857.     case WDT_REMOTE_CALL:   FLAGGED_BYTE_BLOB *     hRemote;
  858.     default:                long            hGlobal;
  859. } userHGLOBAL;
  860.  
  861. typedef [unique] userHGLOBAL       * wireHGLOBAL;
  862.  
  863. // #########################################################################
  864. //
  865. //  HMETAFILE
  866. //
  867.  
  868. typedef union _userHMETAFILE switch( long fContext ) u
  869. {
  870.     case WDT_INPROC_CALL:   long            hInproc;
  871.     case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
  872.     default:                long            hGlobal;
  873. } userHMETAFILE;
  874.  
  875. // #########################################################################
  876. //
  877. //  HMETAFILEPICT
  878. //
  879. typedef struct _remoteMETAFILEPICT
  880. {
  881.     long            mm;
  882.     long            xExt;
  883.     long            yExt;
  884.     userHMETAFILE * hMF;
  885. } remoteMETAFILEPICT;
  886.  
  887. typedef union _userHMETAFILEPICT switch( long fContext ) u
  888. {
  889.     case WDT_INPROC_CALL:   long                hInproc;
  890.     case WDT_REMOTE_CALL:   remoteMETAFILEPICT* hRemote;
  891.     default:                long                hGlobal;
  892. } userHMETAFILEPICT;
  893.  
  894. // #########################################################################
  895. //
  896. //  HENHMETAFILE
  897. //
  898.  
  899. typedef union _userHENHMETAFILE switch( long fContext ) u
  900. {
  901.     case WDT_INPROC_CALL:   long            hInproc;
  902.     case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
  903.     default:                long            hGlobal;
  904. } userHENHMETAFILE;
  905.  
  906. // #########################################################################
  907. //
  908. //  HBITMAP
  909. //
  910.  
  911. // RemHBITMAP was just a byte blob, but the whole bitmap structure was copied
  912. // at the beginning of the buffer.
  913.  
  914. // So, we take BITMAP fields from wingdi.x
  915.  
  916. typedef struct _userBITMAP
  917. {
  918.     LONG            bmType;
  919.     LONG            bmWidth;
  920.     LONG            bmHeight;
  921.     LONG            bmWidthBytes;
  922.     WORD            bmPlanes;
  923.     WORD            bmBitsPixel;
  924.     ULONG                       cbSize;
  925.     [size_is(cbSize)]   byte    pBuffer[];
  926. } userBITMAP;
  927.  
  928.  
  929. typedef union _userHBITMAP switch( long fContext ) u
  930. {
  931.     case WDT_INPROC_CALL:   long            hInproc;
  932.     case WDT_REMOTE_CALL:   userBITMAP *    hRemote;
  933.     default:                long            hGlobal;
  934. } userHBITMAP;
  935.  
  936. // #########################################################################
  937. //
  938. //  HPALETTE
  939. //
  940.  
  941. // PALETTEENTRY is in wingdi.x, it is a struct with 4 bytes.
  942. // LOGPALETTE   is in wingdi.x, it is a conf struct with paletteentries and
  943. //                                    a version field
  944.  
  945. typedef struct tagrpcLOGPALETTE {
  946.     WORD                        palVersion;
  947.     WORD                        palNumEntries;
  948.     [size_is( palNumEntries )]  PALETTEENTRY        palPalEntry[];
  949. } rpcLOGPALETTE;
  950.  
  951. typedef union _userHPALETTE switch( long fContext ) u
  952. {
  953.     case WDT_INPROC_CALL:   long            hInproc;
  954.     case WDT_REMOTE_CALL:   rpcLOGPALETTE * hRemote;
  955.     default:                long            hGlobal;
  956. } userHPALETTE;
  957.  
  958.  
  959. // #########################################################################
  960. //
  961. //  Handles passed locally as longs.
  962. //
  963.  
  964. typedef union _RemotableHandle switch( long fContext ) u
  965. {
  966.     case WDT_INPROC_CALL:   long   hInproc;
  967.     case WDT_REMOTE_CALL:   long   hRemote;
  968. } RemotableHandle;
  969.  
  970. typedef [unique] RemotableHandle * wireHWND;
  971. typedef [unique] RemotableHandle * wireHMENU;
  972. typedef [unique] RemotableHandle * wireHACCEL;
  973. typedef [unique] RemotableHandle * wireHBRUSH;
  974. typedef [unique] RemotableHandle * wireHFONT;
  975. typedef [unique] RemotableHandle * wireHDC;
  976. typedef [unique] RemotableHandle * wireHICON;
  977.  
  978.  
  979. cpp_quote("#if 0")
  980. #ifndef _MIDL_DECLARE_WIREM_HANDLE
  981. DECLARE_WIREM_HANDLE( HWND );
  982. DECLARE_WIREM_HANDLE( HMENU );
  983. DECLARE_WIREM_HANDLE( HACCEL );
  984. DECLARE_WIREM_HANDLE( HBRUSH );
  985. DECLARE_WIREM_HANDLE( HFONT );
  986. DECLARE_WIREM_HANDLE( HDC );
  987. DECLARE_WIREM_HANDLE( HICON );
  988. #endif
  989.  
  990. cpp_quote("#ifndef _HCURSOR_DEFINED")
  991. cpp_quote("#define _HCURSOR_DEFINED")
  992. typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
  993. cpp_quote("#endif // !_HCURSOR_DEFINED")
  994.  
  995. cpp_quote("/* tagTEXTMETRICW was copied from wingdi.h for MIDL */")
  996. typedef struct tagTEXTMETRICW {
  997.     LONG  tmHeight;
  998.     LONG  tmAscent;
  999.     LONG  tmDescent;
  1000.     LONG  tmInternalLeading;
  1001.     LONG  tmExternalLeading;
  1002.     LONG  tmAveCharWidth;
  1003.     LONG  tmMaxCharWidth;
  1004.     LONG  tmWeight;
  1005.     LONG  tmOverhang;
  1006.     LONG  tmDigitizedAspectX;
  1007.     LONG  tmDigitizedAspectY;
  1008.     WCHAR tmFirstChar;
  1009.     WCHAR tmLastChar;
  1010.     WCHAR tmDefaultChar;
  1011.     WCHAR tmBreakChar;
  1012.     BYTE  tmItalic;
  1013.     BYTE  tmUnderlined;
  1014.     BYTE  tmStruckOut;
  1015.     BYTE  tmPitchAndFamily;
  1016.     BYTE  tmCharSet;
  1017. } TEXTMETRICW;
  1018.  
  1019. cpp_quote("#endif //0")
  1020.  
  1021. cpp_quote("#ifndef _WIN32           // The following code is for Win16 only")
  1022. cpp_quote("#ifndef WINAPI          // If not included with 3.1 headers...")
  1023.  
  1024. // Message structure
  1025.  
  1026. typedef struct tagMSG {
  1027.     HWND        hwnd;
  1028.     UINT        message;
  1029.     WPARAM      wParam;
  1030.     LPARAM      lParam;
  1031.     DWORD       time;
  1032.     POINT       pt;
  1033. } MSG, *PMSG, *NPMSG, *LPMSG;
  1034. cpp_quote("#endif // _WIN32")
  1035. cpp_quote("#endif // WINAPI")
  1036.  
  1037.  
  1038. typedef [unique] userHBITMAP      * wireHBITMAP;
  1039. typedef [unique] userHPALETTE     * wireHPALETTE;
  1040. typedef [unique] userHENHMETAFILE * wireHENHMETAFILE;
  1041. typedef [unique] userHMETAFILE    * wireHMETAFILE;
  1042. typedef [unique] userHMETAFILEPICT* wireHMETAFILEPICT;
  1043.  
  1044. cpp_quote("#if 0")
  1045.  
  1046. DECLARE_WIREM_HANDLE( HGLOBAL );
  1047. typedef HGLOBAL HLOCAL;
  1048.  
  1049. DECLARE_WIREM_HANDLE( HBITMAP );
  1050. DECLARE_WIREM_HANDLE( HPALETTE );
  1051. DECLARE_WIREM_HANDLE( HENHMETAFILE );
  1052. DECLARE_WIREM_HANDLE( HMETAFILE );
  1053. cpp_quote("#endif //0")
  1054.  
  1055. DECLARE_WIREM_HANDLE( HMETAFILEPICT );
  1056.  
  1057. }
  1058.  
  1059. // #########################################################################
  1060. //
  1061.  
  1062. typedef double DATE;
  1063.  
  1064. /* This is a helper struct for use in handling currency. */
  1065. cpp_quote("#ifndef _tagCY_DEFINED")
  1066. cpp_quote("#define _tagCY_DEFINED")
  1067. cpp_quote("#define _CY_DEFINED")
  1068.  
  1069. cpp_quote("#if 0")
  1070.  
  1071. cpp_quote("/* the following isn't the real definition of CY, but it is */")
  1072. cpp_quote("/* what RPC knows how to remote */")
  1073. typedef struct tagCY {
  1074.     LONGLONG    int64;
  1075. } CY;
  1076.  
  1077. cpp_quote("#else /* 0 */")
  1078.  
  1079. cpp_quote("/* real definition that makes the C++ compiler happy */")
  1080. cpp_quote("typedef union tagCY {")
  1081. cpp_quote("    struct {")
  1082. cpp_quote("#ifdef _MAC")
  1083. cpp_quote("        long      Hi;")
  1084. cpp_quote("        long Lo;")
  1085. cpp_quote("#else")
  1086. cpp_quote("        unsigned long Lo;")
  1087. cpp_quote("        long      Hi;")
  1088. cpp_quote("#endif")
  1089. cpp_quote("    };")
  1090. cpp_quote("    LONGLONG int64;")
  1091. cpp_quote("} CY;")
  1092. cpp_quote("#endif /* 0 */")
  1093.  
  1094. cpp_quote("#endif /* _tagCY_DEFINED */")
  1095.  
  1096. cpp_quote("#if 0 /* _tagDEC_DEFINED */")
  1097. cpp_quote("/* The following isn't the real definition of Decimal type, */")
  1098. cpp_quote("/* but it is what RPC knows how to remote */")
  1099.  
  1100. typedef struct tagDEC {
  1101.     USHORT wReserved;
  1102.     BYTE  scale;
  1103.     BYTE  sign;
  1104.     ULONG Hi32;
  1105.     ULONGLONG Lo64;
  1106. } DECIMAL;
  1107.  
  1108. cpp_quote("#else /* _tagDEC_DEFINED */")
  1109.  
  1110. cpp_quote("/* real definition that makes the C++ compiler happy */")
  1111. cpp_quote("typedef struct tagDEC {")
  1112. cpp_quote("    USHORT wReserved;")
  1113. cpp_quote("    union {")
  1114. cpp_quote("        struct {")
  1115. cpp_quote("            BYTE scale;")
  1116. cpp_quote("            BYTE sign;")
  1117. cpp_quote("        };")
  1118. cpp_quote("        USHORT signscale;")
  1119. cpp_quote("    };")
  1120. cpp_quote("    ULONG Hi32;")
  1121. cpp_quote("    union {")
  1122. cpp_quote("        struct {")
  1123. cpp_quote("#ifdef _MAC")
  1124. cpp_quote("            ULONG Mid32;")
  1125. cpp_quote("            ULONG Lo32;")
  1126. cpp_quote("#else")
  1127. cpp_quote("            ULONG Lo32;")
  1128. cpp_quote("            ULONG Mid32;")
  1129. cpp_quote("#endif")
  1130. cpp_quote("        };")
  1131. cpp_quote("        ULONGLONG Lo64;")
  1132. cpp_quote("    };")
  1133. cpp_quote("} DECIMAL;")
  1134.  
  1135. cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
  1136. cpp_quote("#define DECIMAL_SETZERO(dec) \\")
  1137. cpp_quote("        {(dec).Lo64 = 0; (dec).Hi32 = 0; (dec).signscale = 0;}")
  1138.  
  1139. cpp_quote("#endif /* _tagDEC_DEFINED */")
  1140.  
  1141. /* IDL declarations for BSTR how to transmit them */
  1142. //
  1143. typedef [unique] FLAGGED_WORD_BLOB * wireBSTR;
  1144. typedef [wire_marshal( wireBSTR )] OLECHAR *  BSTR;
  1145. typedef BSTR * LPBSTR;
  1146.  
  1147. cpp_quote("/* 0 == FALSE, -1 == TRUE */")
  1148. typedef short VARIANT_BOOL;
  1149. cpp_quote("#if !__STDC__ && (_MSC_VER <= 1000)")
  1150. cpp_quote("/* For backward compatibility */")
  1151. typedef VARIANT_BOOL _VARIANT_BOOL;
  1152. cpp_quote("#else")
  1153. cpp_quote("/* ANSI C/C++ reserve bool as keyword */")
  1154. cpp_quote("#define _VARIANT_BOOL    /##/")
  1155. cpp_quote("#endif")
  1156. typedef boolean BOOLEAN;
  1157.  
  1158. cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xffff)")
  1159. cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0)")
  1160.  
  1161. cpp_quote("#ifndef _tagBLOB_DEFINED")
  1162. cpp_quote("#define _tagBLOB_DEFINED")
  1163. cpp_quote("#define _BLOB_DEFINED")
  1164. cpp_quote("#define _LPBLOB_DEFINED")
  1165. typedef struct tagBLOB {
  1166.     ULONG cbSize;
  1167.     [size_is(cbSize)]
  1168.     BYTE  *pBlobData;
  1169. } BLOB, * LPBLOB;
  1170. cpp_quote("#endif")
  1171.  
  1172. typedef struct tagCLIPDATA {
  1173.     ULONG cbSize;       // count that includes sizeof(ulClipFmt)
  1174.     long ulClipFmt;     // long to keep alignment
  1175.     [size_is(cbSize-4)]
  1176.     BYTE * pClipData;   // cbSize-sizeof(ULONG) bytes of data in clipboard format
  1177. } CLIPDATA;
  1178.  
  1179. cpp_quote("// Macro to calculate the size of the above pClipData")
  1180. cpp_quote("#define CBPCLIPDATA(clipdata)    ( (clipdata).cbSize - sizeof((clipdata).ulClipFmt) )")
  1181.  
  1182.  
  1183. typedef unsigned short VARTYPE;
  1184.  
  1185. // #########################################################################
  1186. //
  1187. //  VARTYPE
  1188. //
  1189. // #########################################################################
  1190.  
  1191.  
  1192. cpp_quote("/*")
  1193. cpp_quote(" * VARENUM usage key,")
  1194. cpp_quote(" *")
  1195. cpp_quote(" * * [V] - may appear in a VARIANT")
  1196. cpp_quote(" * * [T] - may appear in a TYPEDESC")
  1197. cpp_quote(" * * [P] - may appear in an OLE property set")
  1198. cpp_quote(" * * [S] - may appear in a Safe Array")
  1199. cpp_quote(" *")
  1200. cpp_quote(" *")
  1201. cpp_quote(" *  VT_EMPTY            [V]   [P]     nothing")
  1202. cpp_quote(" *  VT_NULL             [V]   [P]     SQL style Null")
  1203. cpp_quote(" *  VT_I2               [V][T][P][S]  2 byte signed int")
  1204. cpp_quote(" *  VT_I4               [V][T][P][S]  4 byte signed int")
  1205. cpp_quote(" *  VT_R4               [V][T][P][S]  4 byte real")
  1206. cpp_quote(" *  VT_R8               [V][T][P][S]  8 byte real")
  1207. cpp_quote(" *  VT_CY               [V][T][P][S]  currency")
  1208. cpp_quote(" *  VT_DATE             [V][T][P][S]  date")
  1209. cpp_quote(" *  VT_BSTR             [V][T][P][S]  OLE Automation string")
  1210. cpp_quote(" *  VT_DISPATCH         [V][T][P][S]  IDispatch *")
  1211. cpp_quote(" *  VT_ERROR            [V][T]   [S]  SCODE")
  1212. cpp_quote(" *  VT_BOOL             [V][T][P][S]  True=-1, False=0")
  1213. cpp_quote(" *  VT_VARIANT          [V][T][P][S]  VARIANT *")
  1214. cpp_quote(" *  VT_UNKNOWN          [V][T]   [S]  IUnknown *")
  1215. cpp_quote(" *  VT_DECIMAL          [V][T]   [S]  16 byte fixed point")
  1216. cpp_quote(" *  VT_I1                  [T]        signed char")
  1217. cpp_quote(" *  VT_UI1              [V][T][P][S]  unsigned char")
  1218. cpp_quote(" *  VT_UI2                 [T][P]     unsigned short")
  1219. cpp_quote(" *  VT_UI4                 [T][P]     unsigned short")
  1220. cpp_quote(" *  VT_I8                  [T][P]     signed 64-bit int")
  1221. cpp_quote(" *  VT_UI8                 [T][P]     unsigned 64-bit int")
  1222. cpp_quote(" *  VT_INT                 [T]        signed machine int")
  1223. cpp_quote(" *  VT_UINT                [T]        unsigned machine int")
  1224. cpp_quote(" *  VT_VOID                [T]        C style void")
  1225. cpp_quote(" *  VT_HRESULT             [T]        Standard return type")
  1226. cpp_quote(" *  VT_PTR                 [T]        pointer type")
  1227. cpp_quote(" *  VT_SAFEARRAY           [T]        (use VT_ARRAY in VARIANT)")
  1228. cpp_quote(" *  VT_CARRAY              [T]        C style array")
  1229. cpp_quote(" *  VT_USERDEFINED         [T]        user defined type")
  1230. cpp_quote(" *  VT_LPSTR               [T][P]     null terminated string")
  1231. cpp_quote(" *  VT_LPWSTR              [T][P]     wide null terminated string")
  1232. cpp_quote(" *  VT_FILETIME               [P]     FILETIME")
  1233. cpp_quote(" *  VT_BLOB                   [P]     Length prefixed bytes")
  1234. cpp_quote(" *  VT_STREAM                 [P]     Name of the stream follows")
  1235. cpp_quote(" *  VT_STORAGE                [P]     Name of the storage follows")
  1236. cpp_quote(" *  VT_STREAMED_OBJECT        [P]     Stream contains an object")
  1237. cpp_quote(" *  VT_STORED_OBJECT          [P]     Storage contains an object")
  1238. cpp_quote(" *  VT_BLOB_OBJECT            [P]     Blob contains an object")
  1239. cpp_quote(" *  VT_CF                     [P]     Clipboard format")
  1240. cpp_quote(" *  VT_CLSID                  [P]     A Class ID")
  1241.  
  1242. cpp_quote(" *  VT_VECTOR                 [P]     simple counted array")
  1243. cpp_quote(" *  VT_ARRAY            [V]           SAFEARRAY*")
  1244. cpp_quote(" *  VT_BYREF            [V]           void* for local use")
  1245. cpp_quote(" */")
  1246.  
  1247. enum VARENUM
  1248. {
  1249.     VT_EMPTY           = 0,
  1250.     VT_NULL            = 1,
  1251.     VT_I2              = 2,
  1252.     VT_I4              = 3,
  1253.     VT_R4              = 4,
  1254.     VT_R8              = 5,
  1255.     VT_CY              = 6,
  1256.     VT_DATE            = 7,
  1257.     VT_BSTR            = 8,
  1258.     VT_DISPATCH        = 9,
  1259.     VT_ERROR           = 10,
  1260.     VT_BOOL            = 11,
  1261.     VT_VARIANT         = 12,
  1262.     VT_UNKNOWN         = 13,
  1263.     VT_DECIMAL         = 14,
  1264.  
  1265.     VT_I1              = 16,
  1266.     VT_UI1             = 17,
  1267.     VT_UI2             = 18,
  1268.     VT_UI4             = 19,
  1269.     VT_I8              = 20,
  1270.     VT_UI8             = 21,
  1271.     VT_INT             = 22,
  1272.     VT_UINT            = 23,
  1273.     VT_VOID            = 24,
  1274.     VT_HRESULT         = 25,
  1275.     VT_PTR             = 26,
  1276.     VT_SAFEARRAY       = 27,
  1277.     VT_CARRAY          = 28,
  1278.     VT_USERDEFINED     = 29,
  1279.     VT_LPSTR           = 30,
  1280.     VT_LPWSTR          = 31,
  1281.  
  1282.     VT_FILETIME        = 64,
  1283.     VT_BLOB            = 65,
  1284.     VT_STREAM          = 66,
  1285.     VT_STORAGE         = 67,
  1286.     VT_STREAMED_OBJECT = 68,
  1287.     VT_STORED_OBJECT   = 69,
  1288.     VT_BLOB_OBJECT     = 70,
  1289.     VT_CF              = 71,
  1290.     VT_CLSID           = 72,
  1291.  
  1292.     VT_VECTOR          = 0x1000,
  1293.     VT_ARRAY           = 0x2000,
  1294.     VT_BYREF           = 0x4000,
  1295.     VT_RESERVED        = 0x8000,
  1296.  
  1297.     VT_ILLEGAL         = 0xffff,
  1298.     VT_ILLEGALMASKED   = 0x0fff,
  1299.     VT_TYPEMASK        = 0x0fff
  1300. };
  1301.  
  1302. // Property stuff
  1303. typedef ULONG PROPID;
  1304.  
  1305.