Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
8.3 KiB

  1. #ifndef _PROPSET_H_
  2. #define _PROPSET_H_
  3. // NOTE (scotth): this is a placeholder header so we can
  4. // use this according to the spec \\ole\specs\release\properties.doc
  5. // Don't define if OLE definitions are in place!
  6. #ifndef __IPropertyStorage_INTERFACE_DEFINED__
  7. #define __IPropertyStorage_INTERFACE_DEFINED__
  8. #include <ole2.h>
  9. #ifdef __cplusplus
  10. extern "C" { /* Assume C declarations for C++ */
  11. #endif /* __cplusplus */
  12. typedef struct tagPROPVARIANT PROPVARIANT;
  13. #define TYPEDEF_CA(type, name) \
  14. typedef struct tag ## name {\
  15. ULONG cElems;\
  16. type *pElems;\
  17. } name
  18. TYPEDEF_CA(unsigned char, CAUI1);
  19. TYPEDEF_CA(short, CAI2);
  20. TYPEDEF_CA(USHORT, CAUI2);
  21. TYPEDEF_CA(long, CAI4);
  22. TYPEDEF_CA(ULONG, CAUI4);
  23. TYPEDEF_CA(LARGE_INTEGER, CAI8);
  24. TYPEDEF_CA(ULARGE_INTEGER,CAUI8);
  25. TYPEDEF_CA(float, CAR4);
  26. TYPEDEF_CA(double, CAR8);
  27. TYPEDEF_CA(CURRENCY, CACY);
  28. TYPEDEF_CA(DATE, CADATE);
  29. TYPEDEF_CA(BSTR, CABSTR);
  30. TYPEDEF_CA(VARIANT_BOOL, CABOOL);
  31. TYPEDEF_CA(SCODE, CASCODE);
  32. TYPEDEF_CA(FILETIME, CAFILETIME);
  33. TYPEDEF_CA(LPSTR, CALPSTR);
  34. TYPEDEF_CA(LPWSTR, CALPWSTR);
  35. TYPEDEF_CA(CLSID, CACLSID);
  36. TYPEDEF_CA(CLIPDATA, CACLIPDATA);
  37. TYPEDEF_CA(PROPVARIANT, CAPROPVARIANT);
  38. typedef struct tagPROPVARIANT{
  39. VARTYPE vt; // value type tag
  40. WORD wReserved1; // padding to achieve 4-byte alignment
  41. WORD wReserved2;
  42. WORD wReserved3;
  43. union {
  44. // none // VT_EMPTY, VT_NULL, VT_ILLEGAL
  45. unsigned char bVal; // VT_UI1
  46. short iVal; // VT_I2
  47. USHORT uiVal; // VT_UI2
  48. long lVal; // VT_I4
  49. ULONG ulVal; // VT_UI4
  50. LARGE_INTEGER hVal; // VT_I8
  51. ULARGE_INTEGER uhVal; // VT_UI8
  52. float fltVal; // VT_R4
  53. double dblVal; // VT_R8
  54. CY cyVal; // VT_CY
  55. DATE date; // VT_DATE
  56. BSTR bstrVal; // VT_BSTR // string in the current Ansi code page
  57. VARIANT_BOOL bool; // VT_BOOL
  58. SCODE scode; // VT_ERROR
  59. FILETIME filetime; // VT_FILETIME
  60. LPSTR pszVal; // VT_LPSTR // string in the current Ansi code page
  61. LPWSTR pwszVal; // VT_LPWSTR // string in Unicode
  62. CLSID* puuid; // VT_CLSID
  63. CLIPDATA* pclipdata; // VT_CF
  64. BLOB blob; // VT_BLOB, VT_BLOBOBJECT
  65. IStream* pStream; // VT_STREAM, VT_STREAMED_OBJECT
  66. IStorage* pStorage; // VT_STORAGE, VT_STORED_OBJECT
  67. CAUI1 cab; // VT_VECTOR | VT_UI1
  68. CAI2 cai; // VT_VECTOR | VT_I2
  69. CAUI2 caui; // VT_VECTOR | VT_UI2
  70. CAI4 cal; // VT_VECTOR | VT_I4
  71. CAUI4 caul; // VT_VECTOR | VT_UI4
  72. CAI8 cah; // VT_VECTOR | VT_I8
  73. CAUI8 cauh; // VT_VECTOR | VT_UI8
  74. CAR4 caflt; // VT_VECTOR | VT_R4
  75. CAR8 cadbl; // VT_VECTOR | VT_R8
  76. CACY cacy; // VT_VECTOR | VT_CY
  77. CADATE cadate; // VT_VECTOR | VT_DATE
  78. CABSTR cabstr; // VT_VECTOR | VT_BSTR
  79. CABOOL cabool; // VT_VECTOR | VT_BOOL
  80. CASCODE cascode; // VT_VECTOR | VT_ERROR
  81. CALPSTR calpstr; // VT_VECTOR | VT_LPSTR
  82. CALPWSTR calpwstr; // VT_VECTOR | VT_LPWSTR
  83. CAFILETIME cafiletime; // VT_VECTOR | VT_FILETIME
  84. CACLSID cauuid; // VT_VECTOR | VT_CLSID
  85. CACLIPDATA caclipdata; // VT_VECTOR | VT_CF
  86. CAPROPVARIANT capropvar; // VT_VECTOR | VT_VARIANT
  87. }DUMMYUNIONNAME;
  88. } PROPVARIANT;
  89. #if 0
  90. typedef enum {
  91. VT_EMPTY=0, VT_NULL=1, VT_I2=2, VT_I4=3, VT_R4=4
  92. VT_R8=5, VT_CY=6, VT_DATE=7, VT_BSTR=8, VT_ERROR=10, VT_BOOL=11,
  93. VT_VARIANT=12, VT_UI1=17, VT_UI2=18, VT_UI4=19,
  94. VT_I8=20, VT_UI8=21, VT_LPSTR=30, VT_LPWSTR=31,
  95. VT_FILETIME=64, VT_BLOB=65, VT_STREAM=66, VT_STORAGE=67, VT_STREAMED_OBJECT=68
  96. VT_STORED_OBJECT=69, VT_BLOB_OBJECT=70, VT_CF=71
  97. VT_CLSID=72, VT_VECTOR=0x1000,
  98. VT_ILLEGAL=0xFFFFFFFF,
  99. VT_TYPEMASK=0xFFF, // a mask for masking VT_VECTOR and other modifiers to get the raw VT_ value.
  100. } PROPVARENUM;
  101. #endif // VT_EMPTY
  102. #define VT_ILLEGAL 0xFFFF
  103. typedef enum
  104. {
  105. PRSPEC_LPWSTR = 0,
  106. PRSPEC_PROPID = 1,
  107. } PRSPEC;
  108. // typedef LONG PROPID;
  109. typedef struct tagPROPSPEC {
  110. ULONG ulKind; // PRSPEC_LPWSTR or PRSPEC_PROPID
  111. union {
  112. LPWSTR lpwstr;
  113. PROPID propid;
  114. }DUMMYUNIONNAME;
  115. } PROPSPEC;
  116. typedef GUID FMTID;
  117. typedef struct tagSTATPROPSETSTG { // used in IPropertySetStorage::Enum and IPropertyStorage::Stat
  118. FMTID fmtid; // The fmtid name of this property set.
  119. CLSID clsid; // The class id of this property set.
  120. DWORD grfFlags; // The flag values of this property set as specified in IPropertySetStorage::Create.
  121. FILETIME mtime; // The time in UTC at which this property set was last modified
  122. FILETIME ctime; // The time in UTC at which this property set was created.
  123. FILETIME atime; // The time in UTC at which this property set was last accessed.
  124. } STATPROPSETSTG;
  125. typedef struct tagSTATPROPSTG
  126. {
  127. LPOLESTR lpwstrName;
  128. PROPID propid;
  129. VARTYPE vt;
  130. } STATPROPSTG;
  131. #undef INTERFACE
  132. #define INTERFACE IEnumSTATPROPSTG
  133. DECLARE_INTERFACE_(IEnumSTATPROPSTG, IUnknown)
  134. {
  135. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  136. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  137. STDMETHOD_(ULONG,Release) (THIS) PURE;
  138. STDMETHOD(Next) (THIS_ ULONG celt, STATPROPSTG *rgelt, ULONG *pceltFetched) PURE;
  139. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  140. STDMETHOD(Reset)(THIS) PURE;
  141. STDMETHOD(Clone) (THIS_ IEnumSTATPROPSTG **ppenum) PURE;
  142. };
  143. #undef INTERFACE
  144. #define INTERFACE IEnumSTATPROPSETSTG
  145. DECLARE_INTERFACE_(IEnumSTATPROPSETSTG, IUnknown)
  146. {
  147. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  148. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  149. STDMETHOD_(ULONG,Release) (THIS) PURE;
  150. STDMETHOD(Next) (THIS_ ULONG celt, STATPROPSETSTG *rgelt, ULONG *pceltFetched) PURE;
  151. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  152. STDMETHOD(Reset)(THIS) PURE;
  153. STDMETHOD(Clone) (THIS_ IEnumSTATPROPSTG **ppenum) PURE;
  154. };
  155. #undef INTERFACE
  156. #define INTERFACE IPropertyStorage
  157. DECLARE_INTERFACE_(IPropertyStorage, IUnknown)
  158. {
  159. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  160. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  161. STDMETHOD_(ULONG,Release) (THIS) PURE;
  162. STDMETHOD(ReadMultiple)(THIS_ ULONG cpspec, const PROPSPEC rgpspec[], PROPVARIANT rgvar[]) PURE;
  163. STDMETHOD(WriteMultiple)(THIS_ ULONG cpspec, const PROPSPEC rgpspec[], const PROPVARIANT rgvar[], PROPID propidNameFirst) PURE;
  164. STDMETHOD(DeleteMultiple)(THIS_ ULONG cpspec, const PROPSPEC rgpspec[]) PURE;
  165. STDMETHOD(ReadPropertyNames)(THIS_ ULONG cpropid, const PROPID rgpropid[], LPOLESTR rglpwstrName[]) PURE;
  166. STDMETHOD(WritePropertyNames)(THIS_ ULONG cpropid, const PROPID rgpropid[], const LPOLESTR rglpwstrName[]) PURE;
  167. STDMETHOD(DeletePropertyNames)(THIS_ ULONG cpropid, const PROPID rgpropid[]) PURE;
  168. STDMETHOD(SetClass)(THIS_ REFCLSID clsid) PURE;
  169. STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags) PURE;
  170. STDMETHOD(Revert)(THIS) PURE;
  171. STDMETHOD(Enum)(THIS_ IEnumSTATPROPSTG** ppenm) PURE;
  172. STDMETHOD(Stat)(THIS_ STATPROPSETSTG* pstatpsstg) PURE;
  173. STDMETHOD(SetTimes)(THIS_ const FILETIME* pmtime, const FILETIME* pctime, const FILETIME* patime) PURE;
  174. };
  175. typedef REFGUID REFFMTID;
  176. #undef INTERFACE
  177. #define INTERFACE IPropertySetStorage
  178. DECLARE_INTERFACE_(IPropertySetStorage, IUnknown)
  179. {
  180. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  181. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  182. STDMETHOD_(ULONG,Release) (THIS) PURE;
  183. STDMETHOD(Create)(THIS_ REFFMTID fmtid, const CLSID* pclsid, DWORD grfFlags, DWORD grfMode, IPropertyStorage** ppPropStg)PURE;
  184. STDMETHOD(Open)(THIS_ REFFMTID fmtid, DWORD grfMode, IPropertyStorage** ppPropStg) PURE;
  185. STDMETHOD(Delete)(THIS_ REFFMTID fmtid) PURE;
  186. STDMETHOD(Enum)(THIS_ IEnumSTATPROPSETSTG** ppenum) PURE;
  187. };
  188. typedef enum PROPSETFLAG {
  189. PROPSETFLAG_NONSIMPLE = 1,
  190. PROPSETFLAG_ANSI = 2,
  191. } PROPSETFLAG;
  192. extern const IID IID_IPropertyStorage;
  193. extern const IID IID_IEnumSTATPROPSTG;
  194. extern const IID IID_IPropertySetStorage;
  195. extern const IID IID_IEnumSTATPROPSETSTG;
  196. #ifdef __cplusplus
  197. }
  198. #endif /* __cplusplus */
  199. #endif // __IPropertyStorage_INTERFACE_DEFINED__
  200. #endif // _PROPSET_H_