2004-05-03 22:07:03 +02:00
|
|
|
/*
|
|
|
|
* UrlMon URL tests
|
|
|
|
*
|
|
|
|
* Copyright 2004 Kevin Koltzau
|
2007-10-25 21:55:24 +02:00
|
|
|
* Copyright 2004-2007 Jacek Caban for CodeWeavers
|
2004-05-03 22:07:03 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-05-03 22:07:03 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2007-10-01 14:10:36 +02:00
|
|
|
#include <stdio.h>
|
2004-08-11 21:43:45 +02:00
|
|
|
|
|
|
|
#define COBJMACROS
|
2008-01-31 18:19:53 +01:00
|
|
|
#define NONAMELESSUNION
|
2006-09-29 12:45:44 +02:00
|
|
|
#define CONST_VTABLE
|
2004-08-11 21:43:45 +02:00
|
|
|
|
2004-05-03 22:07:03 +02:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2008-07-08 16:17:17 +02:00
|
|
|
#include "initguid.h"
|
2004-05-03 22:07:03 +02:00
|
|
|
#include "urlmon.h"
|
2006-09-21 11:45:32 +02:00
|
|
|
#include "wininet.h"
|
2007-10-26 18:16:31 +02:00
|
|
|
#include "mshtml.h"
|
2004-05-03 22:07:03 +02:00
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
|
2010-04-22 00:28:55 +02:00
|
|
|
static HRESULT (WINAPI *pCreateAsyncBindCtxEx)(IBindCtx *, DWORD,
|
|
|
|
IBindStatusCallback *, IEnumFORMATETC *, IBindCtx **, DWORD);
|
2010-12-20 15:15:00 +01:00
|
|
|
static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
|
2010-04-22 00:28:55 +02:00
|
|
|
|
2008-07-08 16:17:17 +02:00
|
|
|
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
|
|
|
|
DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(IID_IBindStatusCallbackHolder,0x79eac9cc,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b);
|
2014-02-27 16:36:10 +01:00
|
|
|
static const IID IID_undocumentedIE11 = {0xd5ae15f6,0x2032,0x488e,{0x8f,0x96,0xf9,0x24,0x06,0xd8,0xd8,0xb4}};
|
2012-03-15 12:07:46 +01:00
|
|
|
extern CLSID CLSID_AboutProtocol;
|
2008-07-08 16:17:17 +02:00
|
|
|
|
2005-09-16 20:46:29 +02:00
|
|
|
#define DEFINE_EXPECT(func) \
|
|
|
|
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
|
|
|
|
|
|
|
|
#define SET_EXPECT(func) \
|
2008-01-31 18:19:53 +01:00
|
|
|
do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-12-24 13:21:27 +01:00
|
|
|
#define CHECK_EXPECT2(func) \
|
2005-11-14 16:12:43 +01:00
|
|
|
do { \
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(expect_ ##func, "unexpected call " #func "\n"); \
|
2005-11-14 16:12:43 +01:00
|
|
|
called_ ## func = TRUE; \
|
|
|
|
}while(0)
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-12-24 13:21:27 +01:00
|
|
|
#define CHECK_EXPECT(func) \
|
2005-11-14 16:12:43 +01:00
|
|
|
do { \
|
2007-12-24 13:21:27 +01:00
|
|
|
CHECK_EXPECT2(func); \
|
|
|
|
expect_ ## func = FALSE; \
|
2005-11-14 16:12:43 +01:00
|
|
|
}while(0)
|
2005-09-16 20:46:29 +02:00
|
|
|
|
|
|
|
#define CHECK_CALLED(func) \
|
2005-11-14 16:12:43 +01:00
|
|
|
do { \
|
|
|
|
ok(called_ ## func, "expected " #func "\n"); \
|
|
|
|
expect_ ## func = called_ ## func = FALSE; \
|
|
|
|
}while(0)
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-07-24 03:31:50 +02:00
|
|
|
#define CHECK_NOT_CALLED(func) \
|
|
|
|
do { \
|
|
|
|
ok(!called_ ## func, "unexpected " #func "\n"); \
|
|
|
|
expect_ ## func = called_ ## func = FALSE; \
|
|
|
|
}while(0)
|
|
|
|
|
2009-02-17 10:06:18 +01:00
|
|
|
#define CHECK_CALLED_BROKEN(func) \
|
|
|
|
do { \
|
|
|
|
ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
|
|
|
|
expect_ ## func = called_ ## func = FALSE; \
|
|
|
|
}while(0)
|
|
|
|
|
2007-07-24 03:31:50 +02:00
|
|
|
#define CLEAR_CALLED(func) \
|
|
|
|
expect_ ## func = called_ ## func = FALSE
|
|
|
|
|
|
|
|
DEFINE_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
DEFINE_EXPECT(QueryInterface_IHttpNegotiate);
|
2007-10-01 14:10:36 +02:00
|
|
|
DEFINE_EXPECT(QueryInterface_IBindStatusCallback);
|
2009-07-02 23:21:08 +02:00
|
|
|
DEFINE_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
2007-10-01 14:10:36 +02:00
|
|
|
DEFINE_EXPECT(QueryInterface_IBindStatusCallbackHolder);
|
|
|
|
DEFINE_EXPECT(QueryInterface_IAuthenticate);
|
|
|
|
DEFINE_EXPECT(QueryInterface_IInternetProtocol);
|
2009-09-11 12:22:38 +02:00
|
|
|
DEFINE_EXPECT(QueryInterface_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
DEFINE_EXPECT(QueryInterface_IHttpSecurity);
|
2007-10-01 14:11:11 +02:00
|
|
|
DEFINE_EXPECT(QueryService_IAuthenticate);
|
|
|
|
DEFINE_EXPECT(QueryService_IInternetProtocol);
|
2007-10-25 21:55:24 +02:00
|
|
|
DEFINE_EXPECT(QueryService_IInternetBindInfo);
|
2009-09-11 12:22:38 +02:00
|
|
|
DEFINE_EXPECT(QueryService_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
DEFINE_EXPECT(QueryService_IHttpSecurity);
|
2007-07-24 03:33:08 +02:00
|
|
|
DEFINE_EXPECT(BeginningTransaction);
|
|
|
|
DEFINE_EXPECT(OnResponse);
|
2007-07-24 03:31:50 +02:00
|
|
|
DEFINE_EXPECT(QueryInterface_IHttpNegotiate2);
|
2007-07-24 03:33:08 +02:00
|
|
|
DEFINE_EXPECT(GetRootSecurityId);
|
2005-09-16 20:46:29 +02:00
|
|
|
DEFINE_EXPECT(GetBindInfo);
|
2009-07-02 23:21:08 +02:00
|
|
|
DEFINE_EXPECT(GetBindInfoEx);
|
2005-09-16 20:46:29 +02:00
|
|
|
DEFINE_EXPECT(OnStartBinding);
|
|
|
|
DEFINE_EXPECT(OnProgress_FINDINGRESOURCE);
|
|
|
|
DEFINE_EXPECT(OnProgress_CONNECTING);
|
2009-12-15 21:15:28 +01:00
|
|
|
DEFINE_EXPECT(OnProgress_REDIRECTING);
|
2005-09-16 20:46:29 +02:00
|
|
|
DEFINE_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
DEFINE_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
DEFINE_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
DEFINE_EXPECT(OnProgress_DOWNLOADINGDATA);
|
|
|
|
DEFINE_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
DEFINE_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
2005-09-16 20:46:29 +02:00
|
|
|
DEFINE_EXPECT(OnStopBinding);
|
|
|
|
DEFINE_EXPECT(OnDataAvailable);
|
2007-10-26 18:16:31 +02:00
|
|
|
DEFINE_EXPECT(OnObjectAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
DEFINE_EXPECT(Obj_OnStartBinding);
|
|
|
|
DEFINE_EXPECT(Obj_OnStopBinding);
|
|
|
|
DEFINE_EXPECT(Obj_GetBindInfo);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
|
|
|
|
DEFINE_EXPECT(Obj_OnProgress_CONNECTING);
|
2009-12-15 21:16:35 +01:00
|
|
|
DEFINE_EXPECT(Obj_OnProgress_REDIRECTING);
|
2008-01-31 18:19:53 +01:00
|
|
|
DEFINE_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
2005-11-14 16:12:43 +01:00
|
|
|
DEFINE_EXPECT(Start);
|
|
|
|
DEFINE_EXPECT(Read);
|
|
|
|
DEFINE_EXPECT(LockRequest);
|
|
|
|
DEFINE_EXPECT(Terminate);
|
|
|
|
DEFINE_EXPECT(UnlockRequest);
|
2007-10-25 21:55:24 +02:00
|
|
|
DEFINE_EXPECT(Continue);
|
2010-10-06 21:36:32 +02:00
|
|
|
DEFINE_EXPECT(Abort);
|
2007-12-30 17:55:02 +01:00
|
|
|
DEFINE_EXPECT(CreateInstance);
|
|
|
|
DEFINE_EXPECT(Load);
|
|
|
|
DEFINE_EXPECT(PutProperty_MIMETYPEPROP);
|
|
|
|
DEFINE_EXPECT(PutProperty_CLASSIDPROP);
|
2009-03-29 21:30:42 +02:00
|
|
|
DEFINE_EXPECT(SetPriority);
|
2011-01-09 06:28:54 +01:00
|
|
|
DEFINE_EXPECT(GetWindow_IHttpSecurity);
|
|
|
|
DEFINE_EXPECT(GetWindow_IWindowForBindingUI);
|
2013-08-13 10:41:39 +02:00
|
|
|
DEFINE_EXPECT(GetWindow_ICodeInstall);
|
2011-01-09 06:28:54 +01:00
|
|
|
DEFINE_EXPECT(OnSecurityProblem);
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2011-04-07 15:46:01 +02:00
|
|
|
static const WCHAR winetest_data_urlW[] =
|
|
|
|
{'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/',
|
|
|
|
't','e','s','t','s','/','d','a','t','a','.','p','h','p',0};
|
2013-02-12 17:17:02 +01:00
|
|
|
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
|
2007-02-10 16:34:41 +01:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
static const WCHAR wszWineHQSite[] =
|
|
|
|
{'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
|
|
|
|
static const WCHAR wszWineHQIP[] =
|
|
|
|
{'2','0','9','.','3','2','.','1','4','1','.','3',0};
|
2008-11-11 10:54:54 +01:00
|
|
|
static const CHAR wszIndexHtmlA[] = "index.html";
|
2008-01-31 18:19:53 +01:00
|
|
|
static const WCHAR cache_fileW[] = {'c',':','\\','c','a','c','h','e','.','h','t','m',0};
|
2008-11-11 10:54:54 +01:00
|
|
|
static const CHAR dwl_htmlA[] = "dwl.html";
|
2008-02-18 01:04:34 +01:00
|
|
|
static const WCHAR dwl_htmlW[] = {'d','w','l','.','h','t','m','l',0};
|
2010-09-19 15:01:42 +02:00
|
|
|
static const CHAR test_txtA[] = "test.txt";
|
2007-12-30 17:55:02 +01:00
|
|
|
static const WCHAR emptyW[] = {0};
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
static BOOL stopped_binding = FALSE, stopped_obj_binding = FALSE, emulate_protocol = FALSE,
|
2013-02-12 17:17:02 +01:00
|
|
|
data_available = FALSE, http_is_first = TRUE, bind_to_object = FALSE, filedwl_api, post_test;
|
2011-01-09 06:28:54 +01:00
|
|
|
static DWORD read = 0, bindf = 0, prot_state = 0, thread_id, tymed, security_problem;
|
2012-01-20 14:53:02 +01:00
|
|
|
static const WCHAR *reported_url;
|
2007-08-09 03:24:13 +02:00
|
|
|
static CHAR mime_type[512];
|
2007-10-25 21:55:24 +02:00
|
|
|
static IInternetProtocolSink *protocol_sink = NULL;
|
2009-03-29 21:31:15 +02:00
|
|
|
static IBinding *current_binding;
|
2007-10-25 21:55:24 +02:00
|
|
|
static HANDLE complete_event, complete_event2;
|
2007-12-30 17:55:02 +01:00
|
|
|
static HRESULT binding_hres;
|
2011-01-09 06:28:54 +01:00
|
|
|
static HRESULT onsecurityproblem_hres;
|
2011-05-02 05:29:53 +02:00
|
|
|
static HRESULT abort_hres;
|
2010-10-14 00:51:18 +02:00
|
|
|
static BOOL have_IHttpNegotiate2, use_bscex, is_async_prot;
|
2010-10-06 21:36:32 +02:00
|
|
|
static BOOL test_redirect, use_cache_file, callback_read, no_callback, test_abort;
|
2010-05-04 20:14:49 +02:00
|
|
|
static WCHAR cache_file_name[MAX_PATH];
|
2010-12-19 21:26:06 +01:00
|
|
|
static BOOL only_check_prot_args = FALSE;
|
2011-01-09 06:28:54 +01:00
|
|
|
static BOOL invalid_cn_accepted = FALSE;
|
2011-05-02 05:29:53 +02:00
|
|
|
static BOOL abort_start = FALSE;
|
|
|
|
static BOOL abort_progress = FALSE;
|
2012-01-20 14:52:50 +01:00
|
|
|
static BOOL async_switch = FALSE;
|
2013-11-15 15:45:51 +01:00
|
|
|
static BOOL strict_bsc_qi;
|
2014-02-04 10:49:22 +01:00
|
|
|
static DWORD bindtest_flags;
|
2013-08-13 10:41:39 +02:00
|
|
|
static const char *test_file;
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
static WCHAR file_url[INTERNET_MAX_URL_LENGTH], current_url[INTERNET_MAX_URL_LENGTH];
|
2008-02-18 01:04:34 +01:00
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
static enum {
|
|
|
|
HTTP_TEST,
|
2005-12-26 13:27:10 +01:00
|
|
|
ABOUT_TEST,
|
2007-02-10 16:33:38 +01:00
|
|
|
FILE_TEST,
|
2007-02-10 16:34:41 +01:00
|
|
|
ITS_TEST,
|
2009-01-12 18:20:28 +01:00
|
|
|
MK_TEST,
|
2009-03-04 19:06:18 +01:00
|
|
|
HTTPS_TEST,
|
2010-10-06 21:36:32 +02:00
|
|
|
FTP_TEST,
|
2012-09-03 13:59:08 +02:00
|
|
|
WINETEST_TEST,
|
|
|
|
WINETEST_SYNC_TEST
|
2005-11-14 16:12:43 +01:00
|
|
|
} test_protocol;
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2007-08-07 06:08:49 +02:00
|
|
|
static enum {
|
|
|
|
BEFORE_DOWNLOAD,
|
|
|
|
DOWNLOADING,
|
|
|
|
END_DOWNLOAD
|
|
|
|
} download_state;
|
|
|
|
|
2011-01-19 12:44:07 +01:00
|
|
|
static BOOL proxy_active(void)
|
|
|
|
{
|
|
|
|
HKEY internet_settings;
|
|
|
|
DWORD proxy_enable;
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
|
|
|
|
0, KEY_QUERY_VALUE, &internet_settings) != ERROR_SUCCESS)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
size = sizeof(DWORD);
|
|
|
|
if (RegQueryValueExA(internet_settings, "ProxyEnable", NULL, NULL, (LPBYTE) &proxy_enable, &size) != ERROR_SUCCESS)
|
|
|
|
proxy_enable = 0;
|
|
|
|
|
|
|
|
RegCloseKey(internet_settings);
|
|
|
|
|
|
|
|
return proxy_enable != 0;
|
|
|
|
}
|
|
|
|
|
2009-03-29 21:30:42 +02:00
|
|
|
static BOOL is_urlmon_protocol(int prot)
|
|
|
|
{
|
|
|
|
return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST;
|
|
|
|
}
|
|
|
|
|
2004-05-03 22:07:03 +02:00
|
|
|
static void test_CreateURLMoniker(LPCWSTR url1, LPCWSTR url2)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
IMoniker *mon1 = NULL;
|
|
|
|
IMoniker *mon2 = NULL;
|
|
|
|
|
2010-05-20 05:25:54 +02:00
|
|
|
hr = CreateURLMoniker(NULL, NULL, NULL);
|
|
|
|
ok(hr == E_INVALIDARG,
|
|
|
|
"Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
mon1 = (IMoniker *)0xdeadbeef;
|
|
|
|
hr = CreateURLMoniker(NULL, NULL, &mon1);
|
|
|
|
ok(hr == E_INVALIDARG,
|
|
|
|
"Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
|
|
|
|
ok(mon1 == NULL, "Expected the output pointer to be NULL, got %p\n", mon1);
|
|
|
|
|
|
|
|
hr = CreateURLMoniker(NULL, emptyW, NULL);
|
|
|
|
ok(hr == E_INVALIDARG,
|
|
|
|
"Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
hr = CreateURLMoniker(NULL, emptyW, &mon1);
|
|
|
|
ok(hr == S_OK ||
|
|
|
|
broken(hr == MK_E_SYNTAX), /* IE5/IE5.01/IE6 SP2 */
|
|
|
|
"Expected CreateURLMoniker to return S_OK, got 0x%08x\n", hr);
|
|
|
|
if(mon1) IMoniker_Release(mon1);
|
|
|
|
|
2004-05-03 22:07:03 +02:00
|
|
|
hr = CreateURLMoniker(NULL, url1, &mon1);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hr == S_OK, "failed to create moniker: 0x%08x\n", hr);
|
|
|
|
if(hr == S_OK) {
|
2004-05-03 22:07:03 +02:00
|
|
|
hr = CreateURLMoniker(mon1, url2, &mon2);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hr == S_OK, "failed to create moniker: 0x%08x\n", hr);
|
2004-05-03 22:07:03 +02:00
|
|
|
}
|
|
|
|
if(mon1) IMoniker_Release(mon1);
|
|
|
|
if(mon2) IMoniker_Release(mon2);
|
|
|
|
}
|
|
|
|
|
2005-06-17 12:11:37 +02:00
|
|
|
static void test_create(void)
|
2004-05-03 22:07:03 +02:00
|
|
|
{
|
2011-04-01 08:57:12 +02:00
|
|
|
static const WCHAR relativeW[] = {'a','/','b','.','t','x','t',0};
|
|
|
|
IStream *stream;
|
|
|
|
IMoniker *mon;
|
|
|
|
IBindCtx *bctx;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
static const WCHAR TEST_PART_URL_1[] = {'/','t','e','s','t','s','/','d','a','t','a','.','p','h','p',0};
|
|
|
|
|
2011-04-07 15:46:01 +02:00
|
|
|
test_CreateURLMoniker(winetest_data_urlW, TEST_PART_URL_1);
|
2011-04-01 08:57:12 +02:00
|
|
|
|
|
|
|
mon = (void*)0xdeadbeef;
|
|
|
|
hr = CreateURLMoniker(NULL, relativeW, &mon);
|
|
|
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
hr = CreateBindCtx(0, &bctx);
|
2011-07-26 04:10:41 +02:00
|
|
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
2011-04-01 08:57:12 +02:00
|
|
|
|
|
|
|
stream = (void*)0xdeadbeef;
|
|
|
|
hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&stream);
|
|
|
|
todo_wine ok(hr == INET_E_UNKNOWN_PROTOCOL, "got 0x%08x\n", hr);
|
|
|
|
ok(stream == NULL, "got %p\n", stream);
|
|
|
|
|
|
|
|
hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, NULL);
|
|
|
|
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
stream = (void*)0xdeadbeef;
|
|
|
|
hr = IMoniker_BindToStorage(mon, NULL, NULL, &IID_IStream, (void**)&stream);
|
|
|
|
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
|
|
|
ok(stream == NULL || broken(stream == (void*)0xdeadbeef) /* starting XP SP3 it's set to null */,
|
|
|
|
"got %p\n", stream);
|
|
|
|
|
|
|
|
IMoniker_Release(mon);
|
|
|
|
|
|
|
|
mon = (void*)0xdaedbeef;
|
2011-04-07 15:46:01 +02:00
|
|
|
hr = CreateURLMoniker(NULL, winetest_data_urlW, &mon);
|
2011-04-01 08:57:12 +02:00
|
|
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
stream = (void*)0xdeadbeef;
|
|
|
|
hr = IMoniker_BindToStorage(mon, NULL, NULL, &IID_IStream, (void**)&stream);
|
|
|
|
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
|
|
|
ok(stream == NULL || broken(stream == (void*)0xdeadbeef) /* starting XP SP3 it's set to null */,
|
|
|
|
"got %p\n", stream);
|
|
|
|
|
|
|
|
hr = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, NULL);
|
|
|
|
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
|
|
|
|
|
|
|
IMoniker_Release(mon);
|
|
|
|
IBindCtx_Release(bctx);
|
2004-05-03 22:07:03 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 21:30:42 +02:00
|
|
|
static HRESULT WINAPI Priority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Priority_AddRef(IInternetPriority *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Priority_Release(IInternetPriority *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Priority_SetPriority(IInternetPriority *iface, LONG nPriority)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(SetPriority);
|
|
|
|
ok(!nPriority, "nPriority = %d\n", nPriority);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Priority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IInternetPriorityVtbl InternetPriorityVtbl = {
|
|
|
|
Priority_QueryInterface,
|
|
|
|
Priority_AddRef,
|
|
|
|
Priority_Release,
|
|
|
|
Priority_SetPriority,
|
|
|
|
Priority_GetPriority
|
|
|
|
};
|
|
|
|
|
|
|
|
static IInternetPriority InternetPriority = { &InternetPriorityVtbl };
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
static HRESULT WINAPI Protocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2013-11-15 15:45:51 +01:00
|
|
|
static const IID IID_undocumentedIE10 = {0x7daf9908,0x8415,0x4005,{0x95,0xae,0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
|
|
|
|
|
2009-03-29 21:30:42 +02:00
|
|
|
*ppv = NULL;
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-03-29 21:30:42 +02:00
|
|
|
if(IsEqualGUID(&IID_IInternetPriority, riid)) {
|
|
|
|
if(!is_urlmon_protocol(test_protocol))
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
|
|
|
*ppv = &InternetPriority;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IInternetProtocolEx, riid))
|
|
|
|
return E_NOINTERFACE; /* TODO */
|
|
|
|
|
2013-11-15 15:45:51 +01:00
|
|
|
if(IsEqualGUID(&IID_undocumentedIE10, riid)) {
|
2014-01-25 15:24:46 +01:00
|
|
|
trace("QI(%s)\n", wine_dbgstr_guid(riid));
|
2013-11-15 15:45:51 +01:00
|
|
|
return E_NOINTERFACE; /* TODO */
|
|
|
|
}
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
|
2005-11-14 16:12:43 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Protocol_AddRef(IInternetProtocol *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Protocol_Release(IInternetProtocol *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2009-05-11 22:01:05 +02:00
|
|
|
static void test_switch_fail(void)
|
|
|
|
{
|
|
|
|
IInternetProtocolSink *binding_sink;
|
2011-06-03 11:40:05 +02:00
|
|
|
PROTOCOLDATA protocoldata = {0};
|
2009-05-11 22:01:05 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static BOOL tested_switch_fail;
|
|
|
|
|
|
|
|
if(tested_switch_fail)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tested_switch_fail = TRUE;
|
|
|
|
|
|
|
|
hres = IBinding_QueryInterface(current_binding, &IID_IInternetProtocolSink, (void**)&binding_sink);
|
|
|
|
ok(hres == S_OK, "Could not get IInternetProtocolSink iface: %08x\n", hres);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = IInternetProtocolSink_Switch(binding_sink, &protocoldata);
|
|
|
|
ok(hres == E_FAIL, "Switch failed: %08x, expected E_FAIL\n", hres);
|
|
|
|
IInternetProtocolSink_Release(binding_sink);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
static DWORD WINAPI thread_proc(PVOID arg)
|
|
|
|
{
|
2011-06-03 11:40:05 +02:00
|
|
|
PROTOCOLDATA protocoldata = {0};
|
2007-10-25 21:55:24 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_FINDINGRESOURCE);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_FINDINGRESOURCE, wszWineHQSite);
|
|
|
|
ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2010-10-06 21:36:32 +02:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_FINDINGRESOURCE);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_CONNECTING);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_CONNECTING);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_CONNECTING, wszWineHQIP);
|
|
|
|
ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2010-10-06 21:36:32 +02:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CONNECTING);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_CONNECTING);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_SENDINGREQUEST, NULL);
|
2009-12-15 21:15:28 +01:00
|
|
|
ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2010-10-06 21:36:32 +02:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2009-12-15 21:15:28 +01:00
|
|
|
if(test_redirect) {
|
2009-12-15 21:16:35 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_REDIRECTING);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_REDIRECTING);
|
2011-04-07 15:46:01 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_REDIRECTING, winetest_data_urlW);
|
2009-12-15 21:15:28 +01:00
|
|
|
ok(hres == S_OK, "ReportProgress(BINDSTATUS_REFIRECTING) failed: %08x\n", hres);
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2009-12-15 21:16:35 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_REDIRECTING);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_REDIRECTING);
|
2009-12-15 21:15:28 +01:00
|
|
|
}
|
|
|
|
|
2009-05-11 22:01:05 +02:00
|
|
|
test_switch_fail();
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
SET_EXPECT(Continue);
|
|
|
|
prot_state = 1;
|
|
|
|
hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
|
|
|
|
ok(hres == S_OK, "Switch failed: %08x\n", hres);
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
CHECK_CALLED(Continue);
|
|
|
|
CHECK_CALLED(Read);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object) {
|
|
|
|
CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
CHECK_CALLED(CreateInstance);
|
|
|
|
CHECK_CALLED(PutProperty_MIMETYPEPROP);
|
2009-02-17 10:06:18 +01:00
|
|
|
CHECK_CALLED_BROKEN(PutProperty_CLASSIDPROP);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Load);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
CHECK_CALLED(OnObjectAvailable);
|
|
|
|
CHECK_CALLED(Obj_OnStopBinding);
|
2010-10-06 21:36:32 +02:00
|
|
|
}else if(!no_callback) {
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
2010-10-06 21:36:32 +02:00
|
|
|
}else {
|
|
|
|
CHECK_CALLED(LockRequest);
|
2007-12-30 17:55:02 +01:00
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
SET_EXPECT(Continue);
|
|
|
|
prot_state = 2;
|
|
|
|
hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
|
|
|
|
ok(hres == S_OK, "Switch failed: %08x\n", hres);
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2007-10-25 21:55:24 +02:00
|
|
|
CHECK_CALLED(Continue);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_abort) {
|
|
|
|
CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
SetEvent(complete_event2);
|
|
|
|
return 0;
|
|
|
|
}else {
|
|
|
|
CHECK_CALLED(Read);
|
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
|
|
|
}
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
SET_EXPECT(Continue);
|
|
|
|
prot_state = 2;
|
|
|
|
hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
|
|
|
|
ok(hres == S_OK, "Switch failed: %08x\n", hres);
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2007-10-25 21:55:24 +02:00
|
|
|
CHECK_CALLED(Continue);
|
|
|
|
CHECK_CALLED(Read);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
SET_EXPECT(Continue);
|
|
|
|
prot_state = 3;
|
|
|
|
hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
|
|
|
|
ok(hres == S_OK, "Switch failed: %08x\n", hres);
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2007-10-25 21:55:24 +02:00
|
|
|
CHECK_CALLED(Continue);
|
|
|
|
CHECK_CALLED(Read);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
SET_EXPECT(Read);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
SetEvent(complete_event2);
|
2007-10-25 21:55:24 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
static HRESULT WINAPI Protocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
|
|
|
|
IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
|
2009-04-01 03:42:37 +02:00
|
|
|
DWORD grfPI, HANDLE_PTR dwReserved)
|
2005-11-14 16:12:43 +01:00
|
|
|
{
|
2007-12-30 17:55:02 +01:00
|
|
|
BINDINFO bindinfo;
|
2010-04-29 17:14:47 +02:00
|
|
|
DWORD bind_info, bscf = BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION;
|
2005-11-14 16:12:43 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
static const STGMEDIUM stgmed_zero = {0};
|
|
|
|
static const SECURITY_ATTRIBUTES sa_zero = {0};
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
CHECK_EXPECT(Start);
|
|
|
|
|
|
|
|
read = 0;
|
|
|
|
|
2012-01-20 14:53:02 +01:00
|
|
|
reported_url = szUrl;
|
2008-02-18 01:04:34 +01:00
|
|
|
if(!filedwl_api) /* FIXME */
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(szUrl && !lstrcmpW(szUrl, current_url), "wrong url %s\n", wine_dbgstr_w(szUrl));
|
2005-11-14 16:12:43 +01:00
|
|
|
ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
|
|
|
|
ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(grfPI == 0, "grfPI=%d, expected 0\n", grfPI);
|
2009-04-01 03:42:37 +02:00
|
|
|
ok(dwReserved == 0, "dwReserved=%lx, expected 0\n", dwReserved);
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2008-02-18 01:04:34 +01:00
|
|
|
if(!filedwl_api && binding_hres != S_OK) {
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
SET_EXPECT(Terminate);
|
|
|
|
hres = IInternetProtocolSink_ReportResult(pOIProtSink, binding_hres, 0, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
CHECK_CALLED(Terminate);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-08 13:45:51 +01:00
|
|
|
memset(&bindinfo, 0, sizeof(bindinfo));
|
|
|
|
bindinfo.cbSize = 0;
|
|
|
|
hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
|
|
|
|
ok(hres == E_INVALIDARG, "GetBindInfo returned: %08x, expected E_INVALIDARG\n", hres);
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
memset(&bindinfo, 0, sizeof(bindinfo));
|
|
|
|
bindinfo.cbSize = sizeof(bindinfo);
|
2010-04-29 17:14:47 +02:00
|
|
|
hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2010-05-04 20:14:49 +02:00
|
|
|
ok(bind_info & BINDF_FROMURLMON, "BINDF_FROMURLMON is not set\n");
|
|
|
|
|
2010-12-19 21:26:06 +01:00
|
|
|
if(filedwl_api || !is_urlmon_protocol(test_protocol) || tymed != TYMED_ISTREAM ||
|
|
|
|
!(bindf&BINDF_ASYNCSTORAGE) || !(bindf&BINDF_PULLDATA))
|
2010-05-04 20:14:49 +02:00
|
|
|
ok(bind_info & BINDF_NEEDFILE, "BINDF_NEEDFILE is not set\n");
|
2013-11-15 15:45:51 +01:00
|
|
|
else if(test_protocol != MK_TEST) /* IE10 sets BINDF_NEEDFILE for mk: protocol */
|
2010-05-04 20:14:49 +02:00
|
|
|
ok(!(bind_info & BINDF_NEEDFILE), "BINDF_NEEDFILE is set\n");
|
|
|
|
|
|
|
|
bind_info &= ~(BINDF_NEEDFILE|BINDF_FROMURLMON);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(filedwl_api || no_callback)
|
2010-05-04 20:14:49 +02:00
|
|
|
ok(bind_info == BINDF_PULLDATA, "bind_info = %x, expected BINDF_PULLDATA\n", bind_info);
|
|
|
|
else
|
|
|
|
ok(bind_info == (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)), "bind_info = %x, expected %x\n",
|
|
|
|
bind_info, (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)));
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(bindinfo.cbSize == sizeof(bindinfo), "bindinfo.cbSize = %d\n", bindinfo.cbSize);
|
|
|
|
ok(!bindinfo.szExtraInfo, "bindinfo.szExtraInfo = %p\n", bindinfo.szExtraInfo);
|
|
|
|
ok(!memcmp(&bindinfo.stgmedData, &stgmed_zero, sizeof(STGMEDIUM)), "wrong stgmedData\n");
|
|
|
|
ok(!bindinfo.grfBindInfoF, "bindinfo.grfBindInfoF = %d\n", bindinfo.grfBindInfoF);
|
|
|
|
ok(!bindinfo.dwBindVerb, "bindinfo.dwBindVerb = %d\n", bindinfo.dwBindVerb);
|
|
|
|
ok(!bindinfo.szCustomVerb, "bindinfo.szCustomVerb = %p\n", bindinfo.szCustomVerb);
|
|
|
|
ok(!bindinfo.cbstgmedData, "bindinfo.cbstgmedData = %d\n", bindinfo.cbstgmedData);
|
|
|
|
ok(bindinfo.dwOptions == (bind_to_object ? 0x100000 : 0), "bindinfo.dwOptions = %x\n", bindinfo.dwOptions);
|
|
|
|
ok(!bindinfo.dwOptionsFlags, "bindinfo.dwOptionsFlags = %d\n", bindinfo.dwOptionsFlags);
|
|
|
|
ok(!bindinfo.dwCodePage, "bindinfo.dwCodePage = %d\n", bindinfo.dwCodePage);
|
|
|
|
ok(!memcmp(&bindinfo.securityAttributes, &sa_zero, sizeof(sa_zero)), "wrong bindinfo.securityAttributes\n");
|
|
|
|
ok(IsEqualGUID(&bindinfo.iid, &IID_NULL), "wrong bindinfo.iid\n");
|
|
|
|
ok(!bindinfo.pUnk, "bindinfo.pUnk = %p\n", bindinfo.pUnk);
|
|
|
|
ok(!bindinfo.dwReserved, "bindinfo.dwReserved = %d\n", bindinfo.dwReserved);
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2010-12-19 21:26:06 +01:00
|
|
|
if(only_check_prot_args)
|
|
|
|
return E_FAIL;
|
|
|
|
|
2007-02-10 16:34:41 +01:00
|
|
|
switch(test_protocol) {
|
|
|
|
case MK_TEST:
|
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
|
|
|
|
BINDSTATUS_DIRECTBIND, NULL);
|
|
|
|
ok(hres == S_OK,
|
|
|
|
"ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
|
|
|
|
|
|
|
|
case FILE_TEST:
|
|
|
|
case ITS_TEST:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
2005-12-26 13:27:10 +01:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
|
2007-12-30 17:55:02 +01:00
|
|
|
BINDSTATUS_SENDINGREQUEST, emptyW);
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(hres == S_OK,
|
2006-10-07 15:30:28 +02:00
|
|
|
"ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
2012-09-03 13:59:08 +02:00
|
|
|
case WINETEST_SYNC_TEST:
|
|
|
|
IInternetProtocolSink_AddRef(pOIProtSink);
|
|
|
|
protocol_sink = pOIProtSink;
|
2007-02-10 16:34:41 +01:00
|
|
|
default:
|
|
|
|
break;
|
2007-02-10 16:33:38 +01:00
|
|
|
}
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
2007-10-25 21:55:24 +02:00
|
|
|
IServiceProvider *service_provider;
|
|
|
|
IHttpNegotiate *http_negotiate;
|
|
|
|
IHttpNegotiate2 *http_negotiate2;
|
2011-01-09 06:28:54 +01:00
|
|
|
IHttpSecurity *http_security;
|
2007-10-25 21:55:24 +02:00
|
|
|
LPWSTR ua = (LPWSTR)0xdeadbeef, accept_mimes[256];
|
|
|
|
LPWSTR additional_headers = (LPWSTR)0xdeadbeef;
|
|
|
|
BYTE sec_id[100];
|
|
|
|
DWORD fetched = 256, size = 100;
|
2008-05-01 15:27:16 +02:00
|
|
|
DWORD tid;
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
static const WCHAR wszMimes[] = {'*','/','*',0};
|
|
|
|
|
|
|
|
SET_EXPECT(QueryService_IInternetBindInfo);
|
|
|
|
hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
|
|
|
|
&ua, 1, &fetched);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryService_IInternetBindInfo); /* IE <8 */
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(hres == E_NOINTERFACE,
|
|
|
|
"GetBindString(BINDSTRING_USER_AGETNT) failed: %08x\n", hres);
|
|
|
|
ok(fetched == 256, "fetched = %d, expected 254\n", fetched);
|
|
|
|
ok(ua == (LPWSTR)0xdeadbeef, "ua = %p\n", ua);
|
|
|
|
|
|
|
|
hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
|
|
|
|
accept_mimes, 256, &fetched);
|
|
|
|
ok(hres == S_OK,
|
|
|
|
"GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
|
|
|
|
ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
|
|
|
|
ok(!lstrcmpW(wszMimes, accept_mimes[0]), "unexpected mimes\n");
|
2011-01-17 14:21:33 +01:00
|
|
|
CoTaskMemFree(accept_mimes[0]);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
|
|
|
|
NULL, 256, &fetched);
|
|
|
|
ok(hres == E_INVALIDARG,
|
|
|
|
"GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
|
|
|
|
accept_mimes, 256, NULL);
|
|
|
|
ok(hres == E_INVALIDARG,
|
|
|
|
"GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
|
|
|
|
(void**)&service_provider);
|
|
|
|
ok(hres == S_OK, "QueryInterface failed: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
|
|
|
|
&IID_IHttpNegotiate, (void**)&http_negotiate);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate); /* IE <8 */
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(hres == S_OK, "QueryService failed: %08x\n", hres);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
}
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = IHttpNegotiate_BeginningTransaction(http_negotiate, current_url,
|
2007-10-25 21:55:24 +02:00
|
|
|
NULL, 0, &additional_headers);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
IHttpNegotiate_Release(http_negotiate);
|
|
|
|
ok(hres == S_OK, "BeginningTransction failed: %08x\n", hres);
|
|
|
|
ok(additional_headers == NULL, "additional_headers=%p\n", additional_headers);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
|
|
|
|
&IID_IHttpNegotiate2, (void**)&http_negotiate2);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate2); /* IE <8 */
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(hres == S_OK, "QueryService failed: %08x\n", hres);
|
|
|
|
|
|
|
|
size = 512;
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &size, 0);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
IHttpNegotiate2_Release(http_negotiate2);
|
|
|
|
ok(hres == E_FAIL, "GetRootSecurityId failed: %08x, expected E_FAIL\n", hres);
|
2014-10-25 16:35:31 +02:00
|
|
|
ok(size == (no_callback ? 512 : 13), "size=%d\n", size);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2011-01-09 06:28:54 +01:00
|
|
|
if(!no_callback) {
|
|
|
|
SET_EXPECT(QueryService_IHttpSecurity);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpSecurity);
|
|
|
|
}
|
|
|
|
hres = IServiceProvider_QueryService(service_provider, &IID_IHttpSecurity,
|
|
|
|
&IID_IHttpSecurity, (void**)&http_security);
|
|
|
|
ok(hres == (no_callback ? E_NOINTERFACE : S_OK), "QueryService failed: 0x%08x\n", hres);
|
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED(QueryService_IHttpSecurity);
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpSecurity);
|
|
|
|
}
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
IServiceProvider_Release(service_provider);
|
|
|
|
|
|
|
|
IInternetProtocolSink_AddRef(pOIProtSink);
|
|
|
|
protocol_sink = pOIProtSink;
|
|
|
|
|
2012-01-20 14:52:50 +01:00
|
|
|
if(async_switch) {
|
|
|
|
PROTOCOLDATA data;
|
|
|
|
|
|
|
|
memset(&data, 0, sizeof(data));
|
|
|
|
data.grfFlags = PI_FORCE_ASYNC;
|
|
|
|
prot_state = 0;
|
|
|
|
hres = IInternetProtocolSink_Switch(pOIProtSink, &data);
|
|
|
|
ok(hres == S_OK, "Switch failed: %08x\n", hres);
|
|
|
|
SET_EXPECT(Continue);
|
|
|
|
SetEvent(complete_event2);
|
|
|
|
return E_PENDING;
|
|
|
|
} else {
|
|
|
|
CreateThread(NULL, 0, thread_proc, NULL, 0, &tid);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
}
|
|
|
|
|
2007-02-10 16:33:38 +01:00
|
|
|
if(test_protocol == FILE_TEST) {
|
2005-12-26 13:27:10 +01:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
|
2013-02-12 17:17:02 +01:00
|
|
|
BINDSTATUS_CACHEFILENAMEAVAILABLE, file_url+7);
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(hres == S_OK,
|
2006-10-07 15:30:28 +02:00
|
|
|
"ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
else
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
2005-12-26 13:27:10 +01:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
|
|
|
|
BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
|
|
|
|
ok(hres == S_OK,
|
2007-02-10 16:33:38 +01:00
|
|
|
"ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
2012-09-03 13:59:08 +02:00
|
|
|
}else if(test_protocol == WINETEST_SYNC_TEST) {
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
|
|
|
|
ok(hres == S_OK,
|
|
|
|
"ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
2005-12-26 13:27:10 +01:00
|
|
|
}else {
|
2012-09-03 13:59:08 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(hres == S_OK,
|
2006-10-07 15:30:28 +02:00
|
|
|
"ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
|
2005-12-26 13:27:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(test_protocol == ABOUT_TEST)
|
|
|
|
bscf |= BSCF_DATAFULLYAVAILABLE;
|
2007-02-10 16:33:38 +01:00
|
|
|
if(test_protocol == ITS_TEST)
|
|
|
|
bscf = BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
|
2005-11-14 16:12:43 +01:00
|
|
|
|
|
|
|
SET_EXPECT(Read);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object) {
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol != FILE_TEST && test_protocol != MK_TEST && test_protocol != WINETEST_SYNC_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
|
|
|
|
SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
|
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
SET_EXPECT(CreateInstance);
|
|
|
|
SET_EXPECT(PutProperty_MIMETYPEPROP);
|
|
|
|
SET_EXPECT(PutProperty_CLASSIDPROP);
|
|
|
|
SET_EXPECT(Load);
|
|
|
|
SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
SET_EXPECT(OnObjectAvailable);
|
|
|
|
SET_EXPECT(Obj_OnStopBinding);
|
|
|
|
}else {
|
|
|
|
if(test_protocol != FILE_TEST && test_protocol != MK_TEST)
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
SET_EXPECT(LockRequest);
|
2008-02-18 01:04:34 +01:00
|
|
|
if(!filedwl_api)
|
|
|
|
SET_EXPECT(OnDataAvailable);
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol != WINETEST_SYNC_TEST) /* Set in Read after ReportResult call */
|
|
|
|
SET_EXPECT(OnStopBinding);
|
2007-12-30 17:55:02 +01:00
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2005-12-26 13:27:10 +01:00
|
|
|
hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "ReportData failed: %08x\n", hres);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
CHECK_CALLED(Read);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object) {
|
|
|
|
if(test_protocol != FILE_TEST && test_protocol != MK_TEST)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
CHECK_CALLED(CreateInstance);
|
|
|
|
CHECK_CALLED(PutProperty_MIMETYPEPROP);
|
2009-02-17 10:06:18 +01:00
|
|
|
CHECK_CALLED_BROKEN(PutProperty_CLASSIDPROP);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Load);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
CHECK_CALLED(OnObjectAvailable);
|
|
|
|
CHECK_CALLED(Obj_OnStopBinding);
|
|
|
|
}else {
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol != FILE_TEST && test_protocol != MK_TEST && test_protocol != WINETEST_SYNC_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(LockRequest);
|
2008-02-18 01:04:34 +01:00
|
|
|
if(!filedwl_api)
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2007-02-10 16:33:38 +01:00
|
|
|
if(test_protocol == ITS_TEST) {
|
|
|
|
SET_EXPECT(Read);
|
|
|
|
hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA, NULL);
|
|
|
|
ok(hres == S_OK, "ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(Read);
|
2012-09-03 13:59:08 +02:00
|
|
|
}else if(!bind_to_object && test_protocol == FILE_TEST) {
|
2011-02-15 17:01:44 +01:00
|
|
|
SET_EXPECT(Read);
|
|
|
|
hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
|
|
|
|
ok(hres == S_OK, "ReportData failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(Read);
|
2007-02-10 16:33:38 +01:00
|
|
|
}
|
|
|
|
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol != WINETEST_SYNC_TEST) {
|
|
|
|
SET_EXPECT(Terminate);
|
|
|
|
hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(Terminate);
|
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Continue(IInternetProtocol *iface,
|
|
|
|
PROTOCOLDATA *pProtocolData)
|
|
|
|
{
|
2007-10-25 21:55:24 +02:00
|
|
|
DWORD bscf = 0;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
CHECK_EXPECT(Continue);
|
|
|
|
|
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
2013-02-12 17:21:16 +01:00
|
|
|
|
|
|
|
if(!bind_to_object)
|
|
|
|
ok(reported_url && !lstrcmpW(reported_url, current_url), "wrong url %s\n", wine_dbgstr_w(reported_url));
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
ok(pProtocolData != NULL, "pProtocolData == NULL\n");
|
|
|
|
if(!pProtocolData)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
switch(prot_state) {
|
2012-01-20 14:52:50 +01:00
|
|
|
case 0:
|
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_SENDINGREQUEST, NULL);
|
|
|
|
ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
|
|
|
|
ok(hres == S_OK,
|
|
|
|
"ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
|
|
|
|
|
|
|
|
bscf |= BSCF_FIRSTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION;
|
|
|
|
break;
|
2007-10-25 21:55:24 +02:00
|
|
|
case 1: {
|
|
|
|
IServiceProvider *service_provider;
|
|
|
|
IHttpNegotiate *http_negotiate;
|
2013-12-31 03:00:43 +01:00
|
|
|
static const WCHAR header[] = {'?',0};
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
hres = IInternetProtocolSink_QueryInterface(protocol_sink, &IID_IServiceProvider,
|
|
|
|
(void**)&service_provider);
|
|
|
|
ok(hres == S_OK, "Could not get IServiceProvicder\n");
|
|
|
|
|
|
|
|
hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
|
|
|
|
&IID_IHttpNegotiate, (void**)&http_negotiate);
|
|
|
|
ok(hres == S_OK, "Could not get IHttpNegotiate\n");
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(OnResponse);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(OnResponse);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
IHttpNegotiate_Release(http_negotiate);
|
|
|
|
ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
|
|
|
|
|
2009-12-15 21:15:28 +01:00
|
|
|
if(test_protocol == HTTPS_TEST || test_redirect) {
|
2009-01-12 18:20:28 +01:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
|
|
|
|
ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n", hres);
|
|
|
|
}
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
|
|
|
|
ok(hres == S_OK,
|
|
|
|
"ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
|
|
|
|
|
2010-05-04 20:14:49 +02:00
|
|
|
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
|
|
|
|
BINDSTATUS_CACHEFILENAMEAVAILABLE, use_cache_file ? cache_file_name : cache_fileW);
|
|
|
|
ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
bscf |= BSCF_FIRSTDATANOTIFICATION;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IInternetProtocolSink_ReportData(protocol_sink, bscf, 100, 400);
|
|
|
|
ok(hres == S_OK, "ReportData failed: %08x\n", hres);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(prot_state != 2 || !test_abort)
|
|
|
|
SET_EXPECT(Read);
|
2007-10-25 21:55:24 +02:00
|
|
|
switch(prot_state) {
|
2012-01-20 14:52:50 +01:00
|
|
|
case 0:
|
|
|
|
hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
SET_EXPECT(LockRequest);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
break;
|
2007-10-25 21:55:24 +02:00
|
|
|
case 1:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(bind_to_object) {
|
|
|
|
SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
|
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
SET_EXPECT(CreateInstance);
|
|
|
|
SET_EXPECT(PutProperty_MIMETYPEPROP);
|
|
|
|
SET_EXPECT(PutProperty_CLASSIDPROP);
|
|
|
|
SET_EXPECT(Load);
|
|
|
|
SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
SET_EXPECT(OnObjectAvailable);
|
|
|
|
SET_EXPECT(Obj_OnStopBinding);
|
2010-10-06 21:36:32 +02:00
|
|
|
}else if(!no_callback) {
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
SET_EXPECT(LockRequest);
|
2010-10-06 21:36:32 +02:00
|
|
|
}else {
|
|
|
|
SET_EXPECT(LockRequest);
|
2007-12-30 17:55:02 +01:00
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback)
|
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
2007-10-25 21:55:24 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
if((!bind_to_object || prot_state >= 2) && (!test_abort || prot_state != 2))
|
|
|
|
SET_EXPECT(OnDataAvailable);
|
|
|
|
if(prot_state == 3 || (test_abort && prot_state == 2))
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
return S_OK;
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
|
|
|
|
DWORD dwOptions)
|
|
|
|
{
|
2010-10-06 21:36:32 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
CHECK_EXPECT(Abort);
|
|
|
|
|
|
|
|
ok(hrReason == E_ABORT, "hrReason = %08x\n", hrReason);
|
|
|
|
ok(!dwOptions, "dwOptions = %x\n", dwOptions);
|
|
|
|
|
|
|
|
hres = IInternetProtocolSink_ReportResult(protocol_sink, E_ABORT, ERROR_SUCCESS, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(Terminate);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(dwOptions == 0, "dwOptions=%d, expected 0\n", dwOptions);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
if(protocol_sink) {
|
|
|
|
IInternetProtocolSink_Release(protocol_sink);
|
|
|
|
protocol_sink = NULL;
|
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(no_callback)
|
|
|
|
SetEvent(complete_event);
|
2005-11-14 16:12:43 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Suspend(IInternetProtocol *iface)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Resume(IInternetProtocol *iface)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Read(IInternetProtocol *iface, void *pv,
|
|
|
|
ULONG cb, ULONG *pcbRead)
|
|
|
|
{
|
2012-09-03 13:59:08 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
static const char data[] = "<HTML></HTML>";
|
|
|
|
|
|
|
|
CHECK_EXPECT2(Read);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
ok(pv != NULL, "pv == NULL\n");
|
|
|
|
ok(cb != 0, "cb == 0\n");
|
|
|
|
ok(pcbRead != NULL, "pcbRead == NULL\n");
|
|
|
|
|
2012-01-20 14:52:50 +01:00
|
|
|
if(async_switch) {
|
|
|
|
if(prot_state++ > 1) {
|
|
|
|
*pcbRead = 0;
|
|
|
|
return S_FALSE;
|
|
|
|
} else {
|
|
|
|
memset(pv, '?', cb);
|
|
|
|
*pcbRead = cb;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
2013-10-09 22:36:44 +02:00
|
|
|
static BOOL pending = TRUE;
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
pending = !pending;
|
|
|
|
|
|
|
|
switch(prot_state) {
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
if(pending) {
|
|
|
|
*pcbRead = 10;
|
|
|
|
memset(pv, '?', 10);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(prot_state == 2 && no_callback)
|
|
|
|
SetEvent(complete_event);
|
2007-10-25 21:55:24 +02:00
|
|
|
return E_PENDING;
|
|
|
|
}else {
|
|
|
|
memset(pv, '?', cb);
|
|
|
|
*pcbRead = cb;
|
|
|
|
read++;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
prot_state++;
|
|
|
|
|
|
|
|
*pcbRead = 0;
|
|
|
|
|
|
|
|
hres = IInternetProtocolSink_ReportData(protocol_sink,
|
|
|
|
BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 2000, 2000);
|
|
|
|
ok(hres == S_OK, "ReportData failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
|
|
|
|
return S_FALSE;
|
|
|
|
case 4:
|
|
|
|
*pcbRead = 0;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
if(read) {
|
|
|
|
*pcbRead = 0;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol == WINETEST_SYNC_TEST) {
|
|
|
|
hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
|
|
|
|
ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
|
|
|
|
read += *pcbRead = sizeof(data)-1;
|
|
|
|
memcpy(pv, data, sizeof(data));
|
2005-11-14 16:12:43 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_Seek(IInternetProtocol *iface,
|
|
|
|
LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(LockRequest);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(no_callback)
|
|
|
|
SetEvent(complete_event);
|
2005-11-14 16:12:43 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Protocol_UnlockRequest(IInternetProtocol *iface)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(UnlockRequest);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IInternetProtocolVtbl ProtocolVtbl = {
|
|
|
|
Protocol_QueryInterface,
|
|
|
|
Protocol_AddRef,
|
|
|
|
Protocol_Release,
|
|
|
|
Protocol_Start,
|
|
|
|
Protocol_Continue,
|
|
|
|
Protocol_Abort,
|
|
|
|
Protocol_Terminate,
|
|
|
|
Protocol_Suspend,
|
|
|
|
Protocol_Resume,
|
|
|
|
Protocol_Read,
|
|
|
|
Protocol_Seek,
|
|
|
|
Protocol_LockRequest,
|
|
|
|
Protocol_UnlockRequest
|
|
|
|
};
|
|
|
|
|
|
|
|
static IInternetProtocol Protocol = { &ProtocolVtbl };
|
|
|
|
|
2007-07-24 03:33:08 +02:00
|
|
|
static HRESULT WINAPI HttpNegotiate_QueryInterface(IHttpNegotiate2 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)
|
|
|
|
|| IsEqualGUID(&IID_IHttpNegotiate, riid)
|
|
|
|
|| IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HttpNegotiate_AddRef(IHttpNegotiate2 *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HttpNegotiate_Release(IHttpNegotiate2 *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface, LPCWSTR szURL,
|
|
|
|
LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *pszAdditionalHeaders)
|
|
|
|
{
|
2011-01-09 06:28:54 +01:00
|
|
|
if(onsecurityproblem_hres == S_OK)
|
|
|
|
CHECK_EXPECT2(BeginningTransaction);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(BeginningTransaction);
|
2007-07-24 03:33:08 +02:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(szURL, current_url), "szURL != current_url\n");
|
2007-07-24 03:33:08 +02:00
|
|
|
ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
|
|
|
|
ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
|
|
|
|
if(pszAdditionalHeaders)
|
|
|
|
ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HttpNegotiate_OnResponse(IHttpNegotiate2 *iface, DWORD dwResponseCode,
|
|
|
|
LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(OnResponse);
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2007-07-24 03:33:08 +02:00
|
|
|
ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode);
|
|
|
|
ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n");
|
|
|
|
ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n");
|
|
|
|
/* Note: in protocol.c tests, OnResponse pszAdditionalRequestHeaders _is_ NULL */
|
|
|
|
ok(pszAdditionalRequestHeaders != NULL, "pszAdditionalHeaders == NULL\n");
|
|
|
|
if(pszAdditionalRequestHeaders)
|
|
|
|
ok(*pszAdditionalRequestHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HttpNegotiate_GetRootSecurityId(IHttpNegotiate2 *iface,
|
|
|
|
BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
|
|
|
|
{
|
|
|
|
static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
|
|
|
|
|
|
|
|
CHECK_EXPECT(GetRootSecurityId);
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2007-07-24 03:33:08 +02:00
|
|
|
ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
|
|
|
|
ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
|
|
|
|
ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
if(pbSecurityId == (void*)0xdeadbeef)
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
2007-07-24 03:33:08 +02:00
|
|
|
if(pcbSecurityId) {
|
|
|
|
ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
|
|
|
|
*pcbSecurityId = sizeof(sec_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(pbSecurityId)
|
|
|
|
memcpy(pbSecurityId, sec_id, sizeof(sec_id));
|
|
|
|
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IHttpNegotiate2Vtbl HttpNegotiateVtbl = {
|
|
|
|
HttpNegotiate_QueryInterface,
|
|
|
|
HttpNegotiate_AddRef,
|
|
|
|
HttpNegotiate_Release,
|
|
|
|
HttpNegotiate_BeginningTransaction,
|
|
|
|
HttpNegotiate_OnResponse,
|
|
|
|
HttpNegotiate_GetRootSecurityId
|
|
|
|
};
|
|
|
|
|
|
|
|
static IHttpNegotiate2 HttpNegotiate = { &HttpNegotiateVtbl };
|
|
|
|
|
2011-01-09 06:28:54 +01:00
|
|
|
static HRESULT WINAPI HttpSecurity_QueryInterface(IHttpSecurity *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ok(0, "Unexpected call\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
if(IsEqualGUID(&IID_IHttpSecurity, riid) ||
|
|
|
|
IsEqualGUID(&IID_IWindowForBindingUI, riid) ||
|
|
|
|
IsEqualGUID(&IID_IUnknown, riid))
|
|
|
|
{
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ok(0, "Unexpected interface requested.\n");
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HttpSecurity_AddRef(IHttpSecurity *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HttpSecurity_Release(IHttpSecurity *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HttpSecurity_GetWindow(IHttpSecurity *iface, REFGUID rguidReason, HWND *phwnd)
|
|
|
|
{
|
|
|
|
if(IsEqualGUID(rguidReason, &IID_IHttpSecurity))
|
|
|
|
CHECK_EXPECT(GetWindow_IHttpSecurity);
|
|
|
|
else if(IsEqualGUID(rguidReason, &IID_IWindowForBindingUI))
|
|
|
|
CHECK_EXPECT2(GetWindow_IWindowForBindingUI);
|
2013-08-13 10:41:39 +02:00
|
|
|
else if(IsEqualGUID(rguidReason, &IID_ICodeInstall))
|
|
|
|
CHECK_EXPECT(GetWindow_ICodeInstall);
|
2011-01-09 06:28:54 +01:00
|
|
|
else
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "Unexpected rguidReason: %s\n", wine_dbgstr_guid(rguidReason));
|
2011-01-09 06:28:54 +01:00
|
|
|
|
|
|
|
*phwnd = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HttpSecurity_OnSecurityProblem(IHttpSecurity *iface, DWORD dwProblem)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(OnSecurityProblem);
|
|
|
|
if(!security_problem) {
|
|
|
|
ok(dwProblem == ERROR_INTERNET_SEC_CERT_CN_INVALID ||
|
|
|
|
broken(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS) /* Some versions of IE6 */,
|
|
|
|
"Got problem: %d\n", dwProblem);
|
|
|
|
security_problem = dwProblem;
|
|
|
|
|
|
|
|
if(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS)
|
|
|
|
binding_hres = INET_E_SECURITY_PROBLEM;
|
|
|
|
}else
|
|
|
|
ok(dwProblem == security_problem, "Got problem: %d\n", dwProblem);
|
|
|
|
|
|
|
|
return onsecurityproblem_hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHttpSecurityVtbl HttpSecurityVtbl = {
|
|
|
|
HttpSecurity_QueryInterface,
|
|
|
|
HttpSecurity_AddRef,
|
|
|
|
HttpSecurity_Release,
|
|
|
|
HttpSecurity_GetWindow,
|
|
|
|
HttpSecurity_OnSecurityProblem
|
|
|
|
};
|
|
|
|
|
|
|
|
static IHttpSecurity HttpSecurity = { &HttpSecurityVtbl };
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface,
|
|
|
|
REFGUID guidService, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
if(IsEqualGUID(&IID_IAuthenticate, guidService)) {
|
|
|
|
CHECK_EXPECT(QueryService_IAuthenticate);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IInternetProtocol, guidService)) {
|
|
|
|
CHECK_EXPECT2(QueryService_IInternetProtocol);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
if(IsEqualGUID(&IID_IInternetBindInfo, guidService)) {
|
|
|
|
CHECK_EXPECT(QueryService_IInternetBindInfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-09-11 12:22:38 +02:00
|
|
|
if(IsEqualGUID(&IID_IWindowForBindingUI, guidService)) {
|
2011-01-09 06:28:54 +01:00
|
|
|
CHECK_EXPECT2(QueryService_IWindowForBindingUI);
|
|
|
|
*ppv = &HttpSecurity;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHttpSecurity, guidService)) {
|
|
|
|
CHECK_EXPECT(QueryService_IHttpSecurity);
|
|
|
|
*ppv = &HttpSecurity;
|
|
|
|
return S_OK;
|
2009-09-11 12:22:38 +02:00
|
|
|
}
|
|
|
|
|
2013-11-15 15:45:51 +01:00
|
|
|
if(IsEqualGUID(&IID_IGetBindHandle, guidService)) {
|
|
|
|
trace("QueryService(IID_IGetBindHandle)\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2014-02-27 16:36:10 +01:00
|
|
|
if(IsEqualGUID(&IID_undocumentedIE11, guidService)) {
|
|
|
|
trace("QueryService(IID_undocumentedIE11)\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
|
2007-10-01 14:11:11 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IServiceProviderVtbl ServiceProviderVtbl = {
|
|
|
|
ServiceProvider_QueryInterface,
|
|
|
|
ServiceProvider_AddRef,
|
|
|
|
ServiceProvider_Release,
|
|
|
|
ServiceProvider_QueryService
|
|
|
|
};
|
|
|
|
|
|
|
|
static IServiceProvider ServiceProvider = { &ServiceProviderVtbl };
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static IBindStatusCallbackEx objbsc;
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2011-03-28 23:38:27 +02:00
|
|
|
static void test_WinInetHttpInfo(IWinInetHttpInfo *http_info, DWORD progress)
|
|
|
|
{
|
|
|
|
DWORD status, size;
|
|
|
|
HRESULT hres, expect;
|
|
|
|
|
2014-02-07 22:42:49 +01:00
|
|
|
/* QueryInfo changes its behavior during this request */
|
2011-03-28 23:38:27 +02:00
|
|
|
if(progress == BINDSTATUS_SENDINGREQUEST)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(test_protocol==FTP_TEST && download_state==BEFORE_DOWNLOAD
|
|
|
|
&& progress!=BINDSTATUS_MIMETYPEAVAILABLE)
|
|
|
|
expect = E_FAIL;
|
|
|
|
else if(test_protocol == FTP_TEST)
|
|
|
|
expect = S_FALSE;
|
|
|
|
else
|
|
|
|
expect = S_OK;
|
|
|
|
|
|
|
|
size = sizeof(DWORD);
|
|
|
|
hres = IWinInetHttpInfo_QueryInfo(http_info, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,
|
|
|
|
&status, &size, NULL, NULL);
|
2013-02-12 17:17:47 +01:00
|
|
|
ok(hres == expect || ((progress == BINDSTATUS_COOKIE_SENT || progress == BINDSTATUS_PROXYDETECTING) && hres == S_FALSE),
|
|
|
|
"progress %u: hres = %x, expected %x\n", progress, hres, expect);
|
2011-03-28 23:38:27 +02:00
|
|
|
if(hres == S_OK) {
|
2013-02-12 17:22:15 +01:00
|
|
|
if(download_state == BEFORE_DOWNLOAD && progress != BINDSTATUS_MIMETYPEAVAILABLE && progress != BINDSTATUS_DECODING)
|
|
|
|
ok(status == 0, "progress %u: status = %d\n", progress, status);
|
2011-03-28 23:38:27 +02:00
|
|
|
else
|
2013-02-12 17:22:15 +01:00
|
|
|
ok(status == HTTP_STATUS_OK, "progress %u: status = %d\n", progress, status);
|
2011-03-28 23:38:27 +02:00
|
|
|
ok(size == sizeof(DWORD), "size = %d\n", size);
|
|
|
|
}
|
|
|
|
|
|
|
|
size = sizeof(DWORD);
|
|
|
|
hres = IWinInetHttpInfo_QueryOption(http_info, INTERNET_OPTION_HANDLE_TYPE, &status, &size);
|
|
|
|
if(test_protocol == FTP_TEST) {
|
|
|
|
if(download_state==BEFORE_DOWNLOAD && progress!=BINDSTATUS_MIMETYPEAVAILABLE)
|
|
|
|
ok(hres == E_FAIL, "hres = %x\n", hres);
|
|
|
|
else
|
|
|
|
ok(hres == S_OK, "hres = %x\n", hres);
|
|
|
|
|
|
|
|
if(hres == S_OK)
|
|
|
|
ok(status == INTERNET_HANDLE_TYPE_FTP_FILE, "status = %d\n", status);
|
|
|
|
} else {
|
|
|
|
ok(hres == S_OK, "hres = %x\n", hres);
|
|
|
|
ok(status == INTERNET_HANDLE_TYPE_HTTP_REQUEST, "status = %d\n", status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_QueryInterface(IBindStatusCallbackEx *iface, REFIID riid, void **ppv)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2013-11-15 15:45:51 +01:00
|
|
|
static const IID IID_undocumentedIE10 = {0xf286fa56,0xc1fd,0x4270,{0x8e,0x67,0xb3,0xeb,0x79,0x0a,0x81,0xe8}};
|
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2006-01-05 12:18:06 +01:00
|
|
|
if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
|
2007-10-01 14:10:36 +02:00
|
|
|
CHECK_EXPECT2(QueryInterface_IInternetProtocol);
|
2006-01-05 12:18:06 +01:00
|
|
|
if(emulate_protocol) {
|
|
|
|
*ppv = &Protocol;
|
|
|
|
return S_OK;
|
|
|
|
}else {
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if (IsEqualGUID(&IID_IServiceProvider, riid)) {
|
2007-10-01 14:11:11 +02:00
|
|
|
CHECK_EXPECT2(QueryInterface_IServiceProvider);
|
|
|
|
*ppv = &ServiceProvider;
|
|
|
|
return S_OK;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if (IsEqualGUID(&IID_IHttpNegotiate, riid)) {
|
2009-06-23 14:52:23 +02:00
|
|
|
CHECK_EXPECT2(QueryInterface_IHttpNegotiate);
|
2007-07-24 03:33:08 +02:00
|
|
|
*ppv = &HttpNegotiate;
|
|
|
|
return S_OK;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if (IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
|
2007-07-24 03:31:50 +02:00
|
|
|
CHECK_EXPECT(QueryInterface_IHttpNegotiate2);
|
2007-07-24 03:33:08 +02:00
|
|
|
*ppv = &HttpNegotiate;
|
|
|
|
return S_OK;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if (IsEqualGUID(&IID_IAuthenticate, riid)) {
|
2007-10-01 14:10:36 +02:00
|
|
|
CHECK_EXPECT(QueryInterface_IAuthenticate);
|
|
|
|
return E_NOINTERFACE;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IBindStatusCallback, riid)) {
|
|
|
|
if(strict_bsc_qi)
|
|
|
|
CHECK_EXPECT2(QueryInterface_IBindStatusCallback);
|
2007-10-01 14:10:36 +02:00
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IBindStatusCallbackHolder, riid)) {
|
2007-10-01 14:10:36 +02:00
|
|
|
CHECK_EXPECT2(QueryInterface_IBindStatusCallbackHolder);
|
|
|
|
return E_NOINTERFACE;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IBindStatusCallbackEx, riid)) {
|
2009-07-02 23:21:08 +02:00
|
|
|
CHECK_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
if(!use_bscex)
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) {
|
2007-10-01 14:10:36 +02:00
|
|
|
/* TODO */
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IWindowForBindingUI, riid)) {
|
2009-09-11 12:22:38 +02:00
|
|
|
CHECK_EXPECT2(QueryInterface_IWindowForBindingUI);
|
|
|
|
return E_NOINTERFACE;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHttpSecurity, riid)) {
|
2011-01-09 06:28:54 +01:00
|
|
|
CHECK_EXPECT2(QueryInterface_IHttpSecurity);
|
|
|
|
return E_NOINTERFACE;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IGetBindHandle, riid)) {
|
|
|
|
trace("QI(IID_IGetBindHandle)\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}else if(IsEqualGUID(&IID_undocumentedIE10, riid)) {
|
|
|
|
trace("QI(IID_undocumentedIE10)\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2014-02-27 16:36:10 +01:00
|
|
|
}else if(IsEqualGUID(&IID_undocumentedIE11, riid)) {
|
|
|
|
trace("QI(IID_undocumentedIE11)\n");
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2013-11-15 15:45:51 +01:00
|
|
|
}else {
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected interface %s\n", wine_dbgstr_guid(riid));
|
2007-10-01 14:10:36 +02:00
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2004-12-08 14:46:01 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static ULONG WINAPI statusclb_AddRef(IBindStatusCallbackEx *iface)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2006-01-05 12:18:06 +01:00
|
|
|
return 2;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static ULONG WINAPI statusclb_Release(IBindStatusCallbackEx *iface)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2006-01-05 12:18:06 +01:00
|
|
|
return 1;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnStartBinding(IBindStatusCallbackEx *iface, DWORD dwReserved,
|
2005-09-16 20:46:29 +02:00
|
|
|
IBinding *pib)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2007-12-30 17:55:02 +01:00
|
|
|
IWinInetHttpInfo *http_info;
|
2005-05-23 11:53:21 +02:00
|
|
|
HRESULT hres;
|
|
|
|
IMoniker *mon;
|
2012-03-15 12:07:46 +01:00
|
|
|
DWORD res;
|
|
|
|
CLSID clsid;
|
|
|
|
LPOLESTR res_str;
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnStartBinding);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnStartBinding);
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
ok(pib != NULL, "pib should not be NULL\n");
|
2007-10-01 14:11:11 +02:00
|
|
|
ok(dwReserved == 0xff, "dwReserved=%x\n", dwReserved);
|
|
|
|
|
|
|
|
if(pib == (void*)0xdeadbeef)
|
|
|
|
return S_OK;
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2009-03-29 21:31:15 +02:00
|
|
|
current_binding = pib;
|
|
|
|
|
2005-05-23 11:53:21 +02:00
|
|
|
hres = IBinding_QueryInterface(pib, &IID_IMoniker, (void**)&mon);
|
|
|
|
ok(hres == E_NOINTERFACE, "IBinding should not have IMoniker interface\n");
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IMoniker_Release(mon);
|
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
hres = IBinding_QueryInterface(pib, &IID_IWinInetHttpInfo, (void**)&http_info);
|
|
|
|
ok(hres == E_NOINTERFACE, "Could not get IID_IWinInetHttpInfo: %08x\n", hres);
|
|
|
|
|
2012-03-15 12:07:46 +01:00
|
|
|
if(0) { /* crashes with native urlmon */
|
|
|
|
hres = IBinding_GetBindResult(pib, NULL, &res, &res_str, NULL);
|
|
|
|
ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
|
|
|
|
}
|
|
|
|
hres = IBinding_GetBindResult(pib, &clsid, NULL, &res_str, NULL);
|
|
|
|
ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
|
|
|
|
hres = IBinding_GetBindResult(pib, &clsid, &res, NULL, NULL);
|
|
|
|
ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
|
|
|
|
hres = IBinding_GetBindResult(pib, &clsid, &res, &res_str, (void*)0xdeadbeef);
|
|
|
|
ok(hres == E_INVALIDARG, "GetBindResult failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IBinding_GetBindResult(pib, &clsid, &res, &res_str, NULL);
|
|
|
|
ok(hres == S_OK, "GetBindResult failed: %08x, expected S_OK\n", hres);
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_NULL), "incorrect clsid: %s\n", wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
ok(!res, "incorrect res: %x\n", res);
|
|
|
|
ok(!res_str, "incorrect res_str: %s\n", wine_dbgstr_w(res_str));
|
|
|
|
|
2011-05-02 05:29:53 +02:00
|
|
|
if(abort_start) {
|
2011-05-02 05:29:53 +02:00
|
|
|
binding_hres = abort_hres;
|
|
|
|
return abort_hres;
|
2011-05-02 05:29:53 +02:00
|
|
|
}
|
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_GetPriority(IBindStatusCallbackEx *iface, LONG *pnPriority)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2005-09-16 20:46:29 +02:00
|
|
|
ok(0, "unexpected call\n");
|
2004-12-08 14:46:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnLowResource(IBindStatusCallbackEx *iface, DWORD reserved)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2005-09-16 20:46:29 +02:00
|
|
|
ok(0, "unexpected call\n");
|
2004-12-08 14:46:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG ulProgress,
|
2005-09-16 20:46:29 +02:00
|
|
|
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2005-09-16 20:46:29 +02:00
|
|
|
switch(ulStatusCode) {
|
|
|
|
case BINDSTATUS_FINDINGRESOURCE:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
|
2009-03-04 19:06:18 +01:00
|
|
|
else if(test_protocol == FTP_TEST)
|
|
|
|
todo_wine CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
|
2014-02-04 10:49:22 +01:00
|
|
|
else if(test_protocol == HTTPS_TEST && !bindtest_flags)
|
|
|
|
todo_wine CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
|
2007-12-30 17:55:02 +01:00
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_FINDINGRESOURCE);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(emulate_protocol && (test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST))
|
2007-10-25 21:55:24 +02:00
|
|
|
SetEvent(complete_event);
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_CONNECTING:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_CONNECTING);
|
2009-03-04 19:06:18 +01:00
|
|
|
else if(test_protocol == FTP_TEST)
|
|
|
|
todo_wine CHECK_EXPECT(OnProgress_CONNECTING);
|
2011-01-09 06:28:54 +01:00
|
|
|
else if(onsecurityproblem_hres == S_OK)
|
|
|
|
CHECK_EXPECT2(OnProgress_CONNECTING);
|
2007-12-30 17:55:02 +01:00
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_CONNECTING);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(emulate_protocol && (test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST))
|
2007-10-25 21:55:24 +02:00
|
|
|
SetEvent(complete_event);
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
2009-12-15 21:15:28 +01:00
|
|
|
case BINDSTATUS_REDIRECTING:
|
2009-12-15 21:16:35 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_REDIRECTING);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_REDIRECTING);
|
2011-04-07 15:46:01 +02:00
|
|
|
ok(!lstrcmpW(szStatusText, winetest_data_urlW), "unexpected status text %s\n",
|
2009-12-15 21:15:28 +01:00
|
|
|
wine_dbgstr_w(szStatusText));
|
2010-10-06 21:36:32 +02:00
|
|
|
if(emulate_protocol && (test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST)
|
2010-04-29 17:14:47 +02:00
|
|
|
&& (!bind_to_object || iface == &objbsc))
|
2009-12-15 21:16:35 +01:00
|
|
|
SetEvent(complete_event);
|
2009-12-15 21:15:28 +01:00
|
|
|
break;
|
2005-09-16 20:46:29 +02:00
|
|
|
case BINDSTATUS_SENDINGREQUEST:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_SENDINGREQUEST);
|
2009-03-04 19:06:18 +01:00
|
|
|
else if(test_protocol == FTP_TEST)
|
|
|
|
CHECK_EXPECT2(OnProgress_SENDINGREQUEST);
|
2007-12-30 17:55:02 +01:00
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_SENDINGREQUEST);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(emulate_protocol && (test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST))
|
2007-10-25 21:55:24 +02:00
|
|
|
SetEvent(complete_event);
|
2011-05-02 05:29:53 +02:00
|
|
|
|
2011-05-01 06:30:17 +02:00
|
|
|
if(abort_progress) {
|
|
|
|
if(filedwl_api)
|
|
|
|
binding_hres = E_ABORT;
|
2011-05-02 05:29:53 +02:00
|
|
|
return E_ABORT;
|
2011-05-01 06:30:17 +02:00
|
|
|
}
|
2011-05-02 05:29:53 +02:00
|
|
|
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_MIMETYPEAVAILABLE:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
if(!bind_to_object)
|
|
|
|
ok(download_state == BEFORE_DOWNLOAD, "Download state was %d, expected BEFORE_DOWNLOAD\n",
|
|
|
|
download_state);
|
2007-08-09 03:24:13 +02:00
|
|
|
WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, mime_type, sizeof(mime_type)-1, NULL, NULL);
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_BEGINDOWNLOADDATA:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(szStatusText != NULL, "szStatusText == NULL\n");
|
2008-02-18 01:04:34 +01:00
|
|
|
if(szStatusText) {
|
|
|
|
if(filedwl_api) {
|
|
|
|
/* FIXME */
|
|
|
|
}else {
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(szStatusText, current_url), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
|
2008-02-18 01:04:34 +01:00
|
|
|
}
|
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
if(!bind_to_object)
|
|
|
|
ok(download_state == BEFORE_DOWNLOAD, "Download state was %d, expected BEFORE_DOWNLOAD\n",
|
|
|
|
download_state);
|
2007-08-07 06:08:49 +02:00
|
|
|
download_state = DOWNLOADING;
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_DOWNLOADINGDATA:
|
|
|
|
CHECK_EXPECT2(OnProgress_DOWNLOADINGDATA);
|
2009-03-02 03:18:19 +01:00
|
|
|
ok(iface != &objbsc, "unexpected call\n");
|
2007-08-07 06:08:49 +02:00
|
|
|
ok(download_state == DOWNLOADING, "Download state was %d, expected DOWNLOADING\n",
|
|
|
|
download_state);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_abort) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
SET_EXPECT(Abort);
|
|
|
|
hres = IBinding_Abort(current_binding);
|
|
|
|
ok(hres == S_OK, "Abort failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(Abort);
|
|
|
|
|
|
|
|
hres = IBinding_Abort(current_binding);
|
|
|
|
ok(hres == E_FAIL, "Abort failed: %08x\n", hres);
|
|
|
|
|
|
|
|
binding_hres = E_ABORT;
|
|
|
|
}
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_ENDDOWNLOADDATA:
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(szStatusText != NULL, "szStatusText == NULL\n");
|
2008-02-18 01:04:34 +01:00
|
|
|
if(szStatusText) {
|
|
|
|
if(filedwl_api) {
|
|
|
|
/* FIXME */
|
|
|
|
}else {
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(szStatusText, current_url), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
|
2008-02-18 01:04:34 +01:00
|
|
|
}
|
|
|
|
}
|
2007-08-07 06:08:49 +02:00
|
|
|
ok(download_state == DOWNLOADING, "Download state was %d, expected DOWNLOADING\n",
|
|
|
|
download_state);
|
|
|
|
download_state = END_DOWNLOAD;
|
2005-12-26 13:27:10 +01:00
|
|
|
break;
|
|
|
|
case BINDSTATUS_CACHEFILENAMEAVAILABLE:
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol != HTTP_TEST && test_protocol != HTTPS_TEST && test_protocol != WINETEST_TEST) {
|
2008-01-31 18:19:53 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
}else { /* FIXME */
|
|
|
|
CLEAR_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
CLEAR_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
}
|
|
|
|
|
2005-12-26 13:27:10 +01:00
|
|
|
ok(szStatusText != NULL, "szStatusText == NULL\n");
|
|
|
|
if(szStatusText && test_protocol == FILE_TEST)
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(file_url+7, szStatusText), "wrong szStatusText %s\n", wine_dbgstr_w(szStatusText));
|
2005-09-16 20:46:29 +02:00
|
|
|
break;
|
2007-10-26 18:16:31 +02:00
|
|
|
case BINDSTATUS_CLASSIDAVAILABLE:
|
|
|
|
{
|
|
|
|
CLSID clsid;
|
|
|
|
HRESULT hr;
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface != &objbsc)
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
else
|
2011-05-11 13:34:47 +02:00
|
|
|
CHECK_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
|
2010-03-26 18:59:50 +01:00
|
|
|
hr = CLSIDFromString((LPCOLESTR)szStatusText, &clsid);
|
2007-10-26 18:16:31 +02:00
|
|
|
ok(hr == S_OK, "CLSIDFromString failed with error 0x%08x\n", hr);
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_HTMLDocument),
|
2014-01-25 15:24:46 +01:00
|
|
|
"Expected clsid to be CLSID_HTMLDocument instead of %s\n", wine_dbgstr_guid(&clsid));
|
2007-10-26 18:16:31 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case BINDSTATUS_BEGINSYNCOPERATION:
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
|
|
|
|
if(iface != &objbsc)
|
|
|
|
ok(0, "unexpected call\n");
|
2007-10-26 18:16:31 +02:00
|
|
|
ok(szStatusText == NULL, "Expected szStatusText to be NULL\n");
|
|
|
|
break;
|
|
|
|
case BINDSTATUS_ENDSYNCOPERATION:
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
|
|
|
|
if(iface != &objbsc)
|
|
|
|
ok(0, "unexpected call\n");
|
2007-10-26 18:16:31 +02:00
|
|
|
ok(szStatusText == NULL, "Expected szStatusText to be NULL\n");
|
|
|
|
break;
|
2009-01-07 00:42:03 +01:00
|
|
|
case BINDSTATUS_PROXYDETECTING:
|
|
|
|
trace("BINDSTATUS_PROXYDETECTING\n");
|
|
|
|
break;
|
2009-04-08 22:17:29 +02:00
|
|
|
case BINDSTATUS_COOKIE_SENT:
|
|
|
|
trace("BINDSTATUS_COOKIE_SENT\n");
|
|
|
|
break;
|
2013-02-12 17:22:15 +01:00
|
|
|
case BINDSTATUS_DECODING:
|
|
|
|
trace("BINDSTATUS_DECODING\n");
|
|
|
|
break;
|
2005-09-16 20:46:29 +02:00
|
|
|
default:
|
2008-02-13 22:11:01 +01:00
|
|
|
ok(0, "unexpected code %d\n", ulStatusCode);
|
2005-09-16 20:46:29 +02:00
|
|
|
};
|
2009-03-29 21:31:15 +02:00
|
|
|
|
|
|
|
if(current_binding) {
|
|
|
|
IWinInetHttpInfo *http_info;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = IBinding_QueryInterface(current_binding, &IID_IWinInetHttpInfo, (void**)&http_info);
|
2011-03-28 23:38:27 +02:00
|
|
|
if(!emulate_protocol && test_protocol != FILE_TEST && is_urlmon_protocol(test_protocol)) {
|
2009-03-29 21:31:15 +02:00
|
|
|
ok(hres == S_OK, "Could not get IWinInetHttpInfo iface: %08x\n", hres);
|
2011-03-28 23:38:27 +02:00
|
|
|
test_WinInetHttpInfo(http_info, ulStatusCode);
|
|
|
|
} else
|
2009-03-29 21:31:15 +02:00
|
|
|
ok(hres == E_NOINTERFACE,
|
|
|
|
"QueryInterface(IID_IWinInetHttpInfo) returned: %08x, expected E_NOINTERFACE\n", hres);
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IWinInetHttpInfo_Release(http_info);
|
|
|
|
}
|
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnStopBinding(IBindStatusCallbackEx *iface, HRESULT hresult, LPCWSTR szError)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc) {
|
|
|
|
CHECK_EXPECT(Obj_OnStopBinding);
|
|
|
|
stopped_obj_binding = TRUE;
|
|
|
|
}else {
|
|
|
|
CHECK_EXPECT(OnStopBinding);
|
|
|
|
stopped_binding = TRUE;
|
|
|
|
}
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2010-12-19 21:26:06 +01:00
|
|
|
if(only_check_prot_args) {
|
|
|
|
todo_wine ok(hresult == S_OK, "Got %08x\n", hresult);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2006-09-21 11:45:32 +02:00
|
|
|
/* ignore DNS failure */
|
2007-10-25 21:55:24 +02:00
|
|
|
if (hresult == HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED))
|
|
|
|
return S_OK;
|
|
|
|
|
2011-05-01 06:30:17 +02:00
|
|
|
if(filedwl_api) {
|
|
|
|
if(!abort_progress && !abort_start)
|
|
|
|
ok(SUCCEEDED(hresult), "binding failed: %08x\n", hresult);
|
|
|
|
else if(abort_start && abort_hres == E_NOTIMPL)
|
|
|
|
todo_wine ok(hresult == S_FALSE, "binding failed: %08x, expected S_FALSE\n", hresult);
|
|
|
|
else
|
|
|
|
ok(hresult == E_ABORT, "binding failed: %08x, expected E_ABORT\n", hresult);
|
|
|
|
} else
|
2008-02-18 01:04:34 +01:00
|
|
|
ok(hresult == binding_hres, "binding failed: %08x, expected %08x\n", hresult, binding_hres);
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(szError == NULL, "szError should be NULL\n");
|
|
|
|
|
2012-03-15 12:07:46 +01:00
|
|
|
if(current_binding) {
|
|
|
|
CLSID clsid;
|
|
|
|
DWORD res;
|
|
|
|
LPOLESTR res_str;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = IBinding_GetBindResult(current_binding, &clsid, &res, &res_str, NULL);
|
|
|
|
ok(hres == S_OK, "GetBindResult failed: %08x, expected S_OK\n", hres);
|
|
|
|
ok(res == hresult, "res = %08x, expected %08x\n", res, binding_hres);
|
|
|
|
ok(!res_str, "incorrect res_str = %s\n", wine_dbgstr_w(res_str));
|
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
if(hresult==S_OK || (abort_start && hresult!=S_FALSE) || hresult == REGDB_E_CLASSNOTREG) {
|
2012-03-15 12:07:46 +01:00
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_NULL),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_NULL\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(emulate_protocol) {
|
|
|
|
todo_wine ok(IsEqualCLSID(&clsid, &CLSID_FtpProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(test_protocol == FTP_TEST) {
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_FtpProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_FtpProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(test_protocol == FILE_TEST) {
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_FileProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_FileProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(test_protocol == HTTP_TEST) {
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_HttpProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_HttpProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(test_protocol == HTTPS_TEST) {
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_HttpSProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_HttpSProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else if(test_protocol == ABOUT_TEST) {
|
|
|
|
ok(IsEqualCLSID(&clsid, &CLSID_AboutProtocol),
|
|
|
|
"incorrect protocol CLSID: %s, expected CLSID_AboutProtocol\n",
|
2014-01-25 15:24:46 +01:00
|
|
|
wine_dbgstr_guid(&clsid));
|
2012-03-15 12:07:46 +01:00
|
|
|
}else {
|
|
|
|
ok(0, "unexpected (%d)\n", test_protocol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) && emulate_protocol) {
|
2007-10-25 21:55:24 +02:00
|
|
|
SetEvent(complete_event);
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface != &objbsc)
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event2, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2006-09-21 11:45:32 +02:00
|
|
|
}
|
2004-12-20 19:58:04 +01:00
|
|
|
|
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_GetBindInfo(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2004-12-20 19:58:04 +01:00
|
|
|
DWORD cbSize;
|
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
CHECK_EXPECT(Obj_GetBindInfo);
|
|
|
|
else
|
|
|
|
CHECK_EXPECT(GetBindInfo);
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-10-25 21:55:24 +02:00
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2007-08-07 06:08:21 +02:00
|
|
|
*grfBINDF = bindf;
|
2004-12-20 19:58:04 +01:00
|
|
|
cbSize = pbindinfo->cbSize;
|
|
|
|
memset(pbindinfo, 0, cbSize);
|
|
|
|
pbindinfo->cbSize = cbSize;
|
|
|
|
|
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallbackEx *iface, DWORD grfBSCF,
|
2005-11-14 16:12:43 +01:00
|
|
|
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2004-12-20 19:58:04 +01:00
|
|
|
HRESULT hres;
|
|
|
|
DWORD readed;
|
|
|
|
BYTE buf[512];
|
2007-08-09 03:24:13 +02:00
|
|
|
CHAR clipfmt[512];
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
if(iface == &objbsc)
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
|
2005-09-16 20:46:29 +02:00
|
|
|
CHECK_EXPECT2(OnDataAvailable);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2007-08-07 06:08:49 +02:00
|
|
|
ok(download_state == DOWNLOADING || download_state == END_DOWNLOAD,
|
|
|
|
"Download state was %d, expected DOWNLOADING or END_DOWNLOAD\n",
|
|
|
|
download_state);
|
2007-08-07 06:08:46 +02:00
|
|
|
data_available = TRUE;
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2010-10-14 00:51:18 +02:00
|
|
|
if(bind_to_object && !is_async_prot)
|
|
|
|
ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION), "grfBSCF = %x\n", grfBSCF);
|
|
|
|
|
2006-05-27 22:56:20 +02:00
|
|
|
ok(pformatetc != NULL, "pformatetx == NULL\n");
|
|
|
|
if(pformatetc) {
|
2007-12-13 20:25:59 +01:00
|
|
|
if (mime_type[0]) {
|
2010-12-30 02:38:36 +01:00
|
|
|
INT ret;
|
2007-08-09 03:24:13 +02:00
|
|
|
clipfmt[0] = 0;
|
2013-11-04 10:37:46 +01:00
|
|
|
ret = GetClipboardFormatNameA(pformatetc->cfFormat, clipfmt, sizeof(clipfmt)-1);
|
2010-12-30 02:38:36 +01:00
|
|
|
ok(ret, "GetClipboardFormatName failed, error %d\n", GetLastError());
|
2013-11-04 10:37:46 +01:00
|
|
|
ok(!strcmp(clipfmt, mime_type), "clipformat %x != mime_type, \"%s\" != \"%s\"\n",
|
2007-12-30 17:55:02 +01:00
|
|
|
pformatetc->cfFormat, clipfmt, mime_type);
|
2007-08-09 03:24:13 +02:00
|
|
|
} else {
|
|
|
|
ok(pformatetc->cfFormat == 0, "clipformat=%x\n", pformatetc->cfFormat);
|
|
|
|
}
|
2006-05-27 22:56:20 +02:00
|
|
|
ok(pformatetc->ptd == NULL, "ptd = %p\n", pformatetc->ptd);
|
2007-01-06 19:30:06 +01:00
|
|
|
ok(pformatetc->dwAspect == 1, "dwAspect=%u\n", pformatetc->dwAspect);
|
|
|
|
ok(pformatetc->lindex == -1, "lindex=%d\n", pformatetc->lindex);
|
2008-01-31 18:19:53 +01:00
|
|
|
ok(pformatetc->tymed == tymed, "tymed=%u, expected %u\n", pformatetc->tymed, tymed);
|
2006-05-27 22:56:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ok(pstgmed != NULL, "stgmeg == NULL\n");
|
2008-01-31 18:19:53 +01:00
|
|
|
ok(pstgmed->tymed == tymed, "tymed=%u, expected %u\n", pstgmed->tymed, tymed);
|
2008-01-16 20:03:58 +01:00
|
|
|
ok(pstgmed->pUnkForRelease != NULL, "pUnkForRelease == NULL\n");
|
2006-05-27 22:56:20 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
switch(pstgmed->tymed) {
|
|
|
|
case TYMED_ISTREAM:
|
|
|
|
if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) {
|
2010-10-10 22:22:13 +02:00
|
|
|
STATSTG stat;
|
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
hres = IStream_Write(U(*pstgmed).pstm, buf, 10, NULL);
|
|
|
|
ok(hres == STG_E_ACCESSDENIED,
|
|
|
|
"Write failed: %08x, expected STG_E_ACCESSDENIED\n", hres);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
hres = IStream_Commit(U(*pstgmed).pstm, 0);
|
|
|
|
ok(hres == E_NOTIMPL, "Commit failed: %08x, expected E_NOTIMPL\n", hres);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
hres = IStream_Revert(U(*pstgmed).pstm);
|
|
|
|
ok(hres == E_NOTIMPL, "Revert failed: %08x, expected E_NOTIMPL\n", hres);
|
2010-10-10 22:22:13 +02:00
|
|
|
|
|
|
|
hres = IStream_Stat(U(*pstgmed).pstm, NULL, STATFLAG_NONAME);
|
|
|
|
ok(hres == E_FAIL, "hres = %x\n", hres);
|
|
|
|
if(use_cache_file && emulate_protocol) {
|
|
|
|
hres = IStream_Stat(U(*pstgmed).pstm, &stat, STATFLAG_DEFAULT);
|
|
|
|
ok(hres == S_OK, "hres = %x\n", hres);
|
|
|
|
ok(!lstrcmpW(stat.pwcsName, cache_file_name),
|
|
|
|
"stat.pwcsName = %s, cache_file_name = %s\n",
|
|
|
|
wine_dbgstr_w(stat.pwcsName), wine_dbgstr_w(cache_file_name));
|
|
|
|
CoTaskMemFree(stat.pwcsName);
|
|
|
|
ok(U(stat.cbSize).LowPart == (bindf&BINDF_ASYNCHRONOUS?0:6500),
|
|
|
|
"stat.cbSize.LowPart = %u\n", U(stat.cbSize).LowPart);
|
|
|
|
} else {
|
|
|
|
hres = IStream_Stat(U(*pstgmed).pstm, &stat, STATFLAG_NONAME);
|
|
|
|
ok(hres == S_OK, "hres = %x\n", hres);
|
|
|
|
ok(!stat.pwcsName || broken(stat.pwcsName!=NULL),
|
|
|
|
"stat.pwcsName = %s\n", wine_dbgstr_w(stat.pwcsName));
|
|
|
|
}
|
|
|
|
ok(stat.type == STGTY_STREAM, "stat.type = %x\n", stat.type);
|
|
|
|
ok(U(stat.cbSize).HighPart == 0, "stat.cbSize.HighPart != 0\n");
|
|
|
|
ok(stat.grfMode == (U(stat.cbSize).LowPart?GENERIC_READ:0), "stat.grfMode = %x\n", stat.grfMode);
|
|
|
|
ok(stat.grfLocksSupported == 0, "stat.grfLocksSupported = %x\n", stat.grfLocksSupported);
|
|
|
|
ok(stat.grfStateBits == 0, "stat.grfStateBits = %x\n", stat.grfStateBits);
|
|
|
|
ok(stat.reserved == 0, "stat.reserved = %x\n", stat.reserved);
|
2008-01-31 18:19:53 +01:00
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
ok(U(*pstgmed).pstm != NULL, "U(*pstgmed).pstm == NULL\n");
|
2010-05-04 20:14:49 +02:00
|
|
|
if(callback_read) {
|
|
|
|
do {
|
|
|
|
hres = IStream_Read(U(*pstgmed).pstm, buf, 512, &readed);
|
|
|
|
if(test_protocol == HTTP_TEST && emulate_protocol && readed)
|
|
|
|
ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
|
|
|
|
}while(hres == S_OK);
|
|
|
|
ok(hres == S_FALSE || hres == E_PENDING, "IStream_Read returned %08x\n", hres);
|
|
|
|
}
|
2008-01-31 18:19:53 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TYMED_FILE:
|
|
|
|
if(test_protocol == FILE_TEST)
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(pstgmed->u.lpszFileName, file_url+7),
|
2009-08-19 13:37:04 +02:00
|
|
|
"unexpected file name %s\n", wine_dbgstr_w(pstgmed->u.lpszFileName));
|
2008-01-31 18:19:53 +01:00
|
|
|
else if(emulate_protocol)
|
|
|
|
ok(!lstrcmpW(pstgmed->u.lpszFileName, cache_fileW),
|
2009-08-19 13:37:04 +02:00
|
|
|
"unexpected file name %s\n", wine_dbgstr_w(pstgmed->u.lpszFileName));
|
2008-01-31 18:19:53 +01:00
|
|
|
else
|
|
|
|
ok(pstgmed->u.lpszFileName != NULL, "lpszFileName == NULL\n");
|
2004-12-20 19:58:04 +01:00
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST)
|
2009-01-12 18:20:28 +01:00
|
|
|
&& emulate_protocol && prot_state < 4 && (!bind_to_object || prot_state > 1))
|
2007-10-25 21:55:24 +02:00
|
|
|
SetEvent(complete_event);
|
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_OnObjectAvailable(IBindStatusCallbackEx *iface, REFIID riid, IUnknown *punk)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
2007-10-26 18:16:31 +02:00
|
|
|
CHECK_EXPECT(OnObjectAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
|
|
|
|
if(iface != &objbsc)
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(IsEqualGUID(&IID_IUnknown, riid), "riid = %s\n", wine_dbgstr_guid(riid));
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(punk != NULL, "punk == NULL\n");
|
|
|
|
|
2007-10-26 18:16:31 +02:00
|
|
|
return S_OK;
|
2004-12-08 14:46:01 +01:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static HRESULT WINAPI statusclb_GetBindInfoEx(IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo,
|
|
|
|
DWORD *grfBINDF2, DWORD *pdwReserved)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(GetBindInfoEx);
|
|
|
|
|
|
|
|
ok(grfBINDF != NULL, "grfBINDF == NULL\n");
|
|
|
|
ok(grfBINDF2 != NULL, "grfBINDF2 == NULL\n");
|
|
|
|
ok(pbindinfo != NULL, "pbindinfo == NULL\n");
|
|
|
|
ok(pdwReserved != NULL, "dwReserved == NULL\n");
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IBindStatusCallbackExVtbl BindStatusCallbackVtbl = {
|
2004-12-08 14:46:01 +01:00
|
|
|
statusclb_QueryInterface,
|
|
|
|
statusclb_AddRef,
|
|
|
|
statusclb_Release,
|
|
|
|
statusclb_OnStartBinding,
|
|
|
|
statusclb_GetPriority,
|
|
|
|
statusclb_OnLowResource,
|
|
|
|
statusclb_OnProgress,
|
|
|
|
statusclb_OnStopBinding,
|
|
|
|
statusclb_GetBindInfo,
|
|
|
|
statusclb_OnDataAvailable,
|
2009-07-02 23:21:08 +02:00
|
|
|
statusclb_OnObjectAvailable,
|
|
|
|
statusclb_GetBindInfoEx
|
2004-12-08 14:46:01 +01:00
|
|
|
};
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static IBindStatusCallbackEx bsc = { &BindStatusCallbackVtbl };
|
2010-10-06 21:36:32 +02:00
|
|
|
static IBindStatusCallbackEx bsc2 = { &BindStatusCallbackVtbl };
|
2009-07-02 23:21:08 +02:00
|
|
|
static IBindStatusCallbackEx objbsc = { &BindStatusCallbackVtbl };
|
2007-12-30 17:55:02 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
*ppv = NULL;
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2007-12-30 17:55:02 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
|
|
|
|
{
|
|
|
|
switch(mkp) {
|
|
|
|
case MIMETYPEPROP:
|
|
|
|
CHECK_EXPECT(PutProperty_MIMETYPEPROP);
|
2009-08-19 13:37:04 +02:00
|
|
|
ok(!lstrcmpW(val, wszTextHtml), "val = %s\n", wine_dbgstr_w(val));
|
2007-12-30 17:55:02 +01:00
|
|
|
break;
|
|
|
|
case CLASSIDPROP:
|
|
|
|
CHECK_EXPECT(PutProperty_CLASSIDPROP);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMonikerPropVtbl MonikerPropVtbl = {
|
|
|
|
MonikerProp_QueryInterface,
|
|
|
|
MonikerProp_AddRef,
|
|
|
|
MonikerProp_Release,
|
|
|
|
MonikerProp_PutProperty
|
|
|
|
};
|
|
|
|
|
|
|
|
static IMonikerProp MonikerProp = { &MonikerPropVtbl };
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IPersistMoniker, riid))
|
|
|
|
*ppv = iface;
|
|
|
|
else if(IsEqualGUID(&IID_IMonikerProp, riid))
|
|
|
|
*ppv = &MonikerProp;
|
|
|
|
|
|
|
|
if(*ppv)
|
|
|
|
return S_OK;
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2007-12-30 17:55:02 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
|
|
|
|
IMoniker *pimkName, LPBC pibc, DWORD grfMode)
|
|
|
|
{
|
|
|
|
IUnknown *unk;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static WCHAR cbinding_contextW[] =
|
|
|
|
{'C','B','i','n','d','i','n','g',' ','C','o','n','t','e','x','t',0};
|
|
|
|
|
|
|
|
CHECK_EXPECT(Load);
|
|
|
|
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
|
|
|
|
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(!fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
else
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(pimkName != NULL, "pimkName == NULL\n");
|
|
|
|
ok(pibc != NULL, "pibc == NULL\n");
|
|
|
|
ok(grfMode == 0x12, "grfMode = %x\n", grfMode);
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(pibc, cbinding_contextW, &unk);
|
|
|
|
ok(hres == S_OK, "GetObjectParam(CBinding Context) failed: %08x\n", hres);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
IBinding *binding;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IBinding, (void**)&binding);
|
|
|
|
ok(hres == S_OK, "Could not get IBinding: %08x\n", hres);
|
|
|
|
|
|
|
|
IBinding_Release(binding);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = RegisterBindStatusCallback(pibc, (IBindStatusCallback*)&bsc, NULL, 0);
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
2009-12-15 21:16:35 +01:00
|
|
|
if(test_redirect)
|
|
|
|
SET_EXPECT(OnProgress_REDIRECTING);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol != HTTP_TEST && test_protocol != HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
SET_EXPECT(LockRequest);
|
|
|
|
SET_EXPECT(OnDataAvailable);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol != HTTP_TEST && test_protocol != HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
|
|
|
|
hres = IMoniker_BindToStorage(pimkName, pibc, NULL, &IID_IStream, (void**)&unk);
|
|
|
|
ok(hres == S_OK, "Load failed: %08x\n", hres);
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
2009-12-15 21:16:35 +01:00
|
|
|
if(test_redirect)
|
|
|
|
CHECK_CALLED(OnProgress_REDIRECTING);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol != HTTP_TEST && test_protocol != HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(LockRequest);
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol != HTTP_TEST && test_protocol != HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
|
|
|
|
if(unk)
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **pimkName)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IPersistMonikerVtbl PersistMonikerVtbl = {
|
|
|
|
PersistMoniker_QueryInterface,
|
|
|
|
PersistMoniker_AddRef,
|
|
|
|
PersistMoniker_Release,
|
|
|
|
PersistMoniker_GetClassID,
|
|
|
|
PersistMoniker_IsDirty,
|
|
|
|
PersistMoniker_Load,
|
|
|
|
PersistMoniker_Save,
|
|
|
|
PersistMoniker_SaveCompleted,
|
|
|
|
PersistMoniker_GetCurMoniker
|
|
|
|
};
|
|
|
|
|
|
|
|
static IPersistMoniker PersistMoniker = { &PersistMonikerVtbl };
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IMarshal, riid))
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
if(IsEqualGUID(&CLSID_IdentityUnmarshal, riid))
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2007-12-30 17:55:02 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
CHECK_EXPECT(CreateInstance);
|
|
|
|
ok(!outer, "outer = %p\n", outer);
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2007-12-30 17:55:02 +01:00
|
|
|
*ppv = &PersistMoniker;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
|
|
|
{
|
|
|
|
ok(0, "unexpected call\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IClassFactoryVtbl ClassFactoryVtbl = {
|
|
|
|
ClassFactory_QueryInterface,
|
|
|
|
ClassFactory_AddRef,
|
|
|
|
ClassFactory_Release,
|
|
|
|
ClassFactory_CreateInstance,
|
|
|
|
ClassFactory_LockServer
|
|
|
|
};
|
|
|
|
|
|
|
|
static IClassFactory mime_cf = { &ClassFactoryVtbl };
|
2004-12-08 14:46:01 +01:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
static HRESULT WINAPI ProtocolCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
|
|
|
|
*ppv = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
2014-01-25 15:24:46 +01:00
|
|
|
ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2010-10-06 21:36:32 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
|
|
|
todo_wine ok(outer != NULL, "outer == NULL\n");
|
2014-01-25 15:24:46 +01:00
|
|
|
todo_wine ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
2010-10-06 21:36:32 +02:00
|
|
|
*ppv = &Protocol;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IClassFactoryVtbl ProtocolCFVtbl = {
|
|
|
|
ProtocolCF_QueryInterface,
|
|
|
|
ClassFactory_AddRef,
|
|
|
|
ClassFactory_Release,
|
|
|
|
ProtocolCF_CreateInstance,
|
|
|
|
ClassFactory_LockServer
|
|
|
|
};
|
|
|
|
|
|
|
|
static IClassFactory protocol_cf = { &ProtocolCFVtbl };
|
|
|
|
|
2005-06-17 12:11:37 +02:00
|
|
|
static void test_CreateAsyncBindCtx(void)
|
2004-12-08 14:46:01 +01:00
|
|
|
{
|
|
|
|
IBindCtx *bctx = (IBindCtx*)0x0ff00ff0;
|
2007-08-12 17:39:22 +02:00
|
|
|
IUnknown *unk;
|
2004-12-08 14:46:01 +01:00
|
|
|
HRESULT hres;
|
|
|
|
ULONG ref;
|
|
|
|
BIND_OPTS bindopts;
|
|
|
|
|
|
|
|
hres = CreateAsyncBindCtx(0, NULL, NULL, &bctx);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08x\n", hres);
|
2004-12-08 14:46:01 +01:00
|
|
|
ok(bctx == (IBindCtx*)0x0ff00ff0, "bctx should not be changed\n");
|
|
|
|
|
|
|
|
hres = CreateAsyncBindCtx(0, NULL, NULL, NULL);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08x\n", hres);
|
2004-12-08 14:46:01 +01:00
|
|
|
|
2007-07-24 03:31:50 +02:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
|
2007-10-01 14:11:11 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n", hres);
|
2007-10-01 14:09:32 +02:00
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
2004-12-08 14:46:01 +01:00
|
|
|
|
2005-09-03 11:36:12 +02:00
|
|
|
bindopts.cbStruct = sizeof(bindopts);
|
2004-12-08 14:46:01 +01:00
|
|
|
hres = IBindCtx_GetBindOptions(bctx, &bindopts);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
|
2004-12-08 14:46:01 +01:00
|
|
|
ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
|
2005-09-03 11:36:12 +02:00
|
|
|
ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
|
2005-09-03 11:36:12 +02:00
|
|
|
bindopts.grfMode);
|
2004-12-08 14:46:01 +01:00
|
|
|
ok(bindopts.dwTickCountDeadline == 0,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
|
2004-12-08 14:46:01 +01:00
|
|
|
|
2007-08-12 17:39:22 +02:00
|
|
|
hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (void**)&unk);
|
|
|
|
ok(hres == E_NOINTERFACE, "QueryInterface(IID_IAsyncBindCtx) failed: %08x, expected E_NOINTERFACE\n", hres);
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
2004-12-08 14:46:01 +01:00
|
|
|
ref = IBindCtx_Release(bctx);
|
|
|
|
ok(ref == 0, "bctx should be destroyed here\n");
|
|
|
|
}
|
|
|
|
|
2005-09-03 11:36:12 +02:00
|
|
|
static void test_CreateAsyncBindCtxEx(void)
|
|
|
|
{
|
2007-12-30 17:42:03 +01:00
|
|
|
IBindCtx *bctx = NULL, *bctx2 = NULL, *bctx_arg = NULL;
|
2007-08-12 17:39:22 +02:00
|
|
|
IUnknown *unk;
|
2005-09-03 11:36:12 +02:00
|
|
|
BIND_OPTS bindopts;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2007-12-30 17:42:03 +01:00
|
|
|
static WCHAR testW[] = {'t','e','s','t',0};
|
|
|
|
|
2010-04-22 00:28:55 +02:00
|
|
|
if (!pCreateAsyncBindCtxEx) {
|
|
|
|
win_skip("CreateAsyncBindCtxEx not present\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, NULL, 0);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == E_INVALIDARG, "CreateAsyncBindCtx failed: %08x, expected E_INVALIDARG\n", hres);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
2010-04-22 00:28:55 +02:00
|
|
|
hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
bindopts.cbStruct = sizeof(bindopts);
|
|
|
|
hres = IBindCtx_GetBindOptions(bctx, &bindopts);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
|
2005-09-03 11:36:12 +02:00
|
|
|
ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
|
2005-09-03 11:36:12 +02:00
|
|
|
ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
|
2005-09-03 11:36:12 +02:00
|
|
|
bindopts.grfMode);
|
|
|
|
ok(bindopts.dwTickCountDeadline == 0,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
CreateBindCtx(0, &bctx_arg);
|
2010-04-22 00:28:55 +02:00
|
|
|
hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
bindopts.cbStruct = sizeof(bindopts);
|
|
|
|
hres = IBindCtx_GetBindOptions(bctx, &bindopts);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hres == S_OK, "IBindCtx_GetBindOptions failed: %08x\n", hres);
|
2005-09-03 11:36:12 +02:00
|
|
|
ok(bindopts.grfFlags == BIND_MAYBOTHERUSER,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfFlags = %08x, expected: BIND_MAYBOTHERUSER\n", bindopts.grfFlags);
|
2005-09-03 11:36:12 +02:00
|
|
|
ok(bindopts.grfMode == (STGM_READWRITE | STGM_SHARE_EXCLUSIVE),
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.grfMode = %08x, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE\n",
|
2005-09-03 11:36:12 +02:00
|
|
|
bindopts.grfMode);
|
|
|
|
ok(bindopts.dwTickCountDeadline == 0,
|
2006-10-07 15:30:28 +02:00
|
|
|
"bindopts.dwTickCountDeadline = %08x, expected: 0\n", bindopts.dwTickCountDeadline);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
IBindCtx_Release(bctx_arg);
|
|
|
|
|
2007-07-24 03:31:50 +02:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
2010-04-22 00:28:55 +02:00
|
|
|
hres = pCreateAsyncBindCtxEx(NULL, 0, (IBindStatusCallback*)&bsc, NULL, &bctx, 0);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
|
2007-10-01 14:09:32 +02:00
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
2005-09-03 11:36:12 +02:00
|
|
|
|
2007-08-12 17:39:22 +02:00
|
|
|
hres = IBindCtx_QueryInterface(bctx, &IID_IAsyncBindCtx, (void**)&unk);
|
|
|
|
ok(hres == S_OK, "QueryInterface(IID_IAsyncBindCtx) failed: %08x\n", hres);
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
2007-12-30 17:42:03 +01:00
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
|
|
|
|
hres = CreateBindCtx(0, &bctx2);
|
|
|
|
ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
|
|
|
|
|
2010-04-22 00:28:55 +02:00
|
|
|
hres = pCreateAsyncBindCtxEx(bctx2, 0, NULL, NULL, &bctx, 0);
|
2007-12-30 17:42:03 +01:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IBindCtx_RegisterObjectParam(bctx2, testW, (IUnknown*)&Protocol);
|
|
|
|
ok(hres == S_OK, "RegisterObjectParam failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(bctx, testW, &unk);
|
|
|
|
ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
|
|
|
|
ok(unk == (IUnknown*)&Protocol, "unexpected unk %p\n", unk);
|
|
|
|
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
IBindCtx_Release(bctx2);
|
2005-09-03 11:36:12 +02:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
static void test_GetBindInfoEx(IBindStatusCallback *holder)
|
|
|
|
{
|
|
|
|
IBindStatusCallbackEx *bscex;
|
|
|
|
BINDINFO bindinfo = {sizeof(bindinfo)};
|
|
|
|
DWORD bindf, bindf2, dw;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IBindStatusCallbackEx, (void**)&bscex);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
win_skip("IBindStatusCallbackEx not supported\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
use_bscex = TRUE;
|
|
|
|
|
|
|
|
bindf = 0;
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
SET_EXPECT(GetBindInfoEx);
|
|
|
|
hres = IBindStatusCallback_GetBindInfo(holder, &bindf, &bindinfo);
|
|
|
|
ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
CHECK_CALLED(GetBindInfoEx);
|
|
|
|
|
|
|
|
bindf = bindf2 = dw = 0;
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
SET_EXPECT(GetBindInfoEx);
|
|
|
|
hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &bindf, &bindinfo, &bindf2, &dw);
|
|
|
|
ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
CHECK_CALLED(GetBindInfoEx);
|
|
|
|
|
|
|
|
use_bscex = FALSE;
|
|
|
|
|
|
|
|
bindf = bindf2 = dw = 0xdeadbeef;
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
hres = IBindStatusCallbackEx_GetBindInfoEx(bscex, &bindf, &bindinfo, &bindf2, &dw);
|
|
|
|
ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
ok(bindf2 == 0xdeadbeef, "bindf2 = %x\n", bindf2);
|
|
|
|
ok(dw == 0xdeadbeef, "dw = %x\n", dw);
|
|
|
|
|
|
|
|
IBindStatusCallbackEx_Release(bscex);
|
|
|
|
}
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
static BOOL test_bscholder(IBindStatusCallback *holder)
|
2007-10-01 14:11:11 +02:00
|
|
|
{
|
|
|
|
IServiceProvider *serv_prov;
|
|
|
|
IHttpNegotiate *http_negotiate, *http_negotiate_serv;
|
|
|
|
IHttpNegotiate2 *http_negotiate2, *http_negotiate2_serv;
|
|
|
|
IAuthenticate *authenticate, *authenticate_serv;
|
2015-02-26 11:00:27 +01:00
|
|
|
IInternetBindInfo *bind_info;
|
2007-10-01 14:11:11 +02:00
|
|
|
IInternetProtocol *protocol;
|
|
|
|
BINDINFO bindinfo = {sizeof(bindinfo)};
|
2009-01-07 00:42:03 +01:00
|
|
|
BOOL ret = TRUE;
|
2007-10-01 14:11:11 +02:00
|
|
|
LPWSTR wstr;
|
|
|
|
DWORD dw;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IServiceProvider, (void**)&serv_prov);
|
|
|
|
ok(hres == S_OK, "Could not get IServiceProvider interface: %08x\n", hres);
|
|
|
|
|
|
|
|
dw = 0xdeadbeef;
|
2009-07-02 23:21:08 +02:00
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
2007-10-01 14:11:11 +02:00
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
hres = IBindStatusCallback_GetBindInfo(holder, &dw, &bindinfo);
|
|
|
|
ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
|
2009-07-02 23:21:08 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
|
2007-10-01 14:11:11 +02:00
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
test_GetBindInfoEx(holder);
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
hres = IBindStatusCallback_OnStartBinding(holder, 0, (void*)0xdeadbeef);
|
|
|
|
ok(hres == S_OK, "OnStartBinding failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate, (void**)&http_negotiate);
|
|
|
|
ok(hres == S_OK, "Could not get IHttpNegotiate interface: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate, &IID_IHttpNegotiate,
|
|
|
|
(void**)&http_negotiate_serv);
|
|
|
|
ok(hres == S_OK, "Could not get IHttpNegotiate service: %08x\n", hres);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate); /* IE <8 */
|
2007-10-01 14:11:11 +02:00
|
|
|
|
|
|
|
ok(http_negotiate == http_negotiate_serv, "http_negotiate != http_negotiate_serv\n");
|
|
|
|
|
|
|
|
wstr = (void*)0xdeadbeef;
|
2009-06-23 14:52:23 +02:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
2007-10-01 14:11:11 +02:00
|
|
|
SET_EXPECT(BeginningTransaction);
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = IHttpNegotiate_BeginningTransaction(http_negotiate_serv, current_url, emptyW, 0, &wstr);
|
2009-06-23 14:52:23 +02:00
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate); /* IE8 */
|
2007-10-01 14:11:11 +02:00
|
|
|
CHECK_CALLED(BeginningTransaction);
|
|
|
|
ok(hres == S_OK, "BeginningTransaction failed: %08x\n", hres);
|
|
|
|
ok(wstr == NULL, "wstr = %p\n", wstr);
|
|
|
|
|
|
|
|
IHttpNegotiate_Release(http_negotiate_serv);
|
|
|
|
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate, &IID_IHttpNegotiate,
|
|
|
|
(void**)&http_negotiate_serv);
|
|
|
|
ok(hres == S_OK, "Could not get IHttpNegotiate service: %08x\n", hres);
|
|
|
|
ok(http_negotiate == http_negotiate_serv, "http_negotiate != http_negotiate_serv\n");
|
|
|
|
IHttpNegotiate_Release(http_negotiate_serv);
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate2, (void**)&http_negotiate2);
|
2008-02-20 21:30:00 +01:00
|
|
|
if(SUCCEEDED(hres)) {
|
2008-11-20 23:06:27 +01:00
|
|
|
have_IHttpNegotiate2 = TRUE;
|
2007-10-01 14:11:11 +02:00
|
|
|
|
2008-02-20 21:30:00 +01:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpNegotiate2, &IID_IHttpNegotiate2,
|
|
|
|
(void**)&http_negotiate2_serv);
|
|
|
|
ok(hres == S_OK, "Could not get IHttpNegotiate2 service: %08x\n", hres);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate2); /* IE <8 */
|
2008-02-20 21:30:00 +01:00
|
|
|
ok(http_negotiate2 == http_negotiate2_serv, "http_negotiate != http_negotiate_serv\n");
|
2007-10-01 14:11:11 +02:00
|
|
|
|
2009-06-23 14:52:23 +02:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
2008-02-20 21:30:00 +01:00
|
|
|
SET_EXPECT(GetRootSecurityId);
|
|
|
|
hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, (void*)0xdeadbeef, (void*)0xdeadbeef, 0);
|
|
|
|
ok(hres == E_NOTIMPL, "GetRootSecurityId failed: %08x\n", hres);
|
2009-06-23 14:52:23 +02:00
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate2); /* IE8 */
|
2008-02-20 21:30:00 +01:00
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
2007-10-01 14:11:11 +02:00
|
|
|
|
2012-07-30 10:56:13 +02:00
|
|
|
IHttpNegotiate2_Release(http_negotiate2_serv);
|
|
|
|
IHttpNegotiate2_Release(http_negotiate2);
|
2008-02-20 21:30:00 +01:00
|
|
|
}else {
|
|
|
|
skip("Could not get IHttpNegotiate2\n");
|
2009-01-07 00:42:03 +01:00
|
|
|
ret = FALSE;
|
2008-02-20 21:30:00 +01:00
|
|
|
}
|
2007-10-01 14:11:11 +02:00
|
|
|
|
|
|
|
SET_EXPECT(OnProgress_FINDINGRESOURCE);
|
|
|
|
hres = IBindStatusCallback_OnProgress(holder, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL);
|
|
|
|
ok(hres == S_OK, "OnProgress failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnProgress_FINDINGRESOURCE);
|
|
|
|
|
2009-06-23 14:52:23 +02:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
2007-10-01 14:11:11 +02:00
|
|
|
SET_EXPECT(OnResponse);
|
|
|
|
wstr = (void*)0xdeadbeef;
|
|
|
|
hres = IHttpNegotiate_OnResponse(http_negotiate, 200, emptyW, NULL, NULL);
|
|
|
|
ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
|
2009-06-23 14:52:23 +02:00
|
|
|
CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate); /* IE8 */
|
2007-10-01 14:11:11 +02:00
|
|
|
CHECK_CALLED(OnResponse);
|
|
|
|
|
|
|
|
IHttpNegotiate_Release(http_negotiate);
|
|
|
|
|
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IAuthenticate, (void**)&authenticate);
|
|
|
|
ok(hres == S_OK, "Could not get IAuthenticate interface: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IAuthenticate);
|
|
|
|
SET_EXPECT(QueryService_IAuthenticate);
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IAuthenticate, &IID_IAuthenticate,
|
|
|
|
(void**)&authenticate_serv);
|
|
|
|
ok(hres == S_OK, "Could not get IAuthenticate service: %08x\n", hres);
|
2009-06-23 14:52:23 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IAuthenticate); /* IE <8 */
|
|
|
|
CLEAR_CALLED(QueryService_IAuthenticate); /* IE <8 */
|
2007-10-01 14:11:11 +02:00
|
|
|
ok(authenticate == authenticate_serv, "authenticate != authenticate_serv\n");
|
|
|
|
IAuthenticate_Release(authenticate_serv);
|
|
|
|
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IAuthenticate, &IID_IAuthenticate,
|
|
|
|
(void**)&authenticate_serv);
|
|
|
|
ok(hres == S_OK, "Could not get IAuthenticate service: %08x\n", hres);
|
|
|
|
ok(authenticate == authenticate_serv, "authenticate != authenticate_serv\n");
|
|
|
|
|
|
|
|
IAuthenticate_Release(authenticate);
|
|
|
|
IAuthenticate_Release(authenticate_serv);
|
|
|
|
|
2015-02-26 11:00:27 +01:00
|
|
|
hres = IBindStatusCallback_QueryInterface(holder, &IID_IInternetBindInfo, (void**)&bind_info);
|
|
|
|
ok(hres == S_OK || broken(hres == E_NOINTERFACE /* win2k */), "Could not get IInternetBindInfo interface: %08x\n", hres);
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_USER_AGENT, &wstr, 1, &dw);
|
|
|
|
ok(hres == E_NOINTERFACE, "GetBindString(BINDSTRING_USER_AGENT) failed: %08x\n", hres);
|
|
|
|
|
|
|
|
IInternetBindInfo_Release(bind_info);
|
|
|
|
}
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
hres = IBindStatusCallback_OnStopBinding(holder, S_OK, NULL);
|
|
|
|
ok(hres == S_OK, "OnStopBinding failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
hres = IServiceProvider_QueryService(serv_prov, &IID_IInternetProtocol, &IID_IInternetProtocol,
|
|
|
|
(void**)&protocol);
|
|
|
|
ok(hres == E_NOINTERFACE, "QueryService(IInternetProtocol) failed: %08x\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
|
|
|
|
IServiceProvider_Release(serv_prov);
|
2009-01-07 00:42:03 +01:00
|
|
|
return ret;
|
2007-10-01 14:11:11 +02:00
|
|
|
}
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
static BOOL test_RegisterBindStatusCallback(void)
|
2007-10-01 14:11:11 +02:00
|
|
|
{
|
2010-10-06 21:36:32 +02:00
|
|
|
IBindStatusCallback *prevbsc, *clb, *prev_clb;
|
2007-10-01 14:11:11 +02:00
|
|
|
IBindCtx *bindctx;
|
2009-01-07 00:42:03 +01:00
|
|
|
BOOL ret = TRUE;
|
2007-10-01 14:11:11 +02:00
|
|
|
IUnknown *unk;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2013-11-15 15:45:51 +01:00
|
|
|
strict_bsc_qi = TRUE;
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
hres = CreateBindCtx(0, &bindctx);
|
|
|
|
ok(hres == S_OK, "BindCtx failed: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
|
|
|
|
hres = IBindCtx_RegisterObjectParam(bindctx, BSCBHolder, (IUnknown*)&bsc);
|
|
|
|
ok(hres == S_OK, "RegisterObjectParam failed: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallback);
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackHolder);
|
|
|
|
prevbsc = (void*)0xdeadbeef;
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc, &prevbsc, 0);
|
2007-10-01 14:11:11 +02:00
|
|
|
ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
|
2009-07-02 23:21:08 +02:00
|
|
|
ok(prevbsc == (IBindStatusCallback*)&bsc, "prevbsc=%p\n", prevbsc);
|
2007-10-01 14:11:11 +02:00
|
|
|
CHECK_CALLED(QueryInterface_IBindStatusCallback);
|
|
|
|
CHECK_CALLED(QueryInterface_IBindStatusCallbackHolder);
|
|
|
|
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
|
|
|
|
ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&clb);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
|
2009-07-02 23:21:08 +02:00
|
|
|
ok(clb != (IBindStatusCallback*)&bsc, "bsc == clb\n");
|
2007-10-01 14:11:11 +02:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
if(!test_bscholder(clb))
|
|
|
|
ret = FALSE;
|
2007-10-01 14:11:11 +02:00
|
|
|
|
|
|
|
IBindStatusCallback_Release(clb);
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = RevokeBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc);
|
2007-10-01 14:11:11 +02:00
|
|
|
ok(hres == S_OK, "RevokeBindStatusCallback failed: %08x\n", hres);
|
|
|
|
|
|
|
|
unk = (void*)0xdeadbeef;
|
|
|
|
hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
|
|
|
|
ok(hres == E_FAIL, "GetObjectParam failed: %08x\n", hres);
|
|
|
|
ok(unk == NULL, "unk != NULL\n");
|
|
|
|
|
|
|
|
if(unk)
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
hres = RevokeBindStatusCallback(bindctx, (void*)0xdeadbeef);
|
|
|
|
ok(hres == S_OK, "RevokeBindStatusCallback failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = RevokeBindStatusCallback(NULL, (void*)0xdeadbeef);
|
|
|
|
ok(hres == E_INVALIDARG, "RevokeBindStatusCallback failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = RevokeBindStatusCallback(bindctx, NULL);
|
|
|
|
ok(hres == E_INVALIDARG, "RevokeBindStatusCallback failed: %08x\n", hres);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
prevbsc = (void*)0xdeadbeef;
|
|
|
|
hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc, &prevbsc, 0);
|
|
|
|
ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
|
|
|
|
ok(!prevbsc, "prevbsc=%p\n", prevbsc);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
|
|
|
|
ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&prev_clb);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
|
|
|
|
ok(prev_clb != (IBindStatusCallback*)&bsc, "bsc == clb\n");
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
prevbsc = (void*)0xdeadbeef;
|
|
|
|
hres = RegisterBindStatusCallback(bindctx, (IBindStatusCallback*)&bsc2, &prevbsc, 0);
|
|
|
|
ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
|
|
|
|
ok(prevbsc == (IBindStatusCallback*)&bsc, "prevbsc != bsc\n");
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
|
|
|
hres = IBindCtx_GetObjectParam(bindctx, BSCBHolder, &unk);
|
|
|
|
ok(hres == S_OK, "GetObjectParam failed: %08x\n", hres);
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&clb);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
ok(hres == S_OK, "QueryInterface(IID_IBindStatusCallback) failed: %08x\n", hres);
|
|
|
|
ok(prev_clb == clb, "bsc != clb\n");
|
|
|
|
|
|
|
|
IBindStatusCallback_Release(clb);
|
|
|
|
IBindStatusCallback_Release(prev_clb);
|
|
|
|
|
2007-10-01 14:11:11 +02:00
|
|
|
IBindCtx_Release(bindctx);
|
2013-11-15 15:45:51 +01:00
|
|
|
|
|
|
|
strict_bsc_qi = FALSE;
|
2009-01-07 00:42:03 +01:00
|
|
|
return ret;
|
2007-10-01 14:11:11 +02:00
|
|
|
}
|
|
|
|
|
2011-05-02 05:29:53 +02:00
|
|
|
#define BINDTEST_EMULATE 0x0001
|
|
|
|
#define BINDTEST_TOOBJECT 0x0002
|
|
|
|
#define BINDTEST_FILEDWLAPI 0x0004
|
|
|
|
#define BINDTEST_HTTPRESPONSE 0x0008
|
|
|
|
#define BINDTEST_REDIRECT 0x0010
|
|
|
|
#define BINDTEST_USE_CACHE 0x0020
|
|
|
|
#define BINDTEST_NO_CALLBACK_READ 0x0040
|
|
|
|
#define BINDTEST_NO_CALLBACK 0x0080
|
|
|
|
#define BINDTEST_ABORT 0x0100
|
|
|
|
#define BINDTEST_INVALID_CN 0x0200
|
|
|
|
#define BINDTEST_ABORT_START 0x0400
|
|
|
|
#define BINDTEST_ABORT_PROGRESS 0x0800
|
2012-01-20 14:52:50 +01:00
|
|
|
#define BINDTEST_ASYNC_SWITCH 0x1000
|
2014-05-20 15:11:03 +02:00
|
|
|
#define BINDTEST_ALLOW_FINDINGRESOURCE 0x2000
|
2008-02-18 01:04:34 +01:00
|
|
|
|
|
|
|
static void init_bind_test(int protocol, DWORD flags, DWORD t)
|
2007-12-30 17:55:02 +01:00
|
|
|
{
|
2013-02-12 17:17:02 +01:00
|
|
|
const char *url_a = NULL;
|
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
test_protocol = protocol;
|
2014-02-04 10:49:22 +01:00
|
|
|
bindtest_flags = flags;
|
2008-02-18 01:04:34 +01:00
|
|
|
emulate_protocol = (flags & BINDTEST_EMULATE) != 0;
|
2007-12-30 17:55:02 +01:00
|
|
|
download_state = BEFORE_DOWNLOAD;
|
|
|
|
stopped_binding = FALSE;
|
|
|
|
stopped_obj_binding = FALSE;
|
|
|
|
data_available = FALSE;
|
|
|
|
mime_type[0] = 0;
|
|
|
|
binding_hres = S_OK;
|
2008-02-18 01:04:34 +01:00
|
|
|
bind_to_object = (flags & BINDTEST_TOOBJECT) != 0;
|
2008-01-31 18:19:53 +01:00
|
|
|
tymed = t;
|
2008-02-18 01:04:34 +01:00
|
|
|
filedwl_api = (flags & BINDTEST_FILEDWLAPI) != 0;
|
2013-02-12 17:17:02 +01:00
|
|
|
post_test = (flags & BINDTEST_HTTPRESPONSE) != 0;
|
|
|
|
|
|
|
|
switch(protocol) {
|
|
|
|
case HTTP_TEST:
|
|
|
|
if(post_test)
|
|
|
|
url_a = "http://test.winehq.org/tests/post.php";
|
|
|
|
else
|
|
|
|
lstrcpyW(current_url, winetest_data_urlW);
|
|
|
|
break;
|
|
|
|
case ABOUT_TEST:
|
|
|
|
url_a = "about:blank";
|
|
|
|
break;
|
|
|
|
case FILE_TEST:
|
|
|
|
lstrcpyW(current_url, file_url);
|
|
|
|
break;
|
|
|
|
case MK_TEST:
|
|
|
|
url_a = "mk:@MSITStore:test.chm::/blank.html";
|
|
|
|
break;
|
|
|
|
case ITS_TEST:
|
|
|
|
url_a = "its:test.chm::/blank.html";
|
|
|
|
break;
|
|
|
|
case HTTPS_TEST:
|
2014-01-29 21:57:23 +01:00
|
|
|
url_a = (flags & BINDTEST_INVALID_CN) ? "https://209.46.25.134/favicon.ico" : "https://test.winehq.org/tests/hello.html";
|
2013-02-12 17:17:02 +01:00
|
|
|
break;
|
|
|
|
case FTP_TEST:
|
2015-11-04 06:41:09 +01:00
|
|
|
url_a = "ftp://ftp.winehq.org/welcome.msg";
|
2013-02-12 17:17:02 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
url_a = "winetest:test";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(url_a)
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, url_a, -1, current_url, sizeof(current_url)/sizeof(*current_url));
|
|
|
|
|
2009-12-15 21:15:28 +01:00
|
|
|
test_redirect = (flags & BINDTEST_REDIRECT) != 0;
|
2010-05-04 20:14:49 +02:00
|
|
|
use_cache_file = (flags & BINDTEST_USE_CACHE) != 0;
|
|
|
|
callback_read = !(flags & BINDTEST_NO_CALLBACK_READ);
|
2010-10-06 21:36:32 +02:00
|
|
|
no_callback = (flags & BINDTEST_NO_CALLBACK) != 0;
|
|
|
|
test_abort = (flags & BINDTEST_ABORT) != 0;
|
2011-05-02 05:29:53 +02:00
|
|
|
abort_start = (flags & BINDTEST_ABORT_START) != 0;
|
|
|
|
abort_progress = (flags & BINDTEST_ABORT_PROGRESS) != 0;
|
2012-01-20 14:52:50 +01:00
|
|
|
async_switch = (flags & BINDTEST_ASYNC_SWITCH) != 0;
|
2010-10-14 00:51:18 +02:00
|
|
|
is_async_prot = protocol == HTTP_TEST || protocol == HTTPS_TEST || protocol == FTP_TEST || protocol == WINETEST_TEST;
|
2012-01-20 14:52:50 +01:00
|
|
|
prot_state = 0;
|
|
|
|
ResetEvent(complete_event);
|
2013-02-12 17:17:02 +01:00
|
|
|
|
|
|
|
trace("URL: %s\n", wine_dbgstr_w(current_url));
|
2007-12-30 17:55:02 +01:00
|
|
|
}
|
|
|
|
|
2009-12-15 21:15:08 +01:00
|
|
|
static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
|
2004-12-20 19:58:04 +01:00
|
|
|
{
|
|
|
|
IMoniker *mon;
|
|
|
|
HRESULT hres;
|
|
|
|
LPOLESTR display_name;
|
2010-10-06 21:36:32 +02:00
|
|
|
IBindCtx *bctx = NULL;
|
2004-12-20 19:58:04 +01:00
|
|
|
MSG msg;
|
2006-01-05 12:18:06 +01:00
|
|
|
IBindStatusCallback *previousclb;
|
2004-12-20 19:58:04 +01:00
|
|
|
IUnknown *unk = (IUnknown*)0x00ff00ff;
|
2014-05-20 15:11:03 +02:00
|
|
|
BOOL allow_finding_resource;
|
2005-05-23 11:53:21 +02:00
|
|
|
IBinding *bind;
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2009-12-15 21:15:08 +01:00
|
|
|
init_bind_test(protocol, flags, t);
|
2014-05-20 15:11:03 +02:00
|
|
|
allow_finding_resource = (flags & BINDTEST_ALLOW_FINDINGRESOURCE) != 0;
|
2007-01-12 12:31:04 +01:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(no_callback) {
|
|
|
|
hres = CreateBindCtx(0, &bctx);
|
|
|
|
ok(hres == S_OK, "CreateBindCtx failed: %08x\n", hres);
|
|
|
|
}else {
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
|
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return;
|
2007-07-24 03:31:50 +02:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
hres = RegisterBindStatusCallback(bctx, (IBindStatusCallback*)&bsc, &previousclb, 0);
|
|
|
|
ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
|
|
|
|
ok(previousclb == (IBindStatusCallback*)&bsc, "previousclb(%p) != sclb(%p)\n", previousclb, &bsc);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
if(previousclb)
|
|
|
|
IBindStatusCallback_Release(previousclb);
|
|
|
|
}
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = CreateURLMoniker(NULL, current_url, &mon);
|
2010-10-06 21:36:32 +02:00
|
|
|
ok(hres == S_OK, "failed to create moniker: %08x\n", hres);
|
|
|
|
if(FAILED(hres))
|
2004-12-20 19:58:04 +01:00
|
|
|
return;
|
|
|
|
|
2005-05-23 11:53:21 +02:00
|
|
|
hres = IMoniker_QueryInterface(mon, &IID_IBinding, (void**)&bind);
|
|
|
|
ok(hres == E_NOINTERFACE, "IMoniker should not have IBinding interface\n");
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IBinding_Release(bind);
|
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
hres = IMoniker_GetDisplayName(mon, bctx, NULL, &display_name);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "GetDisplayName failed %08x\n", hres);
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(display_name, current_url), "GetDisplayName got wrong name %s, expected %s\n",
|
|
|
|
wine_dbgstr_w(display_name), wine_dbgstr_w(current_url));
|
2007-12-10 04:28:12 +01:00
|
|
|
CoTaskMemFree(display_name);
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
if(tymed == TYMED_FILE && (test_protocol == ABOUT_TEST || test_protocol == ITS_TEST))
|
|
|
|
binding_hres = INET_E_DATA_NOT_AVAILABLE;
|
2011-01-09 06:28:54 +01:00
|
|
|
if((flags & BINDTEST_INVALID_CN) && !invalid_cn_accepted &&
|
|
|
|
(onsecurityproblem_hres != S_OK || security_problem == ERROR_INTERNET_SEC_CERT_ERRORS)) {
|
|
|
|
if(security_problem == ERROR_INTERNET_SEC_CERT_ERRORS)
|
|
|
|
binding_hres = INET_E_SECURITY_PROBLEM;
|
|
|
|
else
|
|
|
|
binding_hres = INET_E_INVALID_CERTIFICATE;
|
|
|
|
}
|
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2010-12-19 21:26:06 +01:00
|
|
|
if(only_check_prot_args)
|
|
|
|
SET_EXPECT(OnStopBinding);
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
if(!emulate_protocol)
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
|
|
|
SET_EXPECT(SetPriority);
|
2005-11-14 16:12:43 +01:00
|
|
|
SET_EXPECT(Start);
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST
|
|
|
|
|| test_protocol == WINETEST_SYNC_TEST)
|
2007-10-25 21:55:24 +02:00
|
|
|
SET_EXPECT(Terminate);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(tymed != TYMED_FILE || (test_protocol != ABOUT_TEST && test_protocol != ITS_TEST))
|
|
|
|
SET_EXPECT(UnlockRequest);
|
2005-11-14 16:12:43 +01:00
|
|
|
}else {
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
2008-01-31 18:09:32 +01:00
|
|
|
SET_EXPECT(QueryService_IInternetBindInfo);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start)
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
2009-09-11 12:22:38 +02:00
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(QueryService_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
SET_EXPECT(GetWindow_IWindowForBindingUI);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start) {
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
2014-05-20 15:11:03 +02:00
|
|
|
if(http_is_first || allow_finding_resource)
|
2011-05-11 13:34:47 +02:00
|
|
|
SET_EXPECT(OnProgress_FINDINGRESOURCE);
|
2011-05-02 05:29:53 +02:00
|
|
|
SET_EXPECT(OnProgress_CONNECTING);
|
|
|
|
}
|
2011-01-09 06:28:54 +01:00
|
|
|
if(flags & BINDTEST_INVALID_CN) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpSecurity);
|
|
|
|
SET_EXPECT(QueryService_IHttpSecurity);
|
|
|
|
SET_EXPECT(OnSecurityProblem);
|
|
|
|
if(SUCCEEDED(onsecurityproblem_hres))
|
|
|
|
SET_EXPECT(GetWindow_IHttpSecurity);
|
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
2011-05-02 05:29:53 +02:00
|
|
|
if((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FTP_TEST
|
|
|
|
|| test_protocol == FILE_TEST || test_protocol == WINETEST_TEST) && !abort_start)
|
2010-10-06 21:36:32 +02:00
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(OnResponse);
|
|
|
|
}
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start) {
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FTP_TEST || test_protocol == WINETEST_TEST)
|
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start)
|
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start)
|
2010-10-06 21:36:32 +02:00
|
|
|
SET_EXPECT(OnDataAvailable);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2008-01-31 18:19:53 +01:00
|
|
|
hres = IMoniker_BindToStorage(mon, bctx, NULL, tymed == TYMED_ISTREAM ? &IID_IStream : &IID_IUnknown, (void**)&unk);
|
2009-01-12 18:20:28 +01:00
|
|
|
if ((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
|
|
|
&& hres == HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED))
|
2006-09-21 11:45:32 +02:00
|
|
|
{
|
2008-01-31 18:19:53 +01:00
|
|
|
skip("Network unreachable, skipping tests\n");
|
2006-09-21 11:45:32 +02:00
|
|
|
return;
|
|
|
|
}
|
2005-11-15 17:54:13 +01:00
|
|
|
|
2010-12-19 21:26:06 +01:00
|
|
|
if(only_check_prot_args) {
|
|
|
|
ok(hres == E_FAIL, "Got %08x\n", hres);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
2011-05-02 05:29:53 +02:00
|
|
|
} else if(abort_start)
|
2011-05-02 05:29:53 +02:00
|
|
|
ok(hres == abort_hres, "IMoniker_BindToStorage failed: %08x, expected %08x\n", hres, abort_hres);
|
2011-05-02 05:29:53 +02:00
|
|
|
else if(abort_progress)
|
|
|
|
ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
else if(no_callback) {
|
2010-10-06 21:36:32 +02:00
|
|
|
if(emulate_protocol)
|
2013-01-29 16:01:23 +01:00
|
|
|
ok( WaitForSingleObject(complete_event2, 90000) == WAIT_OBJECT_0, "wait timed out\n" );
|
2010-10-06 21:36:32 +02:00
|
|
|
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
ok(unk != NULL, "unk == NULL\n");
|
|
|
|
}else if(!(bindf & BINDF_ASYNCHRONOUS) && tymed == TYMED_FILE) {
|
2010-04-29 17:14:47 +02:00
|
|
|
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
ok(unk == NULL, "unk != NULL\n");
|
|
|
|
}else if(((bindf & BINDF_ASYNCHRONOUS) && !data_available)
|
2008-01-31 18:19:53 +01:00
|
|
|
|| (tymed == TYMED_FILE && test_protocol == FILE_TEST)) {
|
2007-08-07 06:08:46 +02:00
|
|
|
ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
ok(unk == NULL, "istr should be NULL\n");
|
2008-01-31 18:19:53 +01:00
|
|
|
}else if(tymed == TYMED_FILE && test_protocol == ABOUT_TEST) {
|
|
|
|
ok(hres == INET_E_DATA_NOT_AVAILABLE,
|
|
|
|
"IMoniker_BindToStorage failed: %08x, expected INET_E_DATA_NOT_AVAILABLE\n", hres);
|
|
|
|
ok(unk == NULL, "istr should be NULL\n");
|
2011-01-09 06:28:54 +01:00
|
|
|
}else if((flags & BINDTEST_INVALID_CN) && binding_hres != S_OK) {
|
|
|
|
ok(hres == binding_hres, "Got %08x\n", hres);
|
|
|
|
ok(unk == NULL, "Got %p\n", unk);
|
|
|
|
}else if((flags & BINDTEST_INVALID_CN) && invalid_cn_accepted) {
|
2011-05-10 11:26:43 +02:00
|
|
|
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
ok(unk != NULL, "unk == NULL\n");
|
|
|
|
if(unk == NULL) {
|
|
|
|
ok(0, "Expected security problem to be ignored.\n");
|
|
|
|
invalid_cn_accepted = FALSE;
|
|
|
|
binding_hres = INET_E_INVALID_CERTIFICATE;
|
2011-01-09 06:28:54 +01:00
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
}else {
|
2007-08-07 06:08:46 +02:00
|
|
|
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
|
2005-11-14 16:12:43 +01:00
|
|
|
ok(unk != NULL, "unk == NULL\n");
|
2004-12-20 19:58:04 +01:00
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(unk && callback_read && !no_callback) {
|
2004-12-20 19:58:04 +01:00
|
|
|
IUnknown_Release(unk);
|
2010-10-06 21:36:32 +02:00
|
|
|
unk = NULL;
|
|
|
|
}
|
2004-12-20 19:58:04 +01:00
|
|
|
|
2011-05-02 05:29:53 +02:00
|
|
|
if(FAILED(hres) && !(flags & BINDTEST_INVALID_CN) && !(flags & BINDTEST_ABORT_START))
|
2008-01-31 18:19:53 +01:00
|
|
|
return;
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if((bindf & BINDF_ASYNCHRONOUS) && !no_callback) {
|
2013-11-04 10:37:46 +01:00
|
|
|
while(!stopped_binding && GetMessageA(&msg,NULL,0,0)) {
|
2010-10-06 21:36:32 +02:00
|
|
|
TranslateMessage(&msg);
|
2013-11-04 10:37:46 +01:00
|
|
|
DispatchMessageA(&msg);
|
2010-10-06 21:36:32 +02:00
|
|
|
}
|
2004-12-20 19:58:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-20 14:52:50 +01:00
|
|
|
if(async_switch) {
|
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(LockRequest);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
|
|
|
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(abort_start)
|
|
|
|
todo_wine CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
if(!emulate_protocol) {
|
|
|
|
if(abort_start)
|
|
|
|
todo_wine CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
2014-02-27 16:36:10 +01:00
|
|
|
CLEAR_CALLED(SetPriority); /* Not called by IE11 */
|
2005-11-14 16:12:43 +01:00
|
|
|
CHECK_CALLED(Start);
|
2012-09-03 13:59:08 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST
|
|
|
|
|| test_protocol == WINETEST_SYNC_TEST) {
|
2008-01-31 18:19:53 +01:00
|
|
|
if(tymed == TYMED_FILE)
|
|
|
|
CLEAR_CALLED(Read);
|
2007-10-25 21:55:24 +02:00
|
|
|
CHECK_CALLED(Terminate);
|
2008-01-31 18:19:53 +01:00
|
|
|
}
|
|
|
|
if(tymed != TYMED_FILE || (test_protocol != ABOUT_TEST && test_protocol != ITS_TEST))
|
|
|
|
CHECK_CALLED(UnlockRequest);
|
2005-11-14 16:12:43 +01:00
|
|
|
}else {
|
2010-10-06 21:36:32 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
2008-01-31 18:09:32 +01:00
|
|
|
CLEAR_CALLED(QueryService_IInternetBindInfo);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start)
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate);
|
2009-09-11 12:22:38 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
|
|
|
|
CLEAR_CALLED(QueryService_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
CLEAR_CALLED(GetWindow_IWindowForBindingUI);
|
2011-05-02 05:29:53 +02:00
|
|
|
if(!abort_start)
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
|
|
|
if (have_IHttpNegotiate2 && !abort_start)
|
2008-11-20 23:06:27 +01:00
|
|
|
{
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
}
|
2011-05-11 13:34:47 +02:00
|
|
|
if(http_is_first) {
|
2011-01-19 12:44:07 +01:00
|
|
|
if (! proxy_active())
|
|
|
|
{
|
|
|
|
CHECK_CALLED(OnProgress_FINDINGRESOURCE);
|
|
|
|
CHECK_CALLED(OnProgress_CONNECTING);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CLEAR_CALLED(OnProgress_FINDINGRESOURCE);
|
|
|
|
CLEAR_CALLED(OnProgress_CONNECTING);
|
|
|
|
}
|
2011-05-02 05:29:53 +02:00
|
|
|
}else if(!abort_start) {
|
2014-05-20 15:11:03 +02:00
|
|
|
if(allow_finding_resource)
|
|
|
|
CLEAR_CALLED(OnProgress_FINDINGRESOURCE);
|
2011-05-10 11:26:43 +02:00
|
|
|
/* IE7 does call this */
|
|
|
|
CLEAR_CALLED(OnProgress_CONNECTING);
|
2007-08-07 06:08:46 +02:00
|
|
|
}
|
2011-01-09 06:28:54 +01:00
|
|
|
if((flags & BINDTEST_INVALID_CN) && !invalid_cn_accepted) {
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpSecurity);
|
|
|
|
CHECK_CALLED(QueryService_IHttpSecurity);
|
|
|
|
CHECK_CALLED(OnSecurityProblem);
|
|
|
|
}else {
|
|
|
|
CHECK_NOT_CALLED(QueryInterface_IHttpSecurity);
|
|
|
|
CHECK_NOT_CALLED(QueryService_IHttpSecurity);
|
|
|
|
CHECK_NOT_CALLED(OnSecurityProblem);
|
|
|
|
}
|
2007-08-09 03:26:15 +02:00
|
|
|
}
|
2010-10-06 21:36:32 +02:00
|
|
|
if(!no_callback) {
|
2011-05-02 05:29:53 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FILE_TEST || test_protocol == WINETEST_TEST) {
|
2011-01-09 06:28:54 +01:00
|
|
|
if(flags & BINDTEST_INVALID_CN)
|
|
|
|
CLEAR_CALLED(OnProgress_SENDINGREQUEST);
|
2011-05-02 05:29:53 +02:00
|
|
|
else if(!abort_start)
|
2011-01-09 06:28:54 +01:00
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
2011-05-02 05:29:53 +02:00
|
|
|
} else if(test_protocol == FTP_TEST)
|
2010-10-06 21:36:32 +02:00
|
|
|
todo_wine CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) {
|
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate);
|
2011-05-02 05:29:53 +02:00
|
|
|
if((!(flags & BINDTEST_INVALID_CN) || (binding_hres == S_OK)) && !abort_start) {
|
2011-01-09 06:28:54 +01:00
|
|
|
CHECK_CALLED(OnResponse);
|
|
|
|
}
|
|
|
|
}
|
2011-05-02 05:29:53 +02:00
|
|
|
if((!(flags & BINDTEST_INVALID_CN) || binding_hres == S_OK) && !abort_start) {
|
2011-01-09 06:28:54 +01:00
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
2010-10-06 21:36:32 +02:00
|
|
|
}
|
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
|
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FTP_TEST || test_protocol == WINETEST_TEST)
|
|
|
|
CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
|
2011-01-09 06:28:54 +01:00
|
|
|
if((flags & BINDTEST_INVALID_CN)) {
|
|
|
|
if(binding_hres == S_OK)
|
|
|
|
CHECK_CALLED(OnDataAvailable);
|
|
|
|
else
|
|
|
|
CHECK_NOT_CALLED(OnDataAvailable);
|
2011-05-02 05:29:53 +02:00
|
|
|
}else if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start)
|
2010-10-06 21:36:32 +02:00
|
|
|
CHECK_CALLED(OnDataAvailable);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
2005-09-16 20:46:29 +02:00
|
|
|
|
2004-12-20 19:58:04 +01:00
|
|
|
ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
|
2010-10-06 21:36:32 +02:00
|
|
|
if(bctx)
|
|
|
|
ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n");
|
2007-08-07 06:08:46 +02:00
|
|
|
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-08-07 06:08:46 +02:00
|
|
|
http_is_first = FALSE;
|
2010-05-04 20:14:49 +02:00
|
|
|
|
2011-01-09 06:28:54 +01:00
|
|
|
if((flags & BINDTEST_INVALID_CN) && onsecurityproblem_hres == S_OK && security_problem != ERROR_INTERNET_SEC_CERT_ERRORS)
|
|
|
|
invalid_cn_accepted = TRUE;
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
if(unk) {
|
2010-05-04 20:14:49 +02:00
|
|
|
BYTE buf[512];
|
|
|
|
DWORD readed;
|
|
|
|
IStream *stream;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IStream, (void**)&stream);
|
|
|
|
ok(hres == S_OK, "Could not get IStream iface: %08x\n", hres);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
do {
|
|
|
|
readed = 0xdeadbeef;
|
|
|
|
hres = IStream_Read(stream, buf, sizeof(buf), &readed);
|
|
|
|
ok(readed != 0xdeadbeef, "readed = 0xdeadbeef\n");
|
|
|
|
if(emulate_protocol && test_protocol == HTTP_TEST && readed)
|
|
|
|
ok(buf[0] == (use_cache_file && !(bindf&BINDF_ASYNCHRONOUS) ? 'X' : '?'), "buf[0] = '%c'\n", buf[0]);
|
|
|
|
}while(hres == S_OK);
|
|
|
|
ok(hres == S_FALSE, "IStream_Read returned %08x\n", hres);
|
|
|
|
ok(!readed, "readed = %d\n", readed);
|
|
|
|
|
|
|
|
IStream_Release(stream);
|
|
|
|
}
|
2004-12-20 19:58:04 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
static void test_BindToObject(int protocol, DWORD flags, HRESULT exhres)
|
2007-10-26 18:16:31 +02:00
|
|
|
{
|
|
|
|
IMoniker *mon;
|
|
|
|
HRESULT hres;
|
|
|
|
LPOLESTR display_name;
|
|
|
|
IBindCtx *bctx;
|
2007-12-30 17:55:02 +01:00
|
|
|
DWORD regid;
|
2007-10-26 18:16:31 +02:00
|
|
|
MSG msg;
|
|
|
|
IUnknown *unk = (IUnknown*)0x00ff00ff;
|
|
|
|
IBinding *bind;
|
|
|
|
|
2009-12-15 21:16:35 +01:00
|
|
|
init_bind_test(protocol, BINDTEST_TOOBJECT|flags, TYMED_ISTREAM);
|
2013-08-13 10:41:39 +02:00
|
|
|
binding_hres = exhres;
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2009-12-15 21:16:35 +01:00
|
|
|
if(emulate_protocol)
|
2007-12-30 17:55:02 +01:00
|
|
|
CoRegisterClassObject(&CLSID_HTMLDocument, (IUnknown *)&mime_cf,
|
|
|
|
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®id);
|
2007-10-26 18:16:31 +02:00
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&objbsc, NULL, &bctx);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
2007-10-26 18:16:31 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return;
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = CreateURLMoniker(NULL, current_url, &mon);
|
2011-04-01 09:07:31 +02:00
|
|
|
ok(hres == S_OK, "failed to create moniker: %08x\n", hres);
|
2007-10-26 18:16:31 +02:00
|
|
|
if(FAILED(hres)) {
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IMoniker_QueryInterface(mon, &IID_IBinding, (void**)&bind);
|
|
|
|
ok(hres == E_NOINTERFACE, "IMoniker should not have IBinding interface\n");
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
IBinding_Release(bind);
|
|
|
|
|
|
|
|
hres = IMoniker_GetDisplayName(mon, bctx, NULL, &display_name);
|
|
|
|
ok(hres == S_OK, "GetDisplayName failed %08x\n", hres);
|
2013-02-12 17:17:02 +01:00
|
|
|
ok(!lstrcmpW(display_name, current_url), "GetDisplayName got wrong name\n");
|
2011-01-17 14:21:33 +01:00
|
|
|
CoTaskMemFree(display_name);
|
2007-10-26 18:16:31 +02:00
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_GetBindInfo);
|
2007-12-24 13:21:27 +01:00
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
if(!emulate_protocol)
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnStartBinding);
|
2007-10-26 18:16:31 +02:00
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
|
|
|
SET_EXPECT(SetPriority);
|
2007-10-26 18:16:31 +02:00
|
|
|
SET_EXPECT(Start);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Terminate);
|
2008-06-30 01:21:11 +02:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
2007-10-26 18:16:31 +02:00
|
|
|
SET_EXPECT(UnlockRequest);
|
|
|
|
}else {
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
2007-10-26 18:16:31 +02:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
2011-05-11 13:34:47 +02:00
|
|
|
if(http_is_first)
|
|
|
|
SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_CONNECTING);
|
2009-09-11 12:22:38 +02:00
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(QueryService_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
SET_EXPECT(GetWindow_IWindowForBindingUI);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FILE_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
|
2009-06-23 14:52:23 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
2007-10-26 18:16:31 +02:00
|
|
|
SET_EXPECT(OnResponse);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-10-26 18:16:31 +02:00
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(exhres == REGDB_E_CLASSNOTREG) {
|
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(QueryService_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(GetWindow_ICodeInstall);
|
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
SET_EXPECT(OnObjectAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Obj_OnStopBinding);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
hres = IMoniker_BindToObject(mon, bctx, NULL, &IID_IUnknown, (void**)&unk);
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2009-01-12 18:20:28 +01:00
|
|
|
if ((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
|
|
|
&& hres == HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED))
|
2007-10-26 18:16:31 +02:00
|
|
|
{
|
2008-02-18 01:04:34 +01:00
|
|
|
skip( "Network unreachable, skipping tests\n" );
|
2007-10-26 18:16:31 +02:00
|
|
|
return;
|
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
if(FAILED(exhres)) {
|
|
|
|
ok(hres == exhres, "BindToObject failed: %08x, expected %08x\n", hres, exhres);
|
|
|
|
ok(!unk, "unk = %p, expected NULL\n", unk);
|
|
|
|
}else if(bindf & BINDF_ASYNCHRONOUS) {
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(hres == MK_S_ASYNCHRONOUS, "IMoniker_BindToObject failed: %08x\n", hres);
|
2007-10-26 18:16:31 +02:00
|
|
|
ok(unk == NULL, "istr should be NULL\n");
|
|
|
|
}else {
|
|
|
|
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
|
|
|
|
ok(unk != NULL, "unk == NULL\n");
|
2009-12-15 21:16:35 +01:00
|
|
|
if(emulate_protocol)
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(unk == (IUnknown*)&PersistMoniker, "unk != PersistMoniker\n");
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
|
|
|
if(unk)
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
while((bindf & BINDF_ASYNCHRONOUS) &&
|
2013-11-04 10:37:46 +01:00
|
|
|
!((!emulate_protocol || stopped_binding) && stopped_obj_binding) && GetMessageA(&msg,NULL,0,0)) {
|
2007-10-26 18:16:31 +02:00
|
|
|
TranslateMessage(&msg);
|
2013-11-04 10:37:46 +01:00
|
|
|
DispatchMessageA(&msg);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_GetBindInfo);
|
2007-12-24 13:21:27 +01:00
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
if(!emulate_protocol)
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnStartBinding);
|
2007-10-26 18:16:31 +02:00
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
2014-02-27 16:36:10 +01:00
|
|
|
CLEAR_CALLED(SetPriority); /* Not called by IE11 */
|
2007-10-26 18:16:31 +02:00
|
|
|
CHECK_CALLED(Start);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Terminate);
|
2008-06-30 01:21:11 +02:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CLEAR_CALLED(OnProgress_MIMETYPEAVAILABLE); /* not called in IE7 */
|
2007-10-26 18:16:31 +02:00
|
|
|
CHECK_CALLED(UnlockRequest);
|
|
|
|
}else {
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
2007-10-26 18:16:31 +02:00
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
2008-11-20 23:06:27 +01:00
|
|
|
if (have_IHttpNegotiate2)
|
|
|
|
{
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
}
|
2007-10-26 18:16:31 +02:00
|
|
|
if(http_is_first) {
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CONNECTING);
|
2011-05-10 11:26:43 +02:00
|
|
|
}else {
|
2008-09-09 05:18:41 +02:00
|
|
|
/* IE7 does call this */
|
|
|
|
CLEAR_CALLED(Obj_OnProgress_CONNECTING);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
2009-09-11 12:22:38 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
|
|
|
|
CLEAR_CALLED(QueryService_IWindowForBindingUI);
|
2011-01-09 06:28:54 +01:00
|
|
|
CLEAR_CALLED(GetWindow_IWindowForBindingUI);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FILE_TEST) {
|
2013-02-12 17:17:02 +01:00
|
|
|
if(post_test)
|
2008-01-31 18:09:32 +01:00
|
|
|
CLEAR_CALLED(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
else
|
|
|
|
CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
|
|
|
|
}
|
2009-06-23 14:52:23 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate);
|
2007-10-26 18:16:31 +02:00
|
|
|
CHECK_CALLED(OnResponse);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
|
2008-01-31 18:19:53 +01:00
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-10-26 18:16:31 +02:00
|
|
|
CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
|
2007-12-30 17:55:02 +01:00
|
|
|
CLEAR_CALLED(Obj_OnProgress_ENDDOWNLOADDATA);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(exhres == REGDB_E_CLASSNOTREG) {
|
|
|
|
todo_wine CHECK_CALLED(QueryInterface_IWindowForBindingUI);
|
|
|
|
todo_wine CHECK_CALLED(QueryService_IWindowForBindingUI);
|
|
|
|
todo_wine CHECK_CALLED(GetWindow_ICodeInstall);
|
|
|
|
}
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
|
2013-08-13 10:41:39 +02:00
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
CHECK_CALLED(OnObjectAvailable);
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Obj_OnStopBinding);
|
2007-10-26 18:16:31 +02:00
|
|
|
}
|
|
|
|
|
2010-10-01 13:56:56 +02:00
|
|
|
ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
|
|
|
|
if(test_protocol != HTTP_TEST || emulate_protocol || !(bindf & BINDF_ASYNCHRONOUS))
|
2007-12-30 17:45:00 +01:00
|
|
|
ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n");
|
2010-10-01 13:56:56 +02:00
|
|
|
else
|
2009-08-22 19:40:01 +02:00
|
|
|
IBindCtx_Release(bctx);
|
2007-10-26 18:16:31 +02:00
|
|
|
|
2009-12-15 21:16:35 +01:00
|
|
|
if(emulate_protocol)
|
2007-12-30 17:55:02 +01:00
|
|
|
CoRevokeClassObject(regid);
|
|
|
|
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2007-10-26 18:16:31 +02:00
|
|
|
http_is_first = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-02-18 01:04:34 +01:00
|
|
|
static void test_URLDownloadToFile(DWORD prot, BOOL emul)
|
|
|
|
{
|
|
|
|
BOOL res;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
init_bind_test(prot, BINDTEST_FILEDWLAPI | (emul ? BINDTEST_EMULATE : 0), TYMED_FILE);
|
|
|
|
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
2014-02-27 16:36:10 +01:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
if(!emulate_protocol)
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
|
|
|
SET_EXPECT(SetPriority);
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(Start);
|
|
|
|
SET_EXPECT(UnlockRequest);
|
|
|
|
}else {
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
2009-09-11 12:22:38 +02:00
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
2009-12-16 19:57:10 +01:00
|
|
|
SET_EXPECT(OnProgress_CONNECTING);
|
2008-02-18 01:04:34 +01:00
|
|
|
}
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FILE_TEST)
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
2009-06-23 14:52:23 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(OnResponse);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2008-02-18 01:04:34 +01:00
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
}
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = URLDownloadToFileW(NULL, current_url, dwl_htmlW, 0, (IBindStatusCallback*)&bsc);
|
2008-02-18 01:04:34 +01:00
|
|
|
ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
|
|
|
|
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
if(!emulate_protocol) {
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
2014-02-27 16:36:10 +01:00
|
|
|
}else {
|
|
|
|
CLEAR_CALLED(QueryInterface_IServiceProvider);
|
2008-02-18 01:04:34 +01:00
|
|
|
}
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
if(emulate_protocol) {
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
2014-02-27 16:36:10 +01:00
|
|
|
CLEAR_CALLED(SetPriority); /* Not called by IE11 */
|
2008-02-18 01:04:34 +01:00
|
|
|
CHECK_CALLED(Start);
|
|
|
|
CHECK_CALLED(UnlockRequest);
|
|
|
|
}else {
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
2008-02-18 01:04:34 +01:00
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
2008-11-20 23:06:27 +01:00
|
|
|
if (have_IHttpNegotiate2)
|
|
|
|
{
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
}
|
2009-09-11 12:22:38 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
|
2009-12-16 19:57:10 +01:00
|
|
|
CLEAR_CALLED(OnProgress_CONNECTING);
|
2008-02-18 01:04:34 +01:00
|
|
|
}
|
2008-09-09 05:18:41 +02:00
|
|
|
if(test_protocol == FILE_TEST)
|
2008-02-18 01:04:34 +01:00
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
2009-01-12 18:20:28 +01:00
|
|
|
else if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2008-09-09 05:18:41 +02:00
|
|
|
CLEAR_CALLED(OnProgress_SENDINGREQUEST); /* not called by IE7 */
|
2009-06-23 14:52:23 +02:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) {
|
|
|
|
CLEAR_CALLED(QueryInterface_IHttpNegotiate);
|
2008-02-18 01:04:34 +01:00
|
|
|
CHECK_CALLED(OnResponse);
|
2009-06-23 14:52:23 +02:00
|
|
|
}
|
2008-02-18 01:04:34 +01:00
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
if(test_protocol == FILE_TEST)
|
|
|
|
CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
|
2008-02-18 01:04:34 +01:00
|
|
|
CLEAR_CALLED(OnProgress_DOWNLOADINGDATA);
|
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
}
|
|
|
|
|
2008-11-11 10:54:54 +01:00
|
|
|
res = DeleteFileA(dwl_htmlA);
|
2008-02-18 01:04:34 +01:00
|
|
|
ok(res, "DeleteFile failed: %u\n", GetLastError());
|
|
|
|
|
|
|
|
if(prot != FILE_TEST || emul)
|
|
|
|
return;
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = URLDownloadToFileW(NULL, current_url, dwl_htmlW, 0, NULL);
|
2008-02-18 01:04:34 +01:00
|
|
|
ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
|
|
|
|
|
2008-11-11 10:54:54 +01:00
|
|
|
res = DeleteFileA(dwl_htmlA);
|
2008-02-18 01:04:34 +01:00
|
|
|
ok(res, "DeleteFile failed: %u\n", GetLastError());
|
|
|
|
}
|
|
|
|
|
2011-05-01 06:30:17 +02:00
|
|
|
static void test_URLDownloadToFile_abort(void)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
init_bind_test(HTTP_TEST, BINDTEST_FILEDWLAPI|BINDTEST_ABORT_PROGRESS, TYMED_FILE);
|
|
|
|
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(OnProgress_CONNECTING);
|
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = URLDownloadToFileW(NULL, current_url, dwl_htmlW, 0, (IBindStatusCallback*)&bsc);
|
2011-05-01 06:30:17 +02:00
|
|
|
ok(hres == E_ABORT, "URLDownloadToFile failed: %08x, expected E_ABORT\n", hres);
|
|
|
|
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
|
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
|
|
|
CLEAR_CALLED(OnProgress_CONNECTING);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
|
|
|
|
init_bind_test(HTTP_TEST, BINDTEST_FILEDWLAPI|BINDTEST_ABORT_START, TYMED_FILE);
|
|
|
|
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
|
|
|
|
abort_hres = E_ABORT;
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = URLDownloadToFileW(NULL, current_url, dwl_htmlW, 0, (IBindStatusCallback*)&bsc);
|
2011-05-01 06:30:17 +02:00
|
|
|
ok(hres == E_ABORT, "URLDownloadToFile failed: %08x, expected E_ABORT\n", hres);
|
|
|
|
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
todo_wine CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
todo_wine CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
todo_wine CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
|
|
|
|
init_bind_test(HTTP_TEST, BINDTEST_FILEDWLAPI|BINDTEST_ABORT_START, TYMED_FILE);
|
|
|
|
|
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
SET_EXPECT(QueryService_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate);
|
|
|
|
SET_EXPECT(QueryInterface_IHttpNegotiate2);
|
|
|
|
SET_EXPECT(BeginningTransaction);
|
|
|
|
SET_EXPECT(GetRootSecurityId);
|
|
|
|
SET_EXPECT(QueryInterface_IWindowForBindingUI);
|
|
|
|
SET_EXPECT(OnResponse);
|
|
|
|
SET_EXPECT(OnProgress_CONNECTING);
|
|
|
|
SET_EXPECT(OnProgress_SENDINGREQUEST);
|
|
|
|
SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
SET_EXPECT(OnProgress_DOWNLOADINGDATA);
|
|
|
|
SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
SET_EXPECT(OnStopBinding);
|
|
|
|
|
|
|
|
/* URLDownloadToFile doesn't abort if E_NOTIMPL is returned from the
|
|
|
|
* IBindStatusCallback's OnStartBinding function.
|
|
|
|
*/
|
|
|
|
abort_hres = E_NOTIMPL;
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = URLDownloadToFileW(NULL, current_url, dwl_htmlW, 0, (IBindStatusCallback*)&bsc);
|
2011-05-01 06:30:17 +02:00
|
|
|
ok(hres == S_OK, "URLDownloadToFile failed: %08x\n", hres);
|
|
|
|
|
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
CHECK_CALLED(QueryService_IInternetProtocol);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate);
|
|
|
|
CHECK_CALLED(QueryInterface_IHttpNegotiate2);
|
|
|
|
CHECK_CALLED(BeginningTransaction);
|
|
|
|
CHECK_CALLED(GetRootSecurityId);
|
|
|
|
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
|
|
|
|
CHECK_CALLED(OnResponse);
|
|
|
|
CLEAR_CALLED(OnProgress_CONNECTING);
|
|
|
|
CHECK_CALLED(OnProgress_SENDINGREQUEST);
|
|
|
|
CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
|
|
|
|
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnProgress_DOWNLOADINGDATA);
|
|
|
|
CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
|
|
|
|
CHECK_CALLED(OnStopBinding);
|
|
|
|
|
|
|
|
DeleteFileA(dwl_htmlA);
|
|
|
|
}
|
|
|
|
|
2008-11-11 10:54:54 +01:00
|
|
|
static void set_file_url(char *path)
|
2005-12-26 13:27:10 +01:00
|
|
|
{
|
2008-11-11 10:54:54 +01:00
|
|
|
CHAR file_urlA[INTERNET_MAX_URL_LENGTH];
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
lstrcpyA(file_urlA, "file://");
|
2008-11-11 10:54:54 +01:00
|
|
|
lstrcatA(file_urlA, path);
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, file_urlA, -1, file_url, INTERNET_MAX_URL_LENGTH);
|
2005-12-26 13:27:10 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
static void create_file(const char *file_name, const char *content)
|
2005-12-26 13:27:10 +01:00
|
|
|
{
|
|
|
|
HANDLE file;
|
|
|
|
DWORD size;
|
2008-11-11 10:54:54 +01:00
|
|
|
CHAR path[MAX_PATH];
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
file = CreateFileA(file_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
2005-12-26 13:27:10 +01:00
|
|
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
|
2005-12-26 13:27:10 +01:00
|
|
|
if(file == INVALID_HANDLE_VALUE)
|
|
|
|
return;
|
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
if(test_file)
|
|
|
|
DeleteFileA(test_file);
|
|
|
|
test_file = file_name;
|
|
|
|
WriteFile(file, content, strlen(content), &size, NULL);
|
2005-12-26 13:27:10 +01:00
|
|
|
CloseHandle(file);
|
|
|
|
|
2008-11-11 10:54:54 +01:00
|
|
|
GetCurrentDirectoryA(MAX_PATH, path);
|
|
|
|
lstrcatA(path, "\\");
|
2013-08-13 10:41:39 +02:00
|
|
|
lstrcatA(path, file_name);
|
2008-11-11 10:54:54 +01:00
|
|
|
set_file_url(path);
|
2005-12-26 13:27:10 +01:00
|
|
|
}
|
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
static void create_html_file(void)
|
|
|
|
{
|
|
|
|
create_file(wszIndexHtmlA, "<HTML></HTML>");
|
|
|
|
}
|
|
|
|
|
2010-05-04 20:14:49 +02:00
|
|
|
static void create_cache_file(void)
|
|
|
|
{
|
2010-09-19 15:01:42 +02:00
|
|
|
char buf[6500], curdir[MAX_PATH];
|
2010-05-04 20:14:49 +02:00
|
|
|
HANDLE file;
|
|
|
|
DWORD size;
|
|
|
|
|
2010-09-19 15:01:42 +02:00
|
|
|
file = CreateFileA(test_txtA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
2010-05-04 20:14:49 +02:00
|
|
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
|
|
|
ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
|
|
|
|
if(file == INVALID_HANDLE_VALUE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
memset(buf, 'X', sizeof(buf));
|
|
|
|
WriteFile(file, buf, sizeof(buf), &size, NULL);
|
|
|
|
CloseHandle(file);
|
|
|
|
|
2010-09-19 15:01:42 +02:00
|
|
|
memset(curdir, 0, sizeof(curdir));
|
|
|
|
GetCurrentDirectoryA(MAX_PATH, curdir);
|
|
|
|
lstrcatA(curdir, "\\");
|
|
|
|
lstrcatA(curdir, test_txtA);
|
|
|
|
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, curdir, -1, cache_file_name, MAX_PATH);
|
2010-05-04 20:14:49 +02:00
|
|
|
}
|
|
|
|
|
2007-12-30 17:55:02 +01:00
|
|
|
static void test_ReportResult(HRESULT exhres)
|
|
|
|
{
|
|
|
|
IMoniker *mon = NULL;
|
|
|
|
IBindCtx *bctx = NULL;
|
|
|
|
IUnknown *unk = (void*)0xdeadbeef;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2008-02-18 01:04:34 +01:00
|
|
|
init_bind_test(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2007-12-30 17:55:02 +01:00
|
|
|
binding_hres = exhres;
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = CreateURLMoniker(NULL, about_blankW, &mon);
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
|
|
|
|
|
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
2009-07-02 23:21:08 +02:00
|
|
|
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
|
2007-12-30 17:55:02 +01:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(GetBindInfo);
|
|
|
|
SET_EXPECT(QueryInterface_IInternetProtocol);
|
|
|
|
SET_EXPECT(OnStartBinding);
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
|
|
|
SET_EXPECT(SetPriority);
|
2007-12-30 17:55:02 +01:00
|
|
|
SET_EXPECT(Start);
|
|
|
|
|
|
|
|
hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
|
|
|
|
if(SUCCEEDED(exhres))
|
2008-01-31 18:09:32 +01:00
|
|
|
ok(hres == S_OK || hres == MK_S_ASYNCHRONOUS, "BindToStorage failed: %08x\n", hres);
|
2007-12-30 17:55:02 +01:00
|
|
|
else
|
2008-01-31 18:09:32 +01:00
|
|
|
ok(hres == exhres || hres == MK_S_ASYNCHRONOUS,
|
|
|
|
"BindToStorage failed: %08x, expected %08x or MK_S_ASYNCHRONOUS\n", hres, exhres);
|
2007-12-30 17:55:02 +01:00
|
|
|
|
2009-07-02 23:21:08 +02:00
|
|
|
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(GetBindInfo);
|
|
|
|
CHECK_CALLED(QueryInterface_IInternetProtocol);
|
|
|
|
CHECK_CALLED(OnStartBinding);
|
2009-03-29 21:30:42 +02:00
|
|
|
if(is_urlmon_protocol(test_protocol))
|
2014-02-27 16:36:10 +01:00
|
|
|
CLEAR_CALLED(SetPriority); /* Not called by IE11 */
|
2007-12-30 17:55:02 +01:00
|
|
|
CHECK_CALLED(Start);
|
|
|
|
|
|
|
|
ok(unk == NULL, "unk=%p\n", unk);
|
|
|
|
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
IMoniker_Release(mon);
|
|
|
|
}
|
|
|
|
|
2005-11-14 16:12:43 +01:00
|
|
|
static void test_BindToStorage_fail(void)
|
|
|
|
{
|
|
|
|
IMoniker *mon = NULL;
|
|
|
|
IBindCtx *bctx = NULL;
|
|
|
|
IUnknown *unk;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2013-02-12 17:17:02 +01:00
|
|
|
hres = CreateURLMoniker(NULL, about_blankW, &mon);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
|
2005-11-14 16:12:43 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return;
|
|
|
|
|
2010-04-22 00:28:55 +02:00
|
|
|
hres = pCreateAsyncBindCtxEx(NULL, 0, NULL, NULL, &bctx, 0);
|
2006-10-07 15:30:28 +02:00
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtxEx failed: %08x\n", hres);
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2011-04-01 08:57:12 +02:00
|
|
|
unk = (void*)0xdeadbeef;
|
2005-11-14 16:12:43 +01:00
|
|
|
hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
|
2008-01-31 18:09:32 +01:00
|
|
|
ok(hres == MK_E_SYNTAX || hres == INET_E_DATA_NOT_AVAILABLE,
|
2008-01-31 18:19:53 +01:00
|
|
|
"hres=%08x, expected MK_E_SYNTAX or INET_E_DATA_NOT_AVAILABLE\n", hres);
|
2011-04-01 08:57:12 +02:00
|
|
|
ok(unk == NULL, "got %p\n", unk);
|
2005-11-14 16:12:43 +01:00
|
|
|
|
|
|
|
IBindCtx_Release(bctx);
|
|
|
|
|
|
|
|
IMoniker_Release(mon);
|
2007-12-30 17:55:02 +01:00
|
|
|
|
|
|
|
test_ReportResult(E_NOTIMPL);
|
|
|
|
test_ReportResult(S_FALSE);
|
2005-11-14 16:12:43 +01:00
|
|
|
}
|
|
|
|
|
2009-03-23 18:30:47 +01:00
|
|
|
static void test_StdURLMoniker(void)
|
|
|
|
{
|
|
|
|
IMoniker *mon, *async_mon;
|
2009-03-23 18:31:05 +01:00
|
|
|
LPOLESTR display_name;
|
2011-06-23 13:44:38 +02:00
|
|
|
IBindCtx *bctx;
|
|
|
|
IUnknown *unk;
|
2009-03-23 18:30:47 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = CoCreateInstance(&IID_IInternet, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
|
|
|
|
&IID_IMoniker, (void**)&mon);
|
|
|
|
ok(hres == S_OK, "Could not create IInternet instance: %08x\n", hres);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return;
|
|
|
|
|
|
|
|
hres = IMoniker_QueryInterface(mon, &IID_IAsyncMoniker, (void**)&async_mon);
|
|
|
|
ok(hres == S_OK, "Could not get IAsyncMoniker iface: %08x\n", hres);
|
|
|
|
ok(mon == async_mon, "mon != async_mon\n");
|
|
|
|
IMoniker_Release(async_mon);
|
|
|
|
|
2009-03-23 18:31:05 +01:00
|
|
|
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &display_name);
|
|
|
|
ok(hres == E_OUTOFMEMORY, "GetDisplayName failed: %08x, expected E_OUTOFMEMORY\n", hres);
|
|
|
|
|
2010-12-20 15:15:00 +01:00
|
|
|
if(pCreateUri) {
|
|
|
|
IUriContainer *uri_container;
|
|
|
|
IUri *uri;
|
|
|
|
|
|
|
|
hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(hres == S_OK, "Could not get IUriMoniker iface: %08x\n", hres);
|
2010-12-20 15:15:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
uri = (void*)0xdeadbeef;
|
|
|
|
hres = IUriContainer_GetIUri(uri_container, &uri);
|
|
|
|
ok(hres == S_FALSE, "GetIUri failed: %08x\n", hres);
|
|
|
|
ok(!uri, "uri = %p, expected NULL\n", uri);
|
|
|
|
|
|
|
|
IUriContainer_Release(uri_container);
|
|
|
|
}
|
|
|
|
|
2011-06-23 13:44:38 +02:00
|
|
|
SET_EXPECT(QueryInterface_IServiceProvider);
|
|
|
|
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
|
|
|
|
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
|
|
|
|
CHECK_CALLED(QueryInterface_IServiceProvider);
|
|
|
|
|
2011-10-18 15:16:29 +02:00
|
|
|
if(pCreateUri) { /* Skip these tests on old IEs */
|
|
|
|
unk = (void*)0xdeadbeef;
|
|
|
|
hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
|
|
|
|
ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
|
|
|
|
ok(!unk, "unk = %p\n", unk);
|
2011-06-23 13:44:57 +02:00
|
|
|
|
2011-10-18 15:16:29 +02:00
|
|
|
unk = (void*)0xdeadbeef;
|
|
|
|
hres = IMoniker_BindToObject(mon, bctx, NULL, &IID_IUnknown, (void**)&unk);
|
|
|
|
ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
|
|
|
|
ok(!unk, "unk = %p\n", unk);
|
|
|
|
}
|
2011-06-23 13:44:38 +02:00
|
|
|
|
2009-03-23 18:30:47 +01:00
|
|
|
IMoniker_Release(mon);
|
|
|
|
}
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
static void register_protocols(void)
|
|
|
|
{
|
|
|
|
IInternetSession *session;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
|
|
|
|
|
|
|
|
hres = CoInternetGetSession(0, &session, 0);
|
|
|
|
ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return;
|
|
|
|
|
|
|
|
hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
|
|
|
|
winetestW, 0, NULL, 0);
|
|
|
|
ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
|
|
|
|
|
|
|
|
IInternetSession_Release(session);
|
|
|
|
}
|
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
static BOOL can_do_https(void)
|
|
|
|
{
|
|
|
|
HINTERNET ses, con, req;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
|
|
|
|
ok(ses != NULL, "InternetOpen failed\n");
|
|
|
|
|
|
|
|
con = InternetConnectA(ses, "test.winehq.org", INTERNET_DEFAULT_HTTPS_PORT,
|
|
|
|
NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
|
|
|
ok(con != NULL, "InternetConnect failed\n");
|
|
|
|
|
|
|
|
req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL,
|
|
|
|
INTERNET_FLAG_SECURE, 0);
|
|
|
|
ok(req != NULL, "HttpOpenRequest failed\n");
|
|
|
|
|
|
|
|
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
|
|
|
ok(ret || broken(GetLastError() == ERROR_INTERNET_CANNOT_CONNECT),
|
|
|
|
"request failed: %u\n", GetLastError());
|
|
|
|
|
|
|
|
InternetCloseHandle(req);
|
|
|
|
InternetCloseHandle(con);
|
|
|
|
InternetCloseHandle(ses);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-05-03 22:07:03 +02:00
|
|
|
START_TEST(url)
|
|
|
|
{
|
2010-04-22 00:28:55 +02:00
|
|
|
HMODULE hurlmon;
|
|
|
|
|
2013-11-04 10:37:46 +01:00
|
|
|
hurlmon = GetModuleHandleA("urlmon.dll");
|
2010-04-22 00:28:55 +02:00
|
|
|
pCreateAsyncBindCtxEx = (void*) GetProcAddress(hurlmon, "CreateAsyncBindCtxEx");
|
|
|
|
|
2010-10-08 17:49:04 +02:00
|
|
|
if(!GetProcAddress(hurlmon, "CompareSecurityIds")) {
|
|
|
|
win_skip("Too old IE\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-12-20 15:15:00 +01:00
|
|
|
pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
|
|
|
|
if(!pCreateUri)
|
|
|
|
win_skip("IUri not supported\n");
|
|
|
|
|
2013-11-04 10:37:46 +01:00
|
|
|
complete_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
|
|
|
complete_event2 = CreateEventW(NULL, FALSE, FALSE, NULL);
|
2007-10-25 21:55:24 +02:00
|
|
|
thread_id = GetCurrentThreadId();
|
2013-08-13 10:41:39 +02:00
|
|
|
create_html_file();
|
2010-05-04 20:14:49 +02:00
|
|
|
create_cache_file();
|
2010-10-06 21:36:32 +02:00
|
|
|
register_protocols();
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2004-05-03 22:07:03 +02:00
|
|
|
test_create();
|
2009-06-23 14:52:23 +02:00
|
|
|
|
|
|
|
trace("test CreateAsyncBindCtx...\n");
|
2004-12-08 14:46:01 +01:00
|
|
|
test_CreateAsyncBindCtx();
|
2009-06-23 14:52:23 +02:00
|
|
|
|
|
|
|
trace("test CreateAsyncBindCtxEx...\n");
|
2005-09-03 11:36:12 +02:00
|
|
|
test_CreateAsyncBindCtxEx();
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2009-06-23 14:52:23 +02:00
|
|
|
trace("test RegisterBindStatusCallback...\n");
|
2009-01-12 18:20:28 +01:00
|
|
|
if(test_RegisterBindStatusCallback()) {
|
2009-06-23 14:52:23 +02:00
|
|
|
trace("test BindToStorage failures...\n");
|
2009-01-07 00:42:03 +01:00
|
|
|
test_BindToStorage_fail();
|
|
|
|
|
|
|
|
trace("synchronous http test (COM not initialised)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
|
2007-10-26 18:16:31 +02:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
CoInitialize(NULL);
|
2007-10-26 18:16:31 +02:00
|
|
|
|
2009-03-23 18:31:05 +01:00
|
|
|
trace("test StdURLMoniker...\n");
|
2009-03-23 18:30:47 +01:00
|
|
|
test_StdURLMoniker();
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("synchronous http test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2010-04-29 17:14:47 +02:00
|
|
|
trace("emulated synchronous http test (to file)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("synchronous http test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(HTTP_TEST, 0, S_OK);
|
2007-08-07 06:08:46 +02:00
|
|
|
|
2010-05-04 20:14:49 +02:00
|
|
|
trace("emulated synchronous http test (with cache)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM);
|
|
|
|
|
|
|
|
trace("emulated synchronous http test (with cache, no read)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM);
|
|
|
|
|
|
|
|
trace("synchronous http test (with cache, no read)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM);
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("synchronous file test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2010-04-29 17:14:47 +02:00
|
|
|
trace("emulated synchronous file test (to file)...\n");
|
|
|
|
test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("synchronous file test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(FILE_TEST, 0, S_OK);
|
|
|
|
|
|
|
|
trace("bind to an object of not registered MIME type...\n");
|
|
|
|
create_file("test.winetest", "\x01\x02\x03xxxxxxxxxxxxxxxxxxxxxxxxx");
|
|
|
|
test_BindToObject(FILE_TEST, 0, REGDB_E_CLASSNOTREG);
|
|
|
|
create_html_file();
|
2007-08-07 06:08:46 +02:00
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
trace("file test (no callback)...\n");
|
|
|
|
test_BindToStorage(FILE_TEST, BINDTEST_NO_CALLBACK, TYMED_ISTREAM);
|
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
if(can_do_https()) {
|
|
|
|
trace("synchronous https test (invalid CN, dialog)\n");
|
|
|
|
onsecurityproblem_hres = S_FALSE;
|
|
|
|
http_is_first = TRUE;
|
|
|
|
test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM);
|
2011-01-09 06:28:54 +01:00
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
|
|
|
|
|
|
|
|
trace("asynchronous https test (invalid CN, fail)\n");
|
|
|
|
onsecurityproblem_hres = E_FAIL;
|
|
|
|
test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM);
|
2014-03-07 17:30:25 +01:00
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
trace("asynchronous https test (invalid CN, accept)\n");
|
|
|
|
onsecurityproblem_hres = S_OK;
|
|
|
|
test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM);
|
|
|
|
|
|
|
|
trace("asynchronous https test (invalid CN, dialog 2)\n");
|
|
|
|
onsecurityproblem_hres = S_FALSE;
|
|
|
|
test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM);
|
|
|
|
invalid_cn_accepted = FALSE;
|
2011-01-09 06:28:54 +01:00
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
trace("asynchronous https test...\n");
|
|
|
|
test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM);
|
|
|
|
}else {
|
|
|
|
win_skip("Skipping https testt\n");
|
|
|
|
}
|
2011-01-09 06:28:54 +01:00
|
|
|
|
2015-06-19 13:42:36 +02:00
|
|
|
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
|
2011-01-09 06:28:54 +01:00
|
|
|
|
2012-01-20 14:52:50 +01:00
|
|
|
trace("winetest test (async switch)...\n");
|
|
|
|
test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_ASYNC_SWITCH, TYMED_ISTREAM);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
trace("about test (no read)...\n");
|
|
|
|
test_BindToStorage(ABOUT_TEST, BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM);
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("http test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("http test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, 0, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("http test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(HTTP_TEST, 0, S_OK);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("http test (short response)...\n");
|
2014-05-20 15:11:03 +02:00
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("http test (short response, to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(HTTP_TEST, 0, S_OK);
|
2007-08-08 03:11:18 +02:00
|
|
|
|
2011-05-02 05:29:53 +02:00
|
|
|
trace("http test (abort start binding E_NOTIMPL)...\n");
|
|
|
|
abort_hres = E_NOTIMPL;
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE);
|
|
|
|
|
|
|
|
trace("http test (abort start binding E_ABORT)...\n");
|
|
|
|
abort_hres = E_ABORT;
|
2011-05-02 05:29:53 +02:00
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE);
|
|
|
|
|
|
|
|
trace("http test (abort progress)...\n");
|
2014-05-20 15:11:03 +02:00
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_PROGRESS|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_FILE);
|
2011-05-02 05:29:53 +02:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated http test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated http test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(HTTP_TEST, BINDTEST_EMULATE, S_OK);
|
2009-12-15 21:16:35 +01:00
|
|
|
|
|
|
|
trace("emulated http test (to object, redirect)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, S_OK);
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated http test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-12-15 21:15:28 +01:00
|
|
|
trace("emulated http test (redirect)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, TYMED_ISTREAM);
|
|
|
|
|
2010-05-04 20:14:49 +02:00
|
|
|
trace("emulated http test (with cache)...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM);
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
trace("winetest test (no callback)...\n");
|
|
|
|
test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM);
|
|
|
|
|
2009-01-12 18:20:28 +01:00
|
|
|
trace("emulated https test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2009-01-12 18:20:28 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("about test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("about test (to file)...\n");
|
2009-12-16 19:57:10 +01:00
|
|
|
test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("about test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(ABOUT_TEST, 0, S_OK);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated about test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated about test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated about test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(ABOUT_TEST, BINDTEST_EMULATE, S_OK);
|
2005-11-14 16:12:43 +01:00
|
|
|
|
2012-09-03 13:59:08 +02:00
|
|
|
trace("emulalated test reporting result in read...\n");
|
|
|
|
test_BindToStorage(WINETEST_SYNC_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("file test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("file test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FILE_TEST, 0, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("file test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(FILE_TEST, 0, S_OK);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated file test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated file test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated file test (to object)...\n");
|
2013-08-13 10:41:39 +02:00
|
|
|
test_BindToObject(FILE_TEST, BINDTEST_EMULATE, S_OK);
|
2005-12-26 13:27:10 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated its test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2008-01-31 18:19:53 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated its test (to file)...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_FILE);
|
2007-02-10 16:33:38 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("emulated mk test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2007-02-10 16:34:41 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("test URLDownloadToFile for file protocol...\n");
|
|
|
|
test_URLDownloadToFile(FILE_TEST, FALSE);
|
2008-02-18 01:04:34 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("test URLDownloadToFile for emulated file protocol...\n");
|
|
|
|
test_URLDownloadToFile(FILE_TEST, TRUE);
|
2008-02-18 01:04:34 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("test URLDownloadToFile for http protocol...\n");
|
|
|
|
test_URLDownloadToFile(HTTP_TEST, FALSE);
|
2008-02-18 01:04:34 +01:00
|
|
|
|
2011-05-01 06:30:17 +02:00
|
|
|
trace("test URLDownloadToFile abort...\n");
|
|
|
|
test_URLDownloadToFile_abort();
|
|
|
|
|
2010-10-06 21:36:32 +02:00
|
|
|
trace("test emulated http abort...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_ABORT, TYMED_ISTREAM);
|
|
|
|
|
2009-03-04 19:06:18 +01:00
|
|
|
bindf |= BINDF_NOWRITECACHE;
|
|
|
|
|
|
|
|
trace("ftp test...\n");
|
2009-12-15 21:15:08 +01:00
|
|
|
test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM);
|
2009-03-04 19:06:18 +01:00
|
|
|
|
2009-01-07 00:42:03 +01:00
|
|
|
trace("test failures...\n");
|
|
|
|
test_BindToStorage_fail();
|
2010-12-19 21:26:06 +01:00
|
|
|
|
|
|
|
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE;
|
|
|
|
only_check_prot_args = TRUE; /* Fail after checking arguments to Protocol_Start */
|
|
|
|
|
|
|
|
trace("check emulated http protocol arguments...\n");
|
|
|
|
test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
|
2009-01-07 00:42:03 +01:00
|
|
|
}
|
2007-10-25 21:55:24 +02:00
|
|
|
|
2013-08-13 10:41:39 +02:00
|
|
|
DeleteFileA(test_file);
|
2010-09-19 15:01:42 +02:00
|
|
|
DeleteFileA(test_txtA);
|
2007-10-25 21:55:24 +02:00
|
|
|
CloseHandle(complete_event);
|
|
|
|
CloseHandle(complete_event2);
|
2007-10-26 18:16:31 +02:00
|
|
|
CoUninitialize();
|
2004-05-03 22:07:03 +02:00
|
|
|
}
|