set svn:eol-style to native
[reactos.git] / reactos / lib / shdocvw / persist.c
1 /*
2 * Implementation of IPersist interfaces for IE Web Browser control
3 *
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #include "wine/debug.h"
22 #include "shdocvw.h"
23
24 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
25
26 /**********************************************************************
27 * Implement the IPersistStorage interface
28 */
29
30 static HRESULT WINAPI WBPS_QueryInterface(LPPERSISTSTORAGE iface,
31 REFIID riid, LPVOID *ppobj)
32 {
33 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
34
35 if (ppobj == NULL) return E_POINTER;
36
37 return E_NOINTERFACE;
38 }
39
40 static ULONG WINAPI WBPS_AddRef(LPPERSISTSTORAGE iface)
41 {
42 SHDOCVW_LockModule();
43
44 return 2; /* non-heap based object */
45 }
46
47 static ULONG WINAPI WBPS_Release(LPPERSISTSTORAGE iface)
48 {
49 SHDOCVW_UnlockModule();
50
51 return 1; /* non-heap based object */
52 }
53
54 static HRESULT WINAPI WBPS_GetClassID(LPPERSISTSTORAGE iface, CLSID *pClassID)
55 {
56 FIXME("stub: CLSID = %s\n", debugstr_guid(pClassID));
57 return S_OK;
58 }
59
60 static HRESULT WINAPI WBPS_IsDirty(LPPERSISTSTORAGE iface)
61 {
62 FIXME("stub\n");
63 return S_OK;
64 }
65
66 static HRESULT WINAPI WBPS_InitNew(LPPERSISTSTORAGE iface, LPSTORAGE pStg)
67 {
68 FIXME("stub: LPSTORAGE = %p\n", pStg);
69 return S_OK;
70 }
71
72 static HRESULT WINAPI WBPS_Load(LPPERSISTSTORAGE iface, LPSTORAGE pStg)
73 {
74 FIXME("stub: LPSTORAGE = %p\n", pStg);
75 return S_OK;
76 }
77
78 static HRESULT WINAPI WBPS_Save(LPPERSISTSTORAGE iface, LPSTORAGE pStg,
79 BOOL fSameAsLoad)
80 {
81 FIXME("stub: LPSTORAGE = %p, fSameAsLoad = %d\n", pStg, fSameAsLoad);
82 return S_OK;
83 }
84
85 static HRESULT WINAPI WBPS_SaveCompleted(LPPERSISTSTORAGE iface, LPSTORAGE pStgNew)
86 {
87 FIXME("stub: LPSTORAGE = %p\n", pStgNew);
88 return S_OK;
89 }
90
91 /**********************************************************************
92 * IPersistStorage virtual function table for IE Web Browser component
93 */
94
95 static IPersistStorageVtbl WBPS_Vtbl =
96 {
97 WBPS_QueryInterface,
98 WBPS_AddRef,
99 WBPS_Release,
100 WBPS_GetClassID,
101 WBPS_IsDirty,
102 WBPS_InitNew,
103 WBPS_Load,
104 WBPS_Save,
105 WBPS_SaveCompleted
106 };
107
108 IPersistStorageImpl SHDOCVW_PersistStorage = {&WBPS_Vtbl};
109
110
111 /**********************************************************************
112 * Implement the IPersistStreamInit interface
113 */
114
115 static HRESULT WINAPI WBPSI_QueryInterface(LPPERSISTSTREAMINIT iface,
116 REFIID riid, LPVOID *ppobj)
117 {
118 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
119
120 if (ppobj == NULL) return E_POINTER;
121
122 return E_NOINTERFACE;
123 }
124
125 static ULONG WINAPI WBPSI_AddRef(LPPERSISTSTREAMINIT iface)
126 {
127 SHDOCVW_LockModule();
128
129 return 2; /* non-heap based object */
130 }
131
132 static ULONG WINAPI WBPSI_Release(LPPERSISTSTREAMINIT iface)
133 {
134 SHDOCVW_UnlockModule();
135
136 return 1; /* non-heap based object */
137 }
138
139 static HRESULT WINAPI WBPSI_GetClassID(LPPERSISTSTREAMINIT iface, CLSID *pClassID)
140 {
141 FIXME("stub: CLSID = %s\n", debugstr_guid(pClassID));
142 return S_OK;
143 }
144
145 static HRESULT WINAPI WBPSI_IsDirty(LPPERSISTSTREAMINIT iface)
146 {
147 FIXME("stub\n");
148 return S_OK;
149 }
150
151 static HRESULT WINAPI WBPSI_Load(LPPERSISTSTREAMINIT iface, LPSTREAM pStg)
152 {
153 FIXME("stub: LPSTORAGE = %p\n", pStg);
154 return S_OK;
155 }
156
157 static HRESULT WINAPI WBPSI_Save(LPPERSISTSTREAMINIT iface, LPSTREAM pStg,
158 BOOL fSameAsLoad)
159 {
160 FIXME("stub: LPSTORAGE = %p, fSameAsLoad = %d\n", pStg, fSameAsLoad);
161 return S_OK;
162 }
163
164 static HRESULT WINAPI WBPSI_GetSizeMax(LPPERSISTSTREAMINIT iface,
165 ULARGE_INTEGER *pcbSize)
166 {
167 FIXME("stub: ULARGE_INTEGER = %p\n", pcbSize);
168 return S_OK;
169 }
170
171 static HRESULT WINAPI WBPSI_InitNew(LPPERSISTSTREAMINIT iface)
172 {
173 FIXME("stub\n");
174 return S_OK;
175 }
176
177 /**********************************************************************
178 * IPersistStreamInit virtual function table for IE Web Browser component
179 */
180
181 static IPersistStreamInitVtbl WBPSI_Vtbl =
182 {
183 WBPSI_QueryInterface,
184 WBPSI_AddRef,
185 WBPSI_Release,
186 WBPSI_GetClassID,
187 WBPSI_IsDirty,
188 WBPSI_Load,
189 WBPSI_Save,
190 WBPSI_GetSizeMax,
191 WBPSI_InitNew
192 };
193
194 IPersistStreamInitImpl SHDOCVW_PersistStreamInit = {&WBPSI_Vtbl};