ReactOS 0.4.15-dev-8241-g63935f8
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 IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
42}
43
45{
47 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
48}
49
51{
53 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
54}
55
57{
59 FIXME("(%p)->(%p)\n", This, pClassID);
60 return E_NOTIMPL;
61}
62
64{
66 FIXME("(%p)\n", This);
67 return E_NOTIMPL;
68}
69
71{
73 FIXME("(%p)->(%p)\n", This, pStg);
74 return S_OK;
75}
76
78{
80 FIXME("(%p)->(%p)\n", This, pStg);
81 return E_NOTIMPL;
82}
83
85 BOOL fSameAsLoad)
86{
88 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
89 return E_NOTIMPL;
90}
91
93{
95 FIXME("(%p)->(%p)\n", This, pStgNew);
96 return E_NOTIMPL;
97}
98
99static const IPersistStorageVtbl PersistStorageVtbl =
100{
110};
111
112/**********************************************************************
113 * Implement the IPersistMemory interface
114 */
115
117{
118 return CONTAINING_RECORD(iface, WebBrowser, IPersistMemory_iface);
119}
120
122 REFIID riid, LPVOID *ppobj)
123{
125 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
126}
127
129{
131 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
132}
133
135{
137 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
138}
139
141{
143 FIXME("(%p)->(%p)\n", This, pClassID);
144 return E_NOTIMPL;
145}
146
148{
150 FIXME("(%p)\n", This);
151 return E_NOTIMPL;
152}
153
155{
157 FIXME("(%p)\n", This);
158 return S_OK;
159}
160
162{
164 FIXME("(%p)->(%p %x)\n", This, pMem, cbSize);
165 return S_OK;
166}
167
169 BOOL fClearDirty, ULONG cbSize)
170{
172 FIXME("(%p)->(%p %x %x)\n", This, pMem, fClearDirty, cbSize);
173 return E_NOTIMPL;
174}
175
177{
179 FIXME("(%p)->(%p)\n", This, pCbSize);
180 return E_NOTIMPL;
181}
182
183static const IPersistMemoryVtbl PersistMemoryVtbl =
184{
194};
195
196/**********************************************************************
197 * Implement the IPersistStreamInit interface
198 */
199
201{
202 return CONTAINING_RECORD(iface, WebBrowser, IPersistStreamInit_iface);
203}
204
206 REFIID riid, LPVOID *ppobj)
207{
209 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
210}
211
213{
215 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
216}
217
219{
221 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
222}
223
225{
227 return IPersistStorage_GetClassID(&This->IPersistStorage_iface, pClassID);
228}
229
231{
233 return IPersistStorage_IsDirty(&This->IPersistStorage_iface);
234}
235
237{
239 FIXME("(%p)->(%p)\n", This, pStg);
240 return S_OK;
241}
242
244 BOOL fSameAsLoad)
245{
247 FIXME("(%p)->(%p %x)\n", This, pStg, fSameAsLoad);
248 return E_NOTIMPL;
249}
250
252 ULARGE_INTEGER *pcbSize)
253{
255 FIXME("(%p)->(%p)\n", This, pcbSize);
256 return E_NOTIMPL;
257}
258
260{
262 FIXME("(%p)\n", This);
263 return S_OK;
264}
265
266static const IPersistStreamInitVtbl PersistStreamInitVtbl =
267{
277};
278
280{
281 This->IPersistStorage_iface.lpVtbl = &PersistStorageVtbl;
282 This->IPersistMemory_iface.lpVtbl = &PersistMemoryVtbl;
283 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
284}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: debug.h:114
#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:121
static WebBrowser * impl_from_IPersistStreamInit(IPersistStreamInit *iface)
Definition: persist.c:200
static HRESULT WINAPI PersistMemory_GetSizeMax(IPersistMemory *iface, ULONG *pCbSize)
Definition: persist.c:176
static HRESULT WINAPI PersistMemory_InitNew(IPersistMemory *iface)
Definition: persist.c:154
static HRESULT WINAPI PersistMemory_GetClassID(IPersistMemory *iface, CLSID *pClassID)
Definition: persist.c:140
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
Definition: persist.c:251
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
Definition: persist.c:259
static ULONG WINAPI PersistMemory_Release(IPersistMemory *iface)
Definition: persist.c:134
static HRESULT WINAPI PersistStorage_SaveCompleted(IPersistStorage *iface, LPSTORAGE pStgNew)
Definition: persist.c:92
static WebBrowser * impl_from_IPersistMemory(IPersistMemory *iface)
Definition: persist.c:116
void WebBrowser_Persist_Init(WebBrowser *This)
Definition: persist.c:279
static const IPersistMemoryVtbl PersistMemoryVtbl
Definition: persist.c:183
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:212
static HRESULT WINAPI PersistStorage_Load(IPersistStorage *iface, LPSTORAGE pStg)
Definition: persist.c:77
static WebBrowser * impl_from_IPersistStorage(IPersistStorage *iface)
Definition: persist.c:32
static HRESULT WINAPI PersistStorage_InitNew(IPersistStorage *iface, LPSTORAGE pStg)
Definition: persist.c:70
static const IPersistStreamInitVtbl PersistStreamInitVtbl
Definition: persist.c:266
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
Definition: persist.c:230
static const IPersistStorageVtbl PersistStorageVtbl
Definition: persist.c:99
static HRESULT WINAPI PersistMemory_Load(IPersistMemory *iface, LPVOID pMem, ULONG cbSize)
Definition: persist.c:161
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
Definition: persist.c:218
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
Definition: persist.c:224
static HRESULT WINAPI PersistStorage_IsDirty(IPersistStorage *iface)
Definition: persist.c:63
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
Definition: persist.c:236
static HRESULT WINAPI PersistStorage_GetClassID(IPersistStorage *iface, CLSID *pClassID)
Definition: persist.c:56
static HRESULT WINAPI PersistMemory_IsDirty(IPersistMemory *iface)
Definition: persist.c:147
static HRESULT WINAPI PersistMemory_Save(IPersistMemory *iface, LPVOID pMem, BOOL fClearDirty, ULONG cbSize)
Definition: persist.c:168
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg, BOOL fSameAsLoad)
Definition: persist.c:243
static HRESULT WINAPI PersistStorage_Save(IPersistStorage *iface, LPSTORAGE pStg, BOOL fSameAsLoad)
Definition: persist.c:84
static ULONG WINAPI PersistMemory_AddRef(IPersistMemory *iface)
Definition: persist.c:128
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:205
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 CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6