shell32/tests: Use FAILED instead of !SUCCEEDED.
[wine/multimedia.git] / dlls / mshtml / htmllocation.c
blob0881023c87eb083f6415d68f55b17a12439330c1
1 /*
2 * Copyright 2008 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "resource.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
35 #define HTMLLOCATION_THIS(iface) DEFINE_THIS(HTMLLocation, HTMLLocation, iface)
37 static HRESULT WINAPI HTMLLocation_QueryInterface(IHTMLLocation *iface, REFIID riid, void **ppv)
39 HTMLLocation *This = HTMLLOCATION_THIS(iface);
41 *ppv = NULL;
43 if(IsEqualGUID(&IID_IUnknown, riid)) {
44 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
45 *ppv = HTMLLOCATION(This);
46 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
47 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
48 *ppv = HTMLLOCATION(This);
49 }else if(IsEqualGUID(&IID_IHTMLLocation, riid)) {
50 TRACE("(%p)->(IID_IHTMLLocation %p)\n", This, ppv);
51 *ppv = HTMLLOCATION(This);
54 if(*ppv) {
55 IUnknown_AddRef((IUnknown*)*ppv);
56 return S_OK;
59 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
60 return E_NOINTERFACE;
63 static ULONG WINAPI HTMLLocation_AddRef(IHTMLLocation *iface)
65 HTMLLocation *This = HTMLLOCATION_THIS(iface);
66 LONG ref = InterlockedIncrement(&This->ref);
68 TRACE("(%p) ref=%d\n", This, ref);
70 return ref;
73 static ULONG WINAPI HTMLLocation_Release(IHTMLLocation *iface)
75 HTMLLocation *This = HTMLLOCATION_THIS(iface);
76 LONG ref = InterlockedDecrement(&This->ref);
78 TRACE("(%p) ref=%d\n", This, ref);
80 if(!ref) {
81 if(This->doc && This->doc->location == This)
82 This->doc->location = NULL;
83 heap_free(This);
86 return ref;
89 static HRESULT WINAPI HTMLLocation_GetTypeInfoCount(IHTMLLocation *iface, UINT *pctinfo)
91 HTMLLocation *This = HTMLLOCATION_THIS(iface);
92 FIXME("(%p)->(%p)\n", This, pctinfo);
93 return E_NOTIMPL;
96 static HRESULT WINAPI HTMLLocation_GetTypeInfo(IHTMLLocation *iface, UINT iTInfo,
97 LCID lcid, ITypeInfo **ppTInfo)
99 HTMLLocation *This = HTMLLOCATION_THIS(iface);
100 FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
101 return E_NOTIMPL;
104 static HRESULT WINAPI HTMLLocation_GetIDsOfNames(IHTMLLocation *iface, REFIID riid,
105 LPOLESTR *rgszNames, UINT cNames,
106 LCID lcid, DISPID *rgDispId)
108 HTMLLocation *This = HTMLLOCATION_THIS(iface);
109 FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
110 lcid, rgDispId);
111 return E_NOTIMPL;
114 static HRESULT WINAPI HTMLLocation_Invoke(IHTMLLocation *iface, DISPID dispIdMember,
115 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
116 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
118 HTMLLocation *This = HTMLLOCATION_THIS(iface);
119 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
120 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
121 return E_NOTIMPL;
124 static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
126 HTMLLocation *This = HTMLLOCATION_THIS(iface);
127 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
128 return E_NOTIMPL;
131 static HRESULT WINAPI HTMLLocation_get_href(IHTMLLocation *iface, BSTR *p)
133 HTMLLocation *This = HTMLLOCATION_THIS(iface);
134 FIXME("(%p)->(%p)\n", This, p);
135 return E_NOTIMPL;
138 static HRESULT WINAPI HTMLLocation_put_protocol(IHTMLLocation *iface, BSTR v)
140 HTMLLocation *This = HTMLLOCATION_THIS(iface);
141 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
142 return E_NOTIMPL;
145 static HRESULT WINAPI HTMLLocation_get_protocol(IHTMLLocation *iface, BSTR *p)
147 HTMLLocation *This = HTMLLOCATION_THIS(iface);
148 FIXME("(%p)->(%p)\n", This, p);
149 return E_NOTIMPL;
152 static HRESULT WINAPI HTMLLocation_put_host(IHTMLLocation *iface, BSTR v)
154 HTMLLocation *This = HTMLLOCATION_THIS(iface);
155 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
156 return E_NOTIMPL;
159 static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p)
161 HTMLLocation *This = HTMLLOCATION_THIS(iface);
162 FIXME("(%p)->(%p)\n", This, p);
163 return E_NOTIMPL;
166 static HRESULT WINAPI HTMLLocation_put_hostname(IHTMLLocation *iface, BSTR v)
168 HTMLLocation *This = HTMLLOCATION_THIS(iface);
169 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
170 return E_NOTIMPL;
173 static HRESULT WINAPI HTMLLocation_get_hostname(IHTMLLocation *iface, BSTR *p)
175 HTMLLocation *This = HTMLLOCATION_THIS(iface);
176 FIXME("(%p)->(%p)\n", This, p);
177 return E_NOTIMPL;
180 static HRESULT WINAPI HTMLLocation_put_port(IHTMLLocation *iface, BSTR v)
182 HTMLLocation *This = HTMLLOCATION_THIS(iface);
183 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
184 return E_NOTIMPL;
187 static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
189 HTMLLocation *This = HTMLLOCATION_THIS(iface);
190 FIXME("(%p)->(%p)\n", This, p);
191 return E_NOTIMPL;
194 static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v)
196 HTMLLocation *This = HTMLLOCATION_THIS(iface);
197 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
198 return E_NOTIMPL;
201 static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p)
203 HTMLLocation *This = HTMLLOCATION_THIS(iface);
204 FIXME("(%p)->(%p)\n", This, p);
205 return E_NOTIMPL;
208 static HRESULT WINAPI HTMLLocation_put_search(IHTMLLocation *iface, BSTR v)
210 HTMLLocation *This = HTMLLOCATION_THIS(iface);
211 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
212 return E_NOTIMPL;
215 static HRESULT WINAPI HTMLLocation_get_search(IHTMLLocation *iface, BSTR *p)
217 HTMLLocation *This = HTMLLOCATION_THIS(iface);
218 FIXME("(%p)->(%p)\n", This, p);
219 return E_NOTIMPL;
222 static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v)
224 HTMLLocation *This = HTMLLOCATION_THIS(iface);
225 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
226 return E_NOTIMPL;
229 static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p)
231 HTMLLocation *This = HTMLLOCATION_THIS(iface);
232 FIXME("(%p)->(%p)\n", This, p);
233 return E_NOTIMPL;
236 static HRESULT WINAPI HTMLLocation_reload(IHTMLLocation *iface, VARIANT_BOOL flag)
238 HTMLLocation *This = HTMLLOCATION_THIS(iface);
239 FIXME("(%p)->(%x)\n", This, flag);
240 return E_NOTIMPL;
243 static HRESULT WINAPI HTMLLocation_replace(IHTMLLocation *iface, BSTR bstr)
245 HTMLLocation *This = HTMLLOCATION_THIS(iface);
246 FIXME("(%p)->(%s)\n", This, debugstr_w(bstr));
247 return E_NOTIMPL;
250 static HRESULT WINAPI HTMLLocation_assign(IHTMLLocation *iface, BSTR bstr)
252 HTMLLocation *This = HTMLLOCATION_THIS(iface);
253 FIXME("(%p)->(%s)\n", This, debugstr_w(bstr));
254 return E_NOTIMPL;
257 static HRESULT WINAPI HTMLLocation_toString(IHTMLLocation *iface, BSTR *String)
259 HTMLLocation *This = HTMLLOCATION_THIS(iface);
260 FIXME("(%p)->(%p)\n", This, String);
261 return E_NOTIMPL;
264 #undef HTMLLOCATION_THIS
266 static const IHTMLLocationVtbl HTMLLocationVtbl = {
267 HTMLLocation_QueryInterface,
268 HTMLLocation_AddRef,
269 HTMLLocation_Release,
270 HTMLLocation_GetTypeInfoCount,
271 HTMLLocation_GetTypeInfo,
272 HTMLLocation_GetIDsOfNames,
273 HTMLLocation_Invoke,
274 HTMLLocation_put_href,
275 HTMLLocation_get_href,
276 HTMLLocation_put_protocol,
277 HTMLLocation_get_protocol,
278 HTMLLocation_put_host,
279 HTMLLocation_get_host,
280 HTMLLocation_put_hostname,
281 HTMLLocation_get_hostname,
282 HTMLLocation_put_port,
283 HTMLLocation_get_port,
284 HTMLLocation_put_pathname,
285 HTMLLocation_get_pathname,
286 HTMLLocation_put_search,
287 HTMLLocation_get_search,
288 HTMLLocation_put_hash,
289 HTMLLocation_get_hash,
290 HTMLLocation_reload,
291 HTMLLocation_replace,
292 HTMLLocation_assign,
293 HTMLLocation_toString
296 HTMLLocation *HTMLLocation_Create(HTMLDocument *doc)
298 HTMLLocation *ret = heap_alloc(sizeof(*ret));
300 ret->lpHTMLLocationVtbl = &HTMLLocationVtbl;
301 ret->ref = 1;
302 ret->doc = doc;
304 return ret;