Removed some uses of the non-standard ICOM_THIS macro.
[wine] / dlls / 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     IPersistStorageImpl *This = (IPersistStorageImpl *)iface;
34
35     FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
36     return E_NOINTERFACE;
37 }
38
39 static ULONG WINAPI WBPS_AddRef(LPPERSISTSTORAGE iface)
40 {
41     IPersistStorageImpl *This = (IPersistStorageImpl *)iface;
42
43     TRACE("\n");
44     return ++(This->ref);
45 }
46
47 static ULONG WINAPI WBPS_Release(LPPERSISTSTORAGE iface)
48 {
49     IPersistStorageImpl *This = (IPersistStorageImpl *)iface;
50
51     /* static class, won't be freed */
52     TRACE("\n");
53     return --(This->ref);
54 }
55
56 static HRESULT WINAPI WBPS_GetClassID(LPPERSISTSTORAGE iface, CLSID *pClassID)
57 {
58     FIXME("stub: CLSID = %s\n", debugstr_guid(pClassID));
59     return S_OK;
60 }
61
62 static HRESULT WINAPI WBPS_IsDirty(LPPERSISTSTORAGE iface)
63 {
64     FIXME("stub\n");
65     return S_OK;
66 }
67
68 static HRESULT WINAPI WBPS_InitNew(LPPERSISTSTORAGE iface, LPSTORAGE pStg)
69 {
70     FIXME("stub: LPSTORAGE = %p\n", pStg);
71     return S_OK;
72 }
73
74 static HRESULT WINAPI WBPS_Load(LPPERSISTSTORAGE iface, LPSTORAGE pStg)
75 {
76     FIXME("stub: LPSTORAGE = %p\n", pStg);
77     return S_OK;
78 }
79
80 static HRESULT WINAPI WBPS_Save(LPPERSISTSTORAGE iface, LPSTORAGE pStg,
81                                 BOOL fSameAsLoad)
82 {
83     FIXME("stub: LPSTORAGE = %p, fSameAsLoad = %d\n", pStg, fSameAsLoad);
84     return S_OK;
85 }
86
87 static HRESULT WINAPI WBPS_SaveCompleted(LPPERSISTSTORAGE iface, LPSTORAGE pStgNew)
88 {
89     FIXME("stub: LPSTORAGE = %p\n", pStgNew);
90     return S_OK;
91 }
92
93 /**********************************************************************
94  * IPersistStorage virtual function table for IE Web Browser component
95  */
96
97 static IPersistStorageVtbl WBPS_Vtbl =
98 {
99     WBPS_QueryInterface,
100     WBPS_AddRef,
101     WBPS_Release,
102     WBPS_GetClassID,
103     WBPS_IsDirty,
104     WBPS_InitNew,
105     WBPS_Load,
106     WBPS_Save,
107     WBPS_SaveCompleted
108 };
109
110 IPersistStorageImpl SHDOCVW_PersistStorage = { &WBPS_Vtbl, 1 };
111
112
113 /**********************************************************************
114  * Implement the IPersistStreamInit interface
115  */
116
117 static HRESULT WINAPI WBPSI_QueryInterface(LPPERSISTSTREAMINIT iface,
118                                            REFIID riid, LPVOID *ppobj)
119 {
120     IPersistStreamInitImpl *This = (IPersistStreamInitImpl *)iface;
121
122     FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
123     return E_NOINTERFACE;
124 }
125
126 static ULONG WINAPI WBPSI_AddRef(LPPERSISTSTREAMINIT iface)
127 {
128     IPersistStreamInitImpl *This = (IPersistStreamInitImpl *)iface;
129
130     TRACE("\n");
131     return ++(This->ref);
132 }
133
134 static ULONG WINAPI WBPSI_Release(LPPERSISTSTREAMINIT iface)
135 {
136     IPersistStreamInitImpl *This = (IPersistStreamInitImpl *)iface;
137
138     /* static class, won't be freed */
139     TRACE("\n");
140     return --(This->ref);
141 }
142
143 static HRESULT WINAPI WBPSI_GetClassID(LPPERSISTSTREAMINIT iface, CLSID *pClassID)
144 {
145     FIXME("stub: CLSID = %s\n", debugstr_guid(pClassID));
146     return S_OK;
147 }
148
149 static HRESULT WINAPI WBPSI_IsDirty(LPPERSISTSTREAMINIT iface)
150 {
151     FIXME("stub\n");
152     return S_OK;
153 }
154
155 static HRESULT WINAPI WBPSI_Load(LPPERSISTSTREAMINIT iface, LPSTREAM pStg)
156 {
157     FIXME("stub: LPSTORAGE = %p\n", pStg);
158     return S_OK;
159 }
160
161 static HRESULT WINAPI WBPSI_Save(LPPERSISTSTREAMINIT iface, LPSTREAM pStg,
162                                 BOOL fSameAsLoad)
163 {
164     FIXME("stub: LPSTORAGE = %p, fSameAsLoad = %d\n", pStg, fSameAsLoad);
165     return S_OK;
166 }
167
168 static HRESULT WINAPI WBPSI_GetSizeMax(LPPERSISTSTREAMINIT iface,
169                                        ULARGE_INTEGER *pcbSize)
170 {
171     FIXME("stub: ULARGE_INTEGER = %p\n", pcbSize);
172     return S_OK;
173 }
174
175 static HRESULT WINAPI WBPSI_InitNew(LPPERSISTSTREAMINIT iface)
176 {
177     FIXME("stub\n");
178     return S_OK;
179 }
180
181 /**********************************************************************
182  * IPersistStreamInit virtual function table for IE Web Browser component
183  */
184
185 static IPersistStreamInitVtbl WBPSI_Vtbl =
186 {
187     WBPSI_QueryInterface,
188     WBPSI_AddRef,
189     WBPSI_Release,
190     WBPSI_GetClassID,
191     WBPSI_IsDirty,
192     WBPSI_Load,
193     WBPSI_Save,
194     WBPSI_GetSizeMax,
195     WBPSI_InitNew
196 };
197
198 IPersistStreamInitImpl SHDOCVW_PersistStreamInit = { &WBPSI_Vtbl, 1 };