ReactOS  0.4.13-dev-99-g7e18b6d
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 "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 2860 of file url.c.

◆ BINDTEST_ABORT_PROGRESS

#define BINDTEST_ABORT_PROGRESS   0x0800

Definition at line 2863 of file url.c.

◆ BINDTEST_ABORT_START

#define BINDTEST_ABORT_START   0x0400

Definition at line 2862 of file url.c.

◆ BINDTEST_ALLOW_FINDINGRESOURCE

#define BINDTEST_ALLOW_FINDINGRESOURCE   0x2000

Definition at line 2865 of file url.c.

◆ BINDTEST_ASYNC_SWITCH

#define BINDTEST_ASYNC_SWITCH   0x1000

Definition at line 2864 of file url.c.

◆ BINDTEST_EMULATE

#define BINDTEST_EMULATE   0x0001

Definition at line 2852 of file url.c.

◆ BINDTEST_FILEDWLAPI

#define BINDTEST_FILEDWLAPI   0x0004

Definition at line 2854 of file url.c.

◆ BINDTEST_HTTPRESPONSE

#define BINDTEST_HTTPRESPONSE   0x0008

Definition at line 2855 of file url.c.

◆ BINDTEST_INVALID_CN

#define BINDTEST_INVALID_CN   0x0200

Definition at line 2861 of file url.c.

◆ BINDTEST_NO_CALLBACK

#define BINDTEST_NO_CALLBACK   0x0080

Definition at line 2859 of file url.c.

◆ BINDTEST_NO_CALLBACK_READ

#define BINDTEST_NO_CALLBACK_READ   0x0040

Definition at line 2858 of file url.c.

◆ BINDTEST_REDIRECT

#define BINDTEST_REDIRECT   0x0010

Definition at line 2856 of file url.c.

◆ BINDTEST_TOOBJECT

#define BINDTEST_TOOBJECT   0x0002

Definition at line 2853 of file url.c.

◆ BINDTEST_USE_CACHE

#define BINDTEST_USE_CACHE   0x0020

Definition at line 2857 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 66 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 78 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 60 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 54 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 72 of file url.c.

◆ CLEAR_CALLED

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

Definition at line 84 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 48 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 51 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 197 of file url.c.

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

◆ anonymous enum

anonymous enum
Enumerator
BEFORE_DOWNLOAD 
DOWNLOADING 
END_DOWNLOAD 

Definition at line 209 of file url.c.

209  {
211  DOWNLOADING,
static enum @1645 download_state

Function Documentation

◆ can_do_https()

static BOOL can_do_https ( void  )
static

Definition at line 3889 of file url.c.

3890 {
3891  HINTERNET ses, con, req;
3892  BOOL ret;
3893 
3894  ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
3895  ok(ses != NULL, "InternetOpen failed\n");
3896 
3897  con = InternetConnectA(ses, "test.winehq.org", INTERNET_DEFAULT_HTTPS_PORT,
3898  NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
3899  ok(con != NULL, "InternetConnect failed\n");
3900 
3901  req = HttpOpenRequestA(con, "GET", "/tests/hello.html", NULL, NULL, NULL,
3903  ok(req != NULL, "HttpOpenRequest failed\n");
3904 
3905  ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
3907  "request failed: %u\n", GetLastError());
3908 
3909  InternetCloseHandle(req);
3910  InternetCloseHandle(con);
3911  InternetCloseHandle(ses);
3912  return ret;
3913 }
DWORD ret
Definition: url.c:448
#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:1344
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1437
BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5647
#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:1080
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
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
HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, LPCSTR lpszReferrer, LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:1467
#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 2360 of file url.c.

2361 {
2362  return 2;
2363 }

◆ ClassFactory_CreateInstance()

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

Definition at line 2370 of file url.c.

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

◆ ClassFactory_LockServer()

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

Definition at line 2379 of file url.c.

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

◆ ClassFactory_QueryInterface()

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

Definition at line 2342 of file url.c.

2343 {
2344  *ppv = NULL;
2345 
2347  *ppv = iface;
2348  return S_OK;
2349  }
2350 
2351  if(IsEqualGUID(&IID_IMarshal, riid))
2352  return E_NOINTERFACE;
2354  return E_NOINTERFACE;
2355 
2356  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2357  return E_NOTIMPL;
2358 }
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)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 2365 of file url.c.

2366 {
2367  return 1;
2368 }

◆ create_cache_file()

static void create_cache_file ( void  )
static

Definition at line 3712 of file url.c.

3713 {
3714  char buf[6500], curdir[MAX_PATH];
3715  HANDLE file;
3716  DWORD size;
3717 
3720  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3721  if(file == INVALID_HANDLE_VALUE)
3722  return;
3723 
3724  memset(buf, 'X', sizeof(buf));
3725  WriteFile(file, buf, sizeof(buf), &size, NULL);
3726  CloseHandle(file);
3727 
3728  memset(curdir, 0, sizeof(curdir));
3729  GetCurrentDirectoryA(MAX_PATH, curdir);
3730  lstrcatA(curdir, "\\");
3731  lstrcatA(curdir, test_txtA);
3732 
3734 }
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:398
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:391
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ok(value,...)
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:168
#define CREATE_ALWAYS
Definition: disk.h:72
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:184
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
#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 3683 of file url.c.

3684 {
3685  HANDLE file;
3686  DWORD size;
3687  CHAR path[MAX_PATH];
3688 
3691  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3692  if(file == INVALID_HANDLE_VALUE)
3693  return;
3694 
3695  if(test_file)
3697  test_file = file_name;
3699  CloseHandle(file);
3700 
3702  lstrcatA(path, "\\");
3704  set_file_url(path);
3705 }
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:398
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char CHAR
Definition: xmlstorage.h:175
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static const char * test_file
Definition: url.c:193
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ok(value,...)
content
Definition: atl_ax.c:994
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:3674
#define CREATE_ALWAYS
Definition: disk.h:72
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2145
Definition: services.c:325
static LPCWSTR file_name
Definition: protocol.c:146
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
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 3707 of file url.c.

3708 {
3709  create_file(wszIndexHtmlA, "<HTML></HTML>");
3710 }
static void create_file(const char *file_name, const char *content)
Definition: url.c:3683
static const CHAR wszIndexHtmlA[]
Definition: url.c:164

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 1232 of file url.c.

1233 {
1234  return 2;
1235 }

◆ HttpNegotiate_BeginningTransaction()

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

Definition at line 1242 of file url.c.

1244 {
1246  CHECK_EXPECT2(BeginningTransaction);
1247  else
1248  CHECK_EXPECT(BeginningTransaction);
1249 
1250  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1251 
1252  ok(!lstrcmpW(szURL, current_url), "szURL != current_url\n");
1253  ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
1254  ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
1255  if(pszAdditionalHeaders)
1256  ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
1257 
1258  return S_OK;
1259 }
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define CHECK_EXPECT(func)
Definition: url.c:60
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:195
static DWORD thread_id
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
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
#define S_OK
Definition: intsafe.h:59
#define CHECK_EXPECT2(func)
Definition: url.c:54
static HRESULT onsecurityproblem_hres
Definition: url.c:180

◆ HttpNegotiate_GetRootSecurityId()

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

Definition at line 1279 of file url.c.

1281 {
1282  static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
1283 
1284  CHECK_EXPECT(GetRootSecurityId);
1285 
1286  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1287 
1288  ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
1289  ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
1290  ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
1291 
1292  if(pbSecurityId == (void*)0xdeadbeef)
1293  return E_NOTIMPL;
1294 
1295  if(pcbSecurityId) {
1296  ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
1297  *pcbSecurityId = sizeof(sec_id);
1298  }
1299 
1300  if(pbSecurityId)
1301  memcpy(pbSecurityId, sec_id, sizeof(sec_id));
1302 
1303  return E_FAIL;
1304 }
#define CHECK_EXPECT(func)
Definition: url.c:60
#define E_FAIL
Definition: ddrawi.h:102
static DWORD thread_id
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
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#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 1261 of file url.c.

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

◆ HttpNegotiate_QueryInterface()

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

Definition at line 1219 of file url.c.

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

◆ HttpNegotiate_Release()

static ULONG WINAPI HttpNegotiate_Release ( IHttpNegotiate2 iface)
static

Definition at line 1237 of file url.c.

1238 {
1239  return 1;
1240 }

◆ HttpSecurity_AddRef()

static ULONG WINAPI HttpSecurity_AddRef ( IHttpSecurity iface)
static

Definition at line 1334 of file url.c.

1335 {
1336  return 2;
1337 }

◆ HttpSecurity_GetWindow()

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

Definition at line 1344 of file url.c.

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

◆ HttpSecurity_OnSecurityProblem()

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

Definition at line 1359 of file url.c.

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

◆ HttpSecurity_QueryInterface()

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

Definition at line 1317 of file url.c.

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

◆ HttpSecurity_Release()

static ULONG WINAPI HttpSecurity_Release ( IHttpSecurity iface)
static

Definition at line 1339 of file url.c.

1340 {
1341  return 1;
1342 }

◆ init_bind_test()

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

Definition at line 2867 of file url.c.

2868 {
2869  const char *url_a = NULL;
2870 
2878  mime_type[0] = 0;
2879  binding_hres = S_OK;
2881  tymed = t;
2884 
2885  switch(protocol) {
2886  case HTTP_TEST:
2887  if(post_test)
2888  url_a = "http://test.winehq.org/tests/post.php";
2889  else
2891  break;
2892  case ABOUT_TEST:
2893  url_a = "about:blank";
2894  break;
2895  case FILE_TEST:
2897  break;
2898  case MK_TEST:
2899  url_a = "mk:@MSITStore:test.chm::/blank.html";
2900  break;
2901  case ITS_TEST:
2902  url_a = "its:test.chm::/blank.html";
2903  break;
2904  case HTTPS_TEST:
2905  url_a = (flags & BINDTEST_INVALID_CN) ? "https://4.15.184.77/favicon.ico" : "https://test.winehq.org/tests/hello.html";
2906  break;
2907  case FTP_TEST:
2908  url_a = "ftp://ftp.winehq.org/welcome.msg";
2909  break;
2910  default:
2911  url_a = "winetest:test";
2912  }
2913 
2914  if(url_a)
2916 
2921  test_abort = (flags & BINDTEST_ABORT) != 0;
2926  prot_state = 0;
2928 
2929  trace("URL: %s\n", wine_dbgstr_w(current_url));
2930 }
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:195
#define trace(...)
Definition: kmt_test.h:217
#define BINDTEST_FILEDWLAPI
Definition: url.c:2854
static enum @1644 test_protocol
static DWORD prot_state
Definition: url.c:173
static HANDLE complete_event
Definition: url.c:178
static BOOL filedwl_api
Definition: url.c:172
#define BINDTEST_REDIRECT
Definition: url.c:2856
#define CP_ACP
Definition: compat.h:99
#define wine_dbgstr_w
Definition: kernel32.h:34
GLdouble GLdouble t
Definition: gl.h:2047
#define BINDTEST_NO_CALLBACK_READ
Definition: url.c:2858
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:195
static BOOL no_callback
Definition: url.c:183
static BOOL data_available
Definition: url.c:172
Definition: url.c:202
#define BINDTEST_EMULATE
Definition: url.c:2852
static BOOL callback_read
Definition: url.c:183
static BOOL is_async_prot
Definition: url.c:182
static BOOL stopped_binding
Definition: url.c:171
#define BINDTEST_ABORT
Definition: url.c:2860
static BOOL post_test
Definition: url.c:172
static BOOL bind_to_object
Definition: url.c:172
#define BINDTEST_USE_CACHE
Definition: url.c:2857
static BOOL emulate_protocol
Definition: url.c:171
static BOOL test_redirect
Definition: url.c:183
static DWORD bindtest_flags
Definition: url.c:192
static BOOL abort_progress
Definition: url.c:189
smooth NULL
Definition: ftsmooth.c:416
Definition: url.c:200
#define BINDTEST_HTTPRESPONSE
Definition: url.c:2855
Definition: url.c:201
static enum @1645 download_state
#define BINDTEST_NO_CALLBACK
Definition: url.c:2859
static const WCHAR winetest_data_urlW[]
Definition: url.c:151
GLbitfield flags
Definition: glext.h:7161
static HRESULT binding_hres
Definition: url.c:179
#define BINDTEST_INVALID_CN
Definition: url.c:2861
static BOOL stopped_obj_binding
Definition: url.c:171
#define BINDTEST_ABORT_PROGRESS
Definition: url.c:2863
#define BINDTEST_ABORT_START
Definition: url.c:2862
#define S_OK
Definition: intsafe.h:59
static DWORD tymed
Definition: url.c:173
#define lstrcpyW
Definition: compat.h:406
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: url.c:204
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:660
#define MultiByteToWideChar
Definition: compat.h:100
static BOOL async_switch
Definition: url.c:190
#define BINDTEST_TOOBJECT
Definition: url.c:2853
static CHAR mime_type[512]
Definition: url.c:175
static BOOL abort_start
Definition: url.c:188
Definition: url.c:198
static BOOL test_abort
Definition: url.c:183
#define BINDTEST_ASYNC_SWITCH
Definition: url.c:2864
static BOOL use_cache_file
Definition: url.c:183

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 234 of file url.c.

235 {
236  return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST;
237 }
Definition: url.c:202
Definition: url.c:200
Definition: url.c:204
Definition: url.c:198

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 2160 of file url.c.

2161 {
2162  return 2;
2163 }

◆ MonikerProp_PutProperty()

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

Definition at line 2170 of file url.c.

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

◆ MonikerProp_QueryInterface()

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

Definition at line 2153 of file url.c.

2154 {
2155  *ppv = NULL;
2156  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2157  return E_NOINTERFACE;
2158 }
#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)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416

◆ MonikerProp_Release()

static ULONG WINAPI MonikerProp_Release ( IMonikerProp iface)
static

Definition at line 2165 of file url.c.

2166 {
2167  return 1;
2168 }

◆ PersistMoniker_AddRef()

static ULONG WINAPI PersistMoniker_AddRef ( IPersistMoniker iface)
static

Definition at line 2212 of file url.c.

2213 {
2214  return 2;
2215 }

◆ PersistMoniker_GetClassID()

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

Definition at line 2222 of file url.c.

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

◆ PersistMoniker_GetCurMoniker()

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

Definition at line 2322 of file url.c.

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

◆ PersistMoniker_IsDirty()

static HRESULT WINAPI PersistMoniker_IsDirty ( IPersistMoniker iface)
static

Definition at line 2228 of file url.c.

2229 {
2230  ok(0, "unexpected call\n");
2231  return E_NOTIMPL;
2232 }
#define ok(value,...)
#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 2234 of file url.c.

2236 {
2237  IUnknown *unk;
2238  HRESULT hres;
2239 
2240  static WCHAR cbinding_contextW[] =
2241  {'C','B','i','n','d','i','n','g',' ','C','o','n','t','e','x','t',0};
2242 
2243  CHECK_EXPECT(Load);
2244  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2245 
2247  ok(!fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2248  else
2249  ok(fFullyAvailable, "fFullyAvailable = %x\n", fFullyAvailable);
2250  ok(pimkName != NULL, "pimkName == NULL\n");
2251  ok(pibc != NULL, "pibc == NULL\n");
2252  ok(grfMode == 0x12, "grfMode = %x\n", grfMode);
2253 
2254  hres = IBindCtx_GetObjectParam(pibc, cbinding_contextW, &unk);
2255  ok(hres == S_OK, "GetObjectParam(CBinding Context) failed: %08x\n", hres);
2256  if(SUCCEEDED(hres)) {
2257  IBinding *binding;
2258 
2259  hres = IUnknown_QueryInterface(unk, &IID_IBinding, (void**)&binding);
2260  ok(hres == S_OK, "Could not get IBinding: %08x\n", hres);
2261 
2262  IBinding_Release(binding);
2263  IUnknown_Release(unk);
2264  }
2265 
2266  SET_EXPECT(QueryInterface_IServiceProvider);
2268  ok(hres == S_OK, "RegisterBindStatusCallback failed: %08x\n", hres);
2269  CHECK_CALLED(QueryInterface_IServiceProvider);
2270 
2271  SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
2272  SET_EXPECT(GetBindInfo);
2273  SET_EXPECT(OnStartBinding);
2274  if(test_redirect)
2275  SET_EXPECT(OnProgress_REDIRECTING);
2276  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
2277  if(test_protocol == FILE_TEST)
2278  SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
2280  SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
2282  SET_EXPECT(OnDataAvailable);
2284  SET_EXPECT(OnStopBinding);
2285 
2286  hres = IMoniker_BindToStorage(pimkName, pibc, NULL, &IID_IStream, (void**)&unk);
2287  ok(hres == S_OK, "Load failed: %08x\n", hres);
2288 
2289  CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
2290  CHECK_CALLED(GetBindInfo);
2291  CHECK_CALLED(OnStartBinding);
2292  if(test_redirect)
2293  CHECK_CALLED(OnProgress_REDIRECTING);
2294  CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
2295  if(test_protocol == FILE_TEST)
2296  CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
2298  CHECK_CALLED(OnProgress_ENDDOWNLOADDATA);
2300  CHECK_CALLED(OnDataAvailable);
2302  CHECK_CALLED(OnStopBinding);
2303 
2304  if(unk)
2305  IUnknown_Release(unk);
2306 
2307  return S_OK;
2308 }
static WCHAR cbinding_contextW[]
Definition: binding.c:29
static enum @1644 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:51
#define CHECK_EXPECT(func)
Definition: url.c:60
static DWORD thread_id
Definition: url.c:173
static BOOL test_redirect
Definition: url.c:183
#define ok(value,...)
static IBindStatusCallbackEx bsc
Definition: url.c:2149
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
Definition: bindctx.c:615
Definition: url.c:200
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:84
OS_LOADING_METHOD Load
Definition: bootmgr.c:36
#define S_OK
Definition: intsafe.h:59
#define CHECK_CALLED(func)
Definition: url.c:66
Definition: url.c:198
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ PersistMoniker_QueryInterface()

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

Definition at line 2196 of file url.c.

2197 {
2198  *ppv = NULL;
2199 
2200  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IPersistMoniker, riid))
2201  *ppv = iface;
2202  else if(IsEqualGUID(&IID_IMonikerProp, riid))
2203  *ppv = &MonikerProp;
2204 
2205  if(*ppv)
2206  return S_OK;
2207 
2208  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2209  return E_NOINTERFACE;
2210 }
static IMonikerProp MonikerProp
Definition: url.c:2194
#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)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ PersistMoniker_Release()

static ULONG WINAPI PersistMoniker_Release ( IPersistMoniker iface)
static

Definition at line 2217 of file url.c.

2218 {
2219  return 1;
2220 }

◆ PersistMoniker_Save()

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

Definition at line 2310 of file url.c.

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

◆ PersistMoniker_SaveCompleted()

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

Definition at line 2316 of file url.c.

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

◆ Priority_AddRef()

static ULONG WINAPI Priority_AddRef ( IInternetPriority iface)
static

Definition at line 333 of file url.c.

334 {
335  return 2;
336 }

◆ Priority_GetPriority()

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

Definition at line 350 of file url.c.

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

◆ Priority_QueryInterface()

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

Definition at line 327 of file url.c.

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

◆ Priority_Release()

static ULONG WINAPI Priority_Release ( IInternetPriority iface)
static

Definition at line 338 of file url.c.

339 {
340  return 1;
341 }

◆ Priority_SetPriority()

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

Definition at line 343 of file url.c.

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

◆ Protocol_Abort()

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

Definition at line 1055 of file url.c.

1057 {
1058  HRESULT hres;
1059 
1060  CHECK_EXPECT(Abort);
1061 
1062  ok(hrReason == E_ABORT, "hrReason = %08x\n", hrReason);
1063  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
1064 
1065  hres = IInternetProtocolSink_ReportResult(protocol_sink, E_ABORT, ERROR_SUCCESS, NULL);
1066  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1067 
1068  return S_OK;
1069 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define ERROR_SUCCESS
Definition: deptool.c:10
#define CHECK_EXPECT(func)
Definition: url.c:60
#define ok(value,...)
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:176
#define E_ABORT
Definition: winerror.h:2366
#define S_OK
Definition: intsafe.h:59

◆ Protocol_AddRef()

static ULONG WINAPI Protocol_AddRef ( IInternetProtocol iface)
static

Definition at line 397 of file url.c.

398 {
399  return 2;
400 }

◆ Protocol_Continue()

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

Definition at line 924 of file url.c.

926 {
927  DWORD bscf = 0;
928  HRESULT hres;
929 
931 
932  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
933 
934  if(!bind_to_object)
936 
937  ok(pProtocolData != NULL, "pProtocolData == NULL\n");
938  if(!pProtocolData)
939  return S_OK;
940 
941  switch(prot_state) {
942  case 0:
943  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
944  BINDSTATUS_SENDINGREQUEST, NULL);
945  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
946 
947  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
948  BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
949  ok(hres == S_OK,
950  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
951 
952  bscf |= BSCF_FIRSTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION;
953  break;
954  case 1: {
957  static const WCHAR header[] = {'?',0};
958 
959  hres = IInternetProtocolSink_QueryInterface(protocol_sink, &IID_IServiceProvider,
960  (void**)&service_provider);
961  ok(hres == S_OK, "Could not get IServiceProvicder\n");
962 
963  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
964  &IID_IHttpNegotiate, (void**)&http_negotiate);
965  ok(hres == S_OK, "Could not get IHttpNegotiate\n");
966 
967  if(!no_callback) {
968  SET_EXPECT(QueryInterface_IHttpNegotiate);
969  SET_EXPECT(OnResponse);
970  }
971  hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
972  if(!no_callback) {
973  CHECK_CALLED_BROKEN(QueryInterface_IHttpNegotiate);
974  CHECK_CALLED(OnResponse);
975  }
976  IHttpNegotiate_Release(http_negotiate);
977  ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
978 
980  hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
981  ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n", hres);
982  }
983 
984  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
985  BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
986  ok(hres == S_OK,
987  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
988 
989  hres = IInternetProtocolSink_ReportProgress(protocol_sink,
990  BINDSTATUS_CACHEFILENAMEAVAILABLE, use_cache_file ? cache_file_name : cache_fileW);
991  ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
992 
993  bscf |= BSCF_FIRSTDATANOTIFICATION;
994  break;
995  }
996  case 2:
997  case 3:
998  bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
999  break;
1000  }
1001 
1002  hres = IInternetProtocolSink_ReportData(protocol_sink, bscf, 100, 400);
1003  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1004 
1005  if(prot_state != 2 || !test_abort)
1006  SET_EXPECT(Read);
1007  switch(prot_state) {
1008  case 0:
1009  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1010  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1011  SET_EXPECT(OnProgress_SENDINGREQUEST);
1012  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1013  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1015  SET_EXPECT(OnStopBinding);
1016  break;
1017  case 1:
1018  if(bind_to_object) {
1019  SET_EXPECT(Obj_OnProgress_MIMETYPEAVAILABLE);
1020  SET_EXPECT(Obj_OnProgress_BEGINDOWNLOADDATA);
1021  SET_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE);
1022  SET_EXPECT(Obj_OnProgress_BEGINSYNCOPERATION);
1023  SET_EXPECT(CreateInstance);
1024  SET_EXPECT(PutProperty_MIMETYPEPROP);
1025  SET_EXPECT(PutProperty_CLASSIDPROP);
1026  SET_EXPECT(Load);
1027  SET_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
1028  SET_EXPECT(OnObjectAvailable);
1029  SET_EXPECT(Obj_OnStopBinding);
1030  }else if(!no_callback) {
1031  SET_EXPECT(OnProgress_MIMETYPEAVAILABLE);
1032  SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
1034  }else {
1036  }
1037  break;
1038  case 2:
1039  if(!no_callback)
1040  SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1041  break;
1042  case 3:
1043  SET_EXPECT(OnProgress_DOWNLOADINGDATA);
1044  SET_EXPECT(OnProgress_ENDDOWNLOADDATA);
1045  }
1046  if(!no_callback) {
1047  if((!bind_to_object || prot_state >= 2) && (!test_abort || prot_state != 2))
1048  SET_EXPECT(OnDataAvailable);
1049  if(prot_state == 3 || (test_abort && prot_state == 2))
1050  SET_EXPECT(OnStopBinding);
1051  }
1052  return S_OK;
1053 }
_In_ BOOLEAN Read
Definition: strmini.h:479
static enum @1644 test_protocol
static DWORD prot_state
Definition: url.c:173
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 wine_dbgstr_w
Definition: kernel32.h:34
#define SET_EXPECT(func)
Definition: url.c:51
#define CHECK_EXPECT(func)
Definition: url.c:60
static WCHAR current_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:195
static BOOL no_callback
Definition: url.c:183
static DWORD thread_id
Definition: url.c:173
static BOOL bind_to_object
Definition: url.c:172
static const WCHAR cache_fileW[]
Definition: url.c:165
static BOOL test_redirect
Definition: url.c:183
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR wszTextHtml[]
Definition: url.c:156
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define CHECK_CALLED_BROKEN(func)
Definition: url.c:78
static const WCHAR * reported_url
Definition: url.c:174
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
OS_LOADING_METHOD Load
Definition: bootmgr.c:36
volatile int Continue
Definition: gdblib.c:102
static IInternetProtocolSink * protocol_sink
Definition: url.c:176
#define S_OK
Definition: intsafe.h:59
static WCHAR cache_file_name[MAX_PATH]
Definition: url.c:184
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:387
#define CHECK_CALLED(func)
Definition: url.c:66
struct CFHEADER header
Definition: fdi.c:109
static BOOL test_abort
Definition: url.c:183
static BOOL use_cache_file
Definition: url.c:183

◆ Protocol_LockRequest()

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

Definition at line 1187 of file url.c.

1188 {
1190  if(no_callback)
1192  return S_OK;
1193 }
static HANDLE complete_event
Definition: url.c:178
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define CHECK_EXPECT(func)
Definition: url.c:60
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
static BOOL no_callback
Definition: url.c:183
#define S_OK
Definition: intsafe.h:59

◆ Protocol_QueryInterface()

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

Definition at line 366 of file url.c.

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

◆ Protocol_Read()

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

Definition at line 1099 of file url.c.

1101 {
1102  HRESULT hres;
1103 
1104  static const char data[] = "<HTML></HTML>";
1105 
1107 
1108  ok(pv != NULL, "pv == NULL\n");
1109  ok(cb != 0, "cb == 0\n");
1110  ok(pcbRead != NULL, "pcbRead == NULL\n");
1111 
1112  if(async_switch) {
1113  if(prot_state++ > 1) {
1114  *pcbRead = 0;
1115  return S_FALSE;
1116  } else {
1117  memset(pv, '?', cb);
1118  *pcbRead = cb;
1119  return S_OK;
1120  }
1121  }
1122 
1124  static BOOL pending = TRUE;
1125 
1126  pending = !pending;
1127 
1128  switch(prot_state) {
1129  case 1:
1130  case 2:
1131  if(pending) {
1132  *pcbRead = 10;
1133  memset(pv, '?', 10);
1134  if(prot_state == 2 && no_callback)
1136  return E_PENDING;
1137  }else {
1138  memset(pv, '?', cb);
1139  *pcbRead = cb;
1140  read++;
1141  return S_OK;
1142  }
1143  case 3:
1144  prot_state++;
1145 
1146  *pcbRead = 0;
1147 
1148  hres = IInternetProtocolSink_ReportData(protocol_sink,
1149  BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 2000, 2000);
1150  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1151 
1152  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1153  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1154 
1155  return S_FALSE;
1156  case 4:
1157  *pcbRead = 0;
1158  return S_FALSE;
1159  }
1160  }
1161 
1162  if(read) {
1163  *pcbRead = 0;
1164  return S_FALSE;
1165  }
1166 
1168  hres = IInternetProtocolSink_ReportResult(protocol_sink, S_OK, 0, NULL);
1169  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1170 
1171  SET_EXPECT(OnStopBinding);
1172  }
1173 
1174  ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
1175  read += *pcbRead = sizeof(data)-1;
1176  memcpy(pv, data, sizeof(data));
1177  return S_OK;
1178 }
_In_ BOOLEAN Read
Definition: strmini.h:479
#define TRUE
Definition: types.h:120
static enum @1644 test_protocol
static DWORD prot_state
Definition: url.c:173
static HANDLE complete_event
Definition: url.c:178
#define SET_EXPECT(func)
Definition: url.c:51
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
static BOOL no_callback
Definition: url.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
#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
static DWORD cb
Definition: integrity.c:41
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static IInternetProtocolSink * protocol_sink
Definition: url.c:176
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
static DWORD read
Definition: url.c:173
static BOOL async_switch
Definition: url.c:190
#define E_PENDING
Definition: dinput.h:172
#define memset(x, y, z)
Definition: compat.h:39
Definition: url.c:198
#define CHECK_EXPECT2(func)
Definition: url.c:54

◆ Protocol_Release()

static ULONG WINAPI Protocol_Release ( IInternetProtocol iface)
static

Definition at line 402 of file url.c.

403 {
404  return 1;
405 }

◆ Protocol_Resume()

static HRESULT WINAPI Protocol_Resume ( IInternetProtocol iface)
static

Definition at line 1093 of file url.c.

1094 {
1095  ok(0, "unexpected call\n");
1096  return E_NOTIMPL;
1097 }
#define ok(value,...)
#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 1180 of file url.c.

1182 {
1183  ok(0, "unexpected call\n");
1184  return E_NOTIMPL;
1185 }
#define ok(value,...)
#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 579 of file url.c.

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

◆ Protocol_Suspend()

static HRESULT WINAPI Protocol_Suspend ( IInternetProtocol iface)
static

Definition at line 1087 of file url.c.

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

◆ Protocol_Terminate()

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

Definition at line 1071 of file url.c.

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

◆ Protocol_UnlockRequest()

static HRESULT WINAPI Protocol_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 1195 of file url.c.

1196 {
1198  return S_OK;
1199 }
#define CHECK_EXPECT(func)
Definition: url.c:60
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 2411 of file url.c.

2412 {
2413  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2414  return E_NOINTERFACE;
2415 
2416  ok(outer != NULL, "outer == NULL\n");
2417  ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2418  *ppv = &Protocol;
2419  return S_OK;
2420 }
#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:1217
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ ProtocolCF_QueryInterface()

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

Definition at line 2395 of file url.c.

2396 {
2397  *ppv = NULL;
2398 
2400  *ppv = iface;
2401  return S_OK;
2402  }
2403 
2404  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
2405  return E_NOINTERFACE;
2406 
2407  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2408  return E_NOTIMPL;
2409 }
#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)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ proxy_active()

static BOOL proxy_active ( void  )
static

Definition at line 215 of file url.c.

216 {
219  DWORD size;
220 
221  if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
223  return FALSE;
224 
225  size = sizeof(DWORD);
227  proxy_enable = 0;
228 
230 
231  return proxy_enable != 0;
232 }
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:4041
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:3346
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 3870 of file url.c.

3871 {
3872  IInternetSession *session;
3873  HRESULT hres;
3874 
3875  static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
3876 
3877  hres = CoInternetGetSession(0, &session, 0);
3878  ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
3879  if(FAILED(hres))
3880  return;
3881 
3882  hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
3883  winetestW, 0, NULL, 0);
3884  ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
3885 
3886  IInternetSession_Release(session);
3887 }
HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppIInternetSession, DWORD dwReserved)
Definition: session.c:485
#define ok(value,...)
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:2430
#define IID_NULL
Definition: guiddef.h:93
#define S_OK
Definition: intsafe.h:59

Referenced by START_TEST().

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 1392 of file url.c.

1393 {
1394  return 2;
1395 }

◆ ServiceProvider_QueryInterface()

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

Definition at line 1386 of file url.c.

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

◆ ServiceProvider_QueryService()

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

Definition at line 1402 of file url.c.

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

◆ ServiceProvider_Release()

static ULONG WINAPI ServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 1397 of file url.c.

1398 {
1399  return 1;
1400 }

◆ set_file_url()

static void set_file_url ( char path)
static

Definition at line 3674 of file url.c.

3675 {
3676  CHAR file_urlA[INTERNET_MAX_URL_LENGTH];
3677 
3678  lstrcpyA(file_urlA, "file://");
3679  lstrcatA(file_urlA, path);
3681 }
static WCHAR file_url[INTERNET_MAX_URL_LENGTH]
Definition: url.c:195
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1380
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by create_file().

◆ START_TEST()

START_TEST ( url  )

Definition at line 3915 of file url.c.

3916 {
3917  HMODULE hurlmon;
3918 
3919  hurlmon = GetModuleHandleA("urlmon.dll");
3920  pCreateAsyncBindCtxEx = (void*) GetProcAddress(hurlmon, "CreateAsyncBindCtxEx");
3921 
3922  if(!GetProcAddress(hurlmon, "CompareSecurityIds")) {
3923  win_skip("Too old IE\n");
3924  return;
3925  }
3926 
3927  pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
3928  if(!pCreateUri)
3929  win_skip("IUri not supported\n");
3930 
3934  create_html_file();
3937 
3938  test_create();
3939 
3940  trace("test CreateAsyncBindCtx...\n");
3942 
3943  trace("test CreateAsyncBindCtxEx...\n");
3945 
3946  trace("test RegisterBindStatusCallback...\n");
3948  trace("test BindToStorage failures...\n");
3950 
3951  trace("synchronous http test (COM not initialised)...\n");
3952  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3953 
3954  CoInitialize(NULL);
3955 
3956  trace("test StdURLMoniker...\n");
3958 
3959  trace("synchronous http test...\n");
3960  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
3961 
3962  trace("emulated synchronous http test (to file)...\n");
3964 
3965  trace("synchronous http test (to object)...\n");
3967 
3968  trace("emulated synchronous http test (with cache)...\n");
3970 
3971  trace("emulated synchronous http test (with cache, no read)...\n");
3973 
3974  trace("synchronous http test (with cache, no read)...\n");
3976 
3977  trace("synchronous file test...\n");
3978  test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
3979 
3980  trace("emulated synchronous file test (to file)...\n");
3982 
3983  trace("synchronous file test (to object)...\n");
3985 
3986  trace("bind to an object of not registered MIME type...\n");
3987  create_file("test.winetest", "\x01\x02\x03xxxxxxxxxxxxxxxxxxxxxxxxx");
3989  create_html_file();
3990 
3991  trace("file test (no callback)...\n");
3993 
3994  if(can_do_https()) {
3995  trace("synchronous https test (invalid CN, dialog)\n");
3997  http_is_first = TRUE;
3999 
4000  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4001 
4002  trace("asynchronous https test (invalid CN, fail)\n");
4005 
4006  trace("asynchronous https test (invalid CN, accept)\n");
4009 
4010  trace("asynchronous https test (invalid CN, dialog 2)\n");
4014 
4015  trace("asynchronous https test...\n");
4016  test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM);
4017  }else {
4018  win_skip("Skipping https testt\n");
4019  }
4020 
4021  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
4022 
4023  trace("winetest test (async switch)...\n");
4025 
4026  trace("about test (no read)...\n");
4028 
4029  trace("http test...\n");
4030  test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
4031 
4032  trace("http test (to file)...\n");
4033  test_BindToStorage(HTTP_TEST, 0, TYMED_FILE);
4034 
4035  trace("http test (to object)...\n");
4037 
4038  trace("http test (short response)...\n");
4040 
4041  trace("http test (short response, to object)...\n");
4043 
4044  trace("http test (abort start binding E_NOTIMPL)...\n");
4047 
4048  trace("http test (abort start binding E_ABORT)...\n");
4049  abort_hres = E_ABORT;
4051 
4052  trace("http test (abort progress)...\n");
4054 
4055  trace("emulated http test...\n");
4057 
4058  trace("emulated http test (to object)...\n");
4060 
4061  trace("emulated http test (to object, redirect)...\n");
4063 
4064  trace("emulated http test (to file)...\n");
4066 
4067  trace("emulated http test (redirect)...\n");
4069 
4070  trace("emulated http test (with cache)...\n");
4072 
4073  trace("winetest test (no callback)...\n");
4075 
4076  trace("emulated https test...\n");
4078 
4079  trace("about test...\n");
4080  test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM);
4081 
4082  trace("about test (to file)...\n");
4083  test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE);
4084 
4085  trace("about test (to object)...\n");
4087 
4088  trace("emulated about test...\n");
4090 
4091  trace("emulated about test (to file)...\n");
4093 
4094  trace("emulated about test (to object)...\n");
4096 
4097  trace("emulalated test reporting result in read...\n");
4099 
4100  trace("file test...\n");
4101  test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
4102 
4103  trace("file test (to file)...\n");
4104  test_BindToStorage(FILE_TEST, 0, TYMED_FILE);
4105 
4106  trace("file test (to object)...\n");
4108 
4109  trace("emulated file test...\n");
4111 
4112  trace("emulated file test (to file)...\n");
4114 
4115  trace("emulated file test (to object)...\n");
4117 
4118  trace("emulated its test...\n");
4119  test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
4120 
4121  trace("emulated its test (to file)...\n");
4123 
4124  trace("emulated mk test...\n");
4125  test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
4126 
4127  trace("test URLDownloadToFile for file protocol...\n");
4129 
4130  trace("test URLDownloadToFile for emulated file protocol...\n");
4132 
4133  trace("test URLDownloadToFile for http protocol...\n");
4135 
4136  trace("test URLDownloadToFile abort...\n");
4138 
4139  trace("test emulated http abort...\n");
4141 
4142  bindf |= BINDF_NOWRITECACHE;
4143 
4144  trace("ftp test...\n");
4145  test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM);
4146 
4147  trace("test failures...\n");
4149 
4150  bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE;
4151  only_check_prot_args = TRUE; /* Fail after checking arguments to Protocol_Start */
4152 
4153  trace("check emulated http protocol arguments...\n");
4155  }
4156 
4161  CoUninitialize();
4162 }
static DWORD bindf
Definition: url.c:173
static HRESULT abort_hres
Definition: url.c:181
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static HANDLE complete_event
Definition: url.c:178
#define BINDTEST_REDIRECT
Definition: url.c:2856
static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
Definition: url.c:2932
#define BINDTEST_NO_CALLBACK_READ
Definition: url.c:2858
#define E_FAIL
Definition: ddrawi.h:102
static const char * test_file
Definition: url.c:193
Definition: url.c:202
#define BINDTEST_EMULATE
Definition: url.c:2852
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static DWORD thread_id
Definition: url.c:173
static void test_CreateAsyncBindCtx(void)
Definition: url.c:2432
#define BINDTEST_ABORT
Definition: url.c:2860
static void test_CreateAsyncBindCtxEx(void)
Definition: url.c:2472
#define BINDTEST_USE_CACHE
Definition: url.c:2857
static void create_file(const char *file_name, const char *content)
Definition: url.c:3683
static BOOL test_RegisterBindStatusCallback(void)
Definition: url.c:2751
static void test_create(void)
Definition: url.c:275
#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:186
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
Definition: url.c:200
#define BINDTEST_HTTPRESPONSE
Definition: url.c:2855
Definition: url.c:201
#define BINDTEST_NO_CALLBACK
Definition: url.c:2859
static HANDLE complete_event2
Definition: url.c:178
static void test_URLDownloadToFile(DWORD prot, BOOL emul)
Definition: url.c:3464
static void register_protocols(void)
Definition: url.c:3870
static void test_URLDownloadToFile_abort(void)
Definition: url.c:3567
static BOOL http_is_first
Definition: url.c:172
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define E_ABORT
Definition: winerror.h:2366
static const CHAR test_txtA[]
Definition: url.c:168
#define BINDTEST_INVALID_CN
Definition: url.c:2861
#define BINDTEST_ABORT_PROGRESS
Definition: url.c:2863
#define BINDTEST_ABORT_START
Definition: url.c:2862
#define BINDTEST_ALLOW_FINDINGRESOURCE
Definition: url.c:2865
#define S_OK
Definition: intsafe.h:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
static void create_cache_file(void)
Definition: url.c:3712
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: url.c:204
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
static void test_BindToObject(int protocol, DWORD flags, HRESULT exhres)
Definition: url.c:3261
#define GetProcAddress(x, y)
Definition: compat.h:410
static void test_StdURLMoniker(void)
Definition: url.c:3812
Definition: url.c:198
#define win_skip
Definition: test.h:141
static void create_html_file(void)
Definition: url.c:3707
static BOOL can_do_https(void)
Definition: url.c:3889
static void test_BindToStorage_fail(void)
Definition: url.c:3783
static HRESULT onsecurityproblem_hres
Definition: url.c:180
static BOOL invalid_cn_accepted
Definition: url.c:187
#define BINDTEST_ASYNC_SWITCH
Definition: url.c:2864

◆ statusclb_AddRef()

static ULONG WINAPI statusclb_AddRef ( IBindStatusCallbackEx iface)
static

Definition at line 1575 of file url.c.

1576 {
1577  return 2;
1578 }

◆ statusclb_GetBindInfo()

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

Definition at line 1942 of file url.c.

1943 {
1944  DWORD cbSize;
1945 
1946  if(iface == &objbsc)
1947  CHECK_EXPECT(Obj_GetBindInfo);
1948  else
1949  CHECK_EXPECT(GetBindInfo);
1950 
1951  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
1952 
1953  *grfBINDF = bindf;
1954  cbSize = pbindinfo->cbSize;
1955  memset(pbindinfo, 0, cbSize);
1956  pbindinfo->cbSize = cbSize;
1957 
1958  return S_OK;
1959 }
static DWORD bindf
Definition: url.c:173
#define CHECK_EXPECT(func)
Definition: url.c:60
static DWORD thread_id
Definition: url.c:173
#define ok(value,...)
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
static IBindStatusCallbackEx objbsc
Definition: url.c:1457
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#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 2121 of file url.c.

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

◆ statusclb_GetPriority()

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

Definition at line 1643 of file url.c.

1644 {
1645  ok(0, "unexpected call\n");
1646  return E_NOTIMPL;
1647 }
#define ok(value,...)
#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 1986 of file url.c.

1988 {
1989  HRESULT hres;
1990  DWORD readed;
1991  BYTE buf[512];
1992  CHAR clipfmt[512];
1993 
1994  if(iface == &objbsc)
1995  ok(0, "unexpected call\n");
1996 
1997  CHECK_EXPECT2(OnDataAvailable);
1998 
1999  ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
2000 
2001  ok(