ReactOS  0.4.14-dev-593-g1793dcc
url.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "urlmon.h"
#include "wininet.h"
#include "mshtml.h"
#include "shlwapi.h"
#include "wine/test.h"
Include dependency graph for url.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define CONST_VTABLE
 
#define DEFINE_EXPECT(func)   static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)   do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define CHECK_NOT_CALLED(func)
 
#define CHECK_CALLED_BROKEN(func)
 
#define CLEAR_CALLED(func)   expect_ ## func = called_ ## func = FALSE
 
#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
 
#define BINDTEST_ASYNC_SWITCH   0x1000
 
#define BINDTEST_ALLOW_FINDINGRESOURCE   0x2000
 

Enumerations

enum  {
  HTTP_TEST, ABOUT_TEST, FILE_TEST, ITS_TEST,
  MK_TEST, HTTPS_TEST, FTP_TEST, WINETEST_TEST,
  WINETEST_SYNC_TEST
}
 
enum  { BEFORE_DOWNLOAD, DOWNLOADING, END_DOWNLOAD }
 

Functions

static HRESULT (WINAPI *pCreateAsyncBindCtxEx)(IBindCtx *
 
static IUri ** 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)
 
 DEFINE_EXPECT (QueryInterface_IServiceProvider)
 
 DEFINE_EXPECT (QueryInterface_IHttpNegotiate)
 
 DEFINE_EXPECT (QueryInterface_IBindStatusCallback)
 
 DEFINE_EXPECT (QueryInterface_IBindStatusCallbackEx)
 
 DEFINE_EXPECT (QueryInterface_IBindStatusCallbackHolder)
 
 DEFINE_EXPECT (QueryInterface_IAuthenticate)
 
 DEFINE_EXPECT (QueryInterface_IInternetProtocol)
 
 DEFINE_EXPECT (QueryInterface_IWindowForBindingUI)
 
 DEFINE_EXPECT (QueryInterface_IHttpSecurity)
 
 DEFINE_EXPECT (QueryService_IAuthenticate)
 
 DEFINE_EXPECT (QueryService_IInternetProtocol)
 
 DEFINE_EXPECT (QueryService_IInternetBindInfo)
 
 DEFINE_EXPECT (QueryService_IWindowForBindingUI)
 
 DEFINE_EXPECT (QueryService_IHttpSecurity)
 
 DEFINE_EXPECT (BeginningTransaction)
 
 DEFINE_EXPECT (OnResponse)
 
 DEFINE_EXPECT (QueryInterface_IHttpNegotiate2)
 
 DEFINE_EXPECT (GetRootSecurityId)
 
 DEFINE_EXPECT (GetBindInfo)
 
 DEFINE_EXPECT (GetBindInfoEx)
 
 DEFINE_EXPECT (OnStartBinding)
 
 DEFINE_EXPECT (OnProgress_FINDINGRESOURCE)
 
 DEFINE_EXPECT (OnProgress_CONNECTING)
 
 DEFINE_EXPECT (OnProgress_REDIRECTING)
 
 DEFINE_EXPECT (OnProgress_SENDINGREQUEST)
 
 DEFINE_EXPECT (OnProgress_MIMETYPEAVAILABLE)
 
 DEFINE_EXPECT (OnProgress_BEGINDOWNLOADDATA)
 
 DEFINE_EXPECT (OnProgress_DOWNLOADINGDATA)
 
 DEFINE_EXPECT (OnProgress_ENDDOWNLOADDATA)
 
 DEFINE_EXPECT (OnProgress_CACHEFILENAMEAVAILABLE)
 
 DEFINE_EXPECT (OnStopBinding)
 
 DEFINE_EXPECT (OnDataAvailable)
 
 DEFINE_EXPECT (OnObjectAvailable)
 
 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)
 
 DEFINE_EXPECT (Obj_OnProgress_REDIRECTING)
 
 DEFINE_EXPECT (Obj_OnProgress_CACHEFILENAMEAVAILABLE)
 
 DEFINE_EXPECT (Start)
 
 DEFINE_EXPECT (Read)
 
 DEFINE_EXPECT (LockRequest)
 
 DEFINE_EXPECT (Terminate)
 
 DEFINE_EXPECT (UnlockRequest)
 
 DEFINE_EXPECT (Continue)
 
 DEFINE_EXPECT (Abort)
 
 DEFINE_EXPECT (CreateInstance)
 
 DEFINE_EXPECT (Load)
 
 DEFINE_EXPECT (PutProperty_MIMETYPEPROP)
 
 DEFINE_EXPECT (PutProperty_CLASSIDPROP)
 
 DEFINE_EXPECT (SetPriority)
 
 DEFINE_EXPECT (GetWindow_IHttpSecurity)
 
 DEFINE_EXPECT (GetWindow_IWindowForBindingUI)
 
 DEFINE_EXPECT (GetWindow_ICodeInstall)
 
 DEFINE_EXPECT (OnSecurityProblem)
 
static BOOL proxy_active (void)
 
static BOOL is_urlmon_protocol (int prot)
 
static void test_CreateURLMoniker (LPCWSTR url1, LPCWSTR url2)
 
static void test_create (void)
 
static HRESULT WINAPI Priority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Priority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI Priority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI Priority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI Priority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
static HRESULT WINAPI Protocol_QueryInterface (IInternetProtocol *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Protocol_AddRef (IInternetProtocol *iface)
 
static ULONG WINAPI Protocol_Release (IInternetProtocol *iface)
 
static void test_switch_fail (void)
 
static DWORD WINAPI thread_proc (PVOID arg)
 
static HRESULT WINAPI Protocol_Start (IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI Protocol_Continue (IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI Protocol_Abort (IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI Protocol_Terminate (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI Protocol_Suspend (IInternetProtocol *iface)
 
static HRESULT WINAPI Protocol_Resume (IInternetProtocol *iface)
 
static HRESULT WINAPI Protocol_Read (IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI Protocol_Seek (IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI Protocol_LockRequest (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI Protocol_UnlockRequest (IInternetProtocol *iface)
 
static HRESULT WINAPI HttpNegotiate_QueryInterface (IHttpNegotiate2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpNegotiate_AddRef (IHttpNegotiate2 *iface)
 
static ULONG WINAPI HttpNegotiate_Release (IHttpNegotiate2 *iface)
 
static HRESULT WINAPI HttpNegotiate_BeginningTransaction (IHttpNegotiate2 *iface, LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *pszAdditionalHeaders)
 
static HRESULT WINAPI HttpNegotiate_OnResponse (IHttpNegotiate2 *iface, DWORD dwResponseCode, LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders)
 
static HRESULT WINAPI HttpNegotiate_GetRootSecurityId (IHttpNegotiate2 *iface, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
 
static HRESULT WINAPI HttpSecurity_QueryInterface (IHttpSecurity *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpSecurity_AddRef (IHttpSecurity *iface)
 
static ULONG WINAPI HttpSecurity_Release (IHttpSecurity *iface)
 
static HRESULT WINAPI HttpSecurity_GetWindow (IHttpSecurity *iface, REFGUID rguidReason, HWND *phwnd)
 
static HRESULT WINAPI HttpSecurity_OnSecurityProblem (IHttpSecurity *iface, DWORD dwProblem)
 
static HRESULT WINAPI ServiceProvider_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ServiceProvider_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI ServiceProvider_Release (IServiceProvider *iface)
 
static HRESULT WINAPI ServiceProvider_QueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
static void test_WinInetHttpInfo (IWinInetHttpInfo *http_info, DWORD progress)
 
static HRESULT WINAPI statusclb_QueryInterface (IBindStatusCallbackEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI statusclb_AddRef (IBindStatusCallbackEx *iface)
 
static ULONG WINAPI statusclb_Release (IBindStatusCallbackEx *iface)
 
static HRESULT WINAPI statusclb_OnStartBinding (IBindStatusCallbackEx *iface, DWORD dwReserved, IBinding *pib)
 
static HRESULT WINAPI statusclb_GetPriority (IBindStatusCallbackEx *iface, LONG *pnPriority)
 
static HRESULT WINAPI statusclb_OnLowResource (IBindStatusCallbackEx *iface, DWORD reserved)
 
static HRESULT WINAPI statusclb_OnProgress (IBindStatusCallbackEx *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static HRESULT WINAPI statusclb_OnStopBinding (IBindStatusCallbackEx *iface, HRESULT hresult, LPCWSTR szError)
 
static HRESULT WINAPI statusclb_GetBindInfo (IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static void test_stream_seek (IStream *stream)
 
static HRESULT WINAPI statusclb_OnDataAvailable (IBindStatusCallbackEx *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
 
static HRESULT WINAPI statusclb_OnObjectAvailable (IBindStatusCallbackEx *iface, REFIID riid, IUnknown *punk)
 
static HRESULT WINAPI statusclb_GetBindInfoEx (IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo, DWORD *grfBINDF2, DWORD *pdwReserved)
 
static HRESULT WINAPI MonikerProp_QueryInterface (IMonikerProp *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MonikerProp_AddRef (IMonikerProp *iface)
 
static ULONG WINAPI MonikerProp_Release (IMonikerProp *iface)
 
static HRESULT WINAPI MonikerProp_PutProperty (IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
 
static HRESULT WINAPI PersistMoniker_QueryInterface (IPersistMoniker *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PersistMoniker_AddRef (IPersistMoniker *iface)
 
static ULONG WINAPI PersistMoniker_Release (IPersistMoniker *iface)
 
static HRESULT WINAPI PersistMoniker_GetClassID (IPersistMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI PersistMoniker_IsDirty (IPersistMoniker *iface)
 
static HRESULT WINAPI PersistMoniker_Load (IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode)
 
static HRESULT WINAPI PersistMoniker_Save (IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
 
static HRESULT WINAPI PersistMoniker_SaveCompleted (IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
 
static HRESULT WINAPI PersistMoniker_GetCurMoniker (IPersistMoniker *iface, IMoniker **pimkName)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static HRESULT WINAPI ProtocolCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI ProtocolCF_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static void test_CreateAsyncBindCtx (void)
 
static void test_CreateAsyncBindCtxEx (void)
 
static void test_GetBindInfoEx (IBindStatusCallback *holder)
 
static BOOL test_bscholder (IBindStatusCallback *holder)
 
static BOOL test_RegisterBindStatusCallback (void)
 
static void init_bind_test (int protocol, DWORD flags, DWORD t)
 
static void test_BindToStorage (int protocol, DWORD flags, DWORD t)
 
static void test_BindToObject (int protocol, DWORD flags, HRESULT exhres)
 
static void test_URLDownloadToFile (DWORD prot, BOOL emul)
 
static void test_URLDownloadToFile_abort (void)
 
static void set_file_url (char *path)
 
static void create_file (const char *file_name, const char *content)
 
static void create_html_file (void)
 
static void create_cache_file (void)
 
static void test_ReportResult (HRESULT exhres)
 
static void test_BindToStorage_fail (void)
 
static void test_StdURLMoniker (void)
 
static void register_protocols (void)
 
static BOOL can_do_https (void)
 
 START_TEST (url)
 

Variables

static DWORD
 
static DWORD_PTR
 
static const IID IID_undocumentedIE11 = {0xd5ae15f6,0x2032,0x488e,{0x8f,0x96,0xf9,0x24,0x06,0xd8,0xd8,0xb4}}
 
CLSID CLSID_AboutProtocol
 
static const WCHAR winetest_data_urlW []
 
static const WCHAR about_blankW [] = {'a','b','o','u','t',':','b','l','a','n','k',0}
 
static const WCHAR wszTextHtml [] = {'t','e','x','t','/','h','t','m','l',0}
 
static WCHAR BSCBHolder [] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }
 
static const WCHAR wszWineHQSite []
 
static const WCHAR wszWineHQIP []
 
static const CHAR wszIndexHtmlA [] = "index.html"
 
static const WCHAR cache_fileW [] = {'c',':','\\','c','a','c','h','e','.','h','t','m',0}
 
static const CHAR dwl_htmlA [] = "dwl.html"
 
static const WCHAR dwl_htmlW [] = {'d','w','l','.','h','t','m','l',0}
 
static const CHAR test_txtA [] = "test.txt"
 
static const WCHAR emptyW [] = {0}
 
static BOOL stopped_binding = FALSE
 
static BOOL stopped_obj_binding = FALSE
 
static BOOL emulate_protocol = FALSE
 
static BOOL data_available = FALSE
 
static BOOL http_is_first = TRUE
 
static BOOL bind_to_object = FALSE
 
static BOOL filedwl_api
 
static BOOL post_test
 
static DWORD read = 0
 
static DWORD bindf = 0
 
static DWORD prot_state = 0
 
static DWORD thread_id
 
static DWORD tymed
 
static DWORD security_problem
 
static const WCHARreported_url
 
static CHAR mime_type [512]
 
static IInternetProtocolSinkprotocol_sink = NULL
 
static IBindingcurrent_binding
 
static HANDLE complete_event
 
static HANDLE complete_event2
 
static HRESULT binding_hres
 
static HRESULT onsecurityproblem_hres
 
static HRESULT abort_hres
 
static BOOL have_IHttpNegotiate2
 
static BOOL use_bscex
 
static BOOL is_async_prot
 
static BOOL test_redirect
 
static BOOL use_cache_file
 
static BOOL callback_read
 
static BOOL no_callback
 
static BOOL test_abort
 
static WCHAR cache_file_name [MAX_PATH]
 
static WCHAR http_cache_file [MAX_PATH]
 
static BOOL only_check_prot_args = FALSE
 
static BOOL invalid_cn_accepted = FALSE
 
static BOOL abort_start = FALSE
 
static BOOL abort_progress = FALSE
 
static BOOL async_switch = FALSE
 
static BOOL strict_bsc_qi
 
static DWORD bindtest_flags
 
static const chartest_file
 
static WCHAR file_url [INTERNET_MAX_URL_LENGTH]
 
static WCHAR current_url [INTERNET_MAX_URL_LENGTH]
 
static enum { ... }  test_protocol
 
static enum { ... }  download_state
 
static const IInternetPriorityVtbl InternetPriorityVtbl
 
static IInternetPriority InternetPriority = { &InternetPriorityVtbl }
 
static const IInternetProtocolVtbl ProtocolVtbl
 
static IInternetProtocol Protocol = { &ProtocolVtbl }
 
static IHttpNegotiate2Vtbl HttpNegotiateVtbl
 
static IHttpNegotiate2 HttpNegotiate = { &HttpNegotiateVtbl }
 
static const IHttpSecurityVtbl HttpSecurityVtbl
 
static IHttpSecurity HttpSecurity = { &HttpSecurityVtbl }
 
static IServiceProviderVtbl ServiceProviderVtbl
 
static IServiceProvider ServiceProvider = { &ServiceProviderVtbl }
 
static IBindStatusCallbackEx objbsc = { &BindStatusCallbackVtbl }
 
static const IBindStatusCallbackExVtbl BindStatusCallbackVtbl
 
static IBindStatusCallbackEx bsc = { &BindStatusCallbackVtbl }
 
static IBindStatusCallbackEx bsc2 = { &BindStatusCallbackVtbl }
 
static const IMonikerPropVtbl MonikerPropVtbl
 
static IMonikerProp MonikerProp = { &MonikerPropVtbl }
 
static const IPersistMonikerVtbl PersistMonikerVtbl
 
static IPersistMoniker PersistMoniker = { &PersistMonikerVtbl }
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static IClassFactory mime_cf = { &ClassFactoryVtbl }
 
static const IClassFactoryVtbl ProtocolCFVtbl
 
static IClassFactory protocol_cf = { &ProtocolCFVtbl }
 

Macro Definition Documentation

◆ BINDTEST_ABORT

#define BINDTEST_ABORT   0x0100

Definition at line 2861 of file url.c.

◆ BINDTEST_ABORT_PROGRESS

#define BINDTEST_ABORT_PROGRESS   0x0800

Definition at line 2864 of file url.c.

◆ BINDTEST_ABORT_START

#define BINDTEST_ABORT_START   0x0400

Definition at line 2863 of file url.c.

◆ BINDTEST_ALLOW_FINDINGRESOURCE

#define BINDTEST_ALLOW_FINDINGRESOURCE   0x2000

Definition at line 2866 of file url.c.

◆ BINDTEST_ASYNC_SWITCH

#define BINDTEST_ASYNC_SWITCH   0x1000

Definition at line 2865 of file url.c.

◆ BINDTEST_EMULATE

#define BINDTEST_EMULATE   0x0001

Definition at line 2853 of file url.c.

◆ BINDTEST_FILEDWLAPI

#define BINDTEST_FILEDWLAPI   0x0004

Definition at line 2855 of file url.c.

◆ BINDTEST_HTTPRESPONSE

#define BINDTEST_HTTPRESPONSE   0x0008

Definition at line 2856 of file url.c.

◆ BINDTEST_INVALID_CN

#define BINDTEST_INVALID_CN   0x0200

Definition at line 2862 of file url.c.

◆ BINDTEST_NO_CALLBACK

#define BINDTEST_NO_CALLBACK   0x0080

Definition at line 2860 of file url.c.

◆ BINDTEST_NO_CALLBACK_READ

#define BINDTEST_NO_CALLBACK_READ   0x0040

Definition at line 2859 of file url.c.

◆ BINDTEST_REDIRECT

#define BINDTEST_REDIRECT   0x0010

Definition at line 2857 of file url.c.

◆ BINDTEST_TOOBJECT

#define BINDTEST_TOOBJECT   0x0002

Definition at line 2854 of file url.c.

◆ BINDTEST_USE_CACHE

#define BINDTEST_USE_CACHE   0x0020

Definition at line 2858 of file url.c.

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 67 of file url.c.

◆ CHECK_CALLED_BROKEN

#define CHECK_CALLED_BROKEN (   func)
Value:
do { \
ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define broken(x)
Definition: _sntprintf.h:21

Definition at line 79 of file url.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 61 of file url.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 55 of file url.c.

◆ CHECK_NOT_CALLED

#define CHECK_NOT_CALLED (   func)
Value:
do { \
ok(!called_ ## func, "unexpected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 73 of file url.c.

◆ CLEAR_CALLED

#define CLEAR_CALLED (   func)    expect_ ## func = called_ ## func = FALSE

Definition at line 85 of file url.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file url.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 27 of file url.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 49 of file url.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 26 of file url.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)    do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)

Definition at line 52 of file url.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HTTP_TEST 
ABOUT_TEST 
FILE_TEST 
ITS_TEST 
MK_TEST 
HTTPS_TEST 
FTP_TEST 
WINETEST_TEST 
WINETEST_SYNC_TEST 

Definition at line 198 of file url.c.

198  {
199  HTTP_TEST,
200  ABOUT_TEST,
201  FILE_TEST,
202  ITS_TEST,
203  MK_TEST,
204  HTTPS_TEST,
205  FTP_TEST,
208 } test_protocol;
static enum @1671 test_protocol
Definition: url.c:199
Definition: url.c:202
Definition: url.c:205
Definition: url.c:203
Definition: url.c:201

◆ anonymous enum

anonymous enum
Enumerator
BEFORE_DOWNLOAD 
DOWNLOADING 
END_DOWNLOAD 

Definition at line 210 of file url.c.

210  {
212  DOWNLOADING,
static enum @1672 download_state

Function Documentation

◆ can_do_https()

static BOOL can_do_https ( void  )
static

Definition at line 3897 of file url.c.

3898 {
3899  HINTERNET ses, con, req;
3900  BOOL ret;
3901 
3902  ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
3903  ok(ses != NULL, "InternetOpen failed\n");
3904 
3905  con = InternetConnectA(ses, "test.winehq.org", INTERNET_DEFAULT_HTTPS_PORT,
3906  NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
3907  ok(con != NULL, "InternetConnect failed\n");
3908 
3909  req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL,
3911  ok(req != NULL, "HttpOpenRequest failed\n");
3912 
3913  ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
3915  "request failed: %u\n", GetLastError());
3916 
3917  InternetCloseHandle(req);
3918  InternetCloseHandle(con);
3919  InternetCloseHandle(ses);
3920  return ret;
3921 }
DWORD ret
Definition: url.c:452
#define INTERNET_FLAG_SECURE
Definition: wininet.h:71
HINTERNET WINAPI InternetConnectA(HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:1343
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1436
BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5713
#define ERROR_INTERNET_CANNOT_CONNECT
Definition: wininet.h:2018
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:1079
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define broken(x)
Definition: _sntprintf.h:21
#define INTERNET_DEFAULT_HTTPS_PORT
Definition: winhttp.h:37
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define ok(value,...)
Definition: atltest.h:57
HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, LPCSTR lpszReferrer, LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:1509
#define INTERNET_SERVICE_HTTP
Definition: wininet.h:562

Referenced by START_TEST().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 2361 of file url.c.

2362 {
2363  return 2;
2364 }

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2371 of file url.c.

2372 {
2373  CHECK_EXPECT(CreateInstance);
2374  ok(!outer, "outer = %p\n", outer);
2375  ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2376  *ppv = &PersistMoniker;
2377  return S_OK;
2378 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CHECK_EXPECT(func)
Definition: url.c:61
const char * wine_dbgstr_guid(const GUID *guid)
const GUID IID_IUnknown
static IPersistMoniker PersistMoniker
Definition: url.c:2341
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 2380 of file url.c.

2381 {
2382  ok(0, "unexpected call\n");
2383  return S_OK;
2384 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2343 of file url.c.

2344 {
2345  *ppv = NULL;
2346 
2348  *ppv = iface;
2349  return S_OK;
2350  }
2351 
2352  if(IsEqualGUID(&IID_IMarshal, riid))
2353  return E_NOINTERFACE;
2355  return E_NOINTERFACE;
2356 
2357  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2358  return E_NOTIMPL;
2359 }
const CLSID CLSID_IdentityUnmarshal
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 2366 of file url.c.

2367 {
2368  return 1;
2369 }

◆ create_cache_file()

static void create_cache_file ( void  )
static

Definition at line 3720 of file url.c.

3721 {
3722  char buf[6500], curdir[MAX_PATH];
3723  HANDLE file;
3724  DWORD size;
3725 
3728  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3729  if(file == INVALID_HANDLE_VALUE)
3730  return;
3731 
3732  memset(buf, 'X', sizeof(buf));
3733  WriteFile(file, buf, sizeof(buf), &size, NULL);
3734  CloseHandle(file);
3735 
3736  memset(curdir, 0, sizeof(curdir));
3737  GetCurrentDirectoryA(MAX_PATH, curdir);
3738  lstrcatA(curdir, "\\");
3739  lstrcatA(curdir, test_txtA);
3740 
3742 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:406
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const CHAR test_txtA[]
Definition: url.c:169
#define CREATE_ALWAYS
Definition: disk.h:72
#define ok(value,...)
Definition: atltest.h:57
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2145
#define MultiByteToWideChar
Definition: compat.h:100
static WCHAR cache_file_name[MAX_PATH]
Definition: url.c:185
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
#define memset(x, y, z)
Definition: compat.h:39
Definition: fci.c:126

Referenced by START_TEST().

◆ create_file()

static void create_file ( const char file_name,
const char content 
)
static

Definition at line 3691 of file url.c.

3692 {
3693  HANDLE file;
3694  DWORD size;
3695  CHAR path[MAX_PATH];
3696 
3699  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3700  if(file == INVALID_HANDLE_VALUE)
3701  return;
3702 
3703  if(test_file)
3705  test_file = file_name;
3707  CloseHandle(file);
3708 
3710  lstrcatA(path, "\\");
3712  set_file_url(path);
3713 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:406
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char CHAR
Definition: xmlstorage.h:175
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
static const char * test_file
Definition: url.c:194
#define GENERIC_WRITE
Definition: nt_native.h:90
content
Definition: atl_ax.c:993
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static void set_file_url(char *path)
Definition: url.c:3682
#define CREATE_ALWAYS
Definition: disk.h:72
#define ok(value,...)
Definition: atltest.h:57
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2145
static LPCWSTR file_name
Definition: protocol.c:147
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
Definition: fci.c:126

Referenced by create_html_file(), and START_TEST().

◆ create_html_file()

static void create_html_file ( void  )
static

Definition at line 3715 of file url.c.

3716 {
3717  create_file(wszIndexHtmlA, "<HTML></HTML>");
3718 }
static void create_file(const char *file_name, const char *content)
Definition: url.c:3691
static const CHAR wszIndexHtmlA[]
Definition: url.c:165

Referenced by START_TEST().

◆ DEFINE_EXPECT() [1/63]

DEFINE_EXPECT ( QueryInterface_IServiceProvider  )

◆ DEFINE_EXPECT() [2/63]

DEFINE_EXPECT ( QueryInterface_IHttpNegotiate  )

◆ DEFINE_EXPECT() [3/63]

DEFINE_EXPECT ( QueryInterface_IBindStatusCallback  )

◆ DEFINE_EXPECT() [4/63]

DEFINE_EXPECT ( QueryInterface_IBindStatusCallbackEx  )

◆ DEFINE_EXPECT() [5/63]

DEFINE_EXPECT ( QueryInterface_IBindStatusCallbackHolder  )

◆ DEFINE_EXPECT() [6/63]

DEFINE_EXPECT ( QueryInterface_IAuthenticate  )

◆ DEFINE_EXPECT() [7/63]

DEFINE_EXPECT ( QueryInterface_IInternetProtocol  )

◆ DEFINE_EXPECT() [8/63]

DEFINE_EXPECT ( QueryInterface_IWindowForBindingUI  )

◆ DEFINE_EXPECT() [9/63]

DEFINE_EXPECT ( QueryInterface_IHttpSecurity  )

◆ DEFINE_EXPECT() [10/63]

DEFINE_EXPECT ( QueryService_IAuthenticate  )

◆ DEFINE_EXPECT() [11/63]

DEFINE_EXPECT ( QueryService_IInternetProtocol  )

◆ DEFINE_EXPECT() [12/63]

DEFINE_EXPECT ( QueryService_IInternetBindInfo  )

◆ DEFINE_EXPECT() [13/63]

DEFINE_EXPECT ( QueryService_IWindowForBindingUI  )

◆ DEFINE_EXPECT() [14/63]

DEFINE_EXPECT ( QueryService_IHttpSecurity  )

◆ DEFINE_EXPECT() [15/63]

DEFINE_EXPECT ( BeginningTransaction  )

◆ DEFINE_EXPECT() [16/63]

DEFINE_EXPECT ( OnResponse  )

◆ DEFINE_EXPECT() [17/63]

DEFINE_EXPECT ( QueryInterface_IHttpNegotiate2  )

◆ DEFINE_EXPECT() [18/63]

DEFINE_EXPECT ( GetRootSecurityId  )

◆ DEFINE_EXPECT() [19/63]

DEFINE_EXPECT ( GetBindInfo  )

◆ DEFINE_EXPECT() [20/63]

DEFINE_EXPECT ( GetBindInfoEx  )

◆ DEFINE_EXPECT() [21/63]

DEFINE_EXPECT ( OnStartBinding  )

◆ DEFINE_EXPECT() [22/63]

DEFINE_EXPECT ( OnProgress_FINDINGRESOURCE  )

◆ DEFINE_EXPECT() [23/63]

DEFINE_EXPECT ( OnProgress_CONNECTING  )

◆ DEFINE_EXPECT() [24/63]

DEFINE_EXPECT ( OnProgress_REDIRECTING  )

◆ DEFINE_EXPECT() [25/63]

DEFINE_EXPECT ( OnProgress_SENDINGREQUEST  )

◆ DEFINE_EXPECT() [26/63]

DEFINE_EXPECT ( OnProgress_MIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [27/63]

DEFINE_EXPECT ( OnProgress_BEGINDOWNLOADDATA  )

◆ DEFINE_EXPECT() [28/63]

DEFINE_EXPECT ( OnProgress_DOWNLOADINGDATA  )

◆ DEFINE_EXPECT() [29/63]

DEFINE_EXPECT ( OnProgress_ENDDOWNLOADDATA  )

◆ DEFINE_EXPECT() [30/63]

DEFINE_EXPECT ( OnProgress_CACHEFILENAMEAVAILABLE  )

◆ DEFINE_EXPECT() [31/63]

DEFINE_EXPECT ( OnStopBinding  )

◆ DEFINE_EXPECT() [32/63]

DEFINE_EXPECT ( OnDataAvailable  )

◆ DEFINE_EXPECT() [33/63]

DEFINE_EXPECT ( OnObjectAvailable  )

◆ DEFINE_EXPECT() [34/63]

DEFINE_EXPECT ( Obj_OnStartBinding  )

◆ DEFINE_EXPECT() [35/63]

DEFINE_EXPECT ( Obj_OnStopBinding  )

◆ DEFINE_EXPECT() [36/63]

DEFINE_EXPECT ( Obj_GetBindInfo  )

◆ DEFINE_EXPECT() [37/63]

DEFINE_EXPECT ( Obj_OnProgress_BEGINDOWNLOADDATA  )

◆ DEFINE_EXPECT() [38/63]

DEFINE_EXPECT ( Obj_OnProgress_ENDDOWNLOADDATA  )

◆ DEFINE_EXPECT() [39/63]

DEFINE_EXPECT ( Obj_OnProgress_SENDINGREQUEST  )

◆ DEFINE_EXPECT() [40/63]

DEFINE_EXPECT ( Obj_OnProgress_MIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [41/63]

DEFINE_EXPECT ( Obj_OnProgress_CLASSIDAVAILABLE  )

◆ DEFINE_EXPECT() [42/63]

DEFINE_EXPECT ( Obj_OnProgress_BEGINSYNCOPERATION  )

◆ DEFINE_EXPECT() [43/63]

DEFINE_EXPECT ( Obj_OnProgress_ENDSYNCOPERATION  )

◆ DEFINE_EXPECT() [44/63]

DEFINE_EXPECT ( Obj_OnProgress_FINDINGRESOURCE  )

◆ DEFINE_EXPECT() [45/63]

DEFINE_EXPECT ( Obj_OnProgress_CONNECTING  )

◆ DEFINE_EXPECT() [46/63]

DEFINE_EXPECT ( Obj_OnProgress_REDIRECTING  )

◆ DEFINE_EXPECT() [47/63]

DEFINE_EXPECT ( Obj_OnProgress_CACHEFILENAMEAVAILABLE  )

◆ DEFINE_EXPECT() [48/63]

DEFINE_EXPECT ( Start  )

◆ DEFINE_EXPECT() [49/63]

DEFINE_EXPECT ( Read  )

◆ DEFINE_EXPECT() [50/63]

DEFINE_EXPECT ( LockRequest  )

◆ DEFINE_EXPECT() [51/63]

DEFINE_EXPECT ( Terminate  )

◆ DEFINE_EXPECT() [52/63]

DEFINE_EXPECT ( UnlockRequest  )

◆ DEFINE_EXPECT() [53/63]

DEFINE_EXPECT ( Continue  )

◆ DEFINE_EXPECT() [54/63]

DEFINE_EXPECT ( Abort  )

◆ DEFINE_EXPECT() [55/63]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [56/63]

DEFINE_EXPECT ( Load  )

◆ DEFINE_EXPECT() [57/63]

DEFINE_EXPECT ( PutProperty_MIMETYPEPROP  )

◆ DEFINE_EXPECT() [58/63]

DEFINE_EXPECT ( PutProperty_CLASSIDPROP  )

◆ DEFINE_EXPECT() [59/63]

DEFINE_EXPECT ( SetPriority  )

◆ DEFINE_EXPECT() [60/63]

DEFINE_EXPECT ( GetWindow_IHttpSecurity  )

◆ DEFINE_EXPECT() [61/63]

DEFINE_EXPECT ( GetWindow_IWindowForBindingUI  )

◆ DEFINE_EXPECT() [62/63]

DEFINE_EXPECT ( GetWindow_ICodeInstall  )

◆ DEFINE_EXPECT() [63/63]

DEFINE_EXPECT ( OnSecurityProblem  )

◆ DEFINE_GUID() [1/3]

static IUri** DEFINE_GUID ( GUID_NULL  ,
,
,
,
,
,
,
,
,
,
,
 
)

◆ DEFINE_GUID() [2/3]

DEFINE_GUID ( CLSID_IdentityUnmarshal  ,
0x0000001b  ,
0x0000  ,
0x0000  ,
0xc0  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x46   
)

◆ DEFINE_GUID() [3/3]

DEFINE_GUID ( IID_IBindStatusCallbackHolder  ,
0x79eac9cc  ,
0xbaf9  ,
0x11ce  ,
0x8c  ,
0x82  ,
0x00  ,
0xaa  ,
0x00  ,
0x4b  ,
0xa9  ,
0x0b   
)

◆ HRESULT()

static HRESULT ( WINAPI pCreateAsyncBindCtxEx)
static

◆ HttpNegotiate_AddRef()

static ULONG WINAPI HttpNegotiate_AddRef ( IHttpNegotiate2 iface)
static

Definition at line 1233 of file url.c.

1234 {
1235  return 2;
1236 }

◆ HttpNegotiate_BeginningTransaction()

static HRESULT WINAPI HttpNegotiate_BeginningTransaction ( IHttpNegotiate2 iface,
LPCWSTR  szURL,
LPCWSTR  szHeaders,
DWORD  dwReserved,
LPWSTR pszAdditionalHeaders 
)
static

Definition at line 1243 of file url.c.

1245 {
1247  CHECK_EXPECT2(BeginningTransaction);
1248  else
1249  CHECK_EXPECT(BeginningTransaction);
1250 
1251  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1252 
1253  ok(!lstrcmpW(szURL, current_url), "szURL != current_url\n");
1254  ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
1255  ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
1256  if(pszAdditionalHeaders)
1257  ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
1258 
1259  return S_OK;
1260 }
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define CHECK_EXPECT(func)
Definition: url.c:61
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static DWORD thread_id
Definition: url.c:174
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define CHECK_EXPECT2(func)
Definition: url.c:55
static HRESULT onsecurityproblem_hres
Definition: url.c:181

◆ HttpNegotiate_GetRootSecurityId()

static HRESULT WINAPI HttpNegotiate_GetRootSecurityId ( IHttpNegotiate2 iface,
BYTE pbSecurityId,
DWORD pcbSecurityId,
DWORD_PTR  dwReserved 
)
static

Definition at line 1280 of file url.c.

1282 {
1283  static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
1284 
1285  CHECK_EXPECT(GetRootSecurityId);
1286 
1287  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1288 
1289  ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
1290  ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
1291  ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
1292 
1293  if(pbSecurityId == (void*)0xdeadbeef)
1294  return E_NOTIMPL;
1295 
1296  if(pcbSecurityId) {
1297  ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
1298  *pcbSecurityId = sizeof(sec_id);
1299  }
1300 
1301  if(pbSecurityId)
1302  memcpy(pbSecurityId, sec_id, sizeof(sec_id));
1303 
1304  return E_FAIL;
1305 }
#define CHECK_EXPECT(func)
Definition: url.c:61
#define E_FAIL
Definition: ddrawi.h:102
static DWORD thread_id
Definition: url.c:174
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HttpNegotiate_OnResponse()

static HRESULT WINAPI HttpNegotiate_OnResponse ( IHttpNegotiate2 iface,
DWORD  dwResponseCode,
LPCWSTR  szResponseHeaders,
LPCWSTR  szRequestHeaders,
LPWSTR pszAdditionalRequestHeaders 
)
static

Definition at line 1262 of file url.c.

1264 {
1265  CHECK_EXPECT(OnResponse);
1266 
1267  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1268 
1269  ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode);
1270  ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n");
1271  ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n");
1272  /* Note: in protocol.c tests, OnResponse pszAdditionalRequestHeaders _is_ NULL */
1273  ok(pszAdditionalRequestHeaders != NULL, "pszAdditionalHeaders == NULL\n");
1274  if(pszAdditionalRequestHeaders)
1275  ok(*pszAdditionalRequestHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
1276 
1277  return S_OK;
1278 }
#define CHECK_EXPECT(func)
Definition: url.c:61
static DWORD thread_id
Definition: url.c:174
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ HttpNegotiate_QueryInterface()

static HRESULT WINAPI HttpNegotiate_QueryInterface ( IHttpNegotiate2 iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1220 of file url.c.

1221 {
1223  || IsEqualGUID(&IID_IHttpNegotiate, riid)
1224  || IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
1225  *ppv = iface;
1226  return S_OK;
1227  }
1228 
1229  ok(0, "unexpected call\n");
1230  return E_NOINTERFACE;
1231 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HttpNegotiate_Release()

static ULONG WINAPI HttpNegotiate_Release ( IHttpNegotiate2 iface)
static

Definition at line 1238 of file url.c.

1239 {
1240  return 1;
1241 }

◆ HttpSecurity_AddRef()

static ULONG WINAPI HttpSecurity_AddRef ( IHttpSecurity iface)
static

Definition at line 1335 of file url.c.

1336 {
1337  return 2;
1338 }

◆ HttpSecurity_GetWindow()

static HRESULT WINAPI HttpSecurity_GetWindow ( IHttpSecurity iface,
REFGUID  rguidReason,
HWND phwnd 
)
static

Definition at line 1345 of file url.c.

1346 {
1347  if(IsEqualGUID(rguidReason, &IID_IHttpSecurity))
1348  CHECK_EXPECT(GetWindow_IHttpSecurity);
1349  else if(IsEqualGUID(rguidReason, &IID_IWindowForBindingUI))
1350  CHECK_EXPECT2(GetWindow_IWindowForBindingUI);
1351  else if(IsEqualGUID(rguidReason, &IID_ICodeInstall))
1352  CHECK_EXPECT(GetWindow_ICodeInstall);
1353  else
1354  ok(0, "Unexpected rguidReason: %s\n", wine_dbgstr_guid(rguidReason));
1355 
1356  *phwnd = NULL;
1357  return S_OK;
1358 }
#define CHECK_EXPECT(func)
Definition: url.c:61
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define CHECK_EXPECT2(func)
Definition: url.c:55

◆ HttpSecurity_OnSecurityProblem()

static HRESULT WINAPI HttpSecurity_OnSecurityProblem ( IHttpSecurity iface,
DWORD  dwProblem 
)
static

Definition at line 1360 of file url.c.

1361 {
1362  CHECK_EXPECT(OnSecurityProblem);
1363  if(!security_problem) {
1364  ok(dwProblem == ERROR_INTERNET_SEC_CERT_CN_INVALID ||
1365  broken(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS) /* Some versions of IE6 */,
1366  "Got problem: %d\n", dwProblem);
1367  security_problem = dwProblem;
1368 
1369  if(dwProblem == ERROR_INTERNET_SEC_CERT_ERRORS)
1370  binding_hres = INET_E_SECURITY_PROBLEM;
1371  }else
1372  ok(dwProblem == security_problem, "Got problem: %d\n", dwProblem);
1373 
1374  return onsecurityproblem_hres;
1375 }
#define ERROR_INTERNET_SEC_CERT_CN_INVALID
Definition: wininet.h:2026
#define CHECK_EXPECT(func)
Definition: url.c:61
#define ERROR_INTERNET_SEC_CERT_ERRORS
Definition: wininet.h:2042
static HRESULT binding_hres
Definition: url.c:180
#define broken(x)
Definition: _sntprintf.h:21
static DWORD security_problem
Definition: url.c:174
#define ok(value,...)
Definition: atltest.h:57
static HRESULT onsecurityproblem_hres
Definition: url.c:181

◆ HttpSecurity_QueryInterface()

static HRESULT WINAPI HttpSecurity_QueryInterface ( IHttpSecurity iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1318 of file url.c.

1319 {
1320  ok(0, "Unexpected call\n");
1321  *ppv = NULL;
1322  if(IsEqualGUID(&IID_IHttpSecurity, riid) ||
1323  IsEqualGUID(&IID_IWindowForBindingUI, riid) ||
1325  {
1326  *ppv = iface;
1327  return S_OK;
1328  }
1329 
1330  ok(0, "Unexpected interface requested.\n");
1331 
1332  return E_NOINTERFACE;
1333 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HttpSecurity_Release()

static ULONG WINAPI HttpSecurity_Release ( IHttpSecurity iface)
static

Definition at line 1340 of file url.c.

1341 {
1342  return 1;
1343 }

◆ init_bind_test()

static void init_bind_test ( int  protocol,
DWORD  flags,
DWORD  t 
)
static

Definition at line 2868 of file url.c.

2869 {
2870  const char *url_a = NULL;
2871 
2879  mime_type[0] = 0;
2880  binding_hres = S_OK;
2882  tymed = t;
2885 
2886  switch(protocol) {
2887  case HTTP_TEST:
2888  if(post_test)
2889  url_a = "http://test.winehq.org/tests/post.php";
2890  else
2892  break;
2893  case ABOUT_TEST:
2894  url_a = "about:blank";
2895  break;
2896  case FILE_TEST:
2898  break;
2899  case MK_TEST:
2900  url_a = "mk:@MSITStore:test.chm::/blank.html";
2901  break;
2902  case ITS_TEST:
2903  url_a = "its:test.chm::/blank.html";
2904  break;
2905  case HTTPS_TEST:
2906  url_a = (flags & BINDTEST_INVALID_CN) ? "https://4.15.184.77/favicon.ico" : "https://test.winehq.org/tests/hello.html";
2907  break;
2908  case FTP_TEST:
2909  url_a = "ftp://ftp.winehq.org/welcome%2emsg";
2910  break;
2911  default:
2912  url_a = "winetest:test";
2913  }
2914 
2915  if(url_a)
2917 
2922  test_abort = (flags & BINDTEST_ABORT) != 0;
2927  prot_state = 0;
2929 
2930  trace("URL: %s\n", wine_dbgstr_w(current_url));
2931 }
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
#define BINDTEST_FILEDWLAPI
Definition: url.c:2855
static DWORD prot_state
Definition: url.c:174
static enum @1671 test_protocol
static HANDLE complete_event
Definition: url.c:179
static BOOL filedwl_api
Definition: url.c:173
#define BINDTEST_REDIRECT
Definition: url.c:2857
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define CP_ACP
Definition: compat.h:99
GLdouble GLdouble t
Definition: gl.h:2047
#define BINDTEST_NO_CALLBACK_READ
Definition: url.c:2859
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static BOOL no_callback
Definition: url.c:184
Definition: url.c:199
static BOOL data_available
Definition: url.c:173
#define BINDTEST_EMULATE
Definition: url.c:2853
static BOOL callback_read
Definition: url.c:184
static BOOL is_async_prot
Definition: url.c:183
static BOOL stopped_binding
Definition: url.c:172
#define BINDTEST_ABORT
Definition: url.c:2861
static BOOL post_test
Definition: url.c:173
static BOOL bind_to_object
Definition: url.c:173
#define BINDTEST_USE_CACHE
Definition: url.c:2858
static BOOL emulate_protocol
Definition: url.c:172
static BOOL test_redirect
Definition: url.c:184
static DWORD bindtest_flags
Definition: url.c:193
static BOOL abort_progress
Definition: url.c:190
Definition: url.c:202
smooth NULL
Definition: ftsmooth.c:416
#define BINDTEST_HTTPRESPONSE
Definition: url.c:2856
#define trace
Definition: atltest.h:70
#define BINDTEST_NO_CALLBACK
Definition: url.c:2860
static const WCHAR winetest_data_urlW[]
Definition: url.c:152
GLbitfield flags
Definition: glext.h:7161
Definition: url.c:205
static HRESULT binding_hres
Definition: url.c:180
Definition: url.c:203
#define BINDTEST_INVALID_CN
Definition: url.c:2862
static BOOL stopped_obj_binding
Definition: url.c:172
#define BINDTEST_ABORT_PROGRESS
Definition: url.c:2864
#define BINDTEST_ABORT_START
Definition: url.c:2863
#define S_OK
Definition: intsafe.h:59
static DWORD tymed
Definition: url.c:174
#define lstrcpyW
Definition: compat.h:414
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define MultiByteToWideChar
Definition: compat.h:100
static BOOL async_switch
Definition: url.c:191
#define BINDTEST_TOOBJECT
Definition: url.c:2854
static enum @1672 download_state
static CHAR mime_type[512]
Definition: url.c:176
Definition: url.c:201
static BOOL abort_start
Definition: url.c:189
static BOOL test_abort
Definition: url.c:184
#define BINDTEST_ASYNC_SWITCH
Definition: url.c:2865
static BOOL use_cache_file
Definition: url.c:184

Referenced by test_BindToObject(), test_BindToStorage(), test_ReportResult(), test_URLDownloadToFile(), and test_URLDownloadToFile_abort().

◆ is_urlmon_protocol()

static BOOL is_urlmon_protocol ( int  prot)
static

Definition at line 235 of file url.c.

236 {
237  return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST;
238 }
Definition: url.c:199
Definition: url.c:205
Definition: url.c:203
Definition: url.c:201

Referenced by Protocol_QueryInterface(), Protocol_Start(), statusclb_OnProgress(), test_BindToObject(), test_BindToStorage(), test_ReportResult(), and test_URLDownloadToFile().

◆ MonikerProp_AddRef()

static ULONG WINAPI MonikerProp_AddRef ( IMonikerProp iface)
static

Definition at line 2161 of file url.c.

2162 {
2163  return 2;
2164 }

◆ MonikerProp_PutProperty()

static HRESULT WINAPI MonikerProp_PutProperty ( IMonikerProp iface,
MONIKERPROPERTY  mkp,
LPCWSTR  val 
)
static

Definition at line 2171 of file url.c.

2172 {
2173  switch(mkp) {
2174  case MIMETYPEPROP:
2175  CHECK_EXPECT(PutProperty_MIMETYPEPROP);
2176  ok(!lstrcmpW(val, wszTextHtml), "val = %s\n", wine_dbgstr_w(val));
2177  break;
2178  case CLASSIDPROP:
2179  CHECK_EXPECT(PutProperty_CLASSIDPROP);
2180  break;
2181  default:
2182  break;
2183  }
2184 
2185  return S_OK;
2186 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define CHECK_EXPECT(func)
Definition: url.c:61
static const WCHAR wszTextHtml[]
Definition: url.c:157
GLuint GLfloat * val
Definition: glext.h:7180
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ MonikerProp_QueryInterface()

static HRESULT WINAPI MonikerProp_QueryInterface ( IMonikerProp iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2154 of file url.c.

2155 {
2156  *ppv = NULL;
2157  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2158  return E_NOINTERFACE;
2159 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: atltest.h:57

◆ MonikerProp_Release()

static ULONG WINAPI MonikerProp_Release ( IMonikerProp iface)
static

Definition at line 2166 of file url.c.

2167 {
2168  return 1;
2169 }

◆ PersistMoniker_AddRef()

static ULONG WINAPI PersistMoniker_AddRef ( IPersistMoniker iface)
static

Definition at line 2213 of file url.c.

2214 {
2215  return 2;
2216 }

◆ PersistMoniker_GetClassID()

static HRESULT WINAPI PersistMoniker_GetClassID ( IPersistMoniker iface,
CLSID pClassID 
)
static

Definition at line 2223 of file url.c.

2224 {
2225  ok(0, "unexpected call\n");
2226  return E_NOTIMPL;
2227 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PersistMoniker_GetCurMoniker()

static HRESULT WINAPI PersistMoniker_GetCurMoniker ( IPersistMoniker iface,
IMoniker **  pimkName 
)
static

Definition at line 2323 of file url.c.

2324 {
2325  ok(0, "unexpected call\n");
2326  return E_NOTIMPL;
2327 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PersistMoniker_IsDirty()

static HRESULT WINAPI PersistMoniker_IsDirty ( IPersistMoniker iface)
static

Definition at line 2229 of file url.c.

2230 {
2231  ok(0, "unexpected call\n");
2232  return E_NOTIMPL;
2233 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PersistMoniker_Load()

static HRESULT WINAPI PersistMoniker_Load ( IPersistMoniker iface,
BOOL  fFullyAvailable,
IMoniker pimkName,
LPBC  pibc,
DWORD  grfMode 
)
static

Definition at line 2235 of file url.c.

2237 {
2238  IUnknown *unk;
2239  HRESULT hres;
2240 
2241  static WCHAR cbinding_contextW[] =
2242  {'C','B','i','n','d','i','n','g',' ','C','o','n','t','e','x','t',0};
2243 
2244  CHECK_EXPECT(Load);
2245  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2246 
2248  ok(!fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2249  else
2250  ok(fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2251  ok(pimkName != NULL, "pimkName == NULL\n");
2252  ok(pibc != NULL, "pibc == NULL\n");
2253  ok(grfMode == 0x12, "grfMode = %x\n", grfMode);
2254 
2255  hres = IBindCtx_GetObjectParam(pibc, cbinding_contextW, &unk);
2256  ok(hres == S_OK, "GetObjectParam(CBinding Context) failed: %08x\n", hres);
2257  if(SUCCEEDED(hres)) {
2258  IBinding *binding;
2259 
2260  hres = IUnknown_QueryInterface(unk, &IID_IBinding, (void**)&binding);
2261  ok(hres == S_OK, "Could not get IBinding: %08x\n", hres);
2262 
2263  IBinding_Release(binding);
2264  IUnknown_Release(unk);
2265  }
2266 
2267  SET_EXPECT(QueryInterface_IServiceProvider);
2269  ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2270  CHECK_CALLED(QueryInterface_IServiceProvider);
2271 
2272  SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2273  SET_EXPECT(GetBindInfo);
2274  SET_EXPECT(OnStartBinding);
2275  if(test_redirect)
2276  SET_EXPECT(OnProgress_REDIRECTING);
2277  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
2278  if(test_protocol == FILE_TEST)
2279  SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
2281  SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
2283  SET_EXPECT(OnDataAvailable);
2285  SET_EXPECT(OnStopBinding);
2286 
2287  hres = IMoniker_BindToStorage(pimkName, pibc, NULL, &IID_IStream, (void**)&unk);
2288  ok(hres == S_OK, "Load failed: %08x\n", hres);
2289 
2290  CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
2291  CHECK_CALLED(GetBindInfo);
2292  CHECK_CALLED(OnStartBinding);
2293  if(test_redirect)
2294  CHECK_CALLED(OnProgress_REDIRECTING);
2295  CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
2296  if(test_protocol == FILE_TEST)
2297  CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
2299  CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
2301  CHECK_CALLED(OnDataAvailable);
2303  CHECK_CALLED(OnStopBinding);
2304 
2305  if(unk)
2306  IUnknown_Release(unk);
2307 
2308  return S_OK;
2309 }
static WCHAR cbinding_contextW[]
Definition: binding.c:29
static enum @1671 test_protocol
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define SET_EXPECT(func)
Definition: url.c:52
#define CHECK_EXPECT(func)
Definition: url.c:61
Definition: url.c:199
static DWORD thread_id
Definition: url.c:174
static BOOL test_redirect
Definition: url.c:184
static IBindStatusCallbackEx bsc
Definition: url.c:2150
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
Definition: bindctx.c:615
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define CLEAR_CALLED(func)
Definition: url.c:85
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
Definition: url.c:201
#define CHECK_CALLED(func)
Definition: url.c:67
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ PersistMoniker_QueryInterface()

static HRESULT WINAPI PersistMoniker_QueryInterface ( IPersistMoniker iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2197 of file url.c.

2198 {
2199  *ppv = NULL;
2200 
2201  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IPersistMoniker, riid))
2202  *ppv = iface;
2203  else if(IsEqualGUID(&IID_IMonikerProp, riid))
2204  *ppv = &MonikerProp;
2205 
2206  if(*ppv)
2207  return S_OK;
2208 
2209  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2210  return E_NOINTERFACE;
2211 }
static IMonikerProp MonikerProp
Definition: url.c:2195
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ PersistMoniker_Release()

static ULONG WINAPI PersistMoniker_Release ( IPersistMoniker iface)
static

Definition at line 2218 of file url.c.

2219 {
2220  return 1;
2221 }

◆ PersistMoniker_Save()

static HRESULT WINAPI PersistMoniker_Save ( IPersistMoniker iface,
IMoniker pimkName,
LPBC  pbc,
BOOL  fRemember 
)
static

Definition at line 2311 of file url.c.

2312 {
2313  ok(0, "unexpected call\n");
2314  return E_NOTIMPL;
2315 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ PersistMoniker_SaveCompleted()

static HRESULT WINAPI PersistMoniker_SaveCompleted ( IPersistMoniker iface,
IMoniker pimkName,
LPBC  pibc 
)
static

Definition at line 2317 of file url.c.

2318 {
2319  ok(0, "unexpected call\n");
2320  return E_NOTIMPL;
2321 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Priority_AddRef()

static ULONG WINAPI Priority_AddRef ( IInternetPriority iface)
static

Definition at line 334 of file url.c.

335 {
336  return 2;
337 }

◆ Priority_GetPriority()

static HRESULT WINAPI Priority_GetPriority ( IInternetPriority iface,
LONG pnPriority 
)
static

Definition at line 351 of file url.c.

352 {
353  ok(0, "unexpected call\n");
354  return S_OK;
355 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ Priority_QueryInterface()

static HRESULT WINAPI Priority_QueryInterface ( IInternetPriority iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 328 of file url.c.

329 {
330  ok(0, "unexpected call\n");
331  return E_NOINTERFACE;
332 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ Priority_Release()

static ULONG WINAPI Priority_Release ( IInternetPriority iface)
static

Definition at line 339 of file url.c.

340 {
341  return 1;
342 }

◆ Priority_SetPriority()

static HRESULT WINAPI Priority_SetPriority ( IInternetPriority iface,
LONG  nPriority 
)
static

Definition at line 344 of file url.c.

345 {
347  ok(!nPriority, "nPriority = %d\n", nPriority);
348  return S_OK;
349 }
#define CHECK_EXPECT(func)
Definition: url.c:61
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ Protocol_Abort()

static HRESULT WINAPI Protocol_Abort ( IInternetProtocol iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 1056 of file url.c.

1058 {
1059  HRESULT hres;
1060 
1061  CHECK_EXPECT(Abort);
1062 
1063  ok(hrReason == E_ABORT, "hrReason = %08x\n", hrReason);
1064  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
1065 
1066  hres = IInternetProtocolSink_ReportResult(protocol_sink, E_ABORT, ERROR_SUCCESS, NULL);
1067  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1068 
1069  return S_OK;
1070 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CHECK_EXPECT(func)
Definition: url.c:61
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
#define E_ABORT
Definition: winerror.h:2366
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ Protocol_AddRef()

static ULONG WINAPI Protocol_AddRef ( IInternetProtocol iface)
static

Definition at line 398 of file url.c.

399 {
400  return 2;
401 }

◆ Protocol_Continue()

static HRESULT WINAPI Protocol_Continue ( IInternetProtocol iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 925 of file url.c.

927 {
928  DWORD bscf = 0;
929  HRESULT hres;
930 
932 
933  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
934 
935  if(!bind_to_object)
937 
938  ok(pProtocolData != NULL, "pProtocolData == NULL\n");
939  if(!pProtocolData)
940  return S_OK;
941 
942  switch(prot_state) {
943  case 0:
944  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
945  BINDSTATUS_SENDINGREQUEST, NULL);
946  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
947 
948  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
949  BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
950  ok(hres == S_OK,
951  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
952 
953  bscf |= BSCF_FIRSTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION;
954  break;
955  case 1: {
958  static const WCHAR header[] = {'?',0};
959 
960  hres = IInternetProtocolSink_QueryInterface(protocol_sink, &IID_IServiceProvider,
961  (void**)&service_provider);
962  ok(hres == S_OK, "Could not get IServiceProvicder\n");
963 
964  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
965  &IID_IHttpNegotiate, (void**)&http_negotiate);
966  ok(hres == S_OK, "Could not get IHttpNegotiate\n");
967 
968  if(!no_callback) {
969  SET_EXPECT(QueryInterface_IHttpNegotiate);
970  SET_EXPECT(OnResponse);
971  }
972  hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
973  if(!no_callback) {
974  CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
975  CHECK_CALLED(OnResponse);
976  }
977  IHttpNegotiate_Release(http_negotiate);
978  ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
979 
981  hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
982  ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n", hres);
983  }
984 
985  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
986  BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
987  ok(hres == S_OK,
988  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
989 
990  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
991  BINDSTATUS_CACHEFILENAMEAVAILABLE, use_cache_file ? cache_file_name : cache_fileW);
992  ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
993 
994  bscf |= BSCF_FIRSTDATANOTIFICATION;
995  break;
996  }
997  case 2:
998  case 3:
999  bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
1000  break;
1001  }
1002 
1003  hres = IInternetProtocolSink_ReportData(protocol_sink, bscf, 100, 400);
1004  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1005 
1006  if(prot_state != 2 || !test_abort)
1007  SET_EXPECT(Read);
1008  switch(prot_state) {
1009  case 0:
1010  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1011  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1012  SET_EXPECT(OnProgress_SENDINGREQUEST);
1013  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1014  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1016  SET_EXPECT(OnStopBinding);
1017  break;
1018  case 1:
1019  if(bind_to_object) {
1020  SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
1021  SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
1022  SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
1023  SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
1024  SET_EXPECT(CreateInstance);
1025  SET_EXPECT(PutProperty_MIMETYPEPROP);
1026  SET_EXPECT(PutProperty_CLASSIDPROP);
1027  SET_EXPECT(Load);
1028  SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
1029  SET_EXPECT(OnObjectAvailable);
1030  SET_EXPECT(Obj_OnStopBinding);
1031  }else if(!no_callback) {
1032  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1033  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1035  }else {
1037  }
1038  break;
1039  case 2:
1040  if(!no_callback)
1041  SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1042  break;
1043  case 3:
1044  SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1045  SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
1046  }
1047  if(!no_callback) {
1048  if((!bind_to_object || prot_state >= 2) && (!test_abort || prot_state != 2))
1049  SET_EXPECT(OnDataAvailable);
1050  if(prot_state == 3 || (test_abort && prot_state == 2))
1051  SET_EXPECT(OnStopBinding);
1052  }
1053  return S_OK;
1054 }
_In_ BOOLEAN Read
Definition: strmini.h:479
static DWORD prot_state
Definition: url.c:174
static enum @1671 test_protocol
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define SET_EXPECT(func)
Definition: url.c:52
#define CHECK_EXPECT(func)
Definition: url.c:61
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static BOOL no_callback
Definition: url.c:184
static DWORD thread_id
Definition: url.c:174
static BOOL bind_to_object
Definition: url.c:173
static const WCHAR cache_fileW[]
Definition: url.c:166
static BOOL test_redirect
Definition: url.c:184
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR wszTextHtml[]
Definition: url.c:157
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define CHECK_CALLED_BROKEN(func)
Definition: url.c:79
static const WCHAR * reported_url
Definition: url.c:175
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
volatile int Continue
Definition: gdblib.c:102
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static WCHAR cache_file_name[MAX_PATH]
Definition: url.c:185
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:395
#define CHECK_CALLED(func)
Definition: url.c:67
static BOOL test_abort
Definition: url.c:184
static BOOL use_cache_file
Definition: url.c:184

◆ Protocol_LockRequest()

static HRESULT WINAPI Protocol_LockRequest ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 1188 of file url.c.

1189 {
1191  if(no_callback)
1193  return S_OK;
1194 }
static HANDLE complete_event
Definition: url.c:179
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define CHECK_EXPECT(func)
Definition: url.c:61
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static BOOL no_callback
Definition: url.c:184
#define S_OK
Definition: intsafe.h:59

◆ Protocol_QueryInterface()

static HRESULT WINAPI Protocol_QueryInterface ( IInternetProtocol iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 367 of file url.c.

368 {
369  static const IID IID_undocumentedIE10 = {0x7daf9908,0x8415,0x4005,{0x95,0xae,0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
370 
371  *ppv = NULL;
372 
373  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
374  *ppv = iface;
375  return S_OK;
376  }
377 
378  if(IsEqualGUID(&IID_IInternetPriority, riid)) {
380  return E_NOINTERFACE;
381 
382  *ppv = &InternetPriority;
383  return S_OK;
384  }
385 
386  if(IsEqualGUID(&IID_IInternetProtocolEx, riid))
387  return E_NOINTERFACE; /* TODO */
388 
389  if(IsEqualGUID(&IID_undocumentedIE10, riid)) {
390  trace("QI(%s)\n", wine_dbgstr_guid(riid));
391  return E_NOINTERFACE; /* TODO */
392  }
393 
394  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
395  return E_NOINTERFACE;
396 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static enum @1671 test_protocol
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_urlmon_protocol(int prot)
Definition: url.c:235
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IInternetPriority InternetPriority
Definition: url.c:365

◆ Protocol_Read()

static HRESULT WINAPI Protocol_Read ( IInternetProtocol iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 1100 of file url.c.

1102 {
1103  HRESULT hres;
1104 
1105  static const char data[] = "<HTML></HTML>";
1106 
1108 
1109  ok(pv != NULL, "pv == NULL\n");
1110  ok(cb != 0, "cb == 0\n");
1111  ok(pcbRead != NULL, "pcbRead == NULL\n");
1112 
1113  if(async_switch) {
1114  if(prot_state++ > 1) {
1115  *pcbRead = 0;
1116  return S_FALSE;
1117  } else {
1118  memset(pv, '?', cb);
1119  *pcbRead = cb;
1120  return S_OK;
1121  }
1122  }
1123 
1125  static BOOL pending = TRUE;
1126 
1127  pending = !pending;
1128 
1129  switch(prot_state) {
1130  case 1:
1131  case 2:
1132  if(pending) {
1133  *pcbRead = 10;
1134  memset(pv, '?', 10);
1135  if(prot_state == 2 && no_callback)
1137  return E_PENDING;
1138  }else {
1139  memset(pv, '?', cb);
1140  *pcbRead = cb;
1141  read++;
1142  return S_OK;
1143  }
1144  case 3:
1145  prot_state++;
1146 
1147  *pcbRead = 0;
1148 
1149  hres = IInternetProtocolSink_ReportData(protocol_sink,
1150  BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 2000, 2000);
1151  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1152 
1153  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1154  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1155 
1156  return S_FALSE;
1157  case 4:
1158  *pcbRead = 0;
1159  return S_FALSE;
1160  }
1161  }
1162 
1163  if(read) {
1164  *pcbRead = 0;
1165  return S_FALSE;
1166  }
1167 
1169  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1170  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1171 
1172  SET_EXPECT(OnStopBinding);
1173  }
1174 
1175  ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
1176  read += *pcbRead = sizeof(data)-1;
1177  memcpy(pv, data, sizeof(data));
1178  return S_OK;
1179 }
_In_ BOOLEAN Read
Definition: strmini.h:479
#define TRUE
Definition: types.h:120
static DWORD prot_state
Definition: url.c:174
static enum @1671 test_protocol
static HANDLE complete_event
Definition: url.c:179
#define SET_EXPECT(func)
Definition: url.c:52
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static BOOL no_callback
Definition: url.c:184
Definition: url.c:199
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
static DWORD read
Definition: url.c:174
#define ok(value,...)
Definition: atltest.h:57
static BOOL async_switch
Definition: url.c:191
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
#define E_PENDING
Definition: dinput.h:172
#define memset(x, y, z)
Definition: compat.h:39
#define CHECK_EXPECT2(func)
Definition: url.c:55

◆ Protocol_Release()

static ULONG WINAPI Protocol_Release ( IInternetProtocol iface)
static

Definition at line 403 of file url.c.

404 {
405  return 1;
406 }

◆ Protocol_Resume()

static HRESULT WINAPI Protocol_Resume ( IInternetProtocol iface)
static

Definition at line 1094 of file url.c.

1095 {
1096  ok(0, "unexpected call\n");
1097  return E_NOTIMPL;
1098 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Protocol_Seek()

static HRESULT WINAPI Protocol_Seek ( IInternetProtocol iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 1181 of file url.c.

1183 {
1184  ok(0, "unexpected call\n");
1185  return E_NOTIMPL;
1186 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Protocol_Start()

static HRESULT WINAPI Protocol_Start ( IInternetProtocol iface,
LPCWSTR  szUrl,
IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  grfPI,
HANDLE_PTR  dwReserved 
)
static

Definition at line 580 of file url.c.

583 {
584  BINDINFO bindinfo;
585  DWORD bind_info, bscf = BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION;
586  HRESULT hres;
587 
588  static const STGMEDIUM stgmed_zero = {0};
589  static const SECURITY_ATTRIBUTES sa_zero = {0};
590 
592 
593  read = 0;
594 
595  reported_url = szUrl;
596  if(!filedwl_api) /* FIXME */
597  ok(szUrl && !lstrcmpW(szUrl, current_url), "wrong url %s\n", wine_dbgstr_w(szUrl));
598  ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
599  ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
600  ok(grfPI == 0, "grfPI=%d, expected 0\n", grfPI);
601  ok(dwReserved == 0, "dwReserved=%lx, expected 0\n", dwReserved);
602 
603  if(!filedwl_api && binding_hres != S_OK) {
604  SET_EXPECT(OnStopBinding);
605  SET_EXPECT(Terminate);
606  hres = IInternetProtocolSink_ReportResult(pOIProtSink, binding_hres, 0, NULL);
607  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
608  CHECK_CALLED(OnStopBinding);
609  CHECK_CALLED(Terminate);
610 
611  return S_OK;
612  }
613 
614  memset(&bindinfo, 0, sizeof(bindinfo));
615  bindinfo.cbSize = 0;
616  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
617  ok(hres == E_INVALIDARG, "GetBindInfo returned: %08x, expected E_INVALIDARG\n", hres);
618 
619  memset(&bindinfo, 0, sizeof(bindinfo));
620  bindinfo.cbSize = sizeof(bindinfo);
621  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bind_info, &bindinfo);
622  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
623 
624  ok(bind_info & BINDF_FROMURLMON, "BINDF_FROMURLMON is not set\n");
625 
626  if(filedwl_api || !is_urlmon_protocol(test_protocol) || tymed != TYMED_ISTREAM ||
627  !(bindf&BINDF_ASYNCSTORAGE) || !(bindf&BINDF_PULLDATA))
628  ok(bind_info & BINDF_NEEDFILE, "BINDF_NEEDFILE is not set\n");
629  else if(test_protocol != MK_TEST) /* IE10 sets BINDF_NEEDFILE for mk: protocol */
630  ok(!(bind_info & BINDF_NEEDFILE), "BINDF_NEEDFILE is set\n");
631 
632  bind_info &= ~(BINDF_NEEDFILE|BINDF_FROMURLMON);
633  if(filedwl_api || no_callback)
634  ok(bind_info == BINDF_PULLDATA, "bind_info = %x, expected BINDF_PULLDATA\n", bind_info);
635  else
636  ok(bind_info == (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)), "bind_info = %x, expected %x\n",
637  bind_info, (bindf & ~(BINDF_NEEDFILE|BINDF_FROMURLMON)));
638 
639  ok(bindinfo.cbSize == sizeof(bindinfo), "bindinfo.cbSize = %d\n", bindinfo.cbSize);
640  ok(!bindinfo.szExtraInfo, "bindinfo.szExtraInfo = %p\n", bindinfo.szExtraInfo);
641  ok(!memcmp(&bindinfo.stgmedData, &stgmed_zero, sizeof(STGMEDIUM)), "wrong stgmedData\n");
642  ok(!bindinfo.grfBindInfoF, "bindinfo.grfBindInfoF = %d\n", bindinfo.grfBindInfoF);
643  ok(!bindinfo.dwBindVerb, "bindinfo.dwBindVerb = %d\n", bindinfo.dwBindVerb);
644  ok(!bindinfo.szCustomVerb, "bindinfo.szCustomVerb = %p\n", bindinfo.szCustomVerb);
645  ok(!bindinfo.cbstgmedData, "bindinfo.cbstgmedData = %d\n", bindinfo.cbstgmedData);
646  ok(bindinfo.dwOptions == (bind_to_object ? 0x100000 : 0), "bindinfo.dwOptions = %x\n", bindinfo.dwOptions);
647  ok(!bindinfo.dwOptionsFlags, "bindinfo.dwOptionsFlags = %d\n", bindinfo.dwOptionsFlags);
648  ok(!bindinfo.dwCodePage, "bindinfo.dwCodePage = %d\n", bindinfo.dwCodePage);
649  ok(!memcmp(&bindinfo.securityAttributes, &sa_zero, sizeof(sa_zero)), "wrong bindinfo.securityAttributes\n");
650  ok(IsEqualGUID(&bindinfo.iid, &IID_NULL), "wrong bindinfo.iid\n");
651  ok(!bindinfo.pUnk, "bindinfo.pUnk = %p\n", bindinfo.pUnk);
652  ok(!bindinfo.dwReserved, "bindinfo.dwReserved = %d\n", bindinfo.dwReserved);
653 
655  return E_FAIL;
656 
657  switch(test_protocol) {
658  case MK_TEST:
659  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
660  BINDSTATUS_DIRECTBIND, NULL);
661  ok(hres == S_OK,
662  "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
663 
664  case FILE_TEST:
665  case ITS_TEST:
666  if(bind_to_object)
667  SET_EXPECT(Obj_OnProgress_SENDINGREQUEST);
668  else
669  SET_EXPECT(OnProgress_SENDINGREQUEST);
670  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
671  BINDSTATUS_SENDINGREQUEST, emptyW);
672  ok(hres == S_OK,
673  "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
674  if(bind_to_object)
675  CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
676  else
677  CHECK_CALLED(OnProgress_SENDINGREQUEST);
678  case WINETEST_SYNC_TEST:
679  IInternetProtocolSink_AddRef(pOIProtSink);
680  protocol_sink = pOIProtSink;
681  default:
682  break;
683  }
684 
688  IHttpNegotiate2 *http_negotiate2;
690  LPWSTR ua = (LPWSTR)0xdeadbeef, accept_mimes[256];
691  LPWSTR additional_headers = (LPWSTR)0xdeadbeef;
692  BYTE sec_id[100];
693  DWORD fetched = 256, size = 100;
694  DWORD tid;
695 
696  static const WCHAR wszMimes[] = {'*','/','*',0};
697 
698  SET_EXPECT(QueryService_IInternetBindInfo);
699  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
700  &ua, 1, &fetched);
701  CLEAR_CALLED(QueryService_IInternetBindInfo); /* IE <8 */
702 
703  ok(hres == E_NOINTERFACE,
704  "GetBindString(BINDSTRING_USER_AGETNT) failed: %08x\n", hres);
705  ok(fetched == 256, "fetched = %d, expected 254\n", fetched);
706  ok(ua == (LPWSTR)0xdeadbeef, "ua = %p\n", ua);
707 
708  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
709  accept_mimes, 256, &fetched);
710  ok(hres == S_OK,
711  "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
712  ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
713  ok(!lstrcmpW(wszMimes, accept_mimes[0]), "unexpected mimes\n");
714  CoTaskMemFree(accept_mimes[0]);
715 
716  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
717  NULL, 256, &fetched);
718  ok(hres == E_INVALIDARG,
719  "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
720 
721  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
722  accept_mimes, 256, NULL);
723  ok(hres == E_INVALIDARG,
724  "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
725 
726  hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
727  (void**)&service_provider);
728  ok(hres == S_OK, "QueryInterface failed: %08x\n", hres);
729 
730  SET_EXPECT(QueryInterface_IHttpNegotiate);
731  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
732  &IID_IHttpNegotiate, (void**)&http_negotiate);
733  CLEAR_CALLED(QueryInterface_IHttpNegotiate); /* IE <8 */
734  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
735 
736  if(!no_callback) {
737  SET_EXPECT(BeginningTransaction);
738  SET_EXPECT(QueryInterface_IHttpNegotiate);
739  }
740  hres = IHttpNegotiate_BeginningTransaction(http_negotiate, current_url,
741  NULL, 0, &additional_headers);
742  if(!no_callback) {
743  CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
744  CHECK_CALLED(BeginningTransaction);
745  }
746  IHttpNegotiate_Release(http_negotiate);
747  ok(hres == S_OK, "BeginningTransction failed: %08x\n", hres);
748  ok(additional_headers == NULL, "additional_headers=%p\n", additional_headers);
749 
750  SET_EXPECT(QueryInterface_IHttpNegotiate2);
751  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
752  &IID_IHttpNegotiate2, (void**)&http_negotiate2);
753  CLEAR_CALLED(QueryInterface_IHttpNegotiate2); /* IE <8 */
754  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
755 
756  size = 512;
757  if(!no_callback) {
758  SET_EXPECT(QueryInterface_IHttpNegotiate2);
759  SET_EXPECT(GetRootSecurityId);
760  }
761  hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &size, 0);
762  if(!no_callback) {
763  CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate2);
764  CHECK_CALLED(GetRootSecurityId);
765  }
766  IHttpNegotiate2_Release(http_negotiate2);
767  ok(hres == E_FAIL, "GetRootSecurityId failed: %08x, expected E_FAIL\n", hres);
768  ok(size == (no_callback ? 512 : 13), "size=%d\n", size);
769 
770  if(!no_callback) {
771  SET_EXPECT(QueryService_IHttpSecurity);
772  SET_EXPECT(QueryInterface_IHttpSecurity);
773  }
774  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpSecurity,
775  &IID_IHttpSecurity, (void**)&http_security);
776  ok(hres == (no_callback ? E_NOINTERFACE : S_OK), "QueryService failed: 0x%08x\n", hres);
777  if(!no_callback) {
778  CHECK_CALLED(QueryService_IHttpSecurity);
779  CHECK_CALLED(QueryInterface_IHttpSecurity);
780  }
781 
782  IServiceProvider_Release(service_provider);
783 
784  IInternetProtocolSink_AddRef(pOIProtSink);
785  protocol_sink = pOIProtSink;
786 
787  if(async_switch) {
788  PROTOCOLDATA data;
789 
790  memset(&data, 0, sizeof(data));
791  data.grfFlags = PI_FORCE_ASYNC;
792  prot_state = 0;
793  hres = IInternetProtocolSink_Switch(pOIProtSink, &data);
794  ok(hres == S_OK, "Switch failed: %08x\n", hres);
797  return E_PENDING;
798  } else {
799  CreateThread(NULL, 0, thread_proc, NULL, 0, &tid);
800  return S_OK;
801  }
802  }
803 
804  if(test_protocol == FILE_TEST) {
805  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
806  BINDSTATUS_CACHEFILENAMEAVAILABLE, file_url+7);
807  ok(hres == S_OK,
808  "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
809 
810  if(bind_to_object)
811  SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
812  else
813  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
814  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
815  BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
816  ok(hres == S_OK,
817  "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
818  if(bind_to_object)
819  CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
820  else
821  CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
822  }else if(test_protocol == WINETEST_SYNC_TEST) {
823  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
824  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, wszTextHtml);
825  ok(hres == S_OK,
826  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
827  CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
828  }else {
829  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
830  ok(hres == S_OK,
831  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
832  }
833 
835  bscf |= BSCF_DATAFULLYAVAILABLE;
836  if(test_protocol == ITS_TEST)
837  bscf = BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
838 
839  SET_EXPECT(Read);
840  if(bind_to_object) {
842  SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
843  SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
844  if(test_protocol == FILE_TEST)
845  SET_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
846  SET_EXPECT(Obj_OnProgress_ENDDOWNLOADDATA);
847  SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
848  SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
849  SET_EXPECT(CreateInstance);
850  SET_EXPECT(PutProperty_MIMETYPEPROP);
851  SET_EXPECT(PutProperty_CLASSIDPROP);
852  SET_EXPECT(Load);
853  SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
854  SET_EXPECT(OnObjectAvailable);
855  SET_EXPECT(Obj_OnStopBinding);
856  }else {
858  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
859  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
860  if(test_protocol == FILE_TEST)
861  SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
862  SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
864  if(!filedwl_api)
865  SET_EXPECT(OnDataAvailable);
866  if(test_protocol != WINETEST_SYNC_TEST) /* Set in Read after ReportResult call */
867  SET_EXPECT(OnStopBinding);
868  }
869 
870  hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
871  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
872 
874  if(bind_to_object) {
876  CHECK_CALLED(Obj_OnProgress_MIMETYPEAVAILABLE);
877  CHECK_CALLED(Obj_OnProgress_BEGINDOWNLOADDATA);
878  if(test_protocol == FILE_TEST)
879  CHECK_CALLED(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
880  CHECK_CALLED(Obj_OnProgress_ENDDOWNLOADDATA);
881  CHECK_CALLED(Obj_OnProgress_CLASSIDAVAILABLE);
882  CHECK_CALLED(Obj_OnProgress_BEGINSYNCOPERATION);
883  CHECK_CALLED(CreateInstance);
884  CHECK_CALLED(PutProperty_MIMETYPEPROP);
885  CHECK_CALLED_BROKEN(PutProperty_CLASSIDPROP);
886  CHECK_CALLED(Load);
887  CHECK_CALLED(Obj_OnProgress_ENDSYNCOPERATION);
888  CHECK_CALLED(OnObjectAvailable);
889  CHECK_CALLED(Obj_OnStopBinding);
890  }else {
892  CHECK_CALLED(OnProgress_MIMETYPEAVAILABLE);
893  CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
894  if(test_protocol == FILE_TEST)
895  CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
896  CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
898  if(!filedwl_api)
899  CHECK_CALLED(OnDataAvailable);
900  CHECK_CALLED(OnStopBinding);
901  }
902 
903  if(test_protocol == ITS_TEST) {
904  SET_EXPECT(Read);
905  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA, NULL);
906  ok(hres == S_OK, "ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
908  }else if(!bind_to_object && test_protocol == FILE_TEST) {
909  SET_EXPECT(Read);
910  hres = IInternetProtocolSink_ReportData(pOIProtSink, bscf, 13, 13);
911  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
913  }
914 
916  SET_EXPECT(Terminate);
917  hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
918  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
919  CHECK_CALLED(Terminate);
920  }
921 
922  return S_OK;
923 }
static DWORD bindf
Definition: url.c:174
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
_In_ BOOLEAN Read
Definition: strmini.h:479
#define E_NOINTERFACE
Definition: winerror.h:2364
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static DWORD prot_state
Definition: url.c:174
static enum @1671 test_protocol
static BOOL filedwl_api
Definition: url.c:173
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define SET_EXPECT(func)
Definition: url.c:52
#define CHECK_EXPECT(func)
Definition: url.c:61
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
static BOOL no_callback
Definition: url.c:184
Definition: url.c:199
static const WCHAR emptyW[]
Definition: url.c:170
#define E_FAIL
Definition: ddrawi.h:102
static BOOL bind_to_object
Definition: url.c:173
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
Definition: url.c:202
#define E_INVALIDARG
Definition: ddrawi.h:101
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_urlmon_protocol(int prot)
Definition: url.c:235
static BOOL only_check_prot_args
Definition: url.c:187
static const WCHAR wszTextHtml[]
Definition: url.c:157
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define CHECK_CALLED_BROKEN(func)
Definition: url.c:79
static const WCHAR * reported_url
Definition: url.c:175
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HANDLE complete_event2
Definition: url.c:179
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: partlist.h:33
#define CLEAR_CALLED(func)
Definition: url.c:85
volatile int Continue
Definition: gdblib.c:102
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
#define IID_NULL
Definition: guiddef.h:98
unsigned char BYTE
Definition: mem.h:68
static HRESULT binding_hres
Definition: url.c:180
static LPWSTR
Definition: url.c:35
Definition: url.c:203
#define S_OK
Definition: intsafe.h:59
static DWORD tymed
Definition: url.c:174
static DWORD read
Definition: url.c:174
static IHttpSecurity http_security
Definition: protocol.c:294
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static BOOL async_switch
Definition: url.c:191
static IInternetBindInfo bind_info
Definition: mimeole.c:1273
static DWORD WINAPI thread_proc(PVOID arg)
Definition: url.c:430
Definition: url.c:201
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:395
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define E_PENDING
Definition: dinput.h:172
#define CHECK_CALLED(func)
Definition: url.c:67
#define memset(x, y, z)
Definition: compat.h:39
static TfClientId tid

◆ Protocol_Suspend()

static HRESULT WINAPI Protocol_Suspend ( IInternetProtocol iface)
static

Definition at line 1088 of file url.c.

1089 {
1090  ok(0, "unexpected call\n");
1091  return E_NOTIMPL;
1092 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Protocol_Terminate()

static HRESULT WINAPI Protocol_Terminate ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 1072 of file url.c.

1073 {
1074  CHECK_EXPECT(Terminate);
1075 
1076  ok(dwOptions == 0, "dwOptions=%d, expected 0\n", dwOptions);
1077 
1078  if(protocol_sink) {
1079  IInternetProtocolSink_Release(protocol_sink);
1080  protocol_sink = NULL;
1081  }
1082 
1083  if(no_callback)
1085  return S_OK;
1086 }
DWORD dwOptions
Definition: solitaire.cpp:23
static HANDLE complete_event
Definition: url.c:179
#define CHECK_EXPECT(func)
Definition: url.c:61
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static BOOL no_callback
Definition: url.c:184
smooth NULL
Definition: ftsmooth.c:416
static IInternetProtocolSink * protocol_sink
Definition: url.c:177
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ Protocol_UnlockRequest()

static HRESULT WINAPI Protocol_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 1196 of file url.c.

1197 {
1199  return S_OK;
1200 }
#define CHECK_EXPECT(func)
Definition: url.c:61
VOID UnlockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: lock.c:180
#define S_OK
Definition: intsafe.h:59

◆ ProtocolCF_CreateInstance()

static HRESULT WINAPI ProtocolCF_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2412 of file url.c.

2413 {
2414  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2415  return E_NOINTERFACE;
2416 
2417  ok(outer != NULL, "outer == NULL\n");
2418  ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2419  *ppv = &Protocol;
2420  return S_OK;
2421 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
static IInternetProtocol Protocol
Definition: url.c:1218
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ProtocolCF_QueryInterface()

static HRESULT WINAPI ProtocolCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2396 of file url.c.

2397 {
2398  *ppv = NULL;
2399 
2401  *ppv = iface;
2402  return S_OK;
2403  }
2404 
2405  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2406  return E_NOINTERFACE;
2407 
2408  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2409  return E_NOTIMPL;
2410 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ proxy_active()

static BOOL proxy_active ( void  )
static

Definition at line 216 of file url.c.

217 {
220  DWORD size;
221 
222  if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
224  return FALSE;
225 
226  size = sizeof(DWORD);
228  proxy_enable = 0;
229 
231 
232  return proxy_enable != 0;
233 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
static const WCHAR internet_settings[]
Definition: connections.c:35
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR proxy_enable[]
Definition: connections.c:39
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
static DWORD
Definition: url.c:34

Referenced by test_BindToStorage().

◆ register_protocols()

static void register_protocols ( void  )
static

Definition at line 3878 of file url.c.

3879 {
3881  HRESULT hres;
3882 
3883  static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
3884 
3885  hres = CoInternetGetSession(0, &session, 0);
3886  ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
3887  if(FAILED(hres))
3888  return;
3889 
3890  hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
3891  winetestW, 0, NULL, 0);
3892  ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
3893 
3894  IInternetSession_Release(session);
3895 }
HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppIInternetSession, DWORD dwReserved)
Definition: session.c:485
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR winetestW[]
Definition: shelldispatch.c:47
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static IClassFactory protocol_cf
Definition: url.c:2431
#define IID_NULL
Definition: guiddef.h:98
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 1393 of file url.c.

1394 {
1395  return 2;
1396 }

◆ ServiceProvider_QueryInterface()

static HRESULT WINAPI ServiceProvider_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1387 of file url.c.

1388 {
1389  ok(0, "unexpected call\n");
1390  return E_NOINTERFACE;
1391 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ ServiceProvider_QueryService()

static HRESULT WINAPI ServiceProvider_QueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1403 of file url.c.

1405 {
1406  if(IsEqualGUID(&IID_IAuthenticate, guidService)) {
1407  CHECK_EXPECT(QueryService_IAuthenticate);
1408  return E_NOTIMPL;
1409  }
1410 
1411  if(IsEqualGUID(&IID_IInternetProtocol, guidService)) {
1412  CHECK_EXPECT2(QueryService_IInternetProtocol);
1413  return E_NOTIMPL;
1414  }
1415 
1416  if(IsEqualGUID(&IID_IInternetBindInfo, guidService)) {
1417  CHECK_EXPECT(QueryService_IInternetBindInfo);
1418  return E_NOTIMPL;
1419  }
1420 
1421  if(IsEqualGUID(&IID_IWindowForBindingUI, guidService)) {
1422  CHECK_EXPECT2(QueryService_IWindowForBindingUI);
1423  *ppv = &HttpSecurity;
1424  return S_OK;
1425  }
1426 
1427  if(IsEqualGUID(&IID_IHttpSecurity, guidService)) {
1428  CHECK_EXPECT(QueryService_IHttpSecurity);
1429  *ppv = &HttpSecurity;
1430  return S_OK;
1431  }
1432 
1433  if(IsEqualGUID(&IID_IGetBindHandle, guidService)) {
1434  trace("QueryService(IID_IGetBindHandle)\n");
1435  *ppv = NULL;
1436  return E_NOINTERFACE;
1437  }
1438 
1439  if(IsEqualGUID(&IID_undocumentedIE11, guidService)) {
1440  trace("QueryService(IID_undocumentedIE11)\n");
1441  *ppv = NULL;
1442  return E_NOINTERFACE;
1443  }
1444 
1445  ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
1446  return E_NOINTERFACE;
1447 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static const IID IID_undocumentedIE11
Definition: url.c:46
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CHECK_EXPECT(func)
Definition: url.c:61
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
#define trace
Definition: atltest.h:70
#define S_OK
Definition: intsafe.h:59
static IHttpSecurity HttpSecurity
Definition: url.c:1385
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define CHECK_EXPECT2(func)
Definition: url.c:55

◆ ServiceProvider_Release()

static ULONG WINAPI ServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 1398 of file url.c.

1399 {
1400  return 1;
1401 }

◆ set_file_url()

static void set_file_url ( char path)
static

Definition at line 3682 of file url.c.

3683 {
3684  CHAR file_urlA[INTERNET_MAX_URL_LENGTH];
3685 
3686  lstrcpyA(file_urlA, "file://");
3687  lstrcatA(file_urlA, path);
3689 }
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:196
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1410
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by create_file().

◆ START_TEST()

START_TEST ( url  )

Definition at line 3923 of file url.c.

3924 {
3925  HMODULE hurlmon;
3926 
3927  hurlmon = GetModuleHandleA("urlmon.dll");
3928  pCreateAsyncBindCtxEx = (void*) GetProcAddress(hurlmon, "CreateAsyncBindCtxEx");
3929 
3930  if(!GetProcAddress(hurlmon, "CompareSecurityIds")) {
3931  win_skip("Too old IE\n");
3932  return;
3933  }
3934 
3935  pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
3936  if(!pCreateUri)
3937  win_skip("IUri not supported\n");
3938 
3942  create_html_file();
3945 
3946  test_create();
3947 
3948  trace("test CreateAsyncBindCtx...\n");
3950 
3951  trace("test CreateAsyncBindCtxEx...\n");
3953 
3954  trace("test RegisterBindStatusCallback...\n");
3956  trace("test BindToStorage failures...\n");
3958 
3959  trace("synchronous http test (COM not initialised)...\n");
3960  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3961 
3962  CoInitialize(NULL);
3963 
3964  trace("test StdURLMoniker...\n");
3966 
3967  trace("synchronous http test...\n");
3968  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3969 
3970  trace("emulated synchronous http test (to file)...\n");
3972 
3973  trace("synchronous http test (to object)...\n");
3975 
3976  trace("emulated synchronous http test (with cache)...\n");
3978 
3979  trace("emulated synchronous http test (with cache, no read)...\n");
3981 
3982  trace("synchronous http test (with cache, no read)...\n");
3984 
3985  trace("synchronous file test...\n");
3986  test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
3987 
3988  trace("emulated synchronous file test (to file)...\n");
3990 
3991  trace("synchronous file test (to object)...\n");
3993 
3994  trace("bind to an object of not registered MIME type...\n");
3995  create_file("test.winetest", "\x01\x02\x03xxxxxxxxxxxxxxxxxxxxxxxxx");
3997  create_html_file();
3998 
3999  trace("file test (no callback)...\n");
4001 
4002  if(can_do_https()) {
4003  trace("synchronous https test (invalid CN, dialog)\n");
4005  http_is_first = TRUE;
4007 
4008  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4009 
4010  trace("asynchronous https test (invalid CN, fail)\n");
4013 
4014  trace("asynchronous https test (invalid CN, accept)\n");
4017 
4018  trace("asynchronous https test (invalid CN, dialog 2)\n");
4022 
4023  trace("asynchronous https test...\n");
4024  test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM);
4025  }else {
4026  win_skip("Skipping https testt\n");
4027  }
4028 
4029  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4030 
4031  trace("winetest test (async switch)...\n");
4033 
4034  trace("about test (no read)...\n");
4036 
4037  trace("http test...\n");
4038  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
4039 
4040  trace("http test (to file)...\n");
4041  test_BindToStorage(HTTP_TEST, 0, TYMED_FILE);
4042 
4043  trace("http test (to object)...\n");
4045 
4046  trace("http test (short response)...\n");
4048 
4049  trace("http test (short response, to object)...\n");
4051 
4052  trace("http test (abort start binding E_NOTIMPL)...\n");
4055 
4056  trace("http test (abort start binding E_ABORT)...\n");
4057  abort_hres = E_ABORT;
4059 
4060  trace("http test (abort progress)...\n");
4062 
4063  trace("emulated http test...\n");
4065 
4066  trace("emulated http test (to object)...\n");
4068 
4069  trace("emulated http test (to object, redirect)...\n");
4071 
4072  trace("emulated http test (to file)...\n");
4074 
4075  trace("emulated http test (redirect)...\n");
4077 
4078  trace("emulated http test (with cache)...\n");
4080 
4081  trace("winetest test (no callback)...\n");
4083 
4084  trace("emulated https test...\n");
4086 
4087  trace("about test...\n");
4088  test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM);
4089 
4090  trace("about test (to file)...\n");
4091  test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE);
4092 
4093  trace("about test (to object)...\n");
4095 
4096  trace("emulated about test...\n");
4098 
4099  trace("emulated about test (to file)...\n");
4101 
4102  trace("emulated about test (to object)...\n");
4104 
4105  trace("emulalated test reporting result in read...\n");
4107 
4108  trace("file test...\n");
4109  test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
4110 
4111  trace("file test (to file)...\n");
4112  test_BindToStorage(FILE_TEST, 0, TYMED_FILE);
4113 
4114  trace("file test (to object)...\n");
4116 
4117  trace("emulated file test...\n");
4119 
4120  trace("emulated file test (to file)...\n");
4122 
4123  trace("emulated file test (to object)...\n");
4125 
4126  trace("emulated its test...\n");
4127  test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
4128 
4129  trace("emulated its test (to file)...\n");
4131 
4132  trace("emulated mk test...\n");
4133  test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
4134 
4135  trace("test URLDownloadToFile for file protocol...\n");
4137 
4138  trace("test URLDownloadToFile for emulated file protocol...\n");
4140 
4141  trace("test URLDownloadToFile for http protocol...\n");
4143 
4144  trace("test URLDownloadToFile abort...\n");
4146 
4147  trace("test emulated http abort...\n");
4149 
4150  bindf |= BINDF_NOWRITECACHE;
4151 
4152  trace("ftp test...\n");
4153  test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM);
4154 
4155  trace("test failures...\n");
4157 
4158  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE;
4159  only_check_prot_args = TRUE; /* Fail after checking arguments to Protocol_Start */
4160 
4161  trace("check emulated http protocol arguments...\n");
4163  }
4164 
4169  CoUninitialize();
4170 }
static DWORD bindf
Definition: url.c:174
static HRESULT abort_hres
Definition: url.c:182
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
static HANDLE complete_event
Definition: url.c:179
#define BINDTEST_REDIRECT
Definition: url.c:2857
static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
Definition: url.c:2933
#define BINDTEST_NO_CALLBACK_READ
Definition: url.c:2859
Definition: url.c:199
#define E_FAIL
Definition: ddrawi.h:102
static const char * test_file
Definition: url.c:194
#define BINDTEST_EMULATE
Definition: url.c:2853
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
static DWORD thread_id
Definition: url.c:174
static void test_CreateAsyncBindCtx(void)
Definition: url.c:2433
#define BINDTEST_ABORT
Definition: url.c:2861
static void test_CreateAsyncBindCtxEx(void)
Definition: url.c:2473
#define BINDTEST_USE_CACHE
Definition: url.c:2858
static void create_file(const char *file_name, const char *content)
Definition: url.c:3691
static BOOL test_RegisterBindStatusCallback(void)
Definition: url.c:2752
static void test_create(void)
Definition: url.c:276
Definition: url.c:202
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static BOOL only_check_prot_args
Definition: url.c:187
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define BINDTEST_HTTPRESPONSE
Definition: url.c:2856
#define trace
Definition: atltest.h:70
#define BINDTEST_NO_CALLBACK
Definition: url.c:2860
static HANDLE complete_event2
Definition: url.c:179
static void test_URLDownloadToFile(DWORD prot, BOOL emul)
Definition: url.c:3472
static void register_protocols(void)
Definition: url.c:3878
static void test_URLDownloadToFile_abort(void)
Definition: url.c:3575
Definition: url.c:205
static BOOL http_is_first
Definition: url.c:173
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
Definition: url.c:203
#define E_ABORT
Definition: winerror.h:2366
static const CHAR test_txtA[]
Definition: url.c:169
#define BINDTEST_INVALID_CN
Definition: url.c:2862
#define BINDTEST_ABORT_PROGRESS
Definition: url.c:2864
#define BINDTEST_ABORT_START
Definition: url.c:2863
#define BINDTEST_ALLOW_FINDINGRESOURCE
Definition: url.c:2866
#define S_OK
Definition: intsafe.h:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void create_cache_file(void)
Definition: url.c:3720
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void test_BindToObject(int protocol, DWORD flags, HRESULT exhres)
Definition: url.c:3269
#define GetProcAddress(x, y)
Definition: compat.h:418
Definition: url.c:201
static void test_StdURLMoniker(void)
Definition: url.c:3820
#define win_skip
Definition: test.h:150
static void create_html_file(void)
Definition: url.c:3715
static BOOL can_do_https(void)
Definition: url.c:3897
static void test_BindToStorage_fail(void)
Definition: url.c:3791
static HRESULT onsecurityproblem_hres
Definition: url.c:181
static BOOL invalid_cn_accepted
Definition: url.c:188
#define BINDTEST_ASYNC_SWITCH
Definition: url.c:2865

◆ statusclb_AddRef()

static ULONG WINAPI statusclb_AddRef ( IBindStatusCallbackEx iface)
static

Definition at line 1576 of file url.c.

1577 {
1578  return 2;
1579 }

◆ statusclb_GetBindInfo()

static HRESULT WINAPI statusclb_GetBindInfo ( IBindStatusCallbackEx iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo 
)
static

Definition at line 1943 of file url.c.

1944 {
1945  DWORD cbSize;
1946 
1947  if(iface == &objbsc)
1948  CHECK_EXPECT(Obj_GetBindInfo);
1949  else
1950  CHECK_EXPECT(GetBindInfo);
1951 
1952  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1953 
1954  *grfBINDF = bindf;
1955  cbSize = pbindinfo->cbSize;
1956  memset(pbindinfo, 0, cbSize);
1957  pbindinfo->cbSize = cbSize;
1958 
1959  return S_OK;
1960 }
static DWORD bindf
Definition: url.c:174
#define CHECK_EXPECT(func)
Definition: url.c:61
static DWORD thread_id
Definition: url.c:174
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static IBindStatusCallbackEx objbsc
Definition: url.c:1458
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define memset(x, y, z)
Definition: compat.h:39

◆ statusclb_GetBindInfoEx()

static HRESULT WINAPI statusclb_GetBindInfoEx ( IBindStatusCallbackEx iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo,
DWORD grfBINDF2,
DWORD pdwReserved 
)
static

Definition at line 2122 of file url.c.

2124 {
2125  CHECK_EXPECT(GetBindInfoEx);
2126 
2127  ok(grfBINDF != NULL, "grfBINDF == NULL\n");
2128  ok(grfBINDF2 != NULL, "grfBINDF2 == NULL\n");
2129  ok(pbindinfo != NULL, "pbindinfo == NULL\n");
2130  ok(pdwReserved != NULL, "dwReserved == NULL\n");
2131 
2132  return S_OK;
2133 }
#define CHECK_EXPECT(func)
Definition: url.c:61
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ statusclb_GetPriority()

static HRESULT WINAPI statusclb_GetPriority ( IBindStatusCallbackEx iface,
LONG pnPriority 
)
static

Definition at line 1644 of file url.c.

1645 {
1646  ok(0, "unexpected call\n");
1647  return E_NOTIMPL;
1648 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ statusclb_OnDataAvailable()

static HRESULT WINAPI statusclb_OnDataAvailable ( IBindStatusCallbackEx iface,
DWORD  grfBSCF,
DWORD  dwSize,
FORMATETC *  pformatetc,
STGMEDIUM *  pstgmed 
)
static

Definition at line 1987 of file url.c.

1989 {
1990  HRESULT hres;
1991  DWORD readed;
1992  BYTE buf[512];
1993  CHAR clipfmt[512];
1994 
1995  if(iface == &objbsc)
1996  ok(0, "unexpected call\n");
1997 
1998  CHECK_EXPECT2(OnDataAvailable);
1999 
2000  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2001 
2003  "Download state was %d, expected DOWNLOADING or END_DOWNLOAD\n",
2004  download_state);
2005  data_available = TRUE;
2006