1 /*
2 * Copyright 2008 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19 #include "mshtml_private.h"
20
21 #ifdef __REACTOS__
22 /* HACK This is a Vista+ API */
LCIDToLocaleName_(LCID lcid,LPWSTR name,INT count,DWORD flags)23 static INT WINAPI LCIDToLocaleName_( LCID lcid, LPWSTR name, INT count, DWORD flags )
24 {
25 if (flags) FIXME( "unsupported flags %x\n", flags );
26
27 return GetLocaleInfoW( lcid, LOCALE_SNAME | LOCALE_NOUSEROVERRIDE, name, count );
28 }
29 #define LCIDToLocaleName LCIDToLocaleName_
30 #endif
31
32 typedef struct HTMLPluginsCollection HTMLPluginsCollection;
33 typedef struct HTMLMimeTypesCollection HTMLMimeTypesCollection;
34
35 typedef struct {
36 DispatchEx dispex;
37 IOmNavigator IOmNavigator_iface;
38
39 LONG ref;
40
41 HTMLPluginsCollection *plugins;
42 HTMLMimeTypesCollection *mime_types;
43 } OmNavigator;
44
45 typedef struct {
46 DispatchEx dispex;
47 IHTMLDOMImplementation IHTMLDOMImplementation_iface;
48
49 LONG ref;
50 } HTMLDOMImplementation;
51
impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation * iface)52 static inline HTMLDOMImplementation *impl_from_IHTMLDOMImplementation(IHTMLDOMImplementation *iface)
53 {
54 return CONTAINING_RECORD(iface, HTMLDOMImplementation, IHTMLDOMImplementation_iface);
55 }
56
HTMLDOMImplementation_QueryInterface(IHTMLDOMImplementation * iface,REFIID riid,void ** ppv)57 static HRESULT WINAPI HTMLDOMImplementation_QueryInterface(IHTMLDOMImplementation *iface, REFIID riid, void **ppv)
58 {
59 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
60
61 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
62
63 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IHTMLDOMImplementation, riid)) {
64 *ppv = &This->IHTMLDOMImplementation_iface;
65 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
66 return *ppv ? S_OK : E_NOINTERFACE;
67 }else {
68 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
69 *ppv = NULL;
70 return E_NOINTERFACE;
71 }
72
73 IUnknown_AddRef((IUnknown*)*ppv);
74 return S_OK;
75 }
76
HTMLDOMImplementation_AddRef(IHTMLDOMImplementation * iface)77 static ULONG WINAPI HTMLDOMImplementation_AddRef(IHTMLDOMImplementation *iface)
78 {
79 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
80 LONG ref = InterlockedIncrement(&This->ref);
81
82 TRACE("(%p) ref=%d\n", This, ref);
83
84 return ref;
85 }
86
HTMLDOMImplementation_Release(IHTMLDOMImplementation * iface)87 static ULONG WINAPI HTMLDOMImplementation_Release(IHTMLDOMImplementation *iface)
88 {
89 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
90 LONG ref = InterlockedDecrement(&This->ref);
91
92 TRACE("(%p) ref=%d\n", This, ref);
93
94 if(!ref) {
95 release_dispex(&This->dispex);
96 heap_free(This);
97 }
98
99 return ref;
100 }
101
HTMLDOMImplementation_GetTypeInfoCount(IHTMLDOMImplementation * iface,UINT * pctinfo)102 static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfoCount(IHTMLDOMImplementation *iface, UINT *pctinfo)
103 {
104 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
105
106 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
107 }
108
HTMLDOMImplementation_GetTypeInfo(IHTMLDOMImplementation * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)109 static HRESULT WINAPI HTMLDOMImplementation_GetTypeInfo(IHTMLDOMImplementation *iface, UINT iTInfo,
110 LCID lcid, ITypeInfo **ppTInfo)
111 {
112 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
113
114 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
115 }
116
HTMLDOMImplementation_GetIDsOfNames(IHTMLDOMImplementation * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)117 static HRESULT WINAPI HTMLDOMImplementation_GetIDsOfNames(IHTMLDOMImplementation *iface, REFIID riid,
118 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
119 {
120 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
121
122 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames,
123 cNames, lcid, rgDispId);
124 }
125
HTMLDOMImplementation_Invoke(IHTMLDOMImplementation * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)126 static HRESULT WINAPI HTMLDOMImplementation_Invoke(IHTMLDOMImplementation *iface, DISPID dispIdMember,
127 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
128 EXCEPINFO *pExcepInfo, UINT *puArgErr)
129 {
130 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
131
132 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid,
133 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
134 }
135
HTMLDOMImplementation_hasFeature(IHTMLDOMImplementation * iface,BSTR feature,VARIANT version,VARIANT_BOOL * pfHasFeature)136 static HRESULT WINAPI HTMLDOMImplementation_hasFeature(IHTMLDOMImplementation *iface, BSTR feature,
137 VARIANT version, VARIANT_BOOL *pfHasFeature)
138 {
139 HTMLDOMImplementation *This = impl_from_IHTMLDOMImplementation(iface);
140
141 FIXME("(%p)->(%s %s %p) returning false\n", This, debugstr_w(feature), debugstr_variant(&version), pfHasFeature);
142
143 *pfHasFeature = VARIANT_FALSE;
144 return S_OK;
145 }
146
147 static const IHTMLDOMImplementationVtbl HTMLDOMImplementationVtbl = {
148 HTMLDOMImplementation_QueryInterface,
149 HTMLDOMImplementation_AddRef,
150 HTMLDOMImplementation_Release,
151 HTMLDOMImplementation_GetTypeInfoCount,
152 HTMLDOMImplementation_GetTypeInfo,
153 HTMLDOMImplementation_GetIDsOfNames,
154 HTMLDOMImplementation_Invoke,
155 HTMLDOMImplementation_hasFeature
156 };
157
158 static const tid_t HTMLDOMImplementation_iface_tids[] = {
159 IHTMLDOMImplementation_tid,
160 0
161 };
162 static dispex_static_data_t HTMLDOMImplementation_dispex = {
163 NULL,
164 IHTMLDOMImplementation_tid,
165 NULL,
166 HTMLDOMImplementation_iface_tids
167 };
168
create_dom_implementation(IHTMLDOMImplementation ** ret)169 HRESULT create_dom_implementation(IHTMLDOMImplementation **ret)
170 {
171 HTMLDOMImplementation *dom_implementation;
172
173 dom_implementation = heap_alloc_zero(sizeof(*dom_implementation));
174 if(!dom_implementation)
175 return E_OUTOFMEMORY;
176
177 dom_implementation->IHTMLDOMImplementation_iface.lpVtbl = &HTMLDOMImplementationVtbl;
178 dom_implementation->ref = 1;
179
180 init_dispex(&dom_implementation->dispex, (IUnknown*)&dom_implementation->IHTMLDOMImplementation_iface,
181 &HTMLDOMImplementation_dispex);
182
183 *ret = &dom_implementation->IHTMLDOMImplementation_iface;
184 return S_OK;
185 }
186
impl_from_IOmHistory(IOmHistory * iface)187 static inline OmHistory *impl_from_IOmHistory(IOmHistory *iface)
188 {
189 return CONTAINING_RECORD(iface, OmHistory, IOmHistory_iface);
190 }
191
OmHistory_QueryInterface(IOmHistory * iface,REFIID riid,void ** ppv)192 static HRESULT WINAPI OmHistory_QueryInterface(IOmHistory *iface, REFIID riid, void **ppv)
193 {
194 OmHistory *This = impl_from_IOmHistory(iface);
195
196 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
197
198 if(IsEqualGUID(&IID_IUnknown, riid)) {
199 *ppv = &This->IOmHistory_iface;
200 }else if(IsEqualGUID(&IID_IOmHistory, riid)) {
201 *ppv = &This->IOmHistory_iface;
202 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
203 return *ppv ? S_OK : E_NOINTERFACE;
204 }else {
205 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
206 *ppv = NULL;
207 return E_NOINTERFACE;
208 }
209
210 IUnknown_AddRef((IUnknown*)*ppv);
211 return S_OK;
212 }
213
OmHistory_AddRef(IOmHistory * iface)214 static ULONG WINAPI OmHistory_AddRef(IOmHistory *iface)
215 {
216 OmHistory *This = impl_from_IOmHistory(iface);
217 LONG ref = InterlockedIncrement(&This->ref);
218
219 TRACE("(%p) ref=%d\n", This, ref);
220
221 return ref;
222 }
223
OmHistory_Release(IOmHistory * iface)224 static ULONG WINAPI OmHistory_Release(IOmHistory *iface)
225 {
226 OmHistory *This = impl_from_IOmHistory(iface);
227 LONG ref = InterlockedDecrement(&This->ref);
228
229 TRACE("(%p) ref=%d\n", This, ref);
230
231 if(!ref) {
232 release_dispex(&This->dispex);
233 heap_free(This);
234 }
235
236 return ref;
237 }
238
OmHistory_GetTypeInfoCount(IOmHistory * iface,UINT * pctinfo)239 static HRESULT WINAPI OmHistory_GetTypeInfoCount(IOmHistory *iface, UINT *pctinfo)
240 {
241 OmHistory *This = impl_from_IOmHistory(iface);
242 FIXME("(%p)->(%p)\n", This, pctinfo);
243 return E_NOTIMPL;
244 }
245
OmHistory_GetTypeInfo(IOmHistory * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)246 static HRESULT WINAPI OmHistory_GetTypeInfo(IOmHistory *iface, UINT iTInfo,
247 LCID lcid, ITypeInfo **ppTInfo)
248 {
249 OmHistory *This = impl_from_IOmHistory(iface);
250
251 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
252 }
253
OmHistory_GetIDsOfNames(IOmHistory * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)254 static HRESULT WINAPI OmHistory_GetIDsOfNames(IOmHistory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames,
255 LCID lcid, DISPID *rgDispId)
256 {
257 OmHistory *This = impl_from_IOmHistory(iface);
258
259 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
260 lcid, rgDispId);
261 }
262
OmHistory_Invoke(IOmHistory * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)263 static HRESULT WINAPI OmHistory_Invoke(IOmHistory *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
264 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
265 {
266 OmHistory *This = impl_from_IOmHistory(iface);
267
268 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
269 pDispParams, pVarResult, pExcepInfo, puArgErr);
270 }
271
OmHistory_get_length(IOmHistory * iface,short * p)272 static HRESULT WINAPI OmHistory_get_length(IOmHistory *iface, short *p)
273 {
274 OmHistory *This = impl_from_IOmHistory(iface);
275
276 TRACE("(%p)->(%p)\n", This, p);
277
278 if(!This->window || !This->window->base.outer_window->doc_obj
279 || !This->window->base.outer_window->doc_obj->travel_log) {
280 *p = 0;
281 }else {
282 *p = ITravelLog_CountEntries(This->window->base.outer_window->doc_obj->travel_log,
283 This->window->base.outer_window->doc_obj->browser_service);
284 }
285 return S_OK;
286 }
287
OmHistory_back(IOmHistory * iface,VARIANT * pvargdistance)288 static HRESULT WINAPI OmHistory_back(IOmHistory *iface, VARIANT *pvargdistance)
289 {
290 OmHistory *This = impl_from_IOmHistory(iface);
291 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
292 return E_NOTIMPL;
293 }
294
OmHistory_forward(IOmHistory * iface,VARIANT * pvargdistance)295 static HRESULT WINAPI OmHistory_forward(IOmHistory *iface, VARIANT *pvargdistance)
296 {
297 OmHistory *This = impl_from_IOmHistory(iface);
298 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
299 return E_NOTIMPL;
300 }
301
OmHistory_go(IOmHistory * iface,VARIANT * pvargdistance)302 static HRESULT WINAPI OmHistory_go(IOmHistory *iface, VARIANT *pvargdistance)
303 {
304 OmHistory *This = impl_from_IOmHistory(iface);
305 FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance));
306 return E_NOTIMPL;
307 }
308
309 static const IOmHistoryVtbl OmHistoryVtbl = {
310 OmHistory_QueryInterface,
311 OmHistory_AddRef,
312 OmHistory_Release,
313 OmHistory_GetTypeInfoCount,
314 OmHistory_GetTypeInfo,
315 OmHistory_GetIDsOfNames,
316 OmHistory_Invoke,
317 OmHistory_get_length,
318 OmHistory_back,
319 OmHistory_forward,
320 OmHistory_go
321 };
322
323 static const tid_t OmHistory_iface_tids[] = {
324 IOmHistory_tid,
325 0
326 };
327 static dispex_static_data_t OmHistory_dispex = {
328 NULL,
329 DispHTMLHistory_tid,
330 NULL,
331 OmHistory_iface_tids
332 };
333
334
create_history(HTMLInnerWindow * window,OmHistory ** ret)335 HRESULT create_history(HTMLInnerWindow *window, OmHistory **ret)
336 {
337 OmHistory *history;
338
339 history = heap_alloc_zero(sizeof(*history));
340 if(!history)
341 return E_OUTOFMEMORY;
342
343 init_dispex(&history->dispex, (IUnknown*)&history->IOmHistory_iface, &OmHistory_dispex);
344 history->IOmHistory_iface.lpVtbl = &OmHistoryVtbl;
345 history->ref = 1;
346
347 history->window = window;
348
349 *ret = history;
350 return S_OK;
351 }
352
353 struct HTMLPluginsCollection {
354 DispatchEx dispex;
355 IHTMLPluginsCollection IHTMLPluginsCollection_iface;
356
357 LONG ref;
358
359 OmNavigator *navigator;
360 };
361
impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection * iface)362 static inline HTMLPluginsCollection *impl_from_IHTMLPluginsCollection(IHTMLPluginsCollection *iface)
363 {
364 return CONTAINING_RECORD(iface, HTMLPluginsCollection, IHTMLPluginsCollection_iface);
365 }
366
HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection * iface,REFIID riid,void ** ppv)367 static HRESULT WINAPI HTMLPluginsCollection_QueryInterface(IHTMLPluginsCollection *iface, REFIID riid, void **ppv)
368 {
369 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
370
371 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
372
373 if(IsEqualGUID(&IID_IUnknown, riid)) {
374 *ppv = &This->IHTMLPluginsCollection_iface;
375 }else if(IsEqualGUID(&IID_IHTMLPluginsCollection, riid)) {
376 *ppv = &This->IHTMLPluginsCollection_iface;
377 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
378 return *ppv ? S_OK : E_NOINTERFACE;
379 }else {
380 *ppv = NULL;
381 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
382 return E_NOINTERFACE;
383 }
384
385 IUnknown_AddRef((IUnknown*)*ppv);
386 return S_OK;
387 }
388
HTMLPluginsCollection_AddRef(IHTMLPluginsCollection * iface)389 static ULONG WINAPI HTMLPluginsCollection_AddRef(IHTMLPluginsCollection *iface)
390 {
391 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
392 LONG ref = InterlockedIncrement(&This->ref);
393
394 TRACE("(%p) ref=%d\n", This, ref);
395
396 return ref;
397 }
398
HTMLPluginsCollection_Release(IHTMLPluginsCollection * iface)399 static ULONG WINAPI HTMLPluginsCollection_Release(IHTMLPluginsCollection *iface)
400 {
401 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
402 LONG ref = InterlockedDecrement(&This->ref);
403
404 TRACE("(%p) ref=%d\n", This, ref);
405
406 if(!ref) {
407 if(This->navigator)
408 This->navigator->plugins = NULL;
409 release_dispex(&This->dispex);
410 heap_free(This);
411 }
412
413 return ref;
414 }
415
HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection * iface,UINT * pctinfo)416 static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfoCount(IHTMLPluginsCollection *iface, UINT *pctinfo)
417 {
418 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
419 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
420 }
421
HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)422 static HRESULT WINAPI HTMLPluginsCollection_GetTypeInfo(IHTMLPluginsCollection *iface, UINT iTInfo,
423 LCID lcid, ITypeInfo **ppTInfo)
424 {
425 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
426 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
427 }
428
HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)429 static HRESULT WINAPI HTMLPluginsCollection_GetIDsOfNames(IHTMLPluginsCollection *iface, REFIID riid,
430 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
431 {
432 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
433 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
434 lcid, rgDispId);
435 }
436
HTMLPluginsCollection_Invoke(IHTMLPluginsCollection * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)437 static HRESULT WINAPI HTMLPluginsCollection_Invoke(IHTMLPluginsCollection *iface, DISPID dispIdMember,
438 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
439 EXCEPINFO *pExcepInfo, UINT *puArgErr)
440 {
441 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
442 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
443 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
444 }
445
HTMLPluginsCollection_get_length(IHTMLPluginsCollection * iface,LONG * p)446 static HRESULT WINAPI HTMLPluginsCollection_get_length(IHTMLPluginsCollection *iface, LONG *p)
447 {
448 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
449
450 TRACE("(%p)->(%p)\n", This, p);
451
452 /* IE always returns 0 here */
453 *p = 0;
454 return S_OK;
455 }
456
HTMLPluginsCollection_refresh(IHTMLPluginsCollection * iface,VARIANT_BOOL reload)457 static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *iface, VARIANT_BOOL reload)
458 {
459 HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
460
461 TRACE("(%p)->(%x)\n", This, reload);
462
463 /* Nothing to do here. */
464 return S_OK;
465 }
466
467 static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl = {
468 HTMLPluginsCollection_QueryInterface,
469 HTMLPluginsCollection_AddRef,
470 HTMLPluginsCollection_Release,
471 HTMLPluginsCollection_GetTypeInfoCount,
472 HTMLPluginsCollection_GetTypeInfo,
473 HTMLPluginsCollection_GetIDsOfNames,
474 HTMLPluginsCollection_Invoke,
475 HTMLPluginsCollection_get_length,
476 HTMLPluginsCollection_refresh
477 };
478
479 static const tid_t HTMLPluginsCollection_iface_tids[] = {
480 IHTMLPluginsCollection_tid,
481 0
482 };
483 static dispex_static_data_t HTMLPluginsCollection_dispex = {
484 NULL,
485 DispCPlugins_tid,
486 NULL,
487 HTMLPluginsCollection_iface_tids
488 };
489
create_plugins_collection(OmNavigator * navigator,HTMLPluginsCollection ** ret)490 static HRESULT create_plugins_collection(OmNavigator *navigator, HTMLPluginsCollection **ret)
491 {
492 HTMLPluginsCollection *col;
493
494 col = heap_alloc_zero(sizeof(*col));
495 if(!col)
496 return E_OUTOFMEMORY;
497
498 col->IHTMLPluginsCollection_iface.lpVtbl = &HTMLPluginsCollectionVtbl;
499 col->ref = 1;
500 col->navigator = navigator;
501
502 init_dispex(&col->dispex, (IUnknown*)&col->IHTMLPluginsCollection_iface,
503 &HTMLPluginsCollection_dispex);
504
505 *ret = col;
506 return S_OK;
507 }
508
509 struct HTMLMimeTypesCollection {
510 DispatchEx dispex;
511 IHTMLMimeTypesCollection IHTMLMimeTypesCollection_iface;
512
513 LONG ref;
514
515 OmNavigator *navigator;
516 };
517
impl_from_IHTMLMimeTypesCollection(IHTMLMimeTypesCollection * iface)518 static inline HTMLMimeTypesCollection *impl_from_IHTMLMimeTypesCollection(IHTMLMimeTypesCollection *iface)
519 {
520 return CONTAINING_RECORD(iface, HTMLMimeTypesCollection, IHTMLMimeTypesCollection_iface);
521 }
522
HTMLMimeTypesCollection_QueryInterface(IHTMLMimeTypesCollection * iface,REFIID riid,void ** ppv)523 static HRESULT WINAPI HTMLMimeTypesCollection_QueryInterface(IHTMLMimeTypesCollection *iface, REFIID riid, void **ppv)
524 {
525 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
526
527 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
528
529 if(IsEqualGUID(&IID_IUnknown, riid)) {
530 *ppv = &This->IHTMLMimeTypesCollection_iface;
531 }else if(IsEqualGUID(&IID_IHTMLMimeTypesCollection, riid)) {
532 *ppv = &This->IHTMLMimeTypesCollection_iface;
533 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
534 return *ppv ? S_OK : E_NOINTERFACE;
535 }else {
536 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
537 *ppv = NULL;
538 return E_NOINTERFACE;
539 }
540
541 IUnknown_AddRef((IUnknown*)*ppv);
542 return S_OK;
543 }
544
HTMLMimeTypesCollection_AddRef(IHTMLMimeTypesCollection * iface)545 static ULONG WINAPI HTMLMimeTypesCollection_AddRef(IHTMLMimeTypesCollection *iface)
546 {
547 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
548 LONG ref = InterlockedIncrement(&This->ref);
549
550 TRACE("(%p) ref=%d\n", This, ref);
551
552 return ref;
553 }
554
HTMLMimeTypesCollection_Release(IHTMLMimeTypesCollection * iface)555 static ULONG WINAPI HTMLMimeTypesCollection_Release(IHTMLMimeTypesCollection *iface)
556 {
557 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
558 LONG ref = InterlockedDecrement(&This->ref);
559
560 TRACE("(%p) ref=%d\n", This, ref);
561
562 if(!ref) {
563 if(This->navigator)
564 This->navigator->mime_types = NULL;
565 release_dispex(&This->dispex);
566 heap_free(This);
567 }
568
569 return ref;
570 }
571
HTMLMimeTypesCollection_GetTypeInfoCount(IHTMLMimeTypesCollection * iface,UINT * pctinfo)572 static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfoCount(IHTMLMimeTypesCollection *iface, UINT *pctinfo)
573 {
574 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
575 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
576 }
577
HTMLMimeTypesCollection_GetTypeInfo(IHTMLMimeTypesCollection * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)578 static HRESULT WINAPI HTMLMimeTypesCollection_GetTypeInfo(IHTMLMimeTypesCollection *iface, UINT iTInfo,
579 LCID lcid, ITypeInfo **ppTInfo)
580 {
581 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
582 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
583 }
584
HTMLMimeTypesCollection_GetIDsOfNames(IHTMLMimeTypesCollection * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)585 static HRESULT WINAPI HTMLMimeTypesCollection_GetIDsOfNames(IHTMLMimeTypesCollection *iface, REFIID riid,
586 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
587 {
588 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
589 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
590 lcid, rgDispId);
591 }
592
HTMLMimeTypesCollection_Invoke(IHTMLMimeTypesCollection * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)593 static HRESULT WINAPI HTMLMimeTypesCollection_Invoke(IHTMLMimeTypesCollection *iface, DISPID dispIdMember,
594 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
595 EXCEPINFO *pExcepInfo, UINT *puArgErr)
596 {
597 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
598 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
599 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
600 }
601
HTMLMimeTypesCollection_get_length(IHTMLMimeTypesCollection * iface,LONG * p)602 static HRESULT WINAPI HTMLMimeTypesCollection_get_length(IHTMLMimeTypesCollection *iface, LONG *p)
603 {
604 HTMLMimeTypesCollection *This = impl_from_IHTMLMimeTypesCollection(iface);
605
606 TRACE("(%p)->(%p)\n", This, p);
607
608 /* This is just a stub for compatibility with other browser in IE */
609 *p = 0;
610 return S_OK;
611 }
612
613 static const IHTMLMimeTypesCollectionVtbl HTMLMimeTypesCollectionVtbl = {
614 HTMLMimeTypesCollection_QueryInterface,
615 HTMLMimeTypesCollection_AddRef,
616 HTMLMimeTypesCollection_Release,
617 HTMLMimeTypesCollection_GetTypeInfoCount,
618 HTMLMimeTypesCollection_GetTypeInfo,
619 HTMLMimeTypesCollection_GetIDsOfNames,
620 HTMLMimeTypesCollection_Invoke,
621 HTMLMimeTypesCollection_get_length
622 };
623
624 static const tid_t HTMLMimeTypesCollection_iface_tids[] = {
625 IHTMLMimeTypesCollection_tid,
626 0
627 };
628 static dispex_static_data_t HTMLMimeTypesCollection_dispex = {
629 NULL,
630 IHTMLMimeTypesCollection_tid,
631 NULL,
632 HTMLMimeTypesCollection_iface_tids
633 };
634
create_mime_types_collection(OmNavigator * navigator,HTMLMimeTypesCollection ** ret)635 static HRESULT create_mime_types_collection(OmNavigator *navigator, HTMLMimeTypesCollection **ret)
636 {
637 HTMLMimeTypesCollection *col;
638
639 col = heap_alloc_zero(sizeof(*col));
640 if(!col)
641 return E_OUTOFMEMORY;
642
643 col->IHTMLMimeTypesCollection_iface.lpVtbl = &HTMLMimeTypesCollectionVtbl;
644 col->ref = 1;
645 col->navigator = navigator;
646
647 init_dispex(&col->dispex, (IUnknown*)&col->IHTMLMimeTypesCollection_iface,
648 &HTMLMimeTypesCollection_dispex);
649
650 *ret = col;
651 return S_OK;
652 }
653
impl_from_IOmNavigator(IOmNavigator * iface)654 static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface)
655 {
656 return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface);
657 }
658
OmNavigator_QueryInterface(IOmNavigator * iface,REFIID riid,void ** ppv)659 static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
660 {
661 OmNavigator *This = impl_from_IOmNavigator(iface);
662
663 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
664
665 if(IsEqualGUID(&IID_IUnknown, riid)) {
666 *ppv = &This->IOmNavigator_iface;
667 }else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
668 *ppv = &This->IOmNavigator_iface;
669 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
670 return *ppv ? S_OK : E_NOINTERFACE;
671 }else {
672 WARN("Unsupported interface %s\n", debugstr_mshtml_guid(riid));
673 *ppv = NULL;
674 return E_NOINTERFACE;
675 }
676
677 IUnknown_AddRef((IUnknown*)*ppv);
678 return S_OK;
679 }
680
OmNavigator_AddRef(IOmNavigator * iface)681 static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
682 {
683 OmNavigator *This = impl_from_IOmNavigator(iface);
684 LONG ref = InterlockedIncrement(&This->ref);
685
686 TRACE("(%p) ref=%d\n", This, ref);
687
688 return ref;
689 }
690
OmNavigator_Release(IOmNavigator * iface)691 static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
692 {
693 OmNavigator *This = impl_from_IOmNavigator(iface);
694 LONG ref = InterlockedDecrement(&This->ref);
695
696 TRACE("(%p) ref=%d\n", This, ref);
697
698 if(!ref) {
699 if(This->plugins)
700 This->plugins->navigator = NULL;
701 if(This->mime_types)
702 This->mime_types->navigator = NULL;
703 release_dispex(&This->dispex);
704 heap_free(This);
705 }
706
707 return ref;
708 }
709
OmNavigator_GetTypeInfoCount(IOmNavigator * iface,UINT * pctinfo)710 static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
711 {
712 OmNavigator *This = impl_from_IOmNavigator(iface);
713 FIXME("(%p)->(%p)\n", This, pctinfo);
714 return E_NOTIMPL;
715 }
716
OmNavigator_GetTypeInfo(IOmNavigator * iface,UINT iTInfo,LCID lcid,ITypeInfo ** ppTInfo)717 static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
718 LCID lcid, ITypeInfo **ppTInfo)
719 {
720 OmNavigator *This = impl_from_IOmNavigator(iface);
721
722 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
723 }
724
OmNavigator_GetIDsOfNames(IOmNavigator * iface,REFIID riid,LPOLESTR * rgszNames,UINT cNames,LCID lcid,DISPID * rgDispId)725 static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
726 LPOLESTR *rgszNames, UINT cNames,
727 LCID lcid, DISPID *rgDispId)
728 {
729 OmNavigator *This = impl_from_IOmNavigator(iface);
730
731 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
732 lcid, rgDispId);
733 }
734
OmNavigator_Invoke(IOmNavigator * iface,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS * pDispParams,VARIANT * pVarResult,EXCEPINFO * pExcepInfo,UINT * puArgErr)735 static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
736 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
737 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
738 {
739 OmNavigator *This = impl_from_IOmNavigator(iface);
740
741 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
742 pDispParams, pVarResult, pExcepInfo, puArgErr);
743 }
744
OmNavigator_get_appCodeName(IOmNavigator * iface,BSTR * p)745 static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
746 {
747 OmNavigator *This = impl_from_IOmNavigator(iface);
748
749 static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0};
750
751 TRACE("(%p)->(%p)\n", This, p);
752
753 *p = SysAllocString(mozillaW);
754 return S_OK;
755 }
756
OmNavigator_get_appName(IOmNavigator * iface,BSTR * p)757 static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
758 {
759 OmNavigator *This = impl_from_IOmNavigator(iface);
760
761 static const WCHAR app_nameW[] =
762 {'M','i','c','r','o','s','o','f','t',' ',
763 'I','n','t','e','r','n','e','t',' ',
764 'E','x','p','l','o','r','e','r',0};
765
766 TRACE("(%p)->(%p)\n", This, p);
767
768 *p = SysAllocString(app_nameW);
769 if(!*p)
770 return E_OUTOFMEMORY;
771
772 return S_OK;
773 }
774
OmNavigator_get_appVersion(IOmNavigator * iface,BSTR * p)775 static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
776 {
777 OmNavigator *This = impl_from_IOmNavigator(iface);
778
779 char user_agent[512];
780 DWORD size;
781 HRESULT hres;
782
783 TRACE("(%p)->(%p)\n", This, p);
784
785 size = sizeof(user_agent);
786 hres = ObtainUserAgentString(0, user_agent, &size);
787 if(FAILED(hres))
788 return hres;
789
790 if(strncmp(user_agent, "Mozilla/", 8)) {
791 FIXME("Unsupported user agent\n");
792 return E_FAIL;
793 }
794
795 size = MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, NULL, 0);
796 *p = SysAllocStringLen(NULL, size-1);
797 if(!*p)
798 return E_OUTOFMEMORY;
799
800 MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, *p, size);
801 return S_OK;
802 }
803
OmNavigator_get_userAgent(IOmNavigator * iface,BSTR * p)804 static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
805 {
806 OmNavigator *This = impl_from_IOmNavigator(iface);
807 char user_agent[512];
808 DWORD size;
809 HRESULT hres;
810
811 TRACE("(%p)->(%p)\n", This, p);
812
813 size = sizeof(user_agent);
814 hres = ObtainUserAgentString(0, user_agent, &size);
815 if(FAILED(hres))
816 return hres;
817
818 size = MultiByteToWideChar(CP_ACP, 0, user_agent, -1, NULL, 0);
819 *p = SysAllocStringLen(NULL, size-1);
820 if(!*p)
821 return E_OUTOFMEMORY;
822
823 MultiByteToWideChar(CP_ACP, 0, user_agent, -1, *p, size);
824 return S_OK;
825 }
826
OmNavigator_javaEnabled(IOmNavigator * iface,VARIANT_BOOL * enabled)827 static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
828 {
829 OmNavigator *This = impl_from_IOmNavigator(iface);
830
831 FIXME("(%p)->(%p) semi-stub\n", This, enabled);
832
833 *enabled = VARIANT_TRUE;
834 return S_OK;
835 }
836
OmNavigator_taintEnabled(IOmNavigator * iface,VARIANT_BOOL * enabled)837 static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
838 {
839 OmNavigator *This = impl_from_IOmNavigator(iface);
840 FIXME("(%p)->(%p)\n", This, enabled);
841 return E_NOTIMPL;
842 }
843
OmNavigator_get_mimeTypes(IOmNavigator * iface,IHTMLMimeTypesCollection ** p)844 static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
845 {
846 OmNavigator *This = impl_from_IOmNavigator(iface);
847
848 TRACE("(%p)->(%p)\n", This, p);
849
850 if(!This->mime_types) {
851 HRESULT hres;
852
853 hres = create_mime_types_collection(This, &This->mime_types);
854 if(FAILED(hres))
855 return hres;
856 }else {
857 IHTMLMimeTypesCollection_AddRef(&This->mime_types->IHTMLMimeTypesCollection_iface);
858 }
859
860 *p = &This->mime_types->IHTMLMimeTypesCollection_iface;
861 return S_OK;
862 }
863
OmNavigator_get_plugins(IOmNavigator * iface,IHTMLPluginsCollection ** p)864 static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
865 {
866 OmNavigator *This = impl_from_IOmNavigator(iface);
867
868 TRACE("(%p)->(%p)\n", This, p);
869
870 if(!This->plugins) {
871 HRESULT hres;
872
873 hres = create_plugins_collection(This, &This->plugins);
874 if(FAILED(hres))
875 return hres;
876 }else {
877 IHTMLPluginsCollection_AddRef(&This->plugins->IHTMLPluginsCollection_iface);
878 }
879
880 *p = &This->plugins->IHTMLPluginsCollection_iface;
881 return S_OK;
882 }
883
OmNavigator_get_cookieEnabled(IOmNavigator * iface,VARIANT_BOOL * p)884 static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
885 {
886 OmNavigator *This = impl_from_IOmNavigator(iface);
887
888 WARN("(%p)->(%p) semi-stub\n", This, p);
889
890 *p = VARIANT_TRUE;
891 return S_OK;
892 }
893
OmNavigator_get_opsProfile(IOmNavigator * iface,IHTMLOpsProfile ** p)894 static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
895 {
896 OmNavigator *This = impl_from_IOmNavigator(iface);
897 FIXME("(%p)->(%p)\n", This, p);
898 return E_NOTIMPL;
899 }
900
OmNavigator_toString(IOmNavigator * iface,BSTR * String)901 static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
902 {
903 OmNavigator *This = impl_from_IOmNavigator(iface);
904
905 static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
906
907 TRACE("(%p)->(%p)\n", This, String);
908
909 if(!String)
910 return E_INVALIDARG;
911
912 *String = SysAllocString(objectW);
913 return *String ? S_OK : E_OUTOFMEMORY;
914 }
915
OmNavigator_get_cpuClass(IOmNavigator * iface,BSTR * p)916 static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
917 {
918 OmNavigator *This = impl_from_IOmNavigator(iface);
919
920 static const WCHAR cpu_classW[] =
921 #ifdef _WIN64
922 {'x','6','4',0};
923 #else
924 {'x','8','6',0};
925 #endif
926
927 TRACE("(%p)->(%p)\n", This, p);
928
929 *p = SysAllocString(cpu_classW);
930 return *p ? S_OK : E_OUTOFMEMORY;
931 }
932
get_language_string(LCID lcid,BSTR * p)933 static HRESULT get_language_string(LCID lcid, BSTR *p)
934 {
935 BSTR ret;
936 int len;
937
938 len = LCIDToLocaleName(lcid, NULL, 0, 0);
939 if(!len) {
940 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
941 return E_FAIL;
942 }
943
944 ret = SysAllocStringLen(NULL, len-1);
945 if(!ret)
946 return E_OUTOFMEMORY;
947
948 len = LCIDToLocaleName(lcid, ret, len, 0);
949 if(!len) {
950 WARN("LCIDToLocaleName failed: %u\n", GetLastError());
951 SysFreeString(ret);
952 return E_FAIL;
953 }
954
955 *p = ret;
956 return S_OK;
957 }
958
OmNavigator_get_systemLanguage(IOmNavigator * iface,BSTR * p)959 static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
960 {
961 OmNavigator *This = impl_from_IOmNavigator(iface);
962
963 TRACE("(%p)->(%p)\n", This, p);
964
965 return get_language_string(LOCALE_SYSTEM_DEFAULT, p);
966 }
967
OmNavigator_get_browserLanguage(IOmNavigator * iface,BSTR * p)968 static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
969 {
970 OmNavigator *This = impl_from_IOmNavigator(iface);
971
972 TRACE("(%p)->(%p)\n", This, p);
973
974 return get_language_string(GetUserDefaultUILanguage(), p);
975 }
976
OmNavigator_get_userLanguage(IOmNavigator * iface,BSTR * p)977 static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
978 {
979 OmNavigator *This = impl_from_IOmNavigator(iface);
980
981 TRACE("(%p)->(%p)\n", This, p);
982
983 return get_language_string(LOCALE_USER_DEFAULT, p);
984 }
985
OmNavigator_get_platform(IOmNavigator * iface,BSTR * p)986 static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
987 {
988 OmNavigator *This = impl_from_IOmNavigator(iface);
989
990 #ifdef _WIN64
991 static const WCHAR platformW[] = {'W','i','n','6','4',0};
992 #else
993 static const WCHAR platformW[] = {'W','i','n','3','2',0};
994 #endif
995
996 TRACE("(%p)->(%p)\n", This, p);
997
998 *p = SysAllocString(platformW);
999 return S_OK;
1000 }
1001
OmNavigator_get_appMinorVersion(IOmNavigator * iface,BSTR * p)1002 static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
1003 {
1004 OmNavigator *This = impl_from_IOmNavigator(iface);
1005
1006 static const WCHAR zeroW[] = {'0',0};
1007
1008 TRACE("(%p)->(%p)\n", This, p);
1009
1010 /* NOTE: MSIE returns "0" or values like ";SP2;". Returning "0" should be enough. */
1011 *p = SysAllocString(zeroW);
1012 return S_OK;
1013 }
1014
OmNavigator_get_connectionSpeed(IOmNavigator * iface,LONG * p)1015 static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, LONG *p)
1016 {
1017 OmNavigator *This = impl_from_IOmNavigator(iface);
1018 FIXME("(%p)->(%p)\n", This, p);
1019 return E_NOTIMPL;
1020 }
1021
OmNavigator_get_onLine(IOmNavigator * iface,VARIANT_BOOL * p)1022 static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
1023 {
1024 OmNavigator *This = impl_from_IOmNavigator(iface);
1025
1026 WARN("(%p)->(%p) semi-stub, returning true\n", This, p);
1027
1028 *p = VARIANT_TRUE;
1029 return S_OK;
1030 }
1031
OmNavigator_get_userProfile(IOmNavigator * iface,IHTMLOpsProfile ** p)1032 static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
1033 {
1034 OmNavigator *This = impl_from_IOmNavigator(iface);
1035 FIXME("(%p)->(%p)\n", This, p);
1036 return E_NOTIMPL;
1037 }
1038
1039 static const IOmNavigatorVtbl OmNavigatorVtbl = {
1040 OmNavigator_QueryInterface,
1041 OmNavigator_AddRef,
1042 OmNavigator_Release,
1043 OmNavigator_GetTypeInfoCount,
1044 OmNavigator_GetTypeInfo,
1045 OmNavigator_GetIDsOfNames,
1046 OmNavigator_Invoke,
1047 OmNavigator_get_appCodeName,
1048 OmNavigator_get_appName,
1049 OmNavigator_get_appVersion,
1050 OmNavigator_get_userAgent,
1051 OmNavigator_javaEnabled,
1052 OmNavigator_taintEnabled,
1053 OmNavigator_get_mimeTypes,
1054 OmNavigator_get_plugins,
1055 OmNavigator_get_cookieEnabled,
1056 OmNavigator_get_opsProfile,
1057 OmNavigator_toString,
1058 OmNavigator_get_cpuClass,
1059 OmNavigator_get_systemLanguage,
1060 OmNavigator_get_browserLanguage,
1061 OmNavigator_get_userLanguage,
1062 OmNavigator_get_platform,
1063 OmNavigator_get_appMinorVersion,
1064 OmNavigator_get_connectionSpeed,
1065 OmNavigator_get_onLine,
1066 OmNavigator_get_userProfile
1067 };
1068
1069 static const tid_t OmNavigator_iface_tids[] = {
1070 IOmNavigator_tid,
1071 0
1072 };
1073 static dispex_static_data_t OmNavigator_dispex = {
1074 NULL,
1075 DispHTMLNavigator_tid,
1076 NULL,
1077 OmNavigator_iface_tids
1078 };
1079
OmNavigator_Create(void)1080 IOmNavigator *OmNavigator_Create(void)
1081 {
1082 OmNavigator *ret;
1083
1084 ret = heap_alloc_zero(sizeof(*ret));
1085 if(!ret)
1086 return NULL;
1087
1088 ret->IOmNavigator_iface.lpVtbl = &OmNavigatorVtbl;
1089 ret->ref = 1;
1090
1091 init_dispex(&ret->dispex, (IUnknown*)&ret->IOmNavigator_iface, &OmNavigator_dispex);
1092
1093 return &ret->IOmNavigator_iface;
1094 }
1095