ReactOS 0.4.15-dev-6694-g4ba8af9
htmldoc.c
Go to the documentation of this file.
1/*
2 * Copyright 2005-2009 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 "precomp.h"
20
21#include <idispids.h>
22#include <shlguid.h>
23#include <shdeprecated.h>
24#include <perhist.h>
25#include <exdispid.h>
26
27#include <initguid.h>
28#include <docobjectservice.h>
29
30DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
31DEFINE_GUID(IID_IProxyManager,0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
32DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
33DEFINE_GUID(SID_SContainerDispatch,0xb722be00,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
34
35#define DEFINE_EXPECT(func) \
36 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
37
38#define SET_EXPECT(func) \
39 expect_ ## func = TRUE
40
41#define SET_CALLED(func) \
42 called_ ## func = TRUE
43
44#define CHECK_EXPECT2(func) \
45 do { \
46 ok(expect_ ##func, "unexpected call " #func "\n"); \
47 called_ ## func = TRUE; \
48 }while(0)
49
50#define CHECK_EXPECT(func) \
51 do { \
52 CHECK_EXPECT2(func); \
53 expect_ ## func = FALSE; \
54 }while(0)
55
56#define CHECK_CALLED(func) \
57 do { \
58 ok(called_ ## func, "expected " #func "\n"); \
59 expect_ ## func = called_ ## func = FALSE; \
60 }while(0)
61
62#define CHECK_NOT_CALLED(func) \
63 do { \
64 ok(!called_ ## func, "unexpected " #func "\n"); \
65 expect_ ## func = called_ ## func = FALSE; \
66 }while(0)
67
68#define CHECK_CALLED_BROKEN(func) \
69 do { \
70 ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
71 expect_ ## func = called_ ## func = FALSE; \
72 }while(0)
73
74#define CLEAR_CALLED(func) \
75 expect_ ## func = called_ ## func = FALSE
76
77
80
81DEFINE_EXPECT(LockContainer);
82DEFINE_EXPECT(SetActiveObject);
83DEFINE_EXPECT(SetActiveObject_null);
85DEFINE_EXPECT(CanInPlaceActivate);
86DEFINE_EXPECT(OnInPlaceActivate);
87DEFINE_EXPECT(OnInPlaceActivateEx);
88DEFINE_EXPECT(OnUIActivate);
89DEFINE_EXPECT(GetWindowContext);
90DEFINE_EXPECT(OnUIDeactivate);
91DEFINE_EXPECT(OnInPlaceDeactivate);
92DEFINE_EXPECT(OnInPlaceDeactivateEx);
93DEFINE_EXPECT(GetContainer);
95DEFINE_EXPECT(ActivateMe);
96DEFINE_EXPECT(GetHostInfo);
98DEFINE_EXPECT(GetOptionKeyPath);
99DEFINE_EXPECT(GetOverrideKeyPath);
100DEFINE_EXPECT(SetStatusText);
101DEFINE_EXPECT(QueryStatus_SETPROGRESSTEXT);
102DEFINE_EXPECT(QueryStatus_OPEN);
103DEFINE_EXPECT(QueryStatus_NEW);
104DEFINE_EXPECT(Exec_SETPROGRESSMAX);
105DEFINE_EXPECT(Exec_SETPROGRESSPOS);
106DEFINE_EXPECT(Exec_HTTPEQUIV_DONE);
107DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_0);
108DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_1);
109DEFINE_EXPECT(Exec_ShellDocView_37);
110DEFINE_EXPECT(Exec_ShellDocView_62);
111DEFINE_EXPECT(Exec_ShellDocView_63);
112DEFINE_EXPECT(Exec_ShellDocView_67);
113DEFINE_EXPECT(Exec_ShellDocView_84);
114DEFINE_EXPECT(Exec_ShellDocView_103);
115DEFINE_EXPECT(Exec_ShellDocView_105);
116DEFINE_EXPECT(Exec_ShellDocView_138);
117DEFINE_EXPECT(Exec_ShellDocView_140);
118DEFINE_EXPECT(Exec_DocHostCommandHandler_2300);
119DEFINE_EXPECT(Exec_UPDATECOMMANDS);
120DEFINE_EXPECT(Exec_SETTITLE);
121DEFINE_EXPECT(Exec_HTTPEQUIV);
122DEFINE_EXPECT(Exec_MSHTML_PARSECOMPLETE);
123DEFINE_EXPECT(Exec_Explorer_38);
124DEFINE_EXPECT(Exec_Explorer_69);
125DEFINE_EXPECT(Exec_DOCCANNAVIGATE);
126DEFINE_EXPECT(Exec_DOCCANNAVIGATE_NULL);
127DEFINE_EXPECT(Invoke_AMBIENT_USERMODE);
128DEFINE_EXPECT(Invoke_AMBIENT_DLCONTROL);
129DEFINE_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
130DEFINE_EXPECT(Invoke_AMBIENT_SILENT);
131DEFINE_EXPECT(Invoke_AMBIENT_USERAGENT);
132DEFINE_EXPECT(Invoke_AMBIENT_PALETTE);
133DEFINE_EXPECT(Invoke_OnReadyStateChange_Interactive);
134DEFINE_EXPECT(Invoke_OnReadyStateChange_Loading);
135DEFINE_EXPECT(Invoke_OnReadyStateChange_Complete);
136DEFINE_EXPECT(GetDropTarget);
139DEFINE_EXPECT(OnFrameWindowActivate);
140DEFINE_EXPECT(OnChanged_READYSTATE);
141DEFINE_EXPECT(OnChanged_1005);
142DEFINE_EXPECT(OnChanged_1012);
143DEFINE_EXPECT(OnChanged_1014);
145DEFINE_EXPECT(BindToStorage);
146DEFINE_EXPECT(IsSystemMoniker);
147DEFINE_EXPECT(GetBindResult);
148DEFINE_EXPECT(GetClassID);
151DEFINE_EXPECT(CreateInstance);
153DEFINE_EXPECT(Terminate);
157DEFINE_EXPECT(OnFocus_TRUE);
158DEFINE_EXPECT(OnFocus_FALSE);
159DEFINE_EXPECT(RequestUIActivate);
162DEFINE_EXPECT(GetExternal);
163DEFINE_EXPECT(EnableModeless_TRUE);
164DEFINE_EXPECT(EnableModeless_FALSE);
165DEFINE_EXPECT(Frame_EnableModeless_TRUE);
166DEFINE_EXPECT(Frame_EnableModeless_FALSE);
168DEFINE_EXPECT(TranslateUrl);
169DEFINE_EXPECT(Advise_Close);
170DEFINE_EXPECT(OnViewChange);
171DEFINE_EXPECT(EvaluateNewWindow);
172DEFINE_EXPECT(GetTravelLog);
173DEFINE_EXPECT(UpdateBackForwardState);
174DEFINE_EXPECT(FireBeforeNavigate2);
175DEFINE_EXPECT(FireNavigateComplete2);
176DEFINE_EXPECT(FireDocumentComplete);
177DEFINE_EXPECT(GetPendingUrl);
178DEFINE_EXPECT(ActiveElementChanged);
179DEFINE_EXPECT(IsErrorUrl);
180DEFINE_EXPECT(get_LocationURL);
181DEFINE_EXPECT(CountEntries);
182DEFINE_EXPECT(FindConnectionPoint);
185DEFINE_EXPECT(WindowClosing);
186DEFINE_EXPECT(NavigateWithBindCtx);
187
207static enum load_state_t {
213 LD_NO
215
216static LPCOLESTR expect_status_text = NULL;
217static const char *nav_url, *nav_serv_url, *prev_url;
218
219static const char html_page[] =
220"<html>"
221"<head><link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\"></head>"
222"<body><div>test</div></body>"
223"</html>";
224
225static const char css_data[] = "body {color: red; margin: 0}";
226
227static const WCHAR http_urlW[] =
228 {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/','t','e','s','t','s','/','w','i','n','e','h','q','_','s','n','a','p','s','h','o','t','/',0};
229
230static const WCHAR doc_url[] = {'w','i','n','e','t','e','s','t',':','d','o','c',0};
231
232#define DOCHOST_DOCCANNAVIGATE 0
233#define WM_CONTINUE_BINDING (WM_APP+1)
234
235static HRESULT QueryInterface(REFIID riid, void **ppv);
236static void test_MSHTML_QueryStatus(IHTMLDocument2*,DWORD);
237
238#define test_readyState(u) _test_readyState(__LINE__,u)
239static void _test_readyState(unsigned,IUnknown*);
240
241static const WCHAR wszTimesNewRoman[] =
242 {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
243static const WCHAR wszArial[] =
244 {'A','r','i','a','l',0};
245
246static int strcmp_wa(LPCWSTR strw, const char *stra)
247{
248 CHAR buf[512];
249 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
250 return lstrcmpA(stra, buf);
251}
252
253static BOOL wstr_contains(const WCHAR *strw, const char *stra)
254{
255 CHAR buf[512];
256 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
257 return strstr(buf, stra) != NULL;
258}
259
260static const WCHAR *strstrW( const WCHAR *str, const WCHAR *sub )
261{
262 while (*str)
263 {
264 const WCHAR *p1 = str, *p2 = sub;
265 while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
266 if (!*p2) return str;
267 str++;
268 }
269 return NULL;
270}
271
272static BSTR a2bstr(const char *str)
273{
274 BSTR ret;
275 int len;
276
277 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
280
281 return ret;
282}
283
284/* Returns true if the user interface is in English. Note that this does not
285 * presume of the formatting of dates, numbers, etc.
286 */
288{
289 static HMODULE hkernel32 = NULL;
290 static LANGID (WINAPI *pGetThreadUILanguage)(void) = NULL;
291 static LANGID (WINAPI *pGetUserDefaultUILanguage)(void) = NULL;
292
293 if (!hkernel32)
294 {
295 hkernel32 = GetModuleHandleA("kernel32.dll");
296 pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, "GetThreadUILanguage");
297 pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage");
298 }
299 if (pGetThreadUILanguage)
300 return PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH;
301 if (pGetUserDefaultUILanguage)
302 return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH;
303
305}
306
307static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
308{
309 IUnknown *unk1, *unk2;
310
311 if(iface1 == iface2)
312 return TRUE;
313
314 IUnknown_QueryInterface(iface1, &IID_IUnknown, (void**)&unk1);
315 IUnknown_Release(unk1);
316 IUnknown_QueryInterface(iface2, &IID_IUnknown, (void**)&unk2);
317 IUnknown_Release(unk2);
318
319 return unk1 == unk2;
320}
321
322#define EXPECT_UPDATEUI 1
323#define EXPECT_SETTITLE 2
324
326{
327 BOOL *b = &called_Exec_SETTITLE;
328 MSG msg;
329
330 if(flags & EXPECT_UPDATEUI) {
331 SET_EXPECT(UpdateUI);
332 SET_EXPECT(Exec_UPDATECOMMANDS);
333 b = &called_UpdateUI;
334 }
336 SET_EXPECT(Exec_SETTITLE);
337
338 while(!*b && GetMessageA(&msg, doc_hwnd, 0, 0)) {
341 }
342
343 if(flags & EXPECT_UPDATEUI) {
344 CHECK_CALLED(UpdateUI);
345 CHECK_CALLED(Exec_UPDATECOMMANDS);
346 }
348 CHECK_CALLED(Exec_SETTITLE);
349}
350
352
353#define test_GetCurMoniker(u,m,v,t) _test_GetCurMoniker(__LINE__,u,m,v,t)
354static void _test_GetCurMoniker(unsigned line, IUnknown *unk, IMoniker *exmon, const char *exurl, BOOL is_todo)
355{
356 IHTMLDocument2 *doc;
357 IPersistMoniker *permon;
358 IMoniker *mon = (void*)0xdeadbeef;
359 BSTR doc_url = (void*)0xdeadbeef;
360 const WCHAR *ptr;
362
363 if(open_call)
364 return; /* FIXME */
365
366 hres = IUnknown_QueryInterface(unk, &IID_IPersistMoniker, (void**)&permon);
367 ok(hres == S_OK, "QueryInterface(IID_IPersistMoniker) failed: %08x\n", hres);
368 if(FAILED(hres))
369 return;
370
371 hres = IUnknown_QueryInterface(unk, &IID_IHTMLDocument2, (void**)&doc);
372 ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument2) failed: %08x\n", hres);
373
374 hres = IHTMLDocument2_get_URL(doc, &doc_url);
375 ok(hres == S_OK, "get_URL failed: %08x\n", hres);
376 for(ptr = doc_url; *ptr && *ptr != '#'; ptr++);
377
378 hres = IPersistMoniker_GetCurMoniker(permon, &mon);
379 IPersistMoniker_Release(permon);
380
381 if(exmon) {
383 BOOL exb = expect_GetDisplayName;
384 BOOL clb = called_GetDisplayName;
385
386 ok_(__FILE__,line)(hres == S_OK, "GetCurrentMoniker failed: %08x\n", hres);
387 ok_(__FILE__,line)(mon == exmon, "mon(%p) != exmon(%p)\n", mon, exmon);
388
389 if(mon == &Moniker)
391 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url);
392 ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
393 if(mon == &Moniker)
395 expect_GetDisplayName = exb;
396 called_GetDisplayName = clb;
397
398 if(!*ptr)
399 ok(!lstrcmpW(url, doc_url), "url %s != doc_url %s\n", wine_dbgstr_w(url), wine_dbgstr_w(doc_url));
400 else
401 ok(!strcmp_wa(url, nav_serv_url), "url = %s, expected %s\n", wine_dbgstr_w(url), nav_serv_url);
403 }else if(exurl) {
405
406 ok_(__FILE__,line)(hres == S_OK, "GetCurrentMoniker failed: %08x\n", hres);
407
408 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url);
409 ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
410
411 if(is_todo)
412 todo_wine ok_(__FILE__,line)(!strcmp_wa(url, exurl), "unexpected url %s\n", wine_dbgstr_w(url));
413 else
414 ok_(__FILE__,line)(!strcmp_wa(url, exurl), "unexpected url %s\n", wine_dbgstr_w(url));
415 if(!*ptr)
416 ok_(__FILE__,line)(!lstrcmpW(url, doc_url), "url %s != doc_url %s\n", wine_dbgstr_w(url), wine_dbgstr_w(doc_url));
417
419 }else {
420 ok_(__FILE__,line)(hres == E_UNEXPECTED,
421 "GetCurrentMoniker failed: %08x, expected E_UNEXPECTED\n", hres);
422 ok_(__FILE__,line)(mon == (IMoniker*)0xdeadbeef, "mon=%p\n", mon);
423 ok_(__FILE__,line)(!strcmp_wa(doc_url, "about:blank"), "doc_url is not about:blank\n");
424 }
425
427 IHTMLDocument2_Release(doc);
428 if(mon && mon != (void*)0xdeadbeef)
429 IMoniker_Release(mon);
430}
431
432#define test_current_url(a,b) _test_current_url(__LINE__,a,b)
433static void _test_current_url(unsigned line, IUnknown *unk, const char *exurl)
434{
435 IHTMLDocument2 *doc;
436 BSTR url;
438
439 hres = IUnknown_QueryInterface(unk, &IID_IHTMLDocument2, (void**)&doc);
440 ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IHTMLDocument2) failed: %08x\n", hres);
441
442 hres = IHTMLDocument2_get_URL(doc, &url);
443 ok_(__FILE__,line)(hres == S_OK, "get_URL failed: %08x\n", hres);
444 ok_(__FILE__,line)(!strcmp_wa(url, exurl), "Unexpected URL %s, expected %s\n", wine_dbgstr_w(url), exurl);
446
447 IHTMLDocument2_Release(doc);
448}
449
450DEFINE_GUID(IID_External_unk,0x30510406,0x98B5,0x11CF,0xBB,0x82,0x00,0xAA,0x00,0xBD,0xCE,0x0B);
451
453{
454 *ppv = NULL;
455
457 *ppv = iface;
458 return S_OK;
459 }
460
462 return E_NOINTERFACE; /* TODO */
463 if(IsEqualGUID(&IID_IDispatchEx, riid))
464 return E_NOINTERFACE; /* TODO */
465 if(IsEqualGUID(&IID_External_unk, riid))
466 return E_NOINTERFACE; /* TODO */
467
469 ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid));
470 return E_NOINTERFACE;
471}
472
474{
475 return 2;
476}
477
479{
480 return 1;
481}
482
484{
485 ok(0, "unexpected call\n");
486 return E_NOTIMPL;
487}
488
490 ITypeInfo **ppTInfo)
491{
492 ok(0, "unexpected call\n");
493 return E_NOTIMPL;
494}
495
497 UINT cNames, LCID lcid, DISPID *rgDispId)
498{
499 ok(0, "unexpected call\n");
500 return E_NOTIMPL;
501}
502
504 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
505 EXCEPINFO *pExcepInfo, UINT *puArgErr)
506{
507 ok(0, "unexpected call\n");
508 return E_NOTIMPL;
509}
510
511static const IDispatchVtbl ExternalVtbl = {
519};
520
522
524{
525 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
526 *ppv = iface;
527 return S_OK;
528 }
529
530 *ppv = NULL;
531 return E_NOINTERFACE;
532}
533
535{
536 return 2;
537}
538
540{
541 return 1;
542}
543
545 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
547{
548 BINDINFO bindinfo;
549 DWORD bindf = 0;
551
552 static const WCHAR wszTextCss[] = {'t','e','x','t','/','c','s','s',0};
553 static const WCHAR empty_str = {0};
554
556
557 ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
558 ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
559 ok(!grfPI, "grfPI = %x\n", grfPI);
560 ok(!dwReserved, "dwReserved = %lx\n", dwReserved);
561
562 memset(&bindinfo, 0, sizeof(bindinfo));
563 bindinfo.cbSize = sizeof(bindinfo);
564 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bindf, &bindinfo);
565 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
566 if(!testing_submit)
567 ok(bindf == (BINDF_FROMURLMON|BINDF_PULLDATA|BINDF_NEEDFILE|BINDF_ASYNCSTORAGE|BINDF_ASYNCHRONOUS),
568 "bindf = %x\n", bindf);
569 else
570 ok(bindf == (BINDF_FROMURLMON|BINDF_FORMS_SUBMIT|BINDF_PRAGMA_NO_CACHE|BINDF_HYPERLINK
571 |BINDF_PULLDATA|BINDF_NEEDFILE|BINDF_GETNEWESTVERSION|BINDF_ASYNCSTORAGE|BINDF_ASYNCHRONOUS),
572 "bindf = %x\n", bindf);
573
574 ok(bindinfo.cbSize == sizeof(bindinfo), "bindinfo.cbSize=%d\n", bindinfo.cbSize);
575 ok(bindinfo.szExtraInfo == NULL, "bindinfo.szExtraInfo=%p\n", bindinfo.szExtraInfo);
576 /* TODO: test stgmedData */
577 ok(bindinfo.grfBindInfoF == 0, "bindinfo.grfBinfInfoF=%08x\n", bindinfo.grfBindInfoF);
578 if(!testing_submit) {
579 ok(bindinfo.dwBindVerb == BINDVERB_GET, "bindinfo.dwBindVerb=%d\n", bindinfo.dwBindVerb);
580 ok(bindinfo.cbstgmedData == 0, "bindinfo.cbstgmedData=%d\n", bindinfo.cbstgmedData);
581 ok(bindinfo.stgmedData.tymed == TYMED_NULL, "bindinfo.stgmedData.tymed=%d\n", bindinfo.stgmedData.tymed);
582 }else {
583 ok(bindinfo.dwBindVerb == BINDVERB_POST, "bindinfo.dwBindVerb=%d\n", bindinfo.dwBindVerb);
584 ok(bindinfo.cbstgmedData == 8, "bindinfo.cbstgmedData=%d\n", bindinfo.cbstgmedData);
585 ok(bindinfo.stgmedData.tymed == TYMED_HGLOBAL, "bindinfo.stgmedData.tymed=%d\n", bindinfo.stgmedData.tymed);
586 ok(!memcmp(U(bindinfo.stgmedData).hGlobal, "cmd=TEST", 8), "unexpected hGlobal\n");
587 }
588 ok(bindinfo.szCustomVerb == 0, "bindinfo.szCustomVerb=%p\n", bindinfo.szCustomVerb);
589 ok(bindinfo.dwOptions == 0x80000 ||
590 bindinfo.dwOptions == 0x4080000, /* win2k3 */
591 "bindinfo.dwOptions=%x\n", bindinfo.dwOptions);
592 ok(bindinfo.dwOptionsFlags == 0, "bindinfo.dwOptionsFlags=%d\n", bindinfo.dwOptionsFlags);
593 /* TODO: test dwCodePage */
594 /* TODO: test securityAttributes */
595 ok(IsEqualGUID(&IID_NULL, &bindinfo.iid), "unexpected bindinfo.iid\n");
596 ok(bindinfo.pUnk == NULL, "bindinfo.pUnk=%p\n", bindinfo.pUnk);
597 ok(bindinfo.dwReserved == 0, "bindinfo.dwReserved=%d\n", bindinfo.dwReserved);
598
599 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
600 BINDSTATUS_CACHEFILENAMEAVAILABLE, &empty_str);
601 ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
602
603 if(report_mime) {
604 hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
605 BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextCss);
606 ok(hres == S_OK,
607 "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
608 }
609
610 hres = IInternetProtocolSink_ReportData(pOIProtSink,
611 BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION, 13, 13);
612 ok(hres == S_OK, "ReportData failed: %08x\n", hres);
613
614 hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
615 ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
616
617 return S_OK;
618}
619
621 PROTOCOLDATA *pProtocolData)
622{
623 ok(0, "unexpected call\n");
624 return E_NOTIMPL;
625}
626
629{
630 ok(0, "unexpected call\n");
631 return E_NOTIMPL;
632}
633
635{
636 CHECK_EXPECT(Terminate);
637 return S_OK;
638}
639
641{
642 ok(0, "unexpected call\n");
643 return E_NOTIMPL;
644}
645
647{
648 ok(0, "unexpected call\n");
649 return E_NOTIMPL;
650}
651
653 ULONG cb, ULONG *pcbRead)
654{
656
657 ok(pv != NULL, "pv == NULL\n");
658 ok(cb > sizeof(css_data), "cb < sizeof(css_data)\n");
659 ok(pcbRead != NULL, "pcbRead == NULL\n");
660 ok(!*pcbRead || *pcbRead==sizeof(css_data)-1, "*pcbRead=%d\n", *pcbRead);
661
662 if(protocol_read)
663 return S_FALSE;
664
665 protocol_read += *pcbRead = sizeof(css_data)-1;
666 memcpy(pv, css_data, sizeof(css_data)-1);
667
668 return S_OK;
669}
670
672 LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
673{
674 ok(0, "unexpected call\n");
675 return E_NOTIMPL;
676}
677
679{
681 return S_OK;
682}
683
685{
687 return S_OK;
688}
689
690static const IInternetProtocolVtbl ProtocolVtbl = {
704};
705
707
709{
710 if(!IsEqualGUID(&IID_IInternetProtocolInfo, riid))
711 ok(0, "unexpected call\n");
712 return E_NOINTERFACE;
713}
714
716{
717 return 2;
718}
719
721{
722 return 1;
723}
724
726 REFIID riid, void **ppv)
727{
728 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
729 return E_NOINTERFACE;
730
731 CHECK_EXPECT(CreateInstance);
732 ok(ppv != NULL, "ppv == NULL\n");
733
734 *ppv = &Protocol;
735 return S_OK;
736}
737
739{
740 ok(0, "unexpected call\n");
741 return S_OK;
742}
743
744static const IClassFactoryVtbl ClassFactoryVtbl = {
750};
751
753
755{
756 ok(0, "unexpected call\n");
757 return E_NOTIMPL;
758}
759
761{
762 return 2;
763}
764
766{
767 return 1;
768}
769
771 IHlinkBrowseContext *pihlbc)
772{
773 ok(0, "unexpected call\n");
774 return E_NOTIMPL;
775}
776
778 IHlinkBrowseContext **ppihlbc)
779{
780 ok(0, "unexpected call\n");
781 return E_NOTIMPL;
782}
783
785 IBindStatusCallback *pibsc, IHlink *pihlNavigate)
786{
788
789 CHECK_EXPECT(Navigate);
790
791 ok(grfHLNF == 0, "grfHLNF=%d, expected 0\n", grfHLNF);
792 ok(pbc != NULL, "pbc == NULL\n");
793 ok(pibsc != NULL, "pubsc == NULL\n");
794 ok(pihlNavigate != NULL, "puhlNavigate == NULL\n");
795
796 if(pihlNavigate) {
797 LPWSTR frame_name = (LPWSTR)0xdeadbeef;
798 LPWSTR location = (LPWSTR)0xdeadbeef;
800 IMoniker *mon = NULL;
801 DWORD site_data = 0xdeadbeef;
802
803 hres = IHlink_GetTargetFrameName(pihlNavigate, &frame_name);
804 ok(hres == S_FALSE, "GetTargetFrameName failed: %08x\n", hres);
805 ok(frame_name == NULL, "frame_name = %p\n", frame_name);
806
807 hres = IHlink_GetMonikerReference(pihlNavigate, 1, &mon, &location);
808 ok(hres == S_OK, "GetMonikerReference failed: %08x\n", hres);
809 ok(location == NULL, "location = %p\n", location);
810 ok(mon != NULL, "mon == NULL\n");
811
812 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &location);
813 ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
814 ok(!strcmp_wa(location, nav_url), "unexpected display name %s, expected %s\n", wine_dbgstr_w(location), nav_url);
816 IMoniker_Release(mon);
817
818 hres = IHlink_GetHlinkSite(pihlNavigate, &site, &site_data);
819 ok(hres == S_OK, "GetHlinkSite failed: %08x\n", hres);
820 ok(site == NULL, "site = %p\n, expected NULL\n", site);
821 ok(site_data == 0xdeadbeef, "site_data = %x\n", site_data);
822 }
823
824 return S_OK;
825}
826
828 IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName, DWORD dwreserved)
829{
830 ok(0, "unexpected call\n");
831 return E_NOTIMPL;
832}
833
835 IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName)
836{
837 ok(0, "unexpected call\n");
838 return E_NOTIMPL;
839}
840
841static const IHlinkFrameVtbl HlinkFrameVtbl = {
850};
851
853
855{
856 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(riid, &IID_INewWindowManager)) {
857 *ppv = iface;
858 return S_OK;
859 }
860
861 trace("NewWindowManager_QueryInterface %s\n", wine_dbgstr_guid(riid));
862 *ppv = NULL;
863 return E_NOINTERFACE;
864}
865
867{
868 return 2;
869}
870
872{
873 return 1;
874}
875
877 LPCWSTR pszName, LPCWSTR pszUrlContext, LPCWSTR pszFeatures, BOOL fReplace, DWORD dwFlags,
878 DWORD dwUserActionTime)
879{
880 CHECK_EXPECT(EvaluateNewWindow);
881
882 ok(!strcmp_wa(pszUrl, "about:blank"), "pszUrl = %s\n", wine_dbgstr_w(pszUrl));
883 ok(!strcmp_wa(pszName, "test"), "pszName = %s\n", wine_dbgstr_w(pszName));
884 ok(!strcmp_wa(pszUrlContext, prev_url), "pszUrlContext = %s\n", wine_dbgstr_w(pszUrlContext));
885 ok(!pszFeatures, "pszFeatures = %s\n", wine_dbgstr_w(pszFeatures));
886 ok(!fReplace, "fReplace = %x\n", fReplace);
887 ok(dwFlags == (allow_new_window ? 0 : NWMF_FIRST), "dwFlags = %x\n", dwFlags);
888 ok(!dwUserActionTime, "dwUserActionime = %d\n", dwUserActionTime);
889
890 return allow_new_window ? S_OK : E_FAIL;
891}
892
893static const INewWindowManagerVtbl NewWindowManagerVtbl = {
898};
899
901
903 REFIID riid, void**ppv)
904{
906 *ppv = iface;
907 return S_OK;
908 }
909
910 ok(0, "unexpected call\n");
911 return E_NOINTERFACE;
912}
913
915{
916 return 2;
917}
918
920{
921 return 1;
922}
923
925{
927 return S_OK;
928
929 switch(dispID) {
931 CHECK_EXPECT2(OnChanged_READYSTATE);
932
934 test_MSHTML_QueryStatus(NULL, OLECMDF_SUPPORTED
936 ? OLECMDF_ENABLED : 0));
937
941 }
942 if(!editmode || load_state != LD_LOADING || !called_Exec_Explorer_69)
944 return S_OK;
945 case 1005:
946 CHECK_EXPECT2(OnChanged_1005);
947 if(!editmode)
950 return S_OK;
951 case 1012:
952 CHECK_EXPECT2(OnChanged_1012);
953 return S_OK;
954 case 1014:
955 CHECK_EXPECT2(OnChanged_1014);
956 return S_OK;
957 case 1030:
958 case 3000022:
959 case 3000023:
960 case 3000024:
961 case 3000025:
962 case 3000026:
963 case 3000027:
964 case 3000028:
965 case 3000029:
966 case 3000030:
967 case 3000031:
968 case 3000032:
969 /* TODO */
970 return S_OK;
971 }
972
973 ok(0, "unexpected id %d\n", dispID);
974 return E_NOTIMPL;
975}
976
978{
979 ok(0, "unexpected call\n");
980 return E_NOTIMPL;
981}
982
983static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
989};
990
992
994{
995 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ISequentialStream, riid) || IsEqualGUID(&IID_IStream, riid)) {
996 *ppv = iface;
997 return S_OK;
998 }
999
1000 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
1001 *ppv = NULL;
1002 return E_NOINTERFACE;
1003}
1004
1006{
1007 return 2;
1008}
1009
1011{
1012 return 1;
1013}
1014
1015static HRESULT WINAPI Stream_Read(IStream *iface, void *pv,
1016 ULONG cb, ULONG *pcbRead)
1017{
1019 ok(pv != NULL, "pv == NULL\n");
1020 ok(cb > sizeof(html_page), "cb = %d\n", cb);
1021 ok(pcbRead != NULL, "pcbRead == NULL\n");
1022 ok(!*pcbRead, "*pcbRead = %d\n", *pcbRead);
1023
1024 if(stream_read)
1025 return S_FALSE;
1026
1027 memcpy(pv, html_page, sizeof(html_page)-1);
1028 stream_read += *pcbRead = sizeof(html_page)-1;
1029 return S_OK;
1030}
1031
1032static HRESULT WINAPI Stream_Write(IStream *iface, const void *pv,
1033 ULONG cb, ULONG *pcbWritten)
1034{
1035 ok(0, "unexpected call\n");
1036 return E_NOTIMPL;
1037}
1038
1040 DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
1041{
1042 ok(0, "unexpected call\n");
1043 return E_NOTIMPL;
1044}
1045
1047{
1048 ok(0, "unexpected call\n");
1049 return E_NOTIMPL;
1050}
1051
1053 ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
1054{
1055 ok(0, "unexpected call\n");
1056 return E_NOTIMPL;
1057}
1058
1059static HRESULT WINAPI Stream_Commit(IStream *iface, DWORD grfCommitFlags)
1060{
1061 ok(0, "unexpected call\n");
1062 return E_NOTIMPL;
1063}
1064
1066{
1067 ok(0, "unexpected call\n");
1068 return E_NOTIMPL;
1069}
1070
1072 ULARGE_INTEGER cb, DWORD dwLockType)
1073{
1074 ok(0, "unexpected call\n");
1075 return E_NOTIMPL;
1076}
1077
1079 ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
1080{
1081 ok(0, "unexpected call\n");
1082 return E_NOTIMPL;
1083}
1084
1085static HRESULT WINAPI Stream_Stat(IStream *iface, STATSTG *pstatstg,
1086 DWORD dwStatFlag)
1087{
1088 ok(0, "unexpected call\n");
1089 return E_NOTIMPL;
1090}
1091
1093{
1094 ok(0, "unexpected call\n");
1095 return E_NOTIMPL;
1096}
1097
1098static const IStreamVtbl StreamVtbl = {
1113};
1114
1116
1119 REFIID riid,
1120 void **ppvObject)
1121{
1122 *ppvObject = NULL;
1123
1124 if(IsEqualGUID(&IID_IGetBindHandle, riid))
1125 return E_NOINTERFACE;
1126
1127 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
1128 return E_NOINTERFACE;
1129}
1130
1133{
1134 return 2;
1135}
1136
1139{
1140 return 1;
1141}
1142
1145 DWORD dwOption,
1147 DWORD *pcbBuf)
1148{
1149 return E_NOTIMPL; /* TODO */
1150}
1151
1154 DWORD dwOption,
1156 DWORD *pcbBuf,
1157 DWORD *pdwFlags,
1159{
1160 ok(pdwReserved == NULL, "pdwReserved != NULL\n");
1161
1163 ok(pBuffer != NULL, "pBuffer == NULL\n");
1164 ok(*pcbBuf == sizeof(DWORD), "*pcbBuf = %d\n", *pcbBuf);
1165 ok(pdwFlags == NULL, "*pdwFlags != NULL\n");
1166 *((DWORD*)pBuffer) = status_code;
1167 return S_OK;
1168 }
1169
1170 return E_NOTIMPL; /* TODO */
1171}
1172
1173static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = {
1179};
1180
1182
1183DEFINE_GUID(IID_unk_binding, 0xf3d8f080,0xa5eb,0x476f,0x9d,0x19,0xa5,0xef,0x24,0xe5,0xc2,0xe6);
1184
1186{
1188 *ppv = iface;
1189 return S_OK;
1190 }
1191
1192 if(IsEqualGUID(&IID_IWinInetInfo, riid) || IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
1193 *ppv = &WinInetHttpInfo;
1194 return S_OK;
1195 }
1196
1197 if(IsEqualGUID(&IID_unk_binding, riid)) {
1198 *ppv = NULL;
1199 return E_NOINTERFACE;
1200 }
1201
1202 trace("Binding::QI(%s)\n", wine_dbgstr_guid(riid));
1203 *ppv = NULL;
1204 return E_NOINTERFACE;
1205}
1206
1208{
1209 return 2;
1210}
1211
1213{
1214 return 1;
1215}
1216
1218{
1219 CHECK_EXPECT(Abort);
1222 return S_OK;
1223}
1224
1226{
1227 ok(0, "unexpected call\n");
1228 return E_NOTIMPL;
1229}
1230
1232{
1233 ok(0, "unexpected call\n");
1234 return E_NOTIMPL;
1235}
1236
1238{
1239 ok(0, "unexpected call\n");
1240 return E_NOTIMPL;
1241}
1242
1244{
1245 ok(0, "unexpected call\n");
1246 return E_NOTIMPL;
1247}
1248
1249static HRESULT WINAPI Binding_GetBindResult(IBinding *iface, CLSID *pclsidProtocol,
1250 DWORD *pdwResult, LPOLESTR *pszResult, DWORD *pdwReserved)
1251{
1252 CHECK_EXPECT(GetBindResult);
1253 return E_NOTIMPL;
1254}
1255
1256static const IBindingVtbl BindingVtbl = {
1266};
1267
1269
1270DEFINE_GUID(IID_IMoniker_unk,0xA158A630,0xED6F,0x45FB,0xB9,0x87,0xF6,0x86,0x76,0xF5,0x77,0x52);
1271DEFINE_GUID(IID_IMoniker_unk2, 0x79EAC9D3,0xBAF9,0x11CE,0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B);
1272
1274{
1275 *ppv = NULL;
1276
1277 if(IsEqualGUID(&IID_IMoniker_unk, riid))
1278 return E_NOINTERFACE; /* TODO */
1279 if(IsEqualGUID(&IID_IMoniker_unk2, riid))
1280 return E_NOINTERFACE; /* TODO */
1281
1282 ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid));
1283 return E_NOINTERFACE;
1284}
1285
1287{
1288 return 2;
1289}
1290
1292{
1293 return 1;
1294}
1295
1297{
1298 CHECK_EXPECT(GetClassID);
1299 ok(IsEqualGUID(pClassID, &IID_NULL), "pClassID = %s\n", wine_dbgstr_guid(pClassID));
1300 return E_FAIL;
1301}
1302
1304{
1305 ok(0, "unexpected call\n");
1306 return E_NOTIMPL;
1307}
1308
1310{
1311 ok(0, "unexpected call\n");
1312 return E_NOTIMPL;
1313}
1314
1315static HRESULT WINAPI Moniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
1316{
1317 ok(0, "unexpected call\n");
1318 return E_NOTIMPL;
1319}
1320
1322{
1323 ok(0, "unexpected call\n");
1324 return E_NOTIMPL;
1325}
1326
1328 REFIID riidResult, void **ppvResult)
1329{
1330 ok(0, "unexpected call\n");
1331 return E_NOTIMPL;
1332}
1333
1334static void test_binding_ui(IUnknown *unk)
1335{
1336 IWindowForBindingUI *binding_ui;
1337 IServiceProvider *serv_prov;
1338 HWND binding_hwnd;
1339 HRESULT hres;
1340
1341 hres = IUnknown_QueryInterface(unk, &IID_IServiceProvider, (void**)&serv_prov);
1342 ok(hres == S_OK, "Could not get IServiceProvider: %08x\n", hres);
1343
1344 hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI,
1345 (void**)&binding_ui);
1346 ok(hres == S_OK, "Could not get IWindowForBindingUI: %08x\n", hres);
1347
1348 hres = IWindowForBindingUI_GetWindow(binding_ui, &IID_IHttpSecurity, &binding_hwnd);
1349 ok(hres == S_OK, "GetWindow(IID_IHttpSecurity) failed: %08x\n", hres);
1350 if(doc_hwnd)
1351 ok(binding_hwnd == doc_hwnd, "binding_hwnd != doc_hwnd\n");
1352 else
1353 todo_wine ok(binding_hwnd != NULL, "binding_hwnd == NULL\n");
1354
1355 hres = IWindowForBindingUI_GetWindow(binding_ui, &IID_IAuthenticate, &binding_hwnd);
1356 ok(hres == S_OK, "GetWindow(IID_IHttpSecurity) failed: %08x\n", hres);
1357 if(doc_hwnd)
1358 ok(binding_hwnd == doc_hwnd, "binding_hwnd != doc_hwnd\n");
1359 else
1360 todo_wine ok(binding_hwnd != NULL, "binding_hwnd == NULL\n");
1361
1362 hres = IWindowForBindingUI_GetWindow(binding_ui, &IID_IWindowForBindingUI, &binding_hwnd);
1363 ok(hres == S_OK, "GetWindow(IID_IHttpSecurity) failed: %08x\n", hres);
1364 if(doc_hwnd)
1365 ok(binding_hwnd == doc_hwnd, "binding_hwnd != doc_hwnd\n");
1366 else
1367 todo_wine ok(binding_hwnd != NULL, "binding_hwnd == NULL\n");
1368
1369 IWindowForBindingUI_Release(binding_ui);
1370 IServiceProvider_Release(serv_prov);
1371}
1372
1374{
1375 FORMATETC formatetc = {0xc02d, NULL, 1, -1, TYMED_ISTREAM};
1376 STGMEDIUM stgmedium;
1377 HRESULT hres;
1378
1379 static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
1380
1382
1383 if(report_mime) {
1384 hres = IBindStatusCallback_OnProgress(callback, 0, 0, BINDSTATUS_MIMETYPEAVAILABLE,
1385 wszTextHtml);
1386 ok(hres == S_OK, "OnProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
1387 }
1388
1389 hres = IBindStatusCallback_OnProgress(callback, sizeof(html_page)-1, sizeof(html_page)-1,
1390 BINDSTATUS_BEGINDOWNLOADDATA, doc_url);
1391 ok(hres == S_OK, "OnProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
1393 CHECK_CALLED_BROKEN(IsErrorUrl);
1394 SET_EXPECT(IsErrorUrl);
1395 }
1396
1398 stgmedium.tymed = TYMED_ISTREAM;
1399 U(stgmedium).pstm = &Stream;
1400 stgmedium.pUnkForRelease = (IUnknown*)&Moniker;
1401 hres = IBindStatusCallback_OnDataAvailable(callback,
1402 BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION,
1403 sizeof(html_page)-1, &formatetc, &stgmedium);
1404 ok(hres == S_OK, "OnDataAvailable failed: %08x\n", hres);
1406
1407 hres = IBindStatusCallback_OnProgress(callback, sizeof(html_page)-1, sizeof(html_page)-1,
1408 BINDSTATUS_ENDDOWNLOADDATA, NULL);
1409 ok(hres == S_OK, "OnProgress(BINDSTATUS_ENDDOWNLOADDATA) failed: %08x\n", hres);
1410
1411 SET_EXPECT(GetBindResult);
1412 hres = IBindStatusCallback_OnStopBinding(callback, S_OK, NULL);
1413 ok(hres == S_OK, "OnStopBinding failed: %08x\n", hres);
1414 CLEAR_CALLED(GetBindResult); /* IE7 */
1415
1416 IBindStatusCallback_Release(callback);
1417}
1418
1420 REFIID riid, void **ppv)
1421{
1423 BINDINFO bindinfo;
1424 DWORD bindf;
1425 HRESULT hres;
1426
1427 static OLECHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
1428
1429 CHECK_EXPECT(BindToStorage);
1430
1432
1433 ok(pbc != NULL, "pbc == NULL\n");
1434 ok(pmkToLeft == NULL, "pmkToLeft=%p\n", pmkToLeft);
1435 ok(IsEqualGUID(&IID_IStream, riid), "unexpected riid\n");
1436 ok(ppv != NULL, "ppv == NULL\n");
1437 ok(*ppv == NULL, "*ppv=%p\n", *ppv);
1438
1439 hres = IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown**)&callback);
1440 ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
1441 ok(callback != NULL, "callback == NULL\n");
1442
1443 memset(&bindinfo, 0xf0, sizeof(bindinfo));
1444 bindinfo.cbSize = sizeof(bindinfo);
1445
1446 hres = IBindStatusCallback_GetBindInfo(callback, &bindf, &bindinfo);
1447 ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
1448 ok((bindf & ~BINDF_HYPERLINK /* IE9 */) == (BINDF_PULLDATA|BINDF_ASYNCSTORAGE|BINDF_ASYNCHRONOUS), "bindf = %08x\n", bindf);
1449 ok(bindinfo.cbSize == sizeof(bindinfo), "bindinfo.cbSize=%d\n", bindinfo.cbSize);
1450 ok(bindinfo.szExtraInfo == NULL, "bindinfo.szExtraInfo=%p\n", bindinfo.szExtraInfo);
1451 /* TODO: test stgmedData */
1452 ok(bindinfo.grfBindInfoF == 0, "bindinfo.grfBinfInfoF=%08x\n", bindinfo.grfBindInfoF);
1453 ok(bindinfo.dwBindVerb == 0, "bindinfo.dwBindVerb=%d\n", bindinfo.dwBindVerb);
1454 ok(bindinfo.szCustomVerb == 0, "bindinfo.szCustomVerb=%p\n", bindinfo.szCustomVerb);
1455 ok(bindinfo.cbstgmedData == 0, "bindinfo.cbstgmedData=%d\n", bindinfo.cbstgmedData);
1456 ok(bindinfo.dwOptions == 0x80000 || bindinfo.dwOptions == 0x4080000,
1457 "bindinfo.dwOptions=%x\n", bindinfo.dwOptions);
1458 ok(bindinfo.dwOptionsFlags == 0, "bindinfo.dwOptionsFlags=%d\n", bindinfo.dwOptionsFlags);
1459 /* TODO: test dwCodePage */
1460 /* TODO: test securityAttributes */
1461 ok(IsEqualGUID(&IID_NULL, &bindinfo.iid), "unexpected bindinfo.iid\n");
1462 ok(bindinfo.pUnk == NULL, "bindinfo.pUnk=%p\n", bindinfo.pUnk);
1463 ok(bindinfo.dwReserved == 0, "bindinfo.dwReserved=%d\n", bindinfo.dwReserved);
1464
1465 hres = IBindStatusCallback_OnStartBinding(callback, 0, &Binding);
1466 ok(hres == S_OK, "OnStartBinding failed: %08x\n", hres);
1467
1470 return MK_S_ASYNCHRONOUS;
1471 }
1472
1474 return S_OK;
1475}
1476
1477static HRESULT WINAPI Moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar,
1478 IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
1479{
1480 ok(0, "unexpected call\n");
1481 return E_NOTIMPL;
1482}
1483
1485 BOOL fOnlyIfNotGeneric, IMoniker **ppnkComposite)
1486{
1487 ok(0, "unexpected call\n");
1488 return E_NOTIMPL;
1489}
1490
1491static HRESULT WINAPI Moniker_Enum(IMoniker *iface, BOOL fForwrd, IEnumMoniker **ppenumMoniker)
1492{
1493 ok(0, "unexpected call\n");
1494 return E_NOTIMPL;
1495}
1496
1497static HRESULT WINAPI Moniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
1498{
1499 ok(0, "unexpected call\n");
1500 return E_NOTIMPL;
1501}
1502
1503static HRESULT WINAPI Moniker_Hash(IMoniker *iface, DWORD *pdwHash)
1504{
1505 ok(0, "unexpected call\n");
1506 return E_NOTIMPL;
1507}
1508
1510 IMoniker *pmkNewlyRunning)
1511{
1512 ok(0, "unexpected call\n");
1513 return E_NOTIMPL;
1514}
1515
1517 IMoniker *pmkToLeft, FILETIME *pFileTime)
1518{
1519 ok(0, "unexpected call\n");
1520 return E_NOTIMPL;
1521}
1522
1524{
1525 ok(0, "unexpected call\n");
1526 return E_NOTIMPL;
1527}
1528
1530 IMoniker **ppmkPrefix)
1531{
1532 ok(0, "unexpected call\n");
1533 return E_NOTIMPL;
1534}
1535
1537 IMoniker **pmkRelPath)
1538{
1539 ok(0, "unexpected call\n");
1540 return E_NOTIMPL;
1541}
1542
1544 IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
1545{
1547
1548 /* ok(pbc != NULL, "pbc == NULL\n"); */
1549 ok(pmkToLeft == NULL, "pmkToLeft=%p\n", pmkToLeft);
1550 ok(ppszDisplayName != NULL, "ppszDisplayName == NULL\n");
1551
1552 *ppszDisplayName = CoTaskMemAlloc(sizeof(doc_url));
1553 memcpy(*ppszDisplayName, doc_url, sizeof(doc_url));
1554
1555 return S_OK;
1556}
1557
1559 IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
1560{
1561 ok(0, "unexpected call\n");
1562 return E_NOTIMPL;
1563}
1564
1566{
1567 CHECK_EXPECT(IsSystemMoniker);
1568 return E_NOTIMPL;
1569}
1570
1571static const IMonikerVtbl MonikerVtbl = {
1595};
1596
1597static IMoniker Moniker = { &MonikerVtbl };
1598
1600{
1601 return QueryInterface(riid, ppv);
1602}
1603
1605{
1606 return 2;
1607}
1608
1610{
1611 return 1;
1612}
1613
1615 LPOLESTR pszDiaplayName, ULONG *pchEaten, IMoniker **ppmkOut)
1616{
1617 ok(0, "unexpected call\n");
1618 return E_NOTIMPL;
1619}
1620
1622 IEnumUnknown **ppenum)
1623{
1624 ok(0, "unexpected call\n");
1625 return E_NOTIMPL;
1626}
1627
1629{
1630 CHECK_EXPECT(LockContainer);
1631 ok(expect_LockContainer_fLock == fLock, "fLock=%x, expected %x\n", fLock, expect_LockContainer_fLock);
1632 return S_OK;
1633}
1634
1635static const IOleContainerVtbl OleContainerVtbl = {
1642};
1643
1645
1647{
1648 return QueryInterface(riid, ppv);
1649}
1650
1652{
1653 return 2;
1654}
1655
1657{
1658 return 1;
1659}
1660
1662{
1663 ok(0, "unexpected call\n");
1664 return E_NOTIMPL;
1665}
1666
1667static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker,
1668 IMoniker **ppmon)
1669{
1670 ok(0, "unexpected call\n");
1671 return E_NOTIMPL;
1672}
1673
1675{
1676 CHECK_EXPECT(GetContainer);
1677 ok(ppContainer != NULL, "ppContainer = NULL\n");
1678 *ppContainer = &OleContainer;
1679 return S_OK;
1680}
1681
1683{
1684 ok(0, "unexpected call\n");
1685 return E_NOTIMPL;
1686}
1687
1689{
1690 ok(0, "unexpected call\n");
1691 return E_NOTIMPL;
1692}
1693
1695{
1696 ok(0, "unexpected call\n");
1697 return E_NOTIMPL;
1698}
1699
1700static const IOleClientSiteVtbl ClientSiteVtbl = {
1710};
1711
1713
1715{
1716 static const GUID undocumented_frame_iid = {0xfbece6c9,0x48d7,0x4a37,{0x8f,0xe3,0x6a,0xd4,0x27,0x2f,0xdd,0xac}};
1717
1718 if(!IsEqualGUID(&undocumented_frame_iid, riid))
1719 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
1720
1721 *ppv = NULL;
1722 return E_NOINTERFACE;
1723}
1724
1726{
1727 return 2;
1728}
1729
1731{
1732 return 1;
1733}
1734
1736{
1738 return E_NOTIMPL;
1739}
1740
1742{
1743 ok(0, "unexpected call\n");
1744 return E_NOTIMPL;
1745}
1746
1748{
1749 ok(0, "unexpected call\n");
1750 return E_NOTIMPL;
1751}
1752
1754 LPCBORDERWIDTHS pborderwidths)
1755{
1756 ok(0, "unexpected call\n");
1757 return E_NOTIMPL;
1758}
1759
1761 LPCBORDERWIDTHS pborderwidths)
1762{
1764 return S_OK;
1765}
1766
1768 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
1769{
1770 static const WCHAR wszHTML_Document[] =
1771 {'H','T','M','L',' ','D','o','c','u','m','e','n','t',0};
1772
1774
1776 ok(pActiveObject != NULL, "pActiveObject = NULL\n");
1777 if(pActiveObject && is_lang_english())
1778 ok(!lstrcmpW(wszHTML_Document, pszObjName), "%s != \"HTML Document\"\n", wine_dbgstr_w(pszObjName));
1779 }
1780 else {
1781 ok(pActiveObject == NULL, "pActiveObject=%p, expected NULL\n", pActiveObject);
1782 ok(pszObjName == NULL, "pszObjName=%p, expected NULL\n", pszObjName);
1783 }
1785 return S_OK;
1786}
1787
1789 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
1790{
1791 static const WCHAR wszHTML_Document[] =
1792 {'H','T','M','L',' ','D','o','c','u','m','e','n','t',0};
1793
1794 if(pActiveObject) {
1795 CHECK_EXPECT2(SetActiveObject);
1796
1797 if(pActiveObject && is_lang_english())
1798 ok(!lstrcmpW(wszHTML_Document, pszObjName), "%s != \"HTML Document\"\n", wine_dbgstr_w(pszObjName));
1799 }else {
1800 CHECK_EXPECT(SetActiveObject_null);
1801
1802 ok(pActiveObject == NULL, "pActiveObject=%p, expected NULL\n", pActiveObject);
1803 ok(pszObjName == NULL, "pszObjName=%p, expected NULL\n", pszObjName);
1804 }
1805
1806 return S_OK;
1807}
1808
1810 LPOLEMENUGROUPWIDTHS lpMenuWidths)
1811{
1812 ok(0, "unexpected call\n");
1813 return E_NOTIMPL;
1814}
1815
1817 HOLEMENU holemenu, HWND hwndActiveObject)
1818{
1819 ok(0, "unexpected call\n");
1820 return E_NOTIMPL;
1821}
1822
1824{
1825 ok(0, "unexpected call\n");
1826 return E_NOTIMPL;
1827}
1828
1829static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
1830{
1832 CHECK_EXPECT2(SetStatusText);
1834 ok(pszStatusText == NULL, "pszStatusText=%p, expected NULL\n", pszStatusText);
1835 return S_OK;
1836}
1837
1839{
1840 if(fEnable)
1841 CHECK_EXPECT2(Frame_EnableModeless_TRUE);
1842 else
1843 CHECK_EXPECT2(Frame_EnableModeless_FALSE);
1844 return E_NOTIMPL;
1845}
1846
1848{
1849 ok(0, "unexpected call\n");
1850 return E_NOTIMPL;
1851}
1852
1853static const IOleInPlaceFrameVtbl InPlaceFrameVtbl = {
1869};
1870
1872
1873static const IOleInPlaceFrameVtbl InPlaceUIWindowVtbl = {
1883};
1884
1886
1888{
1889 return QueryInterface(riid, ppv);
1890}
1891
1893{
1894 return 2;
1895}
1896
1898{
1899 return 1;
1900}
1901
1903 IOleInPlaceSiteWindowless *iface, HWND *phwnd)
1904{
1906 IOleObject *ole_obj;
1907 HRESULT hres;
1908
1910 ok(phwnd != NULL, "phwnd = NULL\n");
1911 *phwnd = container_hwnd;
1912
1913 hres = IUnknown_QueryInterface(doc_unk, &IID_IOleObject, (void**)&ole_obj);
1914 ok(hres == S_OK, "Could not get IOleObject: %08x\n", hres);
1915
1916 hres = IOleObject_GetClientSite(ole_obj, &client_site);
1917 IOleObject_Release(ole_obj);
1918 ok(hres == S_OK, "GetClientSite failed: %08x\n", hres);
1919 ok(client_site == &ClientSite, "client_site != ClientSite\n");
1920 IOleClientSite_Release(client_site);
1921
1922 return S_OK;
1923}
1924
1926 IOleInPlaceSiteWindowless *iface, BOOL fEnterMode)
1927{
1928 ok(0, "unexpected call\n");
1929 return E_NOTIMPL;
1930}
1931
1934{
1935 CHECK_EXPECT(CanInPlaceActivate);
1936 return S_OK;
1937}
1938
1941{
1942 CHECK_EXPECT(OnInPlaceActivate);
1944 return S_OK;
1945}
1946
1949{
1950 CHECK_EXPECT(OnUIActivate);
1951 return S_OK;
1952}
1953
1956 IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
1957 LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
1958{
1959 static const RECT rect = {0,0,500,500};
1960
1961 CHECK_EXPECT(GetWindowContext);
1962
1963 ok(ppFrame != NULL, "ppFrame = NULL\n");
1964 if(ppFrame)
1965 *ppFrame = &InPlaceFrame;
1966 ok(ppDoc != NULL, "ppDoc = NULL\n");
1967 if(ppDoc)
1969 ok(lprcPosRect != NULL, "lprcPosRect = NULL\n");
1970 if(lprcPosRect)
1971 memcpy(lprcPosRect, &rect, sizeof(RECT));
1972 ok(lprcClipRect != NULL, "lprcClipRect = NULL\n");
1973 if(lprcClipRect)
1974 memcpy(lprcClipRect, &rect, sizeof(RECT));
1975 ok(lpFrameInfo != NULL, "lpFrameInfo = NULL\n");
1976 if(lpFrameInfo) {
1977 ok(lpFrameInfo->cb == sizeof(*lpFrameInfo), "lpFrameInfo->cb = %u, expected %u\n", lpFrameInfo->cb, (unsigned)sizeof(*lpFrameInfo));
1978 lpFrameInfo->fMDIApp = FALSE;
1979 lpFrameInfo->hwndFrame = container_hwnd;
1980 lpFrameInfo->haccel = NULL;
1981 lpFrameInfo->cAccelEntries = 0;
1982 }
1983
1984 return S_OK;
1985}
1986
1988 IOleInPlaceSiteWindowless *iface, SIZE scrollExtent)
1989{
1990 ok(0, "unexpected call\n");
1991 return E_NOTIMPL;
1992}
1993
1995 IOleInPlaceSiteWindowless *iface, BOOL fUndoable)
1996{
1997 CHECK_EXPECT(OnUIDeactivate);
1998 ok(!fUndoable, "fUndoable = TRUE\n");
1999 return S_OK;
2000}
2001
2004{
2005 CHECK_EXPECT(OnInPlaceDeactivate);
2007 return S_OK;
2008}
2009
2012{
2013 ok(0, "unexpected call\n");
2014 return E_NOTIMPL;
2015}
2016
2019{
2020 ok(0, "unexpected call\n");
2021 return E_NOTIMPL;
2022}
2023
2025 IOleInPlaceSiteWindowless *iface, LPCRECT lprcPosRect)
2026{
2027 ok(0, "unexpected call\n");
2028 return E_NOTIMPL;
2029}
2030
2032 IOleInPlaceSiteWindowless *iface, BOOL *pfNoRedraw, DWORD dwFlags)
2033{
2034 CHECK_EXPECT(OnInPlaceActivateEx);
2035
2036 ok(pfNoRedraw != NULL, "pfNoRedraw == NULL\n");
2037 ok(!*pfNoRedraw, "*pfNoRedraw == TRUE\n");
2038 ok(dwFlags == 0, "dwFlags = %08x\n", dwFlags);
2039
2040 return S_OK;
2041}
2042
2044 IOleInPlaceSiteWindowless *iface, BOOL fNoRedraw)
2045{
2046 CHECK_EXPECT(OnInPlaceDeactivateEx);
2047
2048 ok(fNoRedraw, "fNoRedraw == FALSE\n");
2049
2050 return S_OK;
2051}
2052
2055{
2056 CHECK_EXPECT2(RequestUIActivate);
2057 return S_OK;
2058}
2059
2062{
2063 ok(0, "unexpected call\n");
2064 return E_NOTIMPL;
2065}
2066
2069{
2070 ok(0, "unexpected call\n");
2071 return E_NOTIMPL;
2072}
2073
2075 IOleInPlaceSiteWindowless *iface, BOOL fCapture)
2076{
2077 ok(0, "unexpected call\n");
2078 return E_NOTIMPL;
2079}
2080
2083{
2084 ok(0, "unexpected call\n");
2085 return E_NOTIMPL;
2086}
2087
2089 IOleInPlaceSiteWindowless *iface, BOOL fFocus)
2090{
2091 ok(0, "unexpected call\n");
2092 return E_NOTIMPL;
2093}
2094
2096 IOleInPlaceSiteWindowless *iface, LPCRECT pRect,
2097 DWORD grfFlags, HDC *phDC)
2098{
2099 ok(0, "unexpected call\n");
2100 return E_NOTIMPL;
2101}
2102
2105{
2106 ok(0, "unexpected call\n");
2107 return E_NOTIMPL;
2108}
2109
2111 IOleInPlaceSiteWindowless *iface, LPCRECT pRect, BOOL fErase)
2112{
2113 ok(0, "unexpected call\n");
2114 return E_NOTIMPL;
2115}
2116
2118 IOleInPlaceSiteWindowless *iface, HRGN hRGN, BOOL fErase)
2119{
2120 ok(0, "unexpected call\n");
2121 return E_NOTIMPL;
2122}
2123
2126 LPCRECT pRectScroll, LPCRECT pRectClip)
2127{
2128 ok(0, "unexpected call\n");
2129 return E_NOTIMPL;
2130}
2131
2134{
2135 ok(0, "unexpected call\n");
2136 return E_NOTIMPL;
2137}
2138
2141 WPARAM wParam, LPARAM lParam, LRESULT *plResult)
2142{
2143 ok(0, "unexpected call\n");
2144 return E_NOTIMPL;
2145}
2146
2147static const IOleInPlaceSiteWindowlessVtbl InPlaceSiteWindowlessVtbl = {
2178};
2179
2181
2183{
2184 return QueryInterface(riid, ppv);
2185}
2186
2188{
2189 return 2;
2190}
2191
2193{
2194 return 1;
2195}
2196
2197typedef enum
2198{
2203
2206{
2207 IOleDocument *document;
2208 HRESULT hres;
2209
2210 CHECK_EXPECT(ActivateMe);
2211 ok(pViewToActivate != NULL, "pViewToActivate = NULL\n");
2212
2213 hres = IOleDocumentView_QueryInterface(pViewToActivate, &IID_IOleDocument, (void**)&document);
2214 ok(hres == S_OK, "could not get IOleDocument: %08x\n", hres);
2215
2216 if(SUCCEEDED(hres)) {
2217 hres = IOleDocument_CreateView(document, (IOleInPlaceSite*)&InPlaceSiteWindowless, NULL, 0, &view);
2218 ok(hres == S_OK, "CreateView failed: %08x\n", hres);
2219
2220 if(SUCCEEDED(hres)) {
2221 IOleInPlaceActiveObject *activeobj = NULL;
2222 IOleInPlaceSite *inplacesite = NULL;
2223 HWND tmp_hwnd = NULL;
2224 static RECT rect = {0,0,400,500};
2225
2226 hres = IOleDocumentView_GetInPlaceSite(view, &inplacesite);
2227 ok(hres == S_OK, "GetInPlaceSite failed: %08x\n", hres);
2228 ok(inplacesite == (IOleInPlaceSite*)&InPlaceSiteWindowless, "inplacesite=%p, expected %p\n",
2229 inplacesite, &InPlaceSiteWindowless);
2230
2231 hres = IOleDocumentView_SetInPlaceSite(view, (IOleInPlaceSite*)&InPlaceSiteWindowless);
2232 ok(hres == S_OK, "SetInPlaceSite failed: %08x\n", hres);
2233
2234 hres = IOleDocumentView_GetInPlaceSite(view, &inplacesite);
2235 ok(hres == S_OK, "GetInPlaceSite failed: %08x\n", hres);
2236 ok(inplacesite == (IOleInPlaceSite*)&InPlaceSiteWindowless, "inplacesite=%p, expected %p\n",
2237 inplacesite, &InPlaceSiteWindowless);
2238
2239 hres = IOleDocumentView_QueryInterface(view, &IID_IOleInPlaceActiveObject, (void**)&activeobj);
2240 ok(hres == S_OK, "Could not get IOleInPlaceActiveObject: %08x\n", hres);
2241
2242 if(activeobj) {
2243 HWND hwnd = (void*)0xdeadbeef;
2244 hres = IOleInPlaceActiveObject_GetWindow(activeobj, &hwnd);
2245 ok(hres == E_FAIL, "GetWindow returned %08x, expected E_FAIL\n", hres);
2246 ok(hwnd == NULL, "hwnd=%p, expected NULL\n", hwnd);
2247 }
2248
2250 SET_EXPECT(CanInPlaceActivate);
2251 SET_EXPECT(GetWindowContext);
2253 if(ipsex)
2254 SET_EXPECT(OnInPlaceActivateEx);
2255 else
2256 SET_EXPECT(OnInPlaceActivate);
2257 SET_EXPECT(SetStatusText);
2258 SET_EXPECT(Exec_SETPROGRESSMAX);
2259 SET_EXPECT(Exec_SETPROGRESSPOS);
2260 SET_EXPECT(OnUIActivate);
2261 SET_EXPECT(SetActiveObject);
2262 SET_EXPECT(ShowUI);
2264
2265 hres = IOleDocumentView_UIActivate(view, TRUE);
2266 ok(hres == S_OK, "UIActivate failed: %08x\n", hres);
2267
2268 CHECK_CALLED(CanInPlaceActivate);
2269 CHECK_CALLED(GetWindowContext);
2271 if(ipsex)
2272 CHECK_CALLED(OnInPlaceActivateEx);
2273 else
2274 CHECK_CALLED(OnInPlaceActivate);
2275 CHECK_CALLED(SetStatusText);
2276 CHECK_CALLED(Exec_SETPROGRESSMAX);
2277 CHECK_CALLED(Exec_SETPROGRESSPOS);
2278 CHECK_CALLED(OnUIActivate);
2279 CHECK_CALLED(SetActiveObject);
2280 CHECK_CALLED(ShowUI);
2281
2282 if(activeobj) {
2283 hres = IOleInPlaceActiveObject_GetWindow(activeobj, &doc_hwnd);
2284 ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
2285 ok(doc_hwnd != NULL, "hwnd == NULL\n");
2286 if(last_hwnd)
2287 ok(doc_hwnd == last_hwnd, "hwnd != last_hwnd\n");
2288 }
2289
2290 hres = IOleDocumentView_UIActivate(view, TRUE);
2291 ok(hres == S_OK, "UIActivate failed: %08x\n", hres);
2292
2293 if(activeobj) {
2294 hres = IOleInPlaceActiveObject_GetWindow(activeobj, &tmp_hwnd);
2295 ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
2296 ok(tmp_hwnd == doc_hwnd, "tmp_hwnd=%p, expected %p\n", tmp_hwnd, doc_hwnd);
2297 }
2298 }
2299
2300 hres = IOleDocumentView_SetRect(view, &rect);
2301 ok(hres == S_OK, "SetRect failed: %08x\n", hres);
2302
2304 hres = IOleDocumentView_Show(view, TRUE);
2305 ok(hres == S_OK, "Show failed: %08x\n", hres);
2306 }else {
2307 SET_EXPECT(CanInPlaceActivate);
2308 SET_EXPECT(GetWindowContext);
2310 if(ipsex)
2311 SET_EXPECT(OnInPlaceActivateEx);
2312 else
2313 SET_EXPECT(OnInPlaceActivate);
2314 SET_EXPECT(SetStatusText);
2315 SET_EXPECT(Exec_SETPROGRESSMAX);
2316 SET_EXPECT(Exec_SETPROGRESSPOS);
2317 SET_EXPECT(OnUIActivate);
2318 expect_status_text = (load_state == LD_COMPLETE ? (LPCOLESTR)0xdeadbeef : NULL);
2319
2320 hres = IOleDocumentView_Show(view, TRUE);
2321 ok(hres == S_OK, "Show failed: %08x\n", hres);
2322
2323 CHECK_CALLED(CanInPlaceActivate);
2324 CHECK_CALLED(GetWindowContext);
2326 if(ipsex)
2327 CHECK_CALLED(OnInPlaceActivateEx);
2328 else
2329 CHECK_CALLED(OnInPlaceActivate);
2330 CHECK_CALLED(SetStatusText);
2331 CHECK_CALLED(Exec_SETPROGRESSMAX);
2332 CHECK_CALLED(Exec_SETPROGRESSPOS);
2333
2334 if(activeobj) {
2335 hres = IOleInPlaceActiveObject_GetWindow(activeobj, &doc_hwnd);
2336 ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
2337 ok(doc_hwnd != NULL, "doc_hwnd == NULL\n");
2338 if(last_hwnd)
2339 ok(doc_hwnd == last_hwnd, "doc_hwnd != last_hwnd\n");
2340 }
2341 }
2342
2344
2345 if(activeobj)
2346 IOleInPlaceActiveObject_Release(activeobj);
2347 }
2348
2349 IOleDocument_Release(document);
2350 }
2351
2352 return S_OK;
2353}
2354
2355static const IOleDocumentSiteVtbl DocumentSiteVtbl = {
2360};
2361
2363
2365{
2366 return QueryInterface(riid, ppv);
2367}
2368
2370{
2371 return 2;
2372}
2373
2375{
2376 return 1;
2377}
2378
2380{
2381 ok(0, "unexpected call\n");
2382 return E_NOTIMPL;
2383}
2384
2386{
2387 ok(0, "unexpected call\n");
2388 return E_NOTIMPL;
2389}
2390
2392{
2393 ok(0, "unexpected call\n");
2394 return E_NOTIMPL;
2395}
2396
2398 POINTF *pPtfContainer, DWORD dwFlags)
2399{
2400 ok(0, "unexpected call\n");
2401 return E_NOTIMPL;
2402}
2403
2405 MSG *pMsg, DWORD grfModifiers)
2406{
2407 ok(0, "unexpected call\n");
2408 return E_NOTIMPL;
2409}
2410
2412{
2413 if(fGotFocus)
2414 CHECK_EXPECT(OnFocus_TRUE);
2415 else
2416 CHECK_EXPECT2(OnFocus_FALSE);
2417 return S_OK;
2418}
2419
2421{
2422 ok(0, "unexpected call\n");
2423 return E_NOTIMPL;
2424}
2425
2426static const IOleControlSiteVtbl OleControlSiteVtbl = {
2437};
2438
2440
2442
2444{
2445 return QueryInterface(riid, ppv);
2446}
2447
2449{
2450 return 2;
2451}
2452
2454{
2455 return 1;
2456}
2457
2459 IUnknown *pcmdtReserved, IDispatch *pdicpReserved)
2460{
2461 ok(0, "unexpected call\n");
2462 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2463 return E_NOTIMPL;
2464}
2465
2467{
2469 CHECK_EXPECT(GetHostInfo);
2470 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2471 ok(pInfo != NULL, "pInfo=NULL\n");
2472 if(pInfo) {
2473 ok(pInfo->cbSize == sizeof(DOCHOSTUIINFO), "pInfo->cbSize=%u\n", pInfo->cbSize);
2474 ok(!pInfo->dwFlags, "pInfo->dwFlags=%08x, expected 0\n", pInfo->dwFlags);
2478 ok(!pInfo->dwDoubleClick, "pInfo->dwDoubleClick=%08x, expected 0\n", pInfo->dwDoubleClick);
2479 ok(!pInfo->pchHostCss, "pInfo->pchHostCss=%p, expected NULL\n", pInfo->pchHostCss);
2480 ok(!pInfo->pchHostNS, "pInfo->pchhostNS=%p, expected NULL\n", pInfo->pchHostNS);
2481 }
2482 return S_OK;
2483}
2484
2486 IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
2488{
2489 CHECK_EXPECT(ShowUI);
2490 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2491
2492 if (editmode)
2493 ok(dwID == DOCHOSTUITYPE_AUTHOR, "dwID=%d, expected DOCHOSTUITYPE_AUTHOR\n", dwID);
2494 else
2495 ok(dwID == DOCHOSTUITYPE_BROWSE, "dwID=%d, expected DOCHOSTUITYPE_BROWSE\n", dwID);
2496 ok(pActiveObject != NULL, "pActiveObject = NULL\n");
2497 ok(pCommandTarget != NULL, "pCommandTarget = NULL\n");
2498 ok(pFrame == &InPlaceFrame, "pFrame=%p, expected %p\n", pFrame, &InPlaceFrame);
2500 ok(pDoc == (IOleInPlaceUIWindow *)&InPlaceUIWindow, "pDoc=%p, expected %p\n", pDoc, &InPlaceUIWindow);
2501 else
2502 ok(pDoc == NULL, "pDoc=%p, expected NULL\n", pDoc);
2503
2504 return S_OK;
2505}
2506
2508{
2509 CHECK_EXPECT(HideUI);
2510 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2511 return S_OK;
2512}
2513
2515{
2516 CHECK_EXPECT(UpdateUI);
2517 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2518 return S_OK;
2519}
2520
2522{
2523 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2524 if(fEnable)
2525 CHECK_EXPECT2(EnableModeless_TRUE);
2526 else
2527 CHECK_EXPECT2(EnableModeless_FALSE);
2528 return E_NOTIMPL;
2529}
2530
2532{
2533 ok(0, "unexpected call\n");
2534 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2535 return E_NOTIMPL;
2536}
2537
2540{
2541 CHECK_EXPECT2(OnFrameWindowActivate);
2542 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2543 ok(fActivate == expect_OnFrameWindowActivate_fActivate, "fActivate=%x\n", fActivate);
2544 return S_OK;
2545}
2546
2548 IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
2549{
2550 ok(0, "unexpected call\n");
2551 return E_NOTIMPL;
2552}
2553
2555 const GUID *pguidCmdGroup, DWORD nCmdID)
2556{
2557 ok(0, "unexpected call\n");
2558 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2559 return E_NOTIMPL;
2560}
2561
2563 LPOLESTR *pchKey, DWORD dw)
2564{
2565 CHECK_EXPECT(GetOptionKeyPath);
2566 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2567 ok(pchKey != NULL, "pchKey = NULL\n");
2568 ok(!dw, "dw=%d, expected 0\n", dw);
2569 if(pchKey)
2570 ok(!*pchKey, "*pchKey=%p, expected NULL\n", *pchKey);
2571 return S_OK;
2572}
2573
2575 IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
2576{
2577 CHECK_EXPECT(GetDropTarget);
2578 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2579 /* TODO */
2580 return E_NOTIMPL;
2581}
2582
2584{
2585 CHECK_EXPECT(GetExternal);
2586 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2587 *ppDispatch = &External;
2588 return S_FALSE;
2589}
2590
2592 OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
2593{
2594 CHECK_EXPECT(TranslateUrl);
2595 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2596 ok(!dwTranslate, "dwTranslate = %x\n", dwTranslate);
2597 if(!loading_hash)
2598 ok(!strcmp_wa(pchURLIn, nav_serv_url), "pchURLIn = %s, expected %s\n", wine_dbgstr_w(pchURLIn), nav_serv_url);
2599 else
2600 todo_wine ok(!strcmp_wa(pchURLIn, nav_serv_url), "pchURLIn = %s, expected %s\n", wine_dbgstr_w(pchURLIn), nav_serv_url);
2601 ok(ppchURLOut != NULL, "ppchURLOut == NULL\n");
2602 ok(!*ppchURLOut, "*ppchURLOut = %p\n", *ppchURLOut);
2603
2604 /* Not related to hash navigation, just return NULL and S_OK in some cases. */
2605 if(loading_hash) {
2606 *ppchURLOut = NULL;
2607 return S_OK;
2608 }
2609
2610 return S_FALSE;
2611}
2612
2614 IDataObject **ppPORet)
2615{
2616 ok(0, "unexpected call\n");
2617 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2618 return E_NOTIMPL;
2619}
2620
2622 LPOLESTR *pchKey, DWORD dw)
2623{
2624 CHECK_EXPECT(GetOverrideKeyPath);
2625 ok(iface == expect_uihandler_iface, "called on unexpected iface\n");
2626 ok(pchKey != NULL, "pchKey = NULL\n");
2627 if(pchKey)
2628 ok(!*pchKey, "*pchKey=%p, expected NULL\n", *pchKey);
2629 ok(!dw, "dw=%d, expected 0\n", dw);
2630 return S_OK;
2631}
2632
2633static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl = {
2653};
2654
2656
2658{
2659 if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
2660 *ppv = iface;
2661 return S_OK;
2662 }
2663
2664 *ppv = NULL;
2665
2666 if(IsEqualGUID(&IID_IOleCommandTarget, riid))
2667 return E_NOINTERFACE;
2668
2669 if(IsEqualGUID(&IID_IDocHostShowUI, riid))
2670 return E_NOINTERFACE; /* TODO */
2671
2672 trace("CustomDocHostUIHandler::QI(%s)\n", wine_dbgstr_guid(riid));
2673 return E_NOINTERFACE;
2674}
2675
2676static const IDocHostUIHandler2Vtbl CustomDocHostUIHandlerVtbl = {
2696};
2697
2699
2701 REFIID riid, void **ppv)
2702{
2703 return QueryInterface(riid, ppv);
2704}
2705
2707{
2708 return 2;
2709}
2710
2712{
2713 return 1;
2714}
2715
2717 ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
2718{
2719 ok(!pguidCmdGroup, "pguidCmdGroup != MULL\n");
2720 ok(cCmds == 1, "cCmds=%d, expected 1\n", cCmds);
2721 ok(!pCmdText, "pCmdText != NULL\n");
2722
2723 switch(prgCmds[0].cmdID) {
2724 case OLECMDID_SETPROGRESSTEXT:
2725 CHECK_EXPECT(QueryStatus_SETPROGRESSTEXT);
2726 prgCmds[0].cmdf = OLECMDF_ENABLED;
2727 return S_OK;
2728 case OLECMDID_OPEN:
2729 CHECK_EXPECT(QueryStatus_OPEN);
2730 prgCmds[0].cmdf = 0;
2731 return S_OK;
2732 case OLECMDID_NEW:
2733 CHECK_EXPECT(QueryStatus_NEW);
2734 prgCmds[0].cmdf = 0;
2735 return S_OK;
2736 default:
2737 ok(0, "unexpected command %d\n", prgCmds[0].cmdID);
2738 };
2739
2740 return E_FAIL;
2741}
2742
2744{
2745 IPersistHistory *per_hist;
2747 IStream *stream;
2748 HRESULT hres;
2749
2750 hres = IUnknown_QueryInterface(unk, &IID_IPersistHistory, (void**)&per_hist);
2751 ok(hres == S_OK, "Could not get IPersistHistory iface: %08x\n", hres);
2752
2754 ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres);
2755
2756 hres = IPersistHistory_SaveHistory(per_hist, stream);
2757 ok(hres == S_OK, "SaveHistory failed: %08x\n", hres);
2758 IPersistHistory_Release(per_hist);
2759
2760 li.QuadPart = 0;
2761 hres = IStream_Seek(stream, li, STREAM_SEEK_SET, NULL);
2762 ok(hres == S_OK, "Stat failed: %08x\n", hres);
2764}
2765
2766static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup,
2767 DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
2768{
2770 return E_FAIL;
2771
2772 if(!pguidCmdGroup) {
2774
2775 switch(nCmdID) {
2776 case OLECMDID_SETPROGRESSMAX:
2777 CHECK_EXPECT2(Exec_SETPROGRESSMAX);
2778 ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt);
2779 ok(pvaIn != NULL, "pvaIn == NULL\n");
2780 if(pvaIn) {
2781 ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn));
2782 if(load_state == LD_NO)
2783 ok(V_I4(pvaIn) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn));
2784 }
2785 ok(pvaOut == NULL, "pvaOut=%p, expected NULL\n", pvaOut);
2786 return S_OK;
2787 case OLECMDID_SETPROGRESSPOS:
2788 CHECK_EXPECT2(Exec_SETPROGRESSPOS);
2789 ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt);
2790 ok(pvaIn != NULL, "pvaIn == NULL\n");
2791 if(pvaIn) {
2792 ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn));
2793 if(load_state == LD_NO)
2794 ok(V_I4(pvaIn) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn));
2795 }
2796 ok(pvaOut == NULL, "pvaOut=%p, expected NULL\n", pvaOut);
2797 return S_OK;
2798 case OLECMDID_HTTPEQUIV_DONE:
2799 CHECK_EXPECT(Exec_HTTPEQUIV_DONE);
2800 ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt);
2801 ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut);
2802 ok(pvaIn == NULL, "pvaIn=%p\n", pvaIn);
2806 return S_OK;
2807 case OLECMDID_SETDOWNLOADSTATE:
2808 ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt);
2809 ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut);
2810 ok(pvaIn != NULL, "pvaIn == NULL\n");
2811 ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d\n", V_VT(pvaIn));
2812
2813 switch(V_I4(pvaIn)) {
2814 case 0:
2815 CHECK_EXPECT(Exec_SETDOWNLOADSTATE_0);
2816 if(!loading_js)
2818 break;
2819 case 1:
2820 CHECK_EXPECT(Exec_SETDOWNLOADSTATE_1);
2822 break;
2823 default:
2824 ok(0, "unexpevted V_I4(pvaIn)=%d\n", V_I4(pvaIn));
2825 }
2826
2827 return S_OK;
2828 case OLECMDID_UPDATECOMMANDS:
2829 CHECK_EXPECT(Exec_UPDATECOMMANDS);
2830 ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt);
2831 ok(pvaIn == NULL, "pvaIn=%p\n", pvaIn);
2832 ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut);
2833 return S_OK;
2834 case OLECMDID_SETTITLE:
2835 CHECK_EXPECT2(Exec_SETTITLE);
2836 ok(nCmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER, "nCmdexecopts=%08x\n", nCmdexecopt);
2837 ok(pvaIn != NULL, "pvaIn == NULL\n");
2838 ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut);
2839 ok(V_VT(pvaIn) == VT_BSTR, "V_VT(pvaIn)=%d\n", V_VT(pvaIn));
2840 ok(V_BSTR(pvaIn) != NULL, "V_BSTR(pvaIn) == NULL\n"); /* TODO */
2841 return S_OK;
2842 case OLECMDID_HTTPEQUIV:
2843 CHECK_EXPECT2(Exec_HTTPEQUIV);
2844 ok(!nCmdexecopt, "nCmdexecopts=%08x\n", nCmdexecopt);
2845 ok(pvaIn != NULL, "pvaIn == NULL\n");
2846 ok(pvaOut == NULL, "pvaOut=%p\n", pvaOut);
2847 ok(V_VT(pvaIn) == VT_BSTR, "V_VT(pvaIn)=%d\n", V_VT(pvaIn));
2848 ok(V_BSTR(pvaIn) != NULL, "V_BSTR(pvaIn) = NULL\n");
2850 return S_OK;
2851 case OLECMDID_UPDATETRAVELENTRY_DATARECOVERY:
2852 case OLECMDID_PAGEAVAILABLE:
2853 case 6058:
2854 return E_FAIL; /* FIXME */
2855 default:
2856 ok(0, "unexpected command %d\n", nCmdID);
2857 return E_FAIL;
2858 };
2859 }
2860
2861 if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) {
2862 ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt);
2863
2864 switch(nCmdID) {
2865 case 37:
2866 CHECK_EXPECT2(Exec_ShellDocView_37);
2867
2871 }else if(is_refresh && load_state == LD_DOLOAD) {
2874 }else {
2875 if(!is_refresh)
2877 if(nav_url)
2879 else if(load_from_stream)
2880 test_GetCurMoniker(doc_unk, NULL, "about:blank", FALSE);
2881 else if(!editmode)
2883 }
2884
2885 ok(pvaOut == NULL, "pvaOut=%p, expected NULL\n", pvaOut);
2886 ok(pvaIn != NULL, "pvaIn == NULL\n");
2887 if(pvaIn) {
2888 ok(V_VT(pvaIn) == VT_I4, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn));
2889 ok(V_I4(pvaIn) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn));
2890 }
2891 return S_OK;
2892
2893 case 62:
2894 CHECK_EXPECT(Exec_ShellDocView_62);
2895 ok(!pvaIn, "pvaIn != NULL\n");
2896 ok(!pvaOut, "pvaOut != NULL\n");
2897 return S_OK;
2898
2899 case 63: {
2900 IHTMLPrivateWindow *priv_window;
2901 HRESULT hres;
2902
2903 CHECK_EXPECT(Exec_ShellDocView_63);
2904 ok(pvaIn != NULL, "pvaIn == NULL\n");
2905 ok(V_VT(pvaIn) == VT_UNKNOWN, "V_VT(pvaIn) = %d\n", V_VT(pvaIn));
2906 ok(V_UNKNOWN(pvaIn) != NULL, "VPUNKNOWN(pvaIn) = NULL\n");
2907 ok(pvaOut != NULL, "pvaOut == NULL\n");
2908 ok(V_VT(pvaOut) == VT_EMPTY, "V_VT(pvaOut) = %d\n", V_VT(pvaOut));
2909
2910 hres = IUnknown_QueryInterface(V_UNKNOWN(pvaIn), &IID_IHTMLPrivateWindow, (void**)&priv_window);
2911 ok(hres == S_OK, "Could not get IHTMLPrivateWindow: %08x\n", hres);
2912 if(SUCCEEDED(hres))
2913 IHTMLPrivateWindow_Release(priv_window);
2914
2916 return S_OK; /* TODO */
2917 }
2918
2919 case 67:
2920 CHECK_EXPECT(Exec_ShellDocView_67);
2921 ok(pvaIn != NULL, "pvaIn == NULL\n");
2922 ok(V_VT(pvaIn) == VT_BSTR, "V_VT(pvaIn) = %d\n", V_VT(pvaIn));
2923 ok(!strcmp_wa(V_BSTR(pvaIn), nav_serv_url), "V_BSTR(pvaIn) = %s, expected \"%s\"\n",
2925 ok(pvaOut != NULL, "pvaOut == NULL\n");
2926 ok(V_VT(pvaOut) == VT_BOOL, "V_VT(pvaOut) = %d\n", V_VT(pvaOut));
2927 ok(V_BOOL(pvaOut) == VARIANT_TRUE, "V_BOOL(pvaOut) = %x\n", V_BOOL(pvaOut));
2928 if(!loading_hash)
2930 return S_OK;
2931
2932 case 84:
2933 CHECK_EXPECT2(Exec_ShellDocView_84);
2934
2935 ok(pvaIn == NULL, "pvaIn != NULL\n");
2936 ok(pvaOut != NULL, "pvaOut == NULL\n");
2937 if(pvaIn)
2938 ok(V_VT(pvaOut) == VT_EMPTY, "V_VT(pvaOut)=%d\n", V_VT(pvaOut));
2939
2941 return E_NOTIMPL;
2942
2943 case 103:
2944 CHECK_EXPECT2(Exec_ShellDocView_103);
2945
2946 ok(pvaIn == NULL, "pvaIn != NULL\n");
2947 ok(pvaOut == NULL, "pvaOut != NULL\n");
2948
2950 return E_NOTIMPL;
2951
2952 case 105:
2953 CHECK_EXPECT2(Exec_ShellDocView_105);
2954
2955 ok(pvaIn != NULL, "pvaIn == NULL\n");
2956 ok(pvaOut == NULL, "pvaOut != NULL\n");
2957
2959 return E_NOTIMPL;
2960
2961 case 138:
2962 CHECK_EXPECT2(Exec_ShellDocView_138);
2963 ok(!pvaIn, "pvaIn != NULL\n");
2964 ok(!pvaOut, "pvaOut != NULL\n");
2966 return S_OK;
2967
2968 case 140:
2969 CHECK_EXPECT2(Exec_ShellDocView_140);
2970
2971 ok(pvaIn == NULL, "pvaIn != NULL\n");
2972 ok(pvaOut == NULL, "pvaOut != NULL\n");
2973
2975 return E_NOTIMPL;
2976
2977 case 83:
2978 case 101:
2979 case 102:
2980 case 132:
2981 case 133:
2982 case 134: /* TODO */
2983 case 135:
2984 case 136: /* TODO */
2985 case 137:
2986 case 139: /* TODO */
2987 case 143: /* TODO */
2988 case 144: /* TODO */
2989 case 178:
2990 case 179:
2991 case 180:
2992 case 181:
2993 case 182:
2994 case 183:
2995 return E_NOTIMPL;
2996
2997 default:
2998 ok(0, "unexpected command %d\n", nCmdID);
2999 return E_FAIL;
3000 };
3001 }
3002
3003 if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) {
3005 ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt);
3006
3007 switch(nCmdID) {
3008 case IDM_PARSECOMPLETE:
3009 CHECK_EXPECT(Exec_MSHTML_PARSECOMPLETE);
3010 ok(pvaIn == NULL, "pvaIn != NULL\n");
3011 ok(pvaOut == NULL, "pvaOut != NULL\n");
3012 return S_OK;
3013 default:
3014 ok(0, "unexpected command %d\n", nCmdID);
3015 };
3016 }
3017
3018 if(IsEqualGUID(&CGID_DocHostCmdPriv, pguidCmdGroup)) {
3019 switch(nCmdID) {
3021 if(pvaIn) {
3022 CHECK_EXPECT(Exec_DOCCANNAVIGATE);
3023 ok(V_VT(pvaIn) == VT_UNKNOWN, "V_VT(pvaIn) != VT_UNKNOWN\n");
3024 /* FIXME: test V_UNKNOWN(pvaIn) == window */
3025 }else {
3026 CHECK_EXPECT(Exec_DOCCANNAVIGATE_NULL);
3027 }
3028
3030 ok(pvaOut == NULL, "pvaOut != NULL\n");
3031 return S_OK;
3032 case 1: {
3033 SAFEARRAY *sa;
3034 UINT dim;
3035 LONG ind=0;
3036 VARIANT var;
3037 HRESULT hres;
3038
3040
3041 ok(pvaIn != NULL, "pvaIn == NULL\n");
3042 ok(pvaOut != NULL || broken(!pvaOut), "pvaOut != NULL\n");
3043 ok(V_VT(pvaIn) == VT_ARRAY, "V_VT(pvaIn) = %d\n", V_VT(pvaIn));
3044 if(pvaOut)
3045 ok(V_VT(pvaOut) == VT_BOOL, "V_VT(pvaOut) = %d\n", V_VT(pvaOut));
3046 sa = V_ARRAY(pvaIn);
3047
3048 dim = SafeArrayGetDim(sa);
3049 ok(dim == 1, "dim = %d\n", dim);
3050 hres = SafeArrayGetLBound(sa, 1, &ind);
3051 ok(hres == S_OK, "SafeArrayGetLBound failed: %x\n", hres);
3052 ok(ind == 0, "Lower bound = %d\n", ind);
3053 hres = SafeArrayGetUBound(sa, 1, &ind);
3054 ok(hres == S_OK, "SafeArrayGetUBound failed: %x\n", hres);
3055 ok(ind == 7 || ind == 8 /* IE11 */ ||broken(ind == 5), "Upper bound = %d\n", ind);
3056
3057 ind = 0;
3058 SafeArrayGetElement(sa, &ind, &var);
3059 ok(V_VT(&var) == VT_I4, "Incorrect data type: %d\n", V_VT(&var));
3060 ok(V_I4(&var) == status_code, "Incorrect error code: %d\n", V_I4(&var));
3061 VariantClear(&var);
3062 ind = 1;
3063 SafeArrayGetElement(sa, &ind, &var);
3064 ok(V_VT(&var) == VT_BSTR, "Incorrect data type: %d\n", V_VT(&var));
3065 ok(!strcmp_wa(V_BSTR(&var), "winetest:doc"), "Page address: %s\n", wine_dbgstr_w(V_BSTR(&var)));
3066 VariantClear(&var);
3067 ind = 2;
3068 SafeArrayGetElement(sa, &ind, &var);
3069 ok(V_VT(&var) == VT_UNKNOWN, "Incorrect data type: %d\n", V_VT(&var));
3070 VariantClear(&var);
3071 ind = 3;
3072 SafeArrayGetElement(sa, &ind, &var);
3073 ok(V_VT(&var) == VT_UNKNOWN, "Incorrect data type: %d\n", V_VT(&var));
3074 VariantClear(&var);
3075 ind = 4;
3076 SafeArrayGetElement(sa, &ind, &var);
3077 ok(V_VT(&var) == VT_BOOL, "Incorrect data type: %d\n", V_VT(&var));
3078 ok(!V_BOOL(&var), "Unknown value is incorrect\n");
3079 VariantClear(&var);
3080 ind = 5;
3081 SafeArrayGetElement(sa, &ind, &var);
3082 ok(V_VT(&var) == VT_BOOL, "Incorrect data type: %d\n", V_VT(&var));
3083 ok(!V_BOOL(&var), "Unknown value is incorrect\n");
3084 VariantClear(&var);
3085 }
3086 default:
3087 return E_FAIL; /* TODO */
3088 }
3089 }
3090
3091 if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) {
3093 ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt);
3094
3095 switch(nCmdID) {
3096 case 38:
3097 CHECK_EXPECT2(Exec_Explorer_38);
3098 ok(pvaIn != NULL, "pvaIn == NULL\n");
3099 ok(V_VT(pvaIn) == VT_I4 , "V_VT(pvaIn) = %d\n", V_VT(pvaIn));
3100 ok(!V_I4(pvaIn), "V_I4(pvaIn) = %d\n", V_I4(pvaIn));
3101 ok(!pvaOut, "pvaOut != NULL\n");
3102
3104 if(!history_stream)
3106
3107 return S_OK;
3108 case 69:
3109 CHECK_EXPECT2(Exec_Explorer_69);
3110 ok(pvaIn == NULL, "pvaIn != NULL\n");
3111 ok(pvaOut != NULL, "pvaOut == NULL\n");
3112 return E_NOTIMPL;
3113 case 109: /* TODO */
3114 return E_NOTIMPL;
3115 default:
3116 ok(0, "unexpected cmd %d of CGID_Explorer\n", nCmdID);
3117 }
3118 return E_NOTIMPL;
3119 }
3120
3121 if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup)) {
3123
3124 switch (nCmdID) {
3125 case OLECMDID_PAGEACTIONBLOCKED: /* win2k3 */
3126 SET_EXPECT(SetStatusText);
3127 ok(pvaIn == NULL, "pvaIn != NULL\n");
3128 ok(pvaOut == NULL, "pvaOut != NULL\n");
3129 return S_OK;
3130 case OLECMDID_SHOWSCRIPTERROR:
3131 /* TODO */
3132 return S_OK;
3133 case 2300:
3134 CHECK_EXPECT(Exec_DocHostCommandHandler_2300);
3135 return E_NOTIMPL;
3136 default:
3137 ok(0, "unexpected command %d\n", nCmdID);
3138 return E_FAIL;
3139 }
3140 }
3141
3142 ok(0, "unexpected pguidCmdGroup: %s\n", wine_dbgstr_guid(pguidCmdGroup));
3143 return E_NOTIMPL;
3144}
3145
3146static IOleCommandTargetVtbl OleCommandTargetVtbl = {
3152};
3153
3155
3157{
3158 return QueryInterface(riid, ppv);
3159}
3160
3162 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
3163 EXCEPINFO *pExcepInfo, UINT *puArgErr)
3164{
3166 return E_FAIL;
3167
3168 ok(IsEqualGUID(&IID_NULL, riid), "riid != IID_NULL\n");
3169 ok(pDispParams != NULL, "pDispParams == NULL\n");
3170 ok(pExcepInfo == NULL, "pExcepInfo=%p, expected NULL\n", pExcepInfo);
3171 ok(puArgErr != NULL, "puArgErr == NULL\n");
3172 ok(V_VT(pVarResult) == 0, "V_VT(pVarResult)=%d, expected 0\n", V_VT(pVarResult));
3173 ok(wFlags == DISPATCH_PROPERTYGET, "wFlags=%08x, expected DISPATCH_PROPERTYGET\n", wFlags);
3174
3175 if(dispIdMember != DISPID_AMBIENT_SILENT && dispIdMember != DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)
3177
3178 switch(dispIdMember) {
3180 CHECK_EXPECT2(Invoke_AMBIENT_USERMODE);
3181 V_VT(pVarResult) = VT_BOOL;
3182 V_BOOL(pVarResult) = VARIANT_TRUE;
3183 return S_OK;
3185 CHECK_EXPECT2(Invoke_AMBIENT_DLCONTROL);
3186 return E_FAIL;
3188 CHECK_EXPECT2(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
3189 return E_FAIL;
3191 CHECK_EXPECT2(Invoke_AMBIENT_SILENT);
3192 V_VT(pVarResult) = VT_BOOL;
3193 V_BOOL(pVarResult) = VARIANT_FALSE;
3194 return S_OK;
3196 CHECK_EXPECT(Invoke_AMBIENT_USERAGENT);
3197 return E_FAIL;
3199 CHECK_EXPECT(Invoke_AMBIENT_PALETTE);
3200 return E_FAIL;
3201 };
3202
3203 ok(0, "unexpected dispid %d\n", dispIdMember);
3204 return E_FAIL;
3205}
3206
3207static const IDispatchVtbl DispatchVtbl = {
3215};
3216
3218
3220{
3222 *ppv = iface;
3223 return S_OK;
3224 }
3225
3226 ok(0, "Unexpected call\n");
3227 return E_NOINTERFACE;
3228}
3229
3231 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
3232 EXCEPINFO *pExcepInfo, UINT *puArgErr)
3233{
3234 HRESULT hres;
3235 IHTMLDocument2 *doc;
3236 BSTR state;
3237
3239 return E_FAIL;
3240
3241 ok(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", wine_dbgstr_guid(riid));
3242 ok(pDispParams != NULL, "pDispParams == NULL\n");
3243 ok(pExcepInfo != NULL, "pExcepInfo == NULL\n");
3244 ok(puArgErr != NULL, "puArgErr == NULL\n");
3245 ok(V_VT(pVarResult) == 0, "V_VT(pVarResult) = %d\n", V_VT(pVarResult));
3246 ok(wFlags == DISPATCH_METHOD, "wFlags = %d, expected DISPATCH_METHOD\n", wFlags);
3247
3248 hres = IUnknown_QueryInterface(doc_unk, &IID_IHTMLDocument2, (void**)&doc);
3249 ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument2) failed: %08x\n", hres);
3250
3251 switch(dispIdMember) {
3253 hres = IHTMLDocument2_get_readyState(doc, &state);
3254 ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
3255
3256 if(!strcmp_wa(state, "interactive"))
3257 CHECK_EXPECT(Invoke_OnReadyStateChange_Interactive);
3258 else if(!strcmp_wa(state, "loading"))
3259 CHECK_EXPECT(Invoke_OnReadyStateChange_Loading);
3260 else if(!strcmp_wa(state, "complete")) {
3261 CHECK_EXPECT(Invoke_OnReadyStateChange_Complete);
3262 complete = TRUE;
3263 } else
3264 ok(0, "Unexpected readyState: %s\n", wine_dbgstr_w(state));
3265
3267 break;
3269 case 1026:
3270 case 1027:
3271 case 1034:
3272 case 1035:
3273 case 1037:
3274 case 1047:
3275 case 1045:
3276 case 1044:
3277 case 1048:
3278 case 1049:
3279 break; /* FIXME: Handle these events. */
3280 default:
3281 ok(0, "Unexpected DISPID: %d\n", dispIdMember);
3282 }
3283
3284 IHTMLDocument2_Release(doc);
3285 return S_OK;
3286}
3287
3288static const IDispatchVtbl EventDispatchVtbl = {
3296};
3297
3299
3301{
3302 static const IID IID_IIETravelLog2 = {0xb67cefd2,0xe3f1,0x478a,{0x9b,0xfa,0xd8,0x93,0x70,0x37,0x5e,0x94}};
3303 static const IID IID_unk_travellog = {0x6afc8b7f,0xbc17,0x4a95,{0x90,0x2f,0x6f,0x5c,0xb5,0x54,0xc3,0xd8}};
3304 static const IID IID_unk_travellog2 = {0xf6d02767,0x9c80,0x428d,{0xb9,0x74,0x3f,0x17,0x29,0x45,0x3f,0xdb}};
3305
3306 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITravelLog, riid)) {
3307 *ppv = iface;
3308 return S_OK;
3309 }
3310
3311 if(!IsEqualGUID(&IID_IIETravelLog2, riid) && !IsEqualGUID(&IID_unk_travellog, riid)
3312 && !IsEqualGUID(&IID_unk_travellog2, riid))
3313 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
3314
3315 *ppv = NULL;
3316 return E_NOINTERFACE;
3317}
3318
3320{
3321 return 2;
3322}
3323
3325{
3326 return 1;
3327}
3328
3329static HRESULT WINAPI TravelLog_AddEntry(ITravelLog *iface, IUnknown *punk, BOOL fIsLocalAnchor)
3330{
3331 ok(0, "unexpected call\n");
3332 return E_NOTIMPL;
3333}
3334
3335static HRESULT WINAPI TravelLog_UpdateEntry(ITravelLog *iface, IUnknown *punk, BOOL fIsLocalAnchor)
3336{
3337 ok(0, "unexpected call\n");
3338 return E_NOTIMPL;
3339}
3340
3341static HRESULT WINAPI TravelLog_UpdateExternal(ITravelLog *iface, IUnknown *punk, IUnknown *punkHLBrowseContext)
3342{
3343 ok(0, "unexpected call\n");
3344 return E_NOTIMPL;
3345}
3346
3347static HRESULT WINAPI TravelLog_Travel(ITravelLog *iface, IUnknown *punk, int iOffset)
3348{
3349 ok(0, "unexpected call\n");
3350 return E_NOTIMPL;
3351}
3352
3353static HRESULT WINAPI TravelLog_GetTravelEntry(ITravelLog *iface, IUnknown *punk, int iOffset, ITravelEntry **ppte)
3354{
3355 ok(0, "unexpected call\n");
3356 return E_NOTIMPL;
3357}
3358
3360{
3361 ok(0, "unexpected call\n");
3362 return E_NOTIMPL;
3363}
3364
3365static HRESULT WINAPI TravelLog_GetTooltipText(ITravelLog *iface, IUnknown *punk, int iOffset, int idsTemplate,
3366 LPWSTR pwzText, DWORD cchText)
3367{
3368 ok(0, "unexpected call\n");
3369 return E_NOTIMPL;
3370}
3371
3373 int idFirst, int idLast, DWORD dwFlags)
3374{
3375 ok(0, "unexpected call\n");
3376 return E_NOTIMPL;
3377}
3378
3380{
3381 ok(0, "unexpected call\n");
3382 return E_NOTIMPL;
3383}
3384
3387{
3388 CHECK_EXPECT(CountEntries);
3389
3390 ok(punk == (IUnknown*)&BrowserService, "punk != &BrowserService (%p)\n", punk);
3391 return 0;
3392}
3393
3395{
3396 ok(0, "unexpected call\n");
3397 return E_NOTIMPL;
3398}
3399
3400static const ITravelLogVtbl TravelLogVtbl = {
3415};
3416
3418
3419static HRESULT browserservice_qi(REFIID,void**);
3420
3422{
3423 return browserservice_qi(riid, ppv);
3424}
3425
3428{
3429 return 2;
3430}
3431
3434{
3435 return 1;
3436}
3437
3439 LPCWSTR lpszUrl, DWORD dwFlags, LPCWSTR lpszFrameName, BYTE *pPostData, DWORD cbPostData,
3440 LPCWSTR lpszHeaders, BOOL fPlayNavSound, BOOL *pfCancel)
3441{
3442 CHECK_EXPECT(FireBeforeNavigate2);
3443
3444 ok(!pDispatch, "pDispatch = %p\n", pDispatch);
3445 ok(!strcmp_wa(lpszUrl, nav_url), "lpszUrl = %s, expected %s\n", wine_dbgstr_w(lpszUrl), nav_url);
3446 ok(dwFlags == 0x140 /* IE11*/ || dwFlags == 0x40 || !dwFlags || dwFlags == 0x50, "dwFlags = %x\n", dwFlags);
3447 ok(!lpszFrameName, "lpszFrameName = %s\n", wine_dbgstr_w(lpszFrameName));
3448 if(!testing_submit) {
3449 ok(!pPostData, "pPostData = %p\n", pPostData);
3450 ok(!cbPostData, "cbPostData = %d\n", cbPostData);
3451 ok(!lpszHeaders || !strcmp_wa(lpszHeaders, "Referer: http://test.winehq.org/tests/winehq_snapshot/\r\n"),
3452 "lpszHeaders = %s\n", wine_dbgstr_w(lpszHeaders));
3453 }else {
3454 ok(cbPostData == 9, "cbPostData = %d\n", cbPostData);
3455 ok(!memcmp(pPostData, "cmd=TEST", cbPostData), "pPostData = %p\n", pPostData);
3456 ok(wstr_contains(lpszHeaders, "Content-Type: application/x-www-form-urlencoded\r\n"),
3457 "lpszHeaders = %s\n", wine_dbgstr_w(lpszHeaders));
3458
3459 }
3460 ok(fPlayNavSound, "fPlayNavSound = %x\n", fPlayNavSound);
3461 ok(pfCancel != NULL, "pfCancel = NULL\n");
3462 ok(!*pfCancel, "*pfCancel = %x\n", *pfCancel);
3463
3464 return S_OK;
3465}
3466
3469 IHTMLWindow2 *pHTMLWindow2,
3470 DWORD dwFlags)
3471{
3472 CHECK_EXPECT(FireNavigateComplete2);
3474
3475 if(loading_hash)
3476 ok(dwFlags == 0x10 || broken(!dwFlags), "dwFlags = %x, expected 0x10\n", dwFlags);
3477 else
3478 ok(!(dwFlags &~1), "dwFlags = %x\n", dwFlags);
3479
3480 ok(pHTMLWindow2 != NULL, "pHTMLWindow2 = NULL\n");
3481
3482 return S_OK;
3483}
3484
3487{
3488 ok(0, "unexpected call\n");
3489 return E_NOTIMPL;
3490}
3491
3494{
3495 ok(0, "unexpected call\n");
3496 return E_NOTIMPL;
3497}
3498
3501 IHTMLWindow2 *pHTMLWindow,
3502 DWORD dwFlags)
3503{
3504 CHECK_EXPECT(FireDocumentComplete);
3505
3506 ok(pHTMLWindow != NULL, "pHTMLWindow == NULL\n");
3507 ok(!dwFlags, "dwFlags = %x\n", dwFlags);
3508
3509 return S_OK;
3510}
3511
3514 IHTMLWindow2 *pHTMLWindow)
3515{
3516 ok(0, "unexpected call\n");
3517 return E_NOTIMPL;
3518}
3519
3522 BSTR *pbstrPendingUrl)
3523{
3525 CHECK_EXPECT(GetPendingUrl);
3526 return E_NOTIMPL;
3527}
3528
3531 IHTMLElement *pHTMLElement)
3532{
3533 CHECK_EXPECT2(ActiveElementChanged);
3534 return E_NOTIMPL;