2 * Copyright 2002 Ove Kaaven
3 * Copyright 2004 Francois Gouget
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 /******************** Property Storage ********************/
26 interface IEnumSTATPROPSTG
;
27 interface IEnumSTATPROPSETSTG
;
31 uuid(00000138-0000-0000-C000
-000000000046),
32 pointer_default(unique)
34 interface IPropertyStorage
: IUnknown
36 typedef [unique] IPropertyStorage
*LPPROPERTYSTORAGE
;
38 const DWORD PROPSETFLAG_DEFAULT
= 0;
39 const DWORD PROPSETFLAG_NONSIMPLE
= 1;
40 const DWORD PROPSETFLAG_ANSI
= 2;
41 const DWORD PROPSETFLAG_UNBUFFERED
= 4;
43 typedef struct tagPROPVARIANT PROPVARIANT
;
45 #define TYPEDEF_CA
(type
, name
) \
46 typedef struct tag##name
{ \
52 TYPEDEF_CA
(unsigned char, CAUB
);
53 TYPEDEF_CA
(short, CAI
);
54 TYPEDEF_CA
(USHORT
, CAUI
);
55 TYPEDEF_CA
(long, CAL
);
56 TYPEDEF_CA
(ULONG
, CAUL
);
57 TYPEDEF_CA
(float, CAFLT
);
58 TYPEDEF_CA
(double, CADBL
);
60 TYPEDEF_CA
(DATE
, CADATE
);
61 TYPEDEF_CA
(BSTR, CABSTR
);
62 TYPEDEF_CA
(BSTRBLOB
, CABSTRBLOB
);
63 TYPEDEF_CA
(VARIANT_BOOL, CABOOL
);
64 TYPEDEF_CA
(SCODE
, CASCODE
);
65 TYPEDEF_CA
(PROPVARIANT
, CAPROPVARIANT
);
66 TYPEDEF_CA
(LARGE_INTEGER
, CAH
);
67 TYPEDEF_CA
(ULARGE_INTEGER
, CAUH
);
68 TYPEDEF_CA
(LPSTR
, CALPSTR
);
69 TYPEDEF_CA
(LPWSTR
, CALPWSTR
);
70 TYPEDEF_CA
(FILETIME
, CAFILETIME
);
71 TYPEDEF_CA
(CLIPDATA
, CACLIPDATA
);
72 TYPEDEF_CA
(CLSID
, CACLSID
);
74 struct tagPROPVARIANT
{
79 [switch_is(vt
& 0x1fff)] union {
80 [case(VT_EMPTY
, VT_NULL
)] ;
81 [case(VT_I1
)] char cVal
;
82 [case(VT_UI1
)] UCHAR bVal
;
83 [case(VT_I2
)] short iVal
;
84 [case(VT_UI2
)] USHORT uiVal
;
85 [case(VT_BOOL
)] VARIANT_BOOL boolVal
;
86 #if
0 /* illegal in C++ */
87 [case(VT_ILLEGAL
)] _VARIANT_BOOL bool
;
89 [case(VT_I4
)] long lVal
;
90 [case(VT_UI4
)] ULONG ulVal
;
91 [case(VT_R4
)] float fltVal
;
92 [case(VT_ERROR
)] SCODE scode
;
93 [case(VT_I8
)] LARGE_INTEGER hVal
;
94 [case(VT_UI8
)] ULARGE_INTEGER uhVal
;
95 [case(VT_R8
)] double dblVal
;
96 [case(VT_CY
)] CY cyVal
;
97 [case(VT_DATE
)] DATE date
;
98 [case(VT_FILETIME
)] FILETIME filetime
;
99 [case(VT_CLSID
)] CLSID
*puuid
;
100 [case(VT_BLOB
, VT_BLOB_OBJECT
)] BLOB blob
;
101 [case(VT_CF
)] CLIPDATA
*pclipdata
;
102 [case(VT_STREAM
, VT_STREAMED_OBJECT
)] IStream
*pStream
;
103 [case(VT_STORAGE
, VT_STORED_OBJECT
)] IStorage
*pStorage
;
104 [case(VT_BSTR
)] BSTR bstrVal
;
105 [case(VT_BSTR_BLOB
)] BSTRBLOB bstrblobVal
;
106 [case(VT_LPSTR
)] LPSTR pszVal
;
107 [case(VT_LPWSTR
)] LPWSTR pwszVal
;
108 [case(VT_UI1|VT_VECTOR
)] CAUB caub
;
109 [case(VT_I2|VT_VECTOR
)] CAI cai
;
110 [case(VT_UI2|VT_VECTOR
)] CAUI caui
;
111 [case(VT_BOOL|VT_VECTOR
)] CABOOL cabool
;
112 [case(VT_I4|VT_VECTOR
)] CAL cal
;
113 [case(VT_UI4|VT_VECTOR
)] CAUL caul
;
114 [case(VT_R4|VT_VECTOR
)] CAFLT caflt
;
115 [case(VT_ERROR|VT_VECTOR
)] CASCODE cascode
;
116 [case(VT_I8|VT_VECTOR
)] CAH cah
;
117 [case(VT_UI8|VT_VECTOR
)] CAUH cauh
;
118 [case(VT_R8|VT_VECTOR
)] CADBL cadbl
;
119 [case(VT_CY|VT_VECTOR
)] CACY cacy
;
120 [case(VT_DATE|VT_VECTOR
)] CADATE cadate
;
121 [case(VT_FILETIME|VT_VECTOR
)] CAFILETIME cafiletime
;
122 [case(VT_CLSID|VT_VECTOR
)] CACLSID cauuid
;
123 [case(VT_CF|VT_VECTOR
)] CACLIPDATA caclipdata
;
124 [case(VT_BSTR|VT_VECTOR
)] CABSTR cabstr
;
125 [case(VT_BSTR_BLOB|VT_VECTOR
)] CABSTRBLOB cabstrblob
;
126 [case(VT_LPSTR|VT_VECTOR
)] CALPSTR calpstr
;
127 [case(VT_LPWSTR|VT_VECTOR
)] CALPWSTR calpwstr
;
128 [case(VT_VARIANT|VT_VECTOR
)] CAPROPVARIANT capropvar
;
132 typedef struct tagPROPVARIANT
*LPPROPVARIANT
;
134 /* FIXME: bunches of property IDs */
136 const ULONG PRSPEC_INVALID
= 0xffffffff;
137 const ULONG PRSPEC_LPWSTR
= 0;
138 const ULONG PRSPEC_PROPID
= 1;
140 typedef struct tagPROPSPEC
{
142 [switch_is(ulKind
)] union {
143 [case(PRSPEC_PROPID
)] PROPID propid
;
144 [case(PRSPEC_LPWSTR
)] LPOLESTR lpwstr
;
149 typedef struct tagSTATPROPSTG
{
157 typedef struct tagSTATPROPSETSTG
{
167 HRESULT ReadMultiple
(
169 [in, size_is(cpspec
)] const PROPSPEC rgpspec
[],
170 [out, size_is(cpspec
)] PROPVARIANT rgpropvar
[]);
172 HRESULT WriteMultiple
(
174 [in, size_is(cpspec
)] const PROPSPEC rgpspec
[],
175 [in, size_is(cpspec
)] const PROPVARIANT rgpropvar
[],
176 [in] PROPID propidNameFirst
);
178 HRESULT DeleteMultiple
(
180 [in, size_is(cpspec
)] const PROPSPEC rgpspec
[]);
182 HRESULT ReadPropertyNames
(
184 [in, size_is(cpropid
)] const PROPID rgpropid
[],
185 [out, size_is(cpropid
)] LPOLESTR rglpwstrName
[]);
187 HRESULT WritePropertyNames
(
189 [in, size_is(cpropid
)] const PROPID rgpropid
[],
190 [in, size_is(cpropid
)] const LPOLESTR rglpwstrName
[]);
192 HRESULT DeletePropertyNames
(
194 [in, size_is(cpropid
)] const PROPID rgpropid
[]);
197 [in] DWORD grfCommitFlags
);
202 [out] IEnumSTATPROPSTG
**ppenum
);
205 [in] const FILETIME
*pctime
,
206 [in] const FILETIME
*patime
,
207 [in] const FILETIME
*pmtime
);
210 [in] REFCLSID clsid
);
213 [out] STATPROPSETSTG
*statpsstg
);
218 uuid(0000013A
-0000-0000-C000
-000000000046),
219 pointer_default(unique)
221 interface IPropertySetStorage
: IUnknown
223 typedef [unique] IPropertySetStorage
*LPPROPERTYSETSTORAGE
;
226 [in] REFFMTID rfmtid
,
227 [in, unique] const CLSID
*pclsid
,
230 [out] IPropertyStorage
**ppprstg
);
233 [in] REFFMTID rfmtid
,
235 [out] IPropertyStorage
**ppprstg
);
238 [in] REFFMTID rfmtid
);
241 [out] IEnumSTATPROPSETSTG
**ppenum
);
246 uuid(00000139-0000-0000-C000
-000000000046),
247 pointer_default(unique)
249 interface IEnumSTATPROPSTG
: IUnknown
251 typedef [unique] IEnumSTATPROPSTG
*LPENUMSTATPROPSTG
;
256 [out, size_is(celt
), length_is(*pceltFetched
)]
258 [out] ULONG
*pceltFetched
);
263 [out, size_is(celt
), length_is(*pceltFetched
)]
265 [out] ULONG
*pceltFetched
);
273 [out] IEnumSTATPROPSTG
**ppenum
);
278 uuid(0000013B
-0000-0000-C000
-000000000046),
279 pointer_default(unique)
281 interface IEnumSTATPROPSETSTG
: IUnknown
283 typedef [unique] IEnumSTATPROPSETSTG
*LPENUMSTATPROPSETSTG
;
288 [out, size_is(celt
), length_is(*pceltFetched
)]
289 STATPROPSETSTG
*rgelt
,
290 [out] ULONG
*pceltFetched
);
295 [out, size_is(celt
), length_is(*pceltFetched
)]
296 STATPROPSETSTG
*rgelt
,
297 [out] ULONG
*pceltFetched
);
305 [out] IEnumSTATPROPSETSTG
**ppenum
);
309 cpp_quote
("HRESULT WINAPI FreePropVariantArray(ULONG,PROPVARIANT*);");
310 cpp_quote
("HRESULT WINAPI PropVariantClear(PROPVARIANT*);");
311 cpp_quote
("HRESULT WINAPI PropVariantCopy(PROPVARIANT*,const PROPVARIANT*);");