1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | // |
5 | |
6 | // |
7 | // =========================================================================== |
8 | // File: objidl.h |
9 | // |
10 | // =========================================================================== |
11 | // simplified objidl.h for PAL |
12 | |
13 | #include "rpc.h" |
14 | #include "rpcndr.h" |
15 | |
16 | #include "unknwn.h" |
17 | |
18 | #ifndef __IEnumUnknown_INTERFACE_DEFINED__ |
19 | #define __IEnumUnknown_INTERFACE_DEFINED__ |
20 | |
21 | // 00000100-0000-0000-C000-000000000046 |
22 | EXTERN_C const IID IID_IEnumUnknown; |
23 | |
24 | interface IEnumUnknown : public IUnknown |
25 | { |
26 | public: |
27 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( |
28 | /* [annotation][in] */ |
29 | _In_ ULONG celt, |
30 | /* [annotation][out] */ |
31 | _Out_writes_to_(celt,*pceltFetched) IUnknown **rgelt, |
32 | /* [annotation][out] */ |
33 | _Out_opt_ ULONG *pceltFetched) = 0; |
34 | |
35 | virtual HRESULT STDMETHODCALLTYPE Skip( |
36 | /* [in] */ ULONG celt) = 0; |
37 | |
38 | virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; |
39 | |
40 | virtual HRESULT STDMETHODCALLTYPE Clone( |
41 | /* [out] */ __RPC__deref_out_opt IEnumUnknown **ppenum) = 0; |
42 | |
43 | }; |
44 | |
45 | #endif /* __IEnumUnknown_INTERFACE_DEFINED__ */ |
46 | |
47 | #ifndef __ISequentialStream_INTERFACE_DEFINED__ |
48 | #define __ISequentialStream_INTERFACE_DEFINED__ |
49 | |
50 | // 0c733a30-2a1c-11ce-ade5-00aa0044773d |
51 | EXTERN_C const IID IID_ISequentialStream; |
52 | |
53 | interface ISequentialStream : public IUnknown |
54 | { |
55 | public: |
56 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read( |
57 | /* [length_is][size_is][out] */ void *pv, |
58 | /* [in] */ ULONG cb, |
59 | /* [out] */ ULONG *pcbRead) = 0; |
60 | |
61 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE Write( |
62 | /* [size_is][in] */ const void *pv, |
63 | /* [in] */ ULONG cb, |
64 | /* [out] */ ULONG *pcbWritten) = 0; |
65 | |
66 | }; |
67 | |
68 | #endif // __ISequentialStream_INTERFACE_DEFINED__ |
69 | |
70 | |
71 | #ifndef __IStream_INTERFACE_DEFINED__ |
72 | #define __IStream_INTERFACE_DEFINED__ |
73 | |
74 | typedef struct tagSTATSTG |
75 | { |
76 | LPOLESTR pwcsName; |
77 | DWORD type; |
78 | ULARGE_INTEGER cbSize; |
79 | FILETIME mtime; |
80 | FILETIME ctime; |
81 | FILETIME atime; |
82 | DWORD grfMode; |
83 | DWORD grfLocksSupported; |
84 | CLSID clsid; |
85 | DWORD grfStateBits; |
86 | DWORD reserved; |
87 | } STATSTG; |
88 | |
89 | typedef |
90 | enum tagSTGTY |
91 | { STGTY_STORAGE = 1, |
92 | STGTY_STREAM = 2, |
93 | STGTY_LOCKBYTES = 3, |
94 | STGTY_PROPERTY = 4 |
95 | } STGTY; |
96 | |
97 | typedef |
98 | enum tagSTREAM_SEEK |
99 | { STREAM_SEEK_SET = 0, |
100 | STREAM_SEEK_CUR = 1, |
101 | STREAM_SEEK_END = 2 |
102 | } STREAM_SEEK; |
103 | |
104 | typedef |
105 | enum tagLOCKTYPE |
106 | { LOCK_WRITE = 1, |
107 | LOCK_EXCLUSIVE = 2, |
108 | LOCK_ONLYONCE = 4 |
109 | } LOCKTYPE; |
110 | |
111 | typedef |
112 | enum tagSTATFLAG |
113 | { STATFLAG_DEFAULT = 0, |
114 | STATFLAG_NONAME = 1, |
115 | STATFLAG_NOOPEN = 2 |
116 | } STATFLAG; |
117 | |
118 | // 0000000c-0000-0000-C000-000000000046 |
119 | EXTERN_C const IID IID_IStream; |
120 | |
121 | interface DECLSPEC_UUID("0000000c-0000-0000-C000-000000000046" ) |
122 | IStream : public ISequentialStream |
123 | { |
124 | public: |
125 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE Seek( |
126 | /* [in] */ LARGE_INTEGER dlibMove, |
127 | /* [in] */ DWORD dwOrigin, |
128 | /* [out] */ ULARGE_INTEGER *plibNewPosition) = 0; |
129 | |
130 | virtual HRESULT STDMETHODCALLTYPE SetSize( |
131 | /* [in] */ ULARGE_INTEGER libNewSize) = 0; |
132 | |
133 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE CopyTo( |
134 | /* [unique][in] */ IStream *pstm, |
135 | /* [in] */ ULARGE_INTEGER cb, |
136 | /* [out] */ ULARGE_INTEGER *pcbRead, |
137 | /* [out] */ ULARGE_INTEGER *pcbWritten) = 0; |
138 | |
139 | virtual HRESULT STDMETHODCALLTYPE Commit( |
140 | /* [in] */ DWORD grfCommitFlags) = 0; |
141 | |
142 | virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0; |
143 | |
144 | virtual HRESULT STDMETHODCALLTYPE LockRegion( |
145 | /* [in] */ ULARGE_INTEGER libOffset, |
146 | /* [in] */ ULARGE_INTEGER cb, |
147 | /* [in] */ DWORD dwLockType) = 0; |
148 | |
149 | virtual HRESULT STDMETHODCALLTYPE UnlockRegion( |
150 | /* [in] */ ULARGE_INTEGER libOffset, |
151 | /* [in] */ ULARGE_INTEGER cb, |
152 | /* [in] */ DWORD dwLockType) = 0; |
153 | |
154 | virtual HRESULT STDMETHODCALLTYPE Stat( |
155 | /* [out] */ STATSTG *pstatstg, |
156 | /* [in] */ DWORD grfStatFlag) = 0; |
157 | |
158 | virtual HRESULT STDMETHODCALLTYPE Clone( |
159 | /* [out] */ IStream **ppstm) = 0; |
160 | |
161 | }; |
162 | |
163 | #endif // __IStream_INTERFACE_DEFINED__ |
164 | |
165 | |
166 | #ifndef __IStorage_INTERFACE_DEFINED__ |
167 | #define __IStorage_INTERFACE_DEFINED__ |
168 | |
169 | typedef OLECHAR **SNB; |
170 | |
171 | interface IEnumSTATSTG; |
172 | |
173 | // 0000000b-0000-0000-C000-000000000046 |
174 | |
175 | interface IStorage : public IUnknown |
176 | { |
177 | public: |
178 | virtual HRESULT STDMETHODCALLTYPE CreateStream( |
179 | /* [string][in] */ const OLECHAR *pwcsName, |
180 | /* [in] */ DWORD grfMode, |
181 | /* [in] */ DWORD reserved1, |
182 | /* [in] */ DWORD reserved2, |
183 | /* [out] */ IStream **ppstm) = 0; |
184 | |
185 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE OpenStream( |
186 | /* [string][in] */ const OLECHAR *pwcsName, |
187 | /* [unique][in] */ void *reserved1, |
188 | /* [in] */ DWORD grfMode, |
189 | /* [in] */ DWORD reserved2, |
190 | /* [out] */ IStream **ppstm) = 0; |
191 | |
192 | virtual HRESULT STDMETHODCALLTYPE CreateStorage( |
193 | /* [string][in] */ const OLECHAR *pwcsName, |
194 | /* [in] */ DWORD grfMode, |
195 | /* [in] */ DWORD reserved1, |
196 | /* [in] */ DWORD reserved2, |
197 | /* [out] */ IStorage **ppstg) = 0; |
198 | |
199 | virtual HRESULT STDMETHODCALLTYPE OpenStorage( |
200 | /* [string][unique][in] */ const OLECHAR *pwcsName, |
201 | /* [unique][in] */ IStorage *pstgPriority, |
202 | /* [in] */ DWORD grfMode, |
203 | /* [unique][in] */ SNB snbExclude, |
204 | /* [in] */ DWORD reserved, |
205 | /* [out] */ IStorage **ppstg) = 0; |
206 | |
207 | virtual HRESULT STDMETHODCALLTYPE CopyTo( |
208 | /* [in] */ DWORD ciidExclude, |
209 | /* [size_is][unique][in] */ const IID *rgiidExclude, |
210 | /* [unique][in] */ SNB snbExclude, |
211 | /* [unique][in] */ IStorage *pstgDest) = 0; |
212 | |
213 | virtual HRESULT STDMETHODCALLTYPE MoveElementTo( |
214 | /* [string][in] */ const OLECHAR *pwcsName, |
215 | /* [unique][in] */ IStorage *pstgDest, |
216 | /* [string][in] */ const OLECHAR *pwcsNewName, |
217 | /* [in] */ DWORD grfFlags) = 0; |
218 | |
219 | virtual HRESULT STDMETHODCALLTYPE Commit( |
220 | /* [in] */ DWORD grfCommitFlags) = 0; |
221 | |
222 | virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0; |
223 | |
224 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE EnumElements( |
225 | /* [in] */ DWORD reserved1, |
226 | /* [size_is][unique][in] */ void *reserved2, |
227 | /* [in] */ DWORD reserved3, |
228 | /* [out] */ IEnumSTATSTG **ppenum) = 0; |
229 | |
230 | virtual HRESULT STDMETHODCALLTYPE DestroyElement( |
231 | /* [string][in] */ const OLECHAR *pwcsName) = 0; |
232 | |
233 | virtual HRESULT STDMETHODCALLTYPE RenameElement( |
234 | /* [string][in] */ const OLECHAR *pwcsOldName, |
235 | /* [string][in] */ const OLECHAR *pwcsNewName) = 0; |
236 | |
237 | virtual HRESULT STDMETHODCALLTYPE SetElementTimes( |
238 | /* [string][unique][in] */ const OLECHAR *pwcsName, |
239 | /* [unique][in] */ const FILETIME *pctime, |
240 | /* [unique][in] */ const FILETIME *patime, |
241 | /* [unique][in] */ const FILETIME *pmtime) = 0; |
242 | |
243 | virtual HRESULT STDMETHODCALLTYPE SetClass( |
244 | /* [in] */ REFCLSID clsid) = 0; |
245 | |
246 | virtual HRESULT STDMETHODCALLTYPE SetStateBits( |
247 | /* [in] */ DWORD grfStateBits, |
248 | /* [in] */ DWORD grfMask) = 0; |
249 | |
250 | virtual HRESULT STDMETHODCALLTYPE Stat( |
251 | /* [out] */ STATSTG *pstatstg, |
252 | /* [in] */ DWORD grfStatFlag) = 0; |
253 | |
254 | }; |
255 | |
256 | #endif // __IStorage_INTERFACE_DEFINED__ |
257 | |
258 | |
259 | #ifndef __IMalloc_INTERFACE_DEFINED__ |
260 | #define __IMalloc_INTERFACE_DEFINED__ |
261 | |
262 | /* interface IMalloc */ |
263 | /* [uuid][object][local] */ |
264 | |
265 | // 0000001d-0000-0000-C000-000000000046 |
266 | EXTERN_C const IID IID_IMalloc; |
267 | |
268 | interface IMalloc : public IUnknown |
269 | { |
270 | public: |
271 | virtual void *STDMETHODCALLTYPE Alloc( |
272 | /* [in] */ SIZE_T cb) = 0; |
273 | |
274 | virtual void *STDMETHODCALLTYPE Realloc( |
275 | /* [in] */ void *pv, |
276 | /* [in] */ SIZE_T cb) = 0; |
277 | |
278 | virtual void STDMETHODCALLTYPE Free( |
279 | /* [in] */ void *pv) = 0; |
280 | |
281 | virtual SIZE_T STDMETHODCALLTYPE GetSize( |
282 | /* [in] */ void *pv) = 0; |
283 | |
284 | virtual int STDMETHODCALLTYPE DidAlloc( |
285 | void *pv) = 0; |
286 | |
287 | virtual void STDMETHODCALLTYPE HeapMinimize( void) = 0; |
288 | |
289 | }; |
290 | |
291 | typedef /* [unique] */ IMalloc *LPMALLOC; |
292 | |
293 | #endif // __IMalloc_INTERFACE_DEFINED__ |
294 | |