PropIdl.Idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:25k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. //  File: propidl.idl
  7. //
  8. //----------------------------------------------------------------------------
  9. cpp_quote("//+-------------------------------------------------------------------------")
  10. cpp_quote("//")
  11. cpp_quote("//  Microsoft Windows")
  12. cpp_quote("//  Copyright (c) Microsoft Corporation. All rights reserved.")
  13. cpp_quote("//")
  14. cpp_quote("//--------------------------------------------------------------------------")
  15. cpp_quote("#if ( _MSC_VER >= 800 )")
  16. cpp_quote("#if _MSC_VER >= 1200")
  17. cpp_quote("#pragma warning(push)")
  18. cpp_quote("#endif")
  19. cpp_quote("#pragma warning(disable:4201)    /* Nameless struct/union */")
  20. cpp_quote("#pragma warning(disable:4237)    /* obsolete member named 'bool' */")
  21. cpp_quote("#endif")
  22. cpp_quote("#if ( _MSC_VER >= 1020 )")
  23. cpp_quote("#pragma once")
  24. cpp_quote("#endif")
  25. #ifndef DO_NO_IMPORTS
  26. import "objidl.idl";
  27. import "oaidl.idl";
  28. #endif
  29. /****************************************************************************
  30.  *  Property Storage Interfaces
  31.  ****************************************************************************/
  32. interface IPropertyStorage;
  33. interface IEnumSTATPROPSTG;
  34. interface IEnumSTATPROPSETSTG;
  35. typedef struct tagVersionedStream {
  36.     GUID guidVersion;
  37.     IStream *pStream;
  38. } VERSIONEDSTREAM, *LPVERSIONEDSTREAM;
  39. cpp_quote("")
  40. cpp_quote("// Flags for IPropertySetStorage::Create")
  41. const DWORD PROPSETFLAG_DEFAULT = 0;
  42. const DWORD PROPSETFLAG_NONSIMPLE = 1;
  43. const DWORD PROPSETFLAG_ANSI = 2;
  44. cpp_quote("//   (This flag is only supported on StgCreatePropStg & StgOpenPropStg")
  45. const DWORD PROPSETFLAG_UNBUFFERED = 4;
  46. cpp_quote("//   (This flag causes a version-1 property set to be created")
  47. const DWORD PROPSETFLAG_CASE_SENSITIVE = 8;
  48. cpp_quote("")
  49. cpp_quote("// Flags for the reservied PID_BEHAVIOR property")
  50. const DWORD PROPSET_BEHAVIOR_CASE_SENSITIVE = 1;
  51. cpp_quote("#ifdef MIDL_PASS")
  52. cpp_quote("// This is the PROPVARIANT definition for marshaling.")
  53. typedef struct tag_inner_PROPVARIANT PROPVARIANT;
  54. cpp_quote("#else")
  55. cpp_quote("// This is the standard C layout of the PROPVARIANT.")
  56. cpp_quote("typedef struct tagPROPVARIANT PROPVARIANT;")
  57. cpp_quote("#endif")
  58. #define TYPEDEF_CA(type, name) 
  59.     typedef struct tag##name
  60.     {
  61.         ULONG   cElems;
  62.         [size_is( cElems )]
  63.         type *  pElems;
  64.     } name
  65. TYPEDEF_CA(CHAR,                CAC);
  66. TYPEDEF_CA(UCHAR,               CAUB);
  67. TYPEDEF_CA(SHORT,               CAI);
  68. TYPEDEF_CA(USHORT,              CAUI);
  69. TYPEDEF_CA(LONG,                CAL);
  70. TYPEDEF_CA(ULONG,               CAUL);
  71. TYPEDEF_CA(FLOAT,               CAFLT);
  72. TYPEDEF_CA(DOUBLE,              CADBL);
  73. TYPEDEF_CA(CY,                  CACY);
  74. TYPEDEF_CA(DATE,                CADATE);
  75. TYPEDEF_CA(BSTR,                CABSTR);
  76. TYPEDEF_CA(BSTRBLOB,            CABSTRBLOB);
  77. TYPEDEF_CA(VARIANT_BOOL,        CABOOL);
  78. TYPEDEF_CA(SCODE,               CASCODE);
  79. TYPEDEF_CA(PROPVARIANT,         CAPROPVARIANT);
  80. TYPEDEF_CA(LARGE_INTEGER,       CAH);
  81. TYPEDEF_CA(ULARGE_INTEGER,      CAUH);
  82. TYPEDEF_CA(LPSTR,               CALPSTR);
  83. TYPEDEF_CA(LPWSTR,              CALPWSTR);
  84. TYPEDEF_CA(FILETIME,            CAFILETIME);
  85. TYPEDEF_CA(CLIPDATA,            CACLIPDATA);
  86. TYPEDEF_CA(CLSID,               CACLSID);
  87. //
  88. // The new PROPVARIANT.  Apr 16 1998
  89. //   The goal was to add all the OleAut union arms that the OleAut VARIANT
  90. // supports without breaking wire compatibility with the old PROPVARIANT.
  91. //   Adding IDispatch* and safe ARRAYs required the creation of propidl.idl
  92. // since the use of OAIDL types in PROPVARIANT means it can no longer reside
  93. // in objidl.idl.
  94. //   Adding DECIMAL is the tricky part.  OleAut VARIANTs have an extra outer
  95. // union for DECIMAL.  (Go look at the VARIANT definition in oaidl).  Adding
  96. // an outer union in the IDL description would break wire compatibility with
  97. // the old PROPVARIANT.  The solution has two parts:
  98. // 1) If the union contained DECIMAL data (don't worry how it got there, eg.
  99. //  someone cast a pointer) how do we get it across the wire successfully?
  100. //  The types of the padding were changed so they matche the first part of a
  101. // DECIMAL.  Add a case for VT_DECIMAL to marshal the second half.
  102. // 2) Provide an outer union, with devVal field name for the C/C++ programmer.
  103. // Rename the old PROPVARIANT as tag_inner_PROPVARIANT and added some
  104. // cpp_quote's that glue an outer union, named tagPROPVARIANT, around it.
  105. // There are also some cpp_quote games played with the typedef LPPROPVARIANT
  106. // and PROPVARIANT types.
  107. cpp_quote("#ifdef MIDL_PASS")
  108. cpp_quote("// This is the PROPVARIANT padding layout for marshaling.")
  109. typedef BYTE PROPVAR_PAD1;
  110. typedef BYTE PROPVAR_PAD2;
  111. typedef ULONG PROPVAR_PAD3;
  112. cpp_quote("#else")
  113. cpp_quote("// This is the standard C layout of the structure.")
  114. cpp_quote("typedef WORD PROPVAR_PAD1;")
  115. cpp_quote("typedef WORD PROPVAR_PAD2;")
  116. cpp_quote("typedef WORD PROPVAR_PAD3;")
  117. cpp_quote("#define tag_inner_PROPVARIANT")
  118. cpp_quote("#endif")
  119. cpp_quote("#ifndef MIDL_PASS")
  120. cpp_quote("struct tagPROPVARIANT {")
  121. cpp_quote("  union {")
  122. cpp_quote("#endif")
  123. struct tag_inner_PROPVARIANT
  124. {
  125.     VARTYPE vt;
  126.     PROPVAR_PAD1   wReserved1;
  127.     PROPVAR_PAD2   wReserved2;
  128.     PROPVAR_PAD3   wReserved3;
  129.     [switch_is((unsigned short) vt)] union
  130.     {
  131.         //
  132.         // Basic Types.
  133.         //
  134.         [case (VT_EMPTY, VT_NULL)]  ;
  135.         [case (VT_I1)]              CHAR             cVal;      // New
  136.         [case (VT_UI1)]             UCHAR            bVal;
  137.         [case (VT_I2)]              SHORT            iVal;
  138.         [case (VT_UI2)]             USHORT           uiVal;
  139.         [case (VT_I4)]              LONG             lVal;
  140.         [case (VT_UI4)]             ULONG            ulVal;
  141.         [case (VT_INT)]             INT              intVal;    // New
  142.         [case (VT_UINT)]            UINT             uintVal;   // New
  143.         [case (VT_DECIMAL, VT_I8)]  LARGE_INTEGER    hVal;      // Decimal
  144.         [case (VT_UI8)]             ULARGE_INTEGER   uhVal;
  145.         [case (VT_R4)]              FLOAT            fltVal;
  146.         [case (VT_R8)]              DOUBLE           dblVal;
  147.         [case (VT_BOOL)]            VARIANT_BOOL     boolVal;
  148.         [case (VT_ILLEGAL)]         _VARIANT_BOOL    bool;      // obsolete
  149.         [case (VT_ERROR)]           SCODE            scode;
  150.         [case (VT_CY)]              CY               cyVal;
  151.         [case (VT_DATE)]            DATE             date;
  152.         [case (VT_FILETIME)]        FILETIME         filetime;
  153.         [case (VT_CLSID)]           CLSID *          puuid;
  154.         [case (VT_CF)]              CLIPDATA *       pclipdata;
  155.         [case (VT_BSTR)]            BSTR             bstrVal;
  156.         [case (VT_BSTR_BLOB)]       BSTRBLOB         bstrblobVal; // System use only
  157.         [case (VT_BLOB, VT_BLOB_OBJECT)] BLOB        blob;
  158.         [case (VT_LPSTR)]           LPSTR            pszVal;
  159.         [case (VT_LPWSTR)]          LPWSTR           pwszVal;
  160.         [case (VT_UNKNOWN)]         IUnknown *       punkVal;    // New
  161.         [case (VT_DISPATCH)]        IDispatch *      pdispVal;   // New
  162.         [case (VT_STREAM, VT_STREAMED_OBJECT)] IStream*  pStream;
  163.         [case (VT_STORAGE, VT_STORED_OBJECT)]  IStorage* pStorage;
  164.         [case (VT_VERSIONED_STREAM)]  LPVERSIONEDSTREAM  pVersionedStream;
  165.         //
  166.         // Arrays of types  (only the old VARIANT types)
  167.         //
  168.         [case (VT_ARRAY|VT_I1,
  169.                VT_ARRAY|VT_UI1,
  170.                VT_ARRAY|VT_I2,
  171.                VT_ARRAY|VT_UI2,
  172.                VT_ARRAY|VT_I4,
  173.                VT_ARRAY|VT_UI4,
  174.                VT_ARRAY|VT_INT,
  175.                VT_ARRAY|VT_UINT,
  176.                VT_ARRAY|VT_R4,
  177.                VT_ARRAY|VT_R8,
  178.                VT_ARRAY|VT_CY,
  179.                VT_ARRAY|VT_DATE,
  180.                VT_ARRAY|VT_BSTR,
  181.                VT_ARRAY|VT_BOOL,
  182.                VT_ARRAY|VT_DECIMAL,
  183.                VT_ARRAY|VT_DISPATCH,
  184.                VT_ARRAY|VT_UNKNOWN,
  185.                VT_ARRAY|VT_ERROR,
  186.                VT_ARRAY|VT_VARIANT)]   LPSAFEARRAY      parray;     // New
  187.         //
  188.         // Vectors of types
  189.         //
  190.         [case (VT_VECTOR|VT_I1)]       CAC           cac;       // new
  191.         [case (VT_VECTOR|VT_UI1)]      CAUB          caub;
  192.         [case (VT_VECTOR|VT_I2)]       CAI           cai;
  193.         [case (VT_VECTOR|VT_UI2)]      CAUI          caui;
  194.         [case (VT_VECTOR|VT_I4)]       CAL           cal;
  195.         [case (VT_VECTOR|VT_UI4)]      CAUL          caul;
  196.         [case (VT_VECTOR|VT_I8)]       CAH           cah;
  197.         [case (VT_VECTOR|VT_UI8)]      CAUH          cauh;
  198.         [case (VT_VECTOR|VT_R4)]       CAFLT         caflt;
  199.         [case (VT_VECTOR|VT_R8)]       CADBL         cadbl;
  200.         [case (VT_VECTOR|VT_BOOL)]     CABOOL        cabool;
  201.         [case (VT_VECTOR|VT_ERROR)]    CASCODE       cascode;
  202.         [case (VT_VECTOR|VT_CY)]       CACY          cacy;
  203.         [case (VT_VECTOR|VT_DATE)]     CADATE        cadate;
  204.         [case (VT_VECTOR|VT_FILETIME)] CAFILETIME    cafiletime;
  205.         [case (VT_VECTOR|VT_CLSID)]    CACLSID       cauuid;
  206.         [case (VT_VECTOR|VT_CF)]       CACLIPDATA    caclipdata;
  207.         [case (VT_VECTOR|VT_BSTR)]     CABSTR        cabstr;
  208.         [case (VT_VECTOR|VT_BSTR_BLOB)]CABSTRBLOB    cabstrblob; // System use only
  209.         [case (VT_VECTOR|VT_LPSTR)]    CALPSTR       calpstr;
  210.         [case (VT_VECTOR|VT_LPWSTR)]   CALPWSTR      calpwstr;
  211.         [case (VT_VECTOR|VT_VARIANT)]  CAPROPVARIANT capropvar;
  212.         //
  213.         // ByRefs of types.
  214.         //
  215.         [case (VT_BYREF|VT_I1)]       CHAR*           pcVal;       // New
  216.         [case (VT_BYREF|VT_UI1)]      UCHAR*          pbVal;       // New
  217.         [case (VT_BYREF|VT_I2)]       SHORT*          piVal;       // New
  218.         [case (VT_BYREF|VT_UI2)]      USHORT*         puiVal;      // New
  219.         [case (VT_BYREF|VT_I4)]       LONG*           plVal;       // New
  220.         [case (VT_BYREF|VT_UI4)]      ULONG*          pulVal;      // New
  221.         [case (VT_BYREF|VT_INT)]      INT*            pintVal;     // New
  222.         [case (VT_BYREF|VT_UINT)]     UINT*           puintVal;    // New
  223.         [case (VT_BYREF|VT_R4)]       FLOAT*          pfltVal;     // New
  224.         [case (VT_BYREF|VT_R8)]       DOUBLE*         pdblVal;     // New
  225.         [case (VT_BYREF|VT_BOOL)]     VARIANT_BOOL*   pboolVal;    // New
  226.         [case (VT_BYREF|VT_DECIMAL)]  DECIMAL*        pdecVal;     // New
  227.         [case (VT_BYREF|VT_ERROR)]    SCODE*          pscode;      // New
  228.         [case (VT_BYREF|VT_CY)]       CY*             pcyVal;      // New
  229.         [case (VT_BYREF|VT_DATE)]     DATE*           pdate;       // New
  230.         [case (VT_BYREF|VT_BSTR)]     BSTR*           pbstrVal;    // New
  231.         [case (VT_BYREF|VT_UNKNOWN)]  IUnknown **     ppunkVal;    // New
  232.         [case (VT_BYREF|VT_DISPATCH)] IDispatch **    ppdispVal;   // New
  233.         [case (VT_BYREF|VT_ARRAY)]    LPSAFEARRAY*    pparray;     // New
  234.         [case (VT_BYREF|VT_VARIANT)]  PROPVARIANT*    pvarVal;     // New
  235.     };
  236. };
  237. cpp_quote("#ifndef MIDL_PASS")
  238. cpp_quote("    DECIMAL decVal;")
  239. cpp_quote("  };")
  240. cpp_quote("};")
  241. cpp_quote("#endif")
  242. cpp_quote("#ifdef MIDL_PASS")
  243. cpp_quote("// This is the LPPROPVARIANT definition for marshaling.")
  244. typedef struct tag_inner_PROPVARIANT * LPPROPVARIANT;
  245. cpp_quote("#else")
  246. cpp_quote("// This is the standard C layout of the PROPVARIANT.")
  247. cpp_quote("typedef struct tagPROPVARIANT * LPPROPVARIANT;")
  248. cpp_quote("#endif")
  249. cpp_quote("// Reserved global Property IDs")
  250. const PROPID PID_DICTIONARY         = 0x00000000;
  251. const PROPID PID_CODEPAGE           = 0x00000001;
  252. const PROPID PID_FIRST_USABLE       = 0x00000002;
  253. const PROPID PID_FIRST_NAME_DEFAULT = 0x00000fff;
  254. const PROPID PID_LOCALE             = 0x80000000;
  255. const PROPID PID_MODIFY_TIME        = 0x80000001;
  256. const PROPID PID_SECURITY           = 0x80000002;
  257. const PROPID PID_BEHAVIOR           = 0x80000003;
  258. const PROPID PID_ILLEGAL            = 0xffffffff;
  259. cpp_quote("// Range which is read-only to downlevel implementations")
  260. const PROPID PID_MIN_READONLY       = 0x80000000;
  261. const PROPID PID_MAX_READONLY       = 0xbfffffff;
  262. cpp_quote("// Property IDs for the DiscardableInformation Property Set")
  263. cpp_quote("")
  264. cpp_quote("#define PIDDI_THUMBNAIL          0x00000002L // VT_BLOB")
  265. cpp_quote("")
  266. cpp_quote("// Property IDs for the SummaryInformation Property Set")
  267. cpp_quote("")
  268. cpp_quote("#define PIDSI_TITLE               0x00000002L  // VT_LPSTR")
  269. cpp_quote("#define PIDSI_SUBJECT             0x00000003L  // VT_LPSTR")
  270. cpp_quote("#define PIDSI_AUTHOR              0x00000004L  // VT_LPSTR")
  271. cpp_quote("#define PIDSI_KEYWORDS            0x00000005L  // VT_LPSTR")
  272. cpp_quote("#define PIDSI_COMMENTS            0x00000006L  // VT_LPSTR")
  273. cpp_quote("#define PIDSI_TEMPLATE            0x00000007L  // VT_LPSTR")
  274. cpp_quote("#define PIDSI_LASTAUTHOR          0x00000008L  // VT_LPSTR")
  275. cpp_quote("#define PIDSI_REVNUMBER           0x00000009L  // VT_LPSTR")
  276. cpp_quote("#define PIDSI_EDITTIME            0x0000000aL  // VT_FILETIME (UTC)")
  277. cpp_quote("#define PIDSI_LASTPRINTED         0x0000000bL  // VT_FILETIME (UTC)")
  278. cpp_quote("#define PIDSI_CREATE_DTM          0x0000000cL  // VT_FILETIME (UTC)")
  279. cpp_quote("#define PIDSI_LASTSAVE_DTM        0x0000000dL  // VT_FILETIME (UTC)")
  280. cpp_quote("#define PIDSI_PAGECOUNT           0x0000000eL  // VT_I4")
  281. cpp_quote("#define PIDSI_WORDCOUNT           0x0000000fL  // VT_I4")
  282. cpp_quote("#define PIDSI_CHARCOUNT           0x00000010L  // VT_I4")
  283. cpp_quote("#define PIDSI_THUMBNAIL           0x00000011L  // VT_CF")
  284. cpp_quote("#define PIDSI_APPNAME             0x00000012L  // VT_LPSTR")
  285. cpp_quote("#define PIDSI_DOC_SECURITY        0x00000013L  // VT_I4")
  286. cpp_quote("")
  287. cpp_quote("// Property IDs for the DocSummaryInformation Property Set")
  288. cpp_quote("")
  289. cpp_quote("#define PIDDSI_CATEGORY          0x00000002 // VT_LPSTR") 
  290. cpp_quote("#define PIDDSI_PRESFORMAT        0x00000003 // VT_LPSTR")
  291. cpp_quote("#define PIDDSI_BYTECOUNT         0x00000004 // VT_I4")
  292. cpp_quote("#define PIDDSI_LINECOUNT         0x00000005 // VT_I4")
  293. cpp_quote("#define PIDDSI_PARCOUNT          0x00000006 // VT_I4")
  294. cpp_quote("#define PIDDSI_SLIDECOUNT        0x00000007 // VT_I4")
  295. cpp_quote("#define PIDDSI_NOTECOUNT         0x00000008 // VT_I4")
  296. cpp_quote("#define PIDDSI_HIDDENCOUNT       0x00000009 // VT_I4")
  297. cpp_quote("#define PIDDSI_MMCLIPCOUNT       0x0000000A // VT_I4")
  298. cpp_quote("#define PIDDSI_SCALE             0x0000000B // VT_BOOL") 
  299. cpp_quote("#define PIDDSI_HEADINGPAIR       0x0000000C // VT_VARIANT | VT_VECTOR")
  300. cpp_quote("#define PIDDSI_DOCPARTS          0x0000000D // VT_LPSTR | VT_VECTOR")
  301. cpp_quote("#define PIDDSI_MANAGER           0x0000000E // VT_LPSTR")
  302. cpp_quote("#define PIDDSI_COMPANY           0x0000000F // VT_LPSTR")
  303. cpp_quote("#define PIDDSI_LINKSDIRTY        0x00000010 // VT_BOOL")
  304. cpp_quote("")
  305. cpp_quote("")
  306. cpp_quote("//  FMTID_MediaFileSummaryInfo - Property IDs")
  307. cpp_quote("")
  308. cpp_quote("#define PIDMSI_EDITOR                   0x00000002L  // VT_LPWSTR")
  309. cpp_quote("#define PIDMSI_SUPPLIER                 0x00000003L  // VT_LPWSTR")
  310. cpp_quote("#define PIDMSI_SOURCE                   0x00000004L  // VT_LPWSTR")
  311. cpp_quote("#define PIDMSI_SEQUENCE_NO              0x00000005L  // VT_LPWSTR")
  312. cpp_quote("#define PIDMSI_PROJECT                  0x00000006L  // VT_LPWSTR")
  313. cpp_quote("#define PIDMSI_STATUS                   0x00000007L  // VT_UI4")
  314. cpp_quote("#define PIDMSI_OWNER                    0x00000008L  // VT_LPWSTR")
  315. cpp_quote("#define PIDMSI_RATING                   0x00000009L  // VT_LPWSTR")
  316. cpp_quote("#define PIDMSI_PRODUCTION               0x0000000AL  // VT_FILETIME (UTC)")
  317. cpp_quote("#define PIDMSI_COPYRIGHT                0x0000000BL  // VT_LPWSTR")
  318. cpp_quote("")
  319. cpp_quote("//  PIDMSI_STATUS value definitions")
  320. enum PIDMSI_STATUS_VALUE
  321. {
  322.     PIDMSI_STATUS_NORMAL  = 0,
  323.     PIDMSI_STATUS_NEW,
  324.     PIDMSI_STATUS_PRELIM,
  325.     PIDMSI_STATUS_DRAFT,
  326.     PIDMSI_STATUS_INPROGRESS,
  327.     PIDMSI_STATUS_EDIT,
  328.     PIDMSI_STATUS_REVIEW,
  329.     PIDMSI_STATUS_PROOF,
  330.     PIDMSI_STATUS_FINAL,
  331.     PIDMSI_STATUS_OTHER   = 0x7FFF
  332. } ;
  333. const ULONG PRSPEC_INVALID = 0xffffffff;
  334. const ULONG PRSPEC_LPWSTR = 0;
  335. const ULONG PRSPEC_PROPID = 1;
  336. typedef struct tagPROPSPEC
  337. {
  338.     ULONG   ulKind;
  339.     [switch_is(ulKind)] union
  340.     {
  341.         [case(PRSPEC_PROPID)]
  342.             PROPID      propid;
  343.         [case(PRSPEC_LPWSTR)]
  344.             LPOLESTR    lpwstr;
  345.         [default] ;
  346.     } ;
  347. } PROPSPEC;
  348. typedef struct tagSTATPROPSTG
  349. {
  350.     LPOLESTR    lpwstrName;
  351.     PROPID      propid;
  352.     VARTYPE     vt;
  353. } STATPROPSTG;
  354. cpp_quote("// Macros for parsing the OS Version of the Property Set Header")
  355. cpp_quote("#define PROPSETHDR_OSVER_KIND(dwOSVer)      HIWORD( (dwOSVer) )")
  356. cpp_quote("#define PROPSETHDR_OSVER_MAJOR(dwOSVer)     LOBYTE(LOWORD( (dwOSVer) ))")
  357. cpp_quote("#define PROPSETHDR_OSVER_MINOR(dwOSVer)     HIBYTE(LOWORD( (dwOSVer) ))")
  358. cpp_quote("#define PROPSETHDR_OSVERSION_UNKNOWN        0xFFFFFFFF")
  359. typedef struct tagSTATPROPSETSTG
  360. {
  361.     FMTID       fmtid;
  362.     CLSID       clsid;
  363.     DWORD       grfFlags;
  364.     FILETIME    mtime;
  365.     FILETIME    ctime;
  366.     FILETIME    atime;
  367.     DWORD       dwOSVersion;
  368. } STATPROPSETSTG;
  369. [
  370.     object,
  371.     uuid(00000138-0000-0000-C000-000000000046),
  372.     pointer_default(unique)
  373. ]
  374. interface IPropertyStorage : IUnknown
  375. {
  376.     // When this IDL file is used for "IProp.dll" (the
  377.     // standalone property set DLL), we must have local
  378.     // and remotable routines (call_as routines are used
  379.     // to remove BSTRs, which are not remotable with some
  380.     // RPC run-times).
  381.     //
  382.     // For the remotable routines, we must use pointer
  383.     // parameters (e.g. "*rgspec" rather than "rgspec[]")
  384.     // so that the MIDL 2.0 compiler will generate an
  385.     // interpereted proxy/stub, rather than inline.
  386. #ifdef IPROPERTY_DLL
  387.     [local]
  388. #endif
  389.     HRESULT ReadMultiple(
  390.         [in]    ULONG                   cpspec,
  391.         [in, size_is(cpspec)]
  392.                 const PROPSPEC          rgpspec[],
  393.         [out, size_is(cpspec)]
  394.                 PROPVARIANT             rgpropvar[]
  395.         );
  396. #ifdef IPROPERTY_DLL
  397.     [call_as(ReadMultiple)]
  398.     HRESULT RemoteReadMultiple(
  399.         [out]   BOOL                    *pfBstrPresent,
  400.         [in]    ULONG                   cpspec,
  401.         [in, size_is(cpspec)]
  402.                 const PROPSPEC          *rgpspec,
  403.         [out, size_is(cpspec)]
  404.                 PROPVARIANT             *rgpropvar
  405.         );
  406. #endif
  407. #ifdef IPROPERTY_DLL
  408.     [local]
  409. #endif
  410.     HRESULT WriteMultiple(
  411.         [in]    ULONG                   cpspec,
  412.         [in, size_is(cpspec)]
  413.                 const PROPSPEC          rgpspec[],
  414.         [in, size_is(cpspec)]
  415.                 const PROPVARIANT       rgpropvar[],
  416.         [in]    PROPID                  propidNameFirst
  417.         );
  418. #ifdef IPROPERTY_DLL
  419.     [call_as(WriteMultiple)]
  420.     HRESULT RemoteWriteMultiple(
  421.         [in]    BOOL                    fBstrPresent,
  422.         [in]    ULONG                   cpspec,
  423.         [in, size_is(cpspec)]
  424.                 const PROPSPEC          *rgpspec,
  425.         [in, size_is(cpspec)]
  426.                 const PROPVARIANT       *rgpropvar,
  427.         [in]    PROPID                  propidNameFirst
  428.         );
  429. #endif
  430. #ifdef IPROPERTY_DLL
  431.     [local]
  432. #endif
  433.     HRESULT DeleteMultiple(
  434.         [in]    ULONG                   cpspec,
  435.         [in, size_is(cpspec)]
  436.                 const PROPSPEC          rgpspec[]
  437.         );
  438. #ifdef IPROPERTY_DLL
  439.     [call_as(DeleteMultiple)]
  440.     HRESULT RemoteDeleteMultiple(
  441.         [in]    ULONG                   cpspec,
  442.         [in, size_is(cpspec)]
  443.                 const PROPSPEC          *rgpspec
  444.         );
  445. #endif
  446.     HRESULT ReadPropertyNames(
  447.         [in]    ULONG                   cpropid,
  448.         [in, size_is(cpropid)]
  449.                 const PROPID            rgpropid[],
  450.         [out, size_is(cpropid)]
  451.                 LPOLESTR                rglpwstrName[]
  452.         );
  453.     HRESULT WritePropertyNames(
  454.         [in]    ULONG                   cpropid,
  455.         [in, size_is(cpropid)]
  456.                 const PROPID            rgpropid[],
  457.         [in, size_is(cpropid)]
  458.                 const LPOLESTR          rglpwstrName[]
  459.         );
  460.     HRESULT DeletePropertyNames(
  461.         [in]    ULONG                   cpropid,
  462.         [in, size_is(cpropid)]
  463.                 const PROPID            rgpropid[]
  464.         );
  465.     HRESULT Commit(
  466.         [in]    DWORD                   grfCommitFlags
  467.         );
  468.     HRESULT Revert();
  469.     HRESULT Enum(
  470.         [out]   IEnumSTATPROPSTG **     ppenum
  471.         );
  472.     HRESULT SetTimes(
  473.         [in]    FILETIME const *        pctime,
  474.         [in]    FILETIME const *        patime,
  475.         [in]    FILETIME const *        pmtime
  476.         );
  477.     HRESULT SetClass(
  478.         [in]    REFCLSID                clsid
  479.         );
  480.     HRESULT Stat(
  481.         [out]   STATPROPSETSTG *        pstatpsstg
  482.         );
  483. }
  484. [
  485.     object,
  486.     uuid(0000013A-0000-0000-C000-000000000046),
  487.     pointer_default(unique)
  488. ]
  489. interface IPropertySetStorage : IUnknown
  490. {
  491.     typedef [unique] IPropertySetStorage * LPPROPERTYSETSTORAGE;
  492.     HRESULT Create(
  493.         [in]    REFFMTID                rfmtid,
  494.         [in, unique]
  495.                 const CLSID *           pclsid,
  496.         [in]    DWORD                   grfFlags,
  497.         [in]    DWORD                   grfMode,
  498.         [out]   IPropertyStorage **     ppprstg
  499.         );
  500.     HRESULT Open(
  501.         [in]    REFFMTID                rfmtid,
  502.         [in]    DWORD                   grfMode,
  503.         [out]   IPropertyStorage **     ppprstg
  504.         );
  505.     HRESULT Delete(
  506.         [in]    REFFMTID                rfmtid
  507.         );
  508.     HRESULT Enum(
  509.         [out]   IEnumSTATPROPSETSTG **  ppenum
  510.         );
  511. }
  512. [
  513.     object,
  514.     uuid(00000139-0000-0000-C000-000000000046),
  515.     pointer_default(unique)
  516. ]
  517. interface IEnumSTATPROPSTG : IUnknown
  518. {
  519.     typedef [unique] IEnumSTATPROPSTG * LPENUMSTATPROPSTG;
  520.     [local]
  521.     HRESULT Next(
  522.         [in]    ULONG                   celt,
  523.         [out, size_is(celt), length_is(*pceltFetched)]
  524.                 STATPROPSTG *           rgelt,
  525.         [out]   ULONG *                 pceltFetched
  526.         );
  527.     [call_as(Next)]
  528.     HRESULT RemoteNext(
  529.         [in]    ULONG                   celt,
  530.         [out, size_is(celt), length_is(*pceltFetched)]
  531.                 STATPROPSTG *           rgelt,
  532.         [out]   ULONG *                 pceltFetched
  533.         );
  534.     HRESULT Skip(
  535.         [in]    ULONG                   celt
  536.         );
  537.     HRESULT Reset();
  538.     HRESULT Clone(
  539.         [out]   IEnumSTATPROPSTG **     ppenum
  540.         );
  541. }
  542. [
  543.     object,
  544.     uuid(0000013B-0000-0000-C000-000000000046),
  545.     pointer_default(unique)
  546. ]
  547. interface IEnumSTATPROPSETSTG : IUnknown
  548. {
  549.     typedef [unique] IEnumSTATPROPSETSTG * LPENUMSTATPROPSETSTG;
  550.     [local]
  551.     HRESULT Next(
  552.         [in]    ULONG                   celt,
  553.         [out, size_is(celt), length_is(*pceltFetched)]
  554.                 STATPROPSETSTG *        rgelt,
  555.         [out]   ULONG *                 pceltFetched
  556.         );
  557.     [call_as(Next)]
  558.     HRESULT RemoteNext(
  559.         [in]    ULONG                   celt,
  560.         [out, size_is(celt), length_is(*pceltFetched)]
  561.                 STATPROPSETSTG *        rgelt,
  562.         [out]   ULONG *                 pceltFetched
  563.         );
  564.     HRESULT Skip(
  565.         [in]    ULONG                   celt
  566.         );
  567.     HRESULT Reset();
  568.     HRESULT Clone(
  569.         [out]   IEnumSTATPROPSETSTG **  ppenum
  570.         );
  571. }
  572. typedef [unique] IPropertyStorage * LPPROPERTYSTORAGE;
  573. cpp_quote("WINOLEAPI PropVariantCopy ( PROPVARIANT * pvarDest, const PROPVARIANT * pvarSrc );")
  574. cpp_quote("WINOLEAPI PropVariantClear ( PROPVARIANT * pvar );")
  575. cpp_quote("WINOLEAPI FreePropVariantArray ( ULONG cVariants, PROPVARIANT * rgvars );")
  576. cpp_quote("")
  577. cpp_quote("#define _PROPVARIANTINIT_DEFINED_")
  578. cpp_quote("#   ifdef __cplusplus")
  579. cpp_quote("inline void PropVariantInit ( PROPVARIANT * pvar )")
  580. cpp_quote("{")
  581. cpp_quote("    memset ( pvar, 0, sizeof(PROPVARIANT) );")
  582. cpp_quote("}")
  583. cpp_quote("#   else")
  584. cpp_quote("#   define PropVariantInit(pvar) memset ( (pvar), 0, sizeof(PROPVARIANT) )")
  585. cpp_quote("#   endif")
  586. cpp_quote("")
  587. cpp_quote("")
  588. cpp_quote("#ifndef _STGCREATEPROPSTG_DEFINED_")
  589. cpp_quote("WINOLEAPI StgCreatePropStg( IUnknown* pUnk, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );")
  590. cpp_quote("WINOLEAPI StgOpenPropStg( IUnknown* pUnk, REFFMTID fmtid, DWORD grfFlags, DWORD dwReserved, IPropertyStorage **ppPropStg );")
  591. cpp_quote("WINOLEAPI StgCreatePropSetStg( IStorage *pStorage, DWORD dwReserved, IPropertySetStorage **ppPropSetStg);")
  592. cpp_quote("")
  593. cpp_quote("#define CCH_MAX_PROPSTG_NAME    31")
  594. cpp_quote("WINOLEAPI FmtIdToPropStgName( const FMTID *pfmtid, LPOLESTR oszName );" )
  595. cpp_quote("WINOLEAPI PropStgNameToFmtId( const LPOLESTR oszName, FMTID *pfmtid );" )
  596. cpp_quote("#endif")
  597. cpp_quote("#if _MSC_VER >= 1200")
  598. cpp_quote("#pragma warning(pop)")
  599. cpp_quote("#else")
  600. cpp_quote("#pragma warning(default:4201)    /* Nameless struct/union */")
  601. cpp_quote("#pragma warning(default:4237)    /* keywords bool, true, false, etc.. */")
  602. cpp_quote("#endif")