ReactOS 0.4.17-dev-1190-g4c812f4
persist.c
Go to the documentation of this file.
1/*
2 * Implementation of IPersist interfaces for WebBrowser control
3 *
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005 Jacek Caban
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "ieframe.h"
23
24#include "wine/debug.h"
25
27
28/**********************************************************************
29 * Implement the IPersistStorage interface
30 */
31
33{
34 return CONTAINING_RECORD(iface, WebBrowser, IPersistStorage_iface);
35}
36
38 REFIID riid, LPVOID *ppobj)
39{
41 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
42}
43
45{
47 return IUnknown_AddRef(This->hlink_frame.outer);
48}
49
51{
53 return IUnknown_Release(This->hlink_frame.outer);
54}
55
57{
59
60 TRACE("(%p)->(%p)\n", This, pClassID);
61
62 if (!pClassID)
63 return E_INVALIDARG;
64
65 *pClassID = This->version == 1 ? CLSID_WebBrowser_V1: CLSID_WebBrowser;
66 return S_OK;
67}
68
70{
72 FIXME("(%p)\n", This);
73 return E_NOTIMPL;
74}
75
77{
79 FIXME("(%p)->(%p)\n", This, pStg);
80 return S_OK;
81}
82
84{
86 FIXME("(%p)->(%p)\n", This, pStg);
87 return E_NOTIMPL;
88}
89
91 BOOL fSameAsLoad)
92{
94 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
95 return E_NOTIMPL;
96}
97
99{
101 FIXME("(%p)->(%p)\n", This, pStgNew);
102 return E_NOTIMPL;
103}
104
105static const IPersistStorageVtbl PersistStorageVtbl =
106{
116};
117
118/**********************************************************************
119 * Implement the IPersistMemory interface
120 */
121
123{
124 return CONTAINING_RECORD(iface, WebBrowser, IPersistMemory_iface);
125}
126
128 REFIID riid, LPVOID *ppobj)
129{
131 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
132}
133
135{
137 return IUnknown_AddRef(This->hlink_frame.outer);
138}
139
141{
143 return IUnknown_Release(This->hlink_frame.outer);
144}
145
147{
149 FIXME("(%p)->(%p)\n", This, pClassID);
150 return E_NOTIMPL;
151}
152
154{
156 FIXME("(%p)\n", This);
157 return E_NOTIMPL;
158}
159
161{
163 FIXME("(%p)\n", This);
164 return S_OK;
165}
166
168{
170 FIXME("(%p)->(%p %lx)\n", This, pMem, cbSize);
171 return S_OK;
172}
173
175 BOOL fClearDirty, ULONG cbSize)
176{
178 FIXME("(%p)->(%p %x %lx)\n", This, pMem, fClearDirty, cbSize);
179 return E_NOTIMPL;
180}
181
183{
185 FIXME("(%p)->(%p)\n", This, pCbSize);
186 return E_NOTIMPL;
187}
188
189static const IPersistMemoryVtbl PersistMemoryVtbl =
190{
200};
201
202/**********************************************************************
203 * Implement the IPersistStreamInit interface
204 */
205
207{
208 return CONTAINING_RECORD(iface, WebBrowser, IPersistStreamInit_iface);
209}
210
212 REFIID riid, LPVOID *ppobj)
213{
215 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
216}
217
219{
221 return IUnknown_AddRef(This->hlink_frame.outer);
222}
223
225{
227 return IUnknown_Release(This->hlink_frame.outer);
228}
229
231{
233 return IPersistStorage_GetClassID(&This->IPersistStorage_iface, pClassID);
234}
235
237{
239 return IPersistStorage_IsDirty(&This->IPersistStorage_iface);
240}
241
243{
245 FIXME("(%p)->(%p)\n", This, pStg);
246 return S_OK;
247}
248
250 BOOL fSameAsLoad)
251{
253 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
254 return E_NOTIMPL;
255}
256
258 ULARGE_INTEGER *pcbSize)
259{
261 FIXME("(%p)->(%p)\n", This, pcbSize);
262 return E_NOTIMPL;
263}
264
266{
268 FIXME("(%p)\n", This);
269 return S_OK;
270}
271
272static const IPersistStreamInitVtbl PersistStreamInitVtbl =
273{
283};
284
286{
287 This->IPersistStorage_iface.lpVtbl = &PersistStorageVtbl;
288 This->IPersistMemory_iface.lpVtbl = &PersistMemoryVtbl;
289 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
290}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int BOOL
Definition: ntddk_ex.h:94
static ULONG WINAPI PersistStorage_AddRef(IPersistStorage *iface)
Definition: persist.c:44
static HRESULT WINAPI PersistMemory_QueryInterface(IPersistMemory *iface, REFIID riid, LPVOID *ppobj)
Definition: persist.c:127
static WebBrowser * impl_from_IPersistStreamInit(IPersistStreamInit *iface)
Definition: persist.c:206
static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
Definition: persist.c:182
static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
Definition: persist.c:160
static HRESULT WINAPI PersistMemory_GetClassID(IPersistMemory *iface, CLSID *pClassID)
Definition: persist.c:146
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
Definition: persist.c:257
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
Definition: persist.c:265
static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
Definition: persist.c:140
static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTORAGE pStgNew)
Definition: persist.c:98
static WebBrowser * impl_from_IPersistMemory(IPersistMemory *iface)
Definition: persist.c:122
void WebBrowser_Persist_Init(WebBrowser *This)
Definition: persist.c:285
static const IPersistMemoryVtbl PersistMemoryVtbl
Definition: persist.c:189
static HRESULT WINAPI PersistStorage_QueryInterface(IPersistStorage *iface, REFIID riid, LPVOID *ppobj)
Definition: persist.c:37
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
Definition: persist.c:218
static HRESULT WINAPI PersistStorage_Load(IPersistStorage *iface, LPSTORAGE pStg)
Definition: persist.c:83
static WebBrowser * impl_from_IPersistStorage(IPersistStorage *iface)
Definition: persist.c:32
static HRESULT WINAPI PersistStorage_InitNew(IPersistStorage *iface, LPSTORAGE pStg)
Definition: persist.c:76
static const IPersistStreamInitVtbl PersistStreamInitVtbl
Definition: persist.c:272
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
Definition: persist.c:236
static const IPersistStorageVtbl PersistStorageVtbl
Definition: persist.c:105
static HRESULT WINAPI PersistMemory_Load(IPersistMemory *iface, LPVOID pMem, ULONG cbSize)
Definition: persist.c:167
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
Definition: persist.c:224
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
Definition: persist.c:230
static HRESULT WINAPI PersistStorage_IsDirty(IPersistStorage *iface)
Definition: persist.c:69
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
Definition: persist.c:242
static HRESULT WINAPI PersistStorage_GetClassID(IPersistStorage *iface, CLSID *pClassID)
Definition: persist.c:56
static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
Definition: persist.c:153
static HRESULT WINAPI PersistMemory_Save(IPersistMemory *iface, LPVOID pMem, BOOL fClearDirty, ULONG cbSize)
Definition: persist.c:174
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg, BOOL fSameAsLoad)
Definition: persist.c:249
static HRESULT WINAPI PersistStorage_Save(IPersistStorage *iface, LPSTORAGE pStg, BOOL fSameAsLoad)
Definition: persist.c:90
static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
Definition: persist.c:134
static ULONG WINAPI PersistStorage_Release(IPersistStorage *iface)
Definition: persist.c:50
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID riid, LPVOID *ppobj)
Definition: persist.c:211
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
interface IStorage * LPSTORAGE
Definition: objfwd.h:30
interface IStream * LPSTREAM
Definition: objfwd.h:10
#define REFIID
Definition: guiddef.h:118
#define TRACE(s)
Definition: solgame.cpp:4
UINT32 cbSize
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6