ReactOS  0.4.14-dev-41-g31d7680
protocol.c File Reference
#include <wine/test.h>
#include <wine/heap.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "urlmon.h"
#include "wininet.h"
Include dependency graph for protocol.c:

Go to the source code of this file.

Classes

struct  Protocol
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define DEFINE_EXPECT(func)   static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)   expect_ ## func = TRUE
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define CHECK_NOT_CALLED(func)
 
#define CLEAR_CALLED(func)   expect_ ## func = called_ ## func = FALSE
 
#define TEST_BINDING   0x0001
 
#define TEST_FILTER   0x0002
 
#define TEST_FIRST_HTTP   0x0004
 
#define TEST_DIRECT_READ   0x0008
 
#define TEST_POST   0x0010
 
#define TEST_EMULATEPROT   0x0020
 
#define TEST_SHORT_READ   0x0040
 
#define TEST_REDIRECT   0x0080
 
#define TEST_ABORT   0x0100
 
#define TEST_ASYNCREQ   0x0200
 
#define TEST_USEIURI   0x0400
 
#define TEST_IMPLPROTEX   0x0800
 
#define TEST_EMPTY   0x1000
 
#define TEST_NOMIME   0x2000
 
#define TEST_FROMCACHE   0x4000
 
#define TEST_DISABLEAUTOREDIRECT   0x8000
 

Enumerations

enum  { STATE_CONNECTING, STATE_SENDINGREQUEST, STATE_STARTDOWNLOADING, STATE_DOWNLOADING }
 
enum  {
  FILE_TEST, HTTP_TEST, HTTPS_TEST, FTP_TEST,
  MK_TEST, ITS_TEST, BIND_TEST
}
 

Functions

static HRESULT (WINAPI *pCoInternetGetSession)(DWORD
 
 DEFINE_EXPECT (GetBindInfo)
 
 DEFINE_EXPECT (ReportProgress_MIMETYPEAVAILABLE)
 
 DEFINE_EXPECT (ReportProgress_DIRECTBIND)
 
 DEFINE_EXPECT (ReportProgress_RAWMIMETYPE)
 
 DEFINE_EXPECT (ReportProgress_FINDINGRESOURCE)
 
 DEFINE_EXPECT (ReportProgress_CONNECTING)
 
 DEFINE_EXPECT (ReportProgress_SENDINGREQUEST)
 
 DEFINE_EXPECT (ReportProgress_CACHEFILENAMEAVAILABLE)
 
 DEFINE_EXPECT (ReportProgress_VERIFIEDMIMETYPEAVAILABLE)
 
 DEFINE_EXPECT (ReportProgress_PROTOCOLCLASSID)
 
 DEFINE_EXPECT (ReportProgress_COOKIE_SENT)
 
 DEFINE_EXPECT (ReportProgress_REDIRECTING)
 
 DEFINE_EXPECT (ReportProgress_ENCODING)
 
 DEFINE_EXPECT (ReportProgress_ACCEPTRANGES)
 
 DEFINE_EXPECT (ReportProgress_PROXYDETECTING)
 
 DEFINE_EXPECT (ReportProgress_LOADINGMIMEHANDLER)
 
 DEFINE_EXPECT (ReportProgress_DECODING)
 
 DEFINE_EXPECT (ReportData)
 
 DEFINE_EXPECT (ReportData2)
 
 DEFINE_EXPECT (ReportResult)
 
 DEFINE_EXPECT (GetBindString_ACCEPT_MIMES)
 
 DEFINE_EXPECT (GetBindString_USER_AGENT)
 
 DEFINE_EXPECT (GetBindString_POST_COOKIE)
 
 DEFINE_EXPECT (GetBindString_URL)
 
 DEFINE_EXPECT (GetBindString_ROOTDOC_URL)
 
 DEFINE_EXPECT (QueryService_HttpNegotiate)
 
 DEFINE_EXPECT (QueryService_InternetProtocol)
 
 DEFINE_EXPECT (QueryService_HttpSecurity)
 
 DEFINE_EXPECT (QueryService_IBindCallbackRedirect)
 
 DEFINE_EXPECT (QueryInterface_IWinInetInfo)
 
 DEFINE_EXPECT (QueryInterface_IWinInetHttpInfo)
 
 DEFINE_EXPECT (BeginningTransaction)
 
 DEFINE_EXPECT (GetRootSecurityId)
 
 DEFINE_EXPECT (OnResponse)
 
 DEFINE_EXPECT (Switch)
 
 DEFINE_EXPECT (Continue)
 
 DEFINE_EXPECT (CreateInstance)
 
 DEFINE_EXPECT (Start)
 
 DEFINE_EXPECT (StartEx)
 
 DEFINE_EXPECT (Terminate)
 
 DEFINE_EXPECT (Read)
 
 DEFINE_EXPECT (Read2)
 
 DEFINE_EXPECT (SetPriority)
 
 DEFINE_EXPECT (LockRequest)
 
 DEFINE_EXPECT (UnlockRequest)
 
 DEFINE_EXPECT (Abort)
 
 DEFINE_EXPECT (MimeFilter_CreateInstance)
 
 DEFINE_EXPECT (MimeFilter_Start)
 
 DEFINE_EXPECT (MimeFilter_ReportData)
 
 DEFINE_EXPECT (MimeFilter_ReportResult)
 
 DEFINE_EXPECT (MimeFilter_Terminate)
 
 DEFINE_EXPECT (MimeFilter_LockRequest)
 
 DEFINE_EXPECT (MimeFilter_UnlockRequest)
 
 DEFINE_EXPECT (MimeFilter_Read)
 
 DEFINE_EXPECT (MimeFilter_Switch)
 
 DEFINE_EXPECT (MimeFilter_Continue)
 
 DEFINE_EXPECT (Stream_Seek)
 
 DEFINE_EXPECT (Stream_Read)
 
 DEFINE_EXPECT (Redirect)
 
 DEFINE_EXPECT (outer_QI_test)
 
 DEFINE_EXPECT (Protocol_destructor)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static const charw2a (LPCWSTR str)
 
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 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 BindCallbackRedirect_QueryInterface (IBindCallbackRedirect *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindCallbackRedirect_AddRef (IBindCallbackRedirect *iface)
 
static ULONG WINAPI BindCallbackRedirect_Release (IBindCallbackRedirect *iface)
 
static HRESULT WINAPI BindCallbackRedirect_Redirect (IBindCallbackRedirect *iface, const WCHAR *url, VARIANT_BOOL *cancel)
 
static HRESULT QueryInterface (REFIID, void **)
 
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 HRESULT WINAPI Stream_QueryInterface (IStream *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Stream_AddRef (IStream *iface)
 
static ULONG WINAPI Stream_Release (IStream *iface)
 
static HRESULT WINAPI Stream_Read (IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI Stream_Write (IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
 
static HRESULT WINAPI Stream_Seek (IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI Stream_SetSize (IStream *iface, ULARGE_INTEGER libNewSize)
 
static HRESULT WINAPI Stream_CopyTo (IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
 
static HRESULT WINAPI Stream_Commit (IStream *iface, DWORD grfCommitFlags)
 
static HRESULT WINAPI Stream_Revert (IStream *iface)
 
static HRESULT WINAPI Stream_LockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI Stream_UnlockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI Stream_Stat (IStream *iface, STATSTG *pstatstg, DWORD dwStatFlag)
 
static HRESULT WINAPI Stream_Clone (IStream *iface, IStream **ppstm)
 
static HRESULT WINAPI ProtocolSink_QueryInterface (IInternetProtocolSink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ProtocolSink_AddRef (IInternetProtocolSink *iface)
 
static ULONG WINAPI ProtocolSink_Release (IInternetProtocolSink *iface)
 
static void call_continue (PROTOCOLDATA *protocol_data)
 
static HRESULT WINAPI ProtocolSink_Switch (IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI ProtocolSink_ReportProgress (IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static void test_http_info (IInternetProtocol *protocol)
 
static HRESULT WINAPI ProtocolSink_ReportData (IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
 
static HRESULT WINAPI ProtocolSink_ReportResult (IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
 
static HRESULT WINAPI MimeProtocolSink_QueryInterface (IInternetProtocolSink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MimeProtocolSink_AddRef (IInternetProtocolSink *iface)
 
static ULONG WINAPI MimeProtocolSink_Release (IInternetProtocolSink *iface)
 
static HRESULT WINAPI MimeProtocolSink_Switch (IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI MimeProtocolSink_ReportProgress (IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static HRESULT WINAPI MimeProtocolSink_ReportData (IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
 
static HRESULT WINAPI MimeProtocolSink_ReportResult (IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
 
static HRESULT WINAPI BindInfo_QueryInterface (IInternetBindInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindInfo_AddRef (IInternetBindInfo *iface)
 
static ULONG WINAPI BindInfo_Release (IInternetBindInfo *iface)
 
static HRESULT WINAPI BindInfo_GetBindInfo (IInternetBindInfo *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static HRESULT WINAPI BindInfo_GetBindString (IInternetBindInfo *iface, ULONG ulStringType, LPOLESTR *ppwzStr, ULONG cEl, ULONG *pcElFetched)
 
static Protocolimpl_from_IInternetPriority (IInternetPriority *iface)
 
static HRESULT WINAPI InternetPriority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InternetPriority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI InternetPriority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI InternetPriority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI InternetPriority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
static ULONG WINAPI Protocol_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI Protocol_Release (IInternetProtocolEx *iface)
 
static HRESULT WINAPI Protocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI Protocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI Protocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI Protocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static Protocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static HRESULT WINAPI ProtocolEmul_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ProtocolEmul_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI ProtocolEmul_Release (IInternetProtocolEx *iface)
 
static DWORD WINAPI thread_proc (PVOID arg)
 
static void protocol_start (IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD pi)
 
static HRESULT WINAPI ProtocolEmul_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI ProtocolEmul_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI ProtocolEmul_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI ProtocolEmul_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI ProtocolEmul_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI ProtocolEmul_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI ProtocolEmul_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
static Protocolimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI ProtocolUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ProtocolUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI ProtocolUnk_Release (IUnknown *iface)
 
static HRESULT WINAPI MimeProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI MimeProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI Protocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI MimeProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI MimeProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI MimeProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI MimeProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI InternetProtocolInfo_QueryInterface (IInternetProtocolInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InternetProtocolInfo_AddRef (IInternetProtocolInfo *iface)
 
static ULONG WINAPI InternetProtocolInfo_Release (IInternetProtocolInfo *iface)
 
static HRESULT WINAPI InternetProtocolInfo_ParseUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI InternetProtocolInfo_CombineUrl (IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI InternetProtocolInfo_CompareUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
 
static HRESULT WINAPI InternetProtocolInfo_QueryInfo (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
 
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 *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static HRESULT WINAPI MimeFilter_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static void register_filter (BOOL do_register)
 
static void init_test (int prot, DWORD flags)
 
static void test_priority (IInternetProtocol *protocol)
 
static void test_early_abort (const CLSID *clsid)
 
static BOOL file_protocol_start (IInternetProtocol *protocol, LPCWSTR url, IInternetProtocolEx *protocolex, IUri *uri, BOOL is_first)
 
static void test_file_protocol_url (LPCWSTR url)
 
static void test_file_protocol_fail (void)
 
static void test_file_protocol (void)
 
static void create_cache_entry (const WCHAR *urlw)
 
static BOOL http_protocol_start (LPCWSTR url, BOOL use_iuri)
 
static void test_protocol_terminate (IInternetProtocol *protocol)
 
static void test_http_protocol_url (LPCWSTR url, int prot, DWORD flags, DWORD tymed)
 
static void test_http_protocol (void)
 
static void test_https_protocol (void)
 
static void test_ftp_protocol (void)
 
static void test_gopher_protocol (void)
 
static void test_mk_protocol (void)
 
static void test_CreateBinding (void)
 
static void test_binding (int prot, DWORD grf_pi, DWORD test_flags)
 
static HRESULT WINAPI outer_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI outer_AddRef (IUnknown *iface)
 
static ULONG WINAPI outer_Release (IUnknown *iface)
 
static void test_com_aggregation (const CLSID *clsid)
 
 START_TEST (protocol)
 

Variables

static IInternetSession DWORD
 
static DWORD_PTR
 
static const WCHAR wszIndexHtml [] = {'i','n','d','e','x','.','h','t','m','l',0}
 
static const WCHAR index_url []
 
static const WCHAR acc_mimeW [] = {'*','/','*',0}
 
static const WCHAR user_agentW [] = {'W','i','n','e',0}
 
static const WCHAR text_htmlW [] = {'t','e','x','t','/','h','t','m','l',0}
 
static const WCHAR hostW [] = {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}
 
static const WCHAR winehq_ipW [] = {'2','0','9','.','4','6','.','2','5','.','1','3','4',0}
 
static const WCHAR emptyW [] = {0}
 
static const WCHAR pjpegW [] = {'i','m','a','g','e','/','p','j','p','e','g',0}
 
static const WCHAR gifW [] = {'i','m','a','g','e','/','g','i','f',0}
 
static HRESULT expect_hrResult
 
static LPCWSTR file_name
 
static LPCWSTR http_url
 
static LPCWSTR expect_wsz
 
static IInternetProtocolasync_protocol = NULL
 
static BOOL first_data_notif
 
static BOOL http_is_first
 
static BOOL test_redirect
 
static BOOL redirect_on_continue
 
static int prot_state
 
static int read_report_data
 
static int post_stream_read
 
static DWORD bindf
 
static DWORD ex_priority
 
static DWORD pi
 
static DWORD bindinfo_options
 
static IInternetProtocolbinding_protocol
 
static IInternetProtocolfiltered_protocol
 
static IInternetBindInfoprot_bind_info
 
static IInternetProtocolSinkbinding_sink
 
static IInternetProtocolSinkfiltered_sink
 
static voidexpect_pv
 
static HANDLE event_complete
 
static HANDLE event_complete2
 
static HANDLE event_continue
 
static HANDLE event_continue_done
 
static BOOL binding_test
 
static PROTOCOLDATA protocoldata
 
static PROTOCOLDATA * pdata
 
static PROTOCOLDATA continue_protdata
 
static DWORD prot_read
 
static DWORD filter_state
 
static DWORD http_post_test
 
static DWORD thread_id
 
static BOOL security_problem
 
static BOOL test_async_req
 
static BOOL impl_protex
 
static BOOL async_read_pending
 
static BOOL mimefilter_test
 
static BOOL direct_read
 
static BOOL wait_for_switch
 
static BOOL emulate_prot
 
static BOOL short_read
 
static BOOL test_abort
 
static BOOL empty_file
 
static BOOL no_mime
 
static BOOL bind_from_cache
 
static BOOL file_with_hash
 
static BOOL reuse_protocol_thread
 
enum { ... }  state
 
static enum { ... }  tested_protocol
 
static Protocolprotocol_emul
 
static const WCHAR protocol_names [][10]
 
static const WCHAR binding_urls [][130]
 
static const CHAR post_data [] = "mode=Test"
 
static IHttpSecurityVtbl HttpSecurityVtbl
 
static IHttpSecurity http_security = { &HttpSecurityVtbl }
 
static IHttpNegotiate2Vtbl HttpNegotiateVtbl
 
static IHttpNegotiate2 http_negotiate = { &HttpNegotiateVtbl }
 
static const IBindCallbackRedirectVtbl BindCallbackRedirectVtbl
 
static IBindCallbackRedirect redirect_callback = { &BindCallbackRedirectVtbl }
 
static const IServiceProviderVtbl ServiceProviderVtbl
 
static IServiceProvider service_provider = { &ServiceProviderVtbl }
 
static const IStreamVtbl StreamVtbl
 
static IStream Stream = { &StreamVtbl }
 
static const charstatus_names []
 
static IInternetProtocolSinkVtbl protocol_sink_vtbl
 
static IInternetProtocolSink protocol_sink = { &protocol_sink_vtbl }
 
static IInternetProtocolSinkVtbl mime_protocol_sink_vtbl
 
static IInternetProtocolSink mime_protocol_sink = { &mime_protocol_sink_vtbl }
 
static IInternetBindInfoVtbl bind_info_vtbl
 
static IInternetBindInfo bind_info = { &bind_info_vtbl }
 
static const IInternetPriorityVtbl InternetPriorityVtbl
 
static const IInternetProtocolExVtbl ProtocolVtbl
 
static const IUnknownVtbl ProtocolUnkVtbl
 
static const IInternetProtocolExVtbl MimeProtocolVtbl
 
static IInternetProtocolEx MimeProtocol = { &MimeProtocolVtbl }
 
static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
 
static IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static IClassFactory ClassFactory = { &ClassFactoryVtbl }
 
static const IClassFactoryVtbl MimeFilterCFVtbl
 
static IClassFactory mimefilter_cf = { &MimeFilterCFVtbl }
 
static const IID outer_test_iid = {0xabcabc00,0,0,{0,0,0,0,0,0,0,0x66}}
 
static const IUnknownVtbl outer_vtbl
 

Macro Definition Documentation

◆ 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 55 of file protocol.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 49 of file protocol.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 43 of file protocol.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 61 of file protocol.c.

◆ CLEAR_CALLED

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

Definition at line 67 of file protocol.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file protocol.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 20 of file protocol.c.

◆ DEFINE_EXPECT

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

Definition at line 37 of file protocol.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)    expect_ ## func = TRUE

Definition at line 40 of file protocol.c.

◆ TEST_ABORT

#define TEST_ABORT   0x0100

Definition at line 2642 of file protocol.c.

◆ TEST_ASYNCREQ

#define TEST_ASYNCREQ   0x0200

Definition at line 2643 of file protocol.c.

◆ TEST_BINDING

#define TEST_BINDING   0x0001

Definition at line 2634 of file protocol.c.

◆ TEST_DIRECT_READ

#define TEST_DIRECT_READ   0x0008

Definition at line 2637 of file protocol.c.

◆ TEST_DISABLEAUTOREDIRECT

#define TEST_DISABLEAUTOREDIRECT   0x8000

Definition at line 2649 of file protocol.c.

◆ TEST_EMPTY

#define TEST_EMPTY   0x1000

Definition at line 2646 of file protocol.c.

◆ TEST_EMULATEPROT

#define TEST_EMULATEPROT   0x0020

Definition at line 2639 of file protocol.c.

◆ TEST_FILTER

#define TEST_FILTER   0x0002

Definition at line 2635 of file protocol.c.

◆ TEST_FIRST_HTTP

#define TEST_FIRST_HTTP   0x0004

Definition at line 2636 of file protocol.c.

◆ TEST_FROMCACHE

#define TEST_FROMCACHE   0x4000

Definition at line 2648 of file protocol.c.

◆ TEST_IMPLPROTEX

#define TEST_IMPLPROTEX   0x0800

Definition at line 2645 of file protocol.c.

◆ TEST_NOMIME

#define TEST_NOMIME   0x2000

Definition at line 2647 of file protocol.c.

◆ TEST_POST

#define TEST_POST   0x0010

Definition at line 2638 of file protocol.c.

◆ TEST_REDIRECT

#define TEST_REDIRECT   0x0080

Definition at line 2641 of file protocol.c.

◆ TEST_SHORT_READ

#define TEST_SHORT_READ   0x0040

Definition at line 2640 of file protocol.c.

◆ TEST_USEIURI

#define TEST_USEIURI   0x0400

Definition at line 2644 of file protocol.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
STATE_CONNECTING 
STATE_SENDINGREQUEST 
STATE_STARTDOWNLOADING 
STATE_DOWNLOADING 

Definition at line 163 of file protocol.c.

◆ anonymous enum

anonymous enum
Enumerator
FILE_TEST 
HTTP_TEST 
HTTPS_TEST 
FTP_TEST 
MK_TEST 
ITS_TEST 
BIND_TEST 

Definition at line 170 of file protocol.c.

170  {
171  FILE_TEST,
172  HTTP_TEST,
173  HTTPS_TEST,
174  FTP_TEST,
175  MK_TEST,
176  ITS_TEST,
177  BIND_TEST
static enum @1650 tested_protocol

Function Documentation

◆ BindCallbackRedirect_AddRef()

static ULONG WINAPI BindCallbackRedirect_AddRef ( IBindCallbackRedirect iface)
static

Definition at line 396 of file protocol.c.

397 {
398  return 2;
399 }

◆ BindCallbackRedirect_QueryInterface()

static HRESULT WINAPI BindCallbackRedirect_QueryInterface ( IBindCallbackRedirect iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 389 of file protocol.c.

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

◆ BindCallbackRedirect_Redirect()

static HRESULT WINAPI BindCallbackRedirect_Redirect ( IBindCallbackRedirect iface,
const WCHAR url,
VARIANT_BOOL cancel 
)
static

Definition at line 406 of file protocol.c.

407 {
408  CHECK_EXPECT(Redirect);
409  *cancel = VARIANT_FALSE;
410  return S_OK;
411 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define S_OK
Definition: intsafe.h:59

◆ BindCallbackRedirect_Release()

static ULONG WINAPI BindCallbackRedirect_Release ( IBindCallbackRedirect iface)
static

Definition at line 401 of file protocol.c.

402 {
403  return 1;
404 }

◆ BindInfo_AddRef()

static ULONG WINAPI BindInfo_AddRef ( IInternetBindInfo iface)
static

Definition at line 1403 of file protocol.c.

1404 {
1405  return 2;
1406 }

◆ BindInfo_GetBindInfo()

static HRESULT WINAPI BindInfo_GetBindInfo ( IInternetBindInfo iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo 
)
static

Definition at line 1413 of file protocol.c.

1414 {
1415  DWORD cbSize;
1416 
1417  CHECK_EXPECT(GetBindInfo);
1418 
1419  ok(grfBINDF != NULL, "grfBINDF == NULL\n");
1420  ok(pbindinfo != NULL, "pbindinfo == NULL\n");
1421  ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize);
1422 
1423  *grfBINDF = bindf;
1424  if(binding_test)
1425  *grfBINDF |= BINDF_FROMURLMON;
1426  cbSize = pbindinfo->cbSize;
1427  memset(pbindinfo, 0, cbSize);
1428  pbindinfo->cbSize = cbSize;
1429  pbindinfo->dwOptions = bindinfo_options;
1430 
1431  if(http_post_test)
1432  {
1433  pbindinfo->cbstgmedData = sizeof(post_data)-1;
1434  pbindinfo->dwBindVerb = BINDVERB_POST;
1435  pbindinfo->stgmedData.tymed = http_post_test;
1436 
1437  if(http_post_test == TYMED_HGLOBAL) {
1438  HGLOBAL data;
1439 
1440  /* Must be GMEM_FIXED, GMEM_MOVABLE does not work properly */
1441  data = GlobalAlloc(GPTR, sizeof(post_data));
1442  memcpy(data, post_data, sizeof(post_data));
1443  U(pbindinfo->stgmedData).hGlobal = data;
1444  }else {
1445  U(pbindinfo->stgmedData).pstm = &Stream;
1446  }
1447  }
1448 
1449  return S_OK;
1450 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define GPTR
Definition: winbase.h:293
static DWORD bindf
Definition: protocol.c:150
#define U(x)
Definition: wordpad.c:44
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:150
static DWORD http_post_test
Definition: protocol.c:158
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const CHAR post_data[]
Definition: protocol.c:215
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static BOOL binding_test
Definition: protocol.c:156
#define memset(x, y, z)
Definition: compat.h:39
static IStream Stream
Definition: protocol.c:621

◆ BindInfo_GetBindString()

static HRESULT WINAPI BindInfo_GetBindString ( IInternetBindInfo iface,
ULONG  ulStringType,
LPOLESTR ppwzStr,
ULONG  cEl,
ULONG pcElFetched 
)
static

Definition at line 1452 of file protocol.c.

1454 {
1455  ok(ppwzStr != NULL, "ppwzStr == NULL\n");
1456  ok(pcElFetched != NULL, "pcElFetched == NULL\n");
1457 
1458  switch(ulStringType) {
1459  case BINDSTRING_ACCEPT_MIMES:
1460  CHECK_EXPECT(GetBindString_ACCEPT_MIMES);
1461  ok(cEl == 256, "cEl=%d, expected 256\n", cEl);
1462  if(pcElFetched) {
1463  ok(*pcElFetched == 256, "*pcElFetched=%d, expected 256\n", *pcElFetched);
1464  *pcElFetched = 1;
1465  }
1466  if(ppwzStr) {
1467  *ppwzStr = CoTaskMemAlloc(sizeof(acc_mimeW));
1468  memcpy(*ppwzStr, acc_mimeW, sizeof(acc_mimeW));
1469  }
1470  return S_OK;
1471  case BINDSTRING_USER_AGENT:
1472  CHECK_EXPECT(GetBindString_USER_AGENT);
1473  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1474  if(pcElFetched) {
1475  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1476  *pcElFetched = 1;
1477  }
1478  if(ppwzStr) {
1479  *ppwzStr = CoTaskMemAlloc(sizeof(user_agentW));
1480  memcpy(*ppwzStr, user_agentW, sizeof(user_agentW));
1481  }
1482  return S_OK;
1483  case BINDSTRING_POST_COOKIE:
1484  CHECK_EXPECT(GetBindString_POST_COOKIE);
1485  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1486  if(pcElFetched)
1487  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1488  return S_OK;
1489  case BINDSTRING_URL: {
1490  DWORD size;
1491 
1492  CHECK_EXPECT(GetBindString_URL);
1493  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1494  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1495  *pcElFetched = 1;
1496 
1498  *ppwzStr = CoTaskMemAlloc(size);
1499  memcpy(*ppwzStr, binding_urls[tested_protocol], size);
1500  return S_OK;
1501  }
1502  case BINDSTRING_ROOTDOC_URL:
1503  CHECK_EXPECT(GetBindString_ROOTDOC_URL);
1504  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1505  return E_NOTIMPL;
1506  case BINDSTRING_ENTERPRISE_ID:
1507  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1508  return E_NOTIMPL;
1509  default:
1510  ok(0, "unexpected ulStringType %d\n", ulStringType);
1511  }
1512 
1513  return E_NOTIMPL;
1514 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static const WCHAR user_agentW[]
Definition: protocol.c:137
static enum @1650 tested_protocol
#define lstrlenW
Definition: compat.h:407
static const WCHAR acc_mimeW[]
Definition: protocol.c:136
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const WCHAR binding_urls[][130]
Definition: protocol.c:201
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

◆ BindInfo_QueryInterface()

static HRESULT WINAPI BindInfo_QueryInterface ( IInternetBindInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1394 of file protocol.c.

1395 {
1396  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetBindInfo, riid)) {
1397  *ppv = iface;
1398  return S_OK;
1399  }
1400  return E_NOINTERFACE;
1401 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ BindInfo_Release()

static ULONG WINAPI BindInfo_Release ( IInternetBindInfo iface)
static

Definition at line 1408 of file protocol.c.

1409 {
1410  return 1;
1411 }

◆ call_continue()

static void call_continue ( PROTOCOLDATA *  protocol_data)
static

Definition at line 638 of file protocol.c.

639 {
640  HRESULT hres;
641 
642  if (winetest_debug > 1)
643  trace("continue in state %d\n", state);
644 
645  if(state == STATE_CONNECTING) {
647  if (http_is_first){
648  CLEAR_CALLED(ReportProgress_FINDINGRESOURCE);
649  CLEAR_CALLED(ReportProgress_PROXYDETECTING);
650  }
651  CLEAR_CALLED(ReportProgress_CONNECTING);
652  }
654  todo_wine CHECK_CALLED(ReportProgress_SENDINGREQUEST);
655  else if (tested_protocol != HTTPS_TEST)
656  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
657  if(test_redirect && !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
658  CHECK_CALLED(ReportProgress_REDIRECTING);
660  }
661 
662  switch(state) {
665  SET_EXPECT(ReportProgress_SENDINGREQUEST);
666  break;
669  && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))) {
670  SET_EXPECT(OnResponse);
672  SET_EXPECT(ReportProgress_ACCEPTRANGES);
673  SET_EXPECT(ReportProgress_ENCODING);
674  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
675  if(bindf & BINDF_NEEDFILE)
676  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
677  }
678  default:
679  break;
680  }
681 
682  if(state != STATE_SENDINGREQUEST && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)))
683  SET_EXPECT(ReportData);
684  hres = IInternetProtocol_Continue(async_protocol, protocol_data);
685  ok(hres == S_OK, "Continue failed: %08x\n", hres);
687  CLEAR_CALLED(ReportData);
688  else if(state != STATE_SENDINGREQUEST && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)))
689  CHECK_CALLED(ReportData);
690 
691  switch(state) {
694  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
696  break;
698  if(!security_problem) {
701  && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))) {
702  CHECK_CALLED(OnResponse);
704  CHECK_CALLED(ReportProgress_ACCEPTRANGES);
705  else if(test_redirect || test_abort)
706  CLEAR_CALLED(ReportProgress_ACCEPTRANGES);
707  CLEAR_CALLED(ReportProgress_ENCODING);
708  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
709  if(bindf & BINDF_NEEDFILE)
710  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
711  }
712  }
713  else
714  {
716  SET_EXPECT(ReportProgress_CONNECTING);
717  }
718  default:
719  break;
720  }
721 }
enum @1649 state
static DWORD bindf
Definition: protocol.c:150
static BOOL test_redirect
Definition: protocol.c:148
static enum @1650 tested_protocol
#define CLEAR_CALLED(func)
Definition: protocol.c:67
int winetest_debug
static BOOL http_is_first
Definition: protocol.c:148
static DWORD bindinfo_options
Definition: protocol.c:150
static BOOL empty_file
Definition: protocol.c:161
static BOOL test_abort
Definition: protocol.c:160
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
static BOOL test_async_req
Definition: protocol.c:159
static IInternetProtocol * async_protocol
Definition: protocol.c:147
#define todo_wine
Definition: test.h:154
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
static HRESULT WINAPI Stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: protocol.c:512
#define CHECK_CALLED(func)
Definition: protocol.c:55
static BOOL security_problem
Definition: protocol.c:159

Referenced by ProtocolSink_Switch(), and test_http_protocol_url().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 2563 of file protocol.c.

2564 {
2565  return 2;
2566 }

◆ ClassFactory_CreateInstance()

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

Definition at line 2573 of file protocol.c.

2575 {
2576  Protocol *ret;
2577 
2578  CHECK_EXPECT(CreateInstance);
2579 
2580  ok(pOuter == (IUnknown*)prot_bind_info, "pOuter != protocol_unk\n");
2581  ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2582  ok(ppv != NULL, "ppv == NULL\n");
2583 
2584  ret = heap_alloc(sizeof(*ret));
2585  ret->IUnknown_inner.lpVtbl = &ProtocolUnkVtbl;
2586  ret->IInternetProtocolEx_iface.lpVtbl = &ProtocolVtbl;
2587  ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl;
2588  ret->outer = pOuter;
2589  ret->inner_ref = 1;
2590  ret->outer_ref = 0;
2591 
2592  protocol_emul = ret;
2593  *ppv = &ret->IUnknown_inner;
2594  return S_OK;
2595 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static const IInternetProtocolExVtbl ProtocolVtbl
Definition: protocol.c:2200
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static Protocol * protocol_emul
Definition: protocol.c:189
const GUID IID_IUnknown
static const IUnknownVtbl ProtocolUnkVtbl
Definition: protocol.c:2286
int ret
#define S_OK
Definition: intsafe.h:59
static const IInternetPriorityVtbl InternetPriorityVtbl
Definition: protocol.c:1566
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static IInternetBindInfo * prot_bind_info
Definition: protocol.c:152

◆ ClassFactory_LockServer()

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

Definition at line 2597 of file protocol.c.

2598 {
2599  ok(0, "unexpected call\n");
2600  return S_OK;
2601 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ClassFactory_QueryInterface()

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

Definition at line 2552 of file protocol.c.

2553 {
2554  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
2555  *ppv = &protocol_info;
2556  return S_OK;
2557  }
2558 
2559  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
2560  return E_NOINTERFACE;
2561 }
#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 IInternetProtocolInfo protocol_info
Definition: protocol.c:2550
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 2568 of file protocol.c.

2569 {
2570  return 1;
2571 }

◆ create_cache_entry()

static void create_cache_entry ( const WCHAR urlw)
static

Definition at line 3137 of file protocol.c.

3138 {
3139  FILETIME now, tomorrow, yesterday;
3140  char file_path[MAX_PATH];
3141  BYTE content[1000];
3142  ULARGE_INTEGER li;
3143  const char *url;
3144  HANDLE file;
3145  DWORD size;
3146  unsigned i;
3147  BOOL res;
3148 
3149  BYTE cache_headers[] = "HTTP/1.1 200 OK\r\n\r\n";
3150 
3151  trace("Testing cache read...\n");
3152 
3153  url = w2a(urlw);
3154 
3155  for(i = 0; i < sizeof(content); i++)
3156  content[i] = '0' + (i%10);
3157 
3159  li.u.HighPart = now.dwHighDateTime;
3160  li.u.LowPart = now.dwLowDateTime;
3161  li.QuadPart += (LONGLONG)10000000 * 3600 * 24;
3162  tomorrow.dwHighDateTime = li.u.HighPart;
3163  tomorrow.dwLowDateTime = li.u.LowPart;
3164  li.QuadPart -= (LONGLONG)10000000 * 3600 * 24 * 2;
3165  yesterday.dwHighDateTime = li.u.HighPart;
3166  yesterday.dwLowDateTime = li.u.LowPart;
3167 
3168  res = CreateUrlCacheEntryA(url, sizeof(content), "", file_path, 0);
3169  ok(res, "CreateUrlCacheEntryA failed: %u\n", GetLastError());
3170 
3172  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3173 
3174  WriteFile(file, content, sizeof(content), &size, NULL);
3175  CloseHandle(file);
3176 
3177  res = CommitUrlCacheEntryA(url, file_path, tomorrow, yesterday, NORMAL_CACHE_ENTRY,
3178  cache_headers, sizeof(cache_headers)-1, "", 0);
3179  ok(res, "CommitUrlCacheEntryA failed: %u\n", GetLastError());
3180 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
#define CloseHandle
Definition: compat.h:398
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD dwHighDateTime
Definition: mapidefs.h:66
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
unsigned int BOOL
Definition: ntddk_ex.h:94
time_t now
Definition: finger.c:65
#define GENERIC_WRITE
Definition: nt_native.h:90
content
Definition: atl_ax.c:994
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CreateUrlCacheEntryA(LPCSTR lpszUrlName, DWORD dwExpectedFileSize, LPCSTR lpszFileExtension, LPSTR lpszFileName, DWORD dwReserved)
Definition: urlcache.c:2807
#define NORMAL_CACHE_ENTRY
Definition: wininet.h:2086
int64_t LONGLONG
Definition: typedefs.h:66
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
static const WCHAR url[]
Definition: encode.c:1432
#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
unsigned char BYTE
Definition: mem.h:68
#define CREATE_ALWAYS
Definition: disk.h:72
struct _ULARGE_INTEGER::@3746 u
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI CommitUrlCacheEntryA(LPCSTR lpszUrlName, LPCSTR lpszLocalFileName, FILETIME ExpireTime, FILETIME LastModifiedTime, DWORD CacheEntryType, LPBYTE lpHeaderInfo, DWORD dwHeaderSize, LPCSTR lpszFileExtension, LPCSTR lpszOriginalUrl)
Definition: urlcache.c:3074
static const char * w2a(LPCWSTR str)
Definition: protocol.c:224
GLuint res
Definition: glext.h:9613
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
DWORD dwLowDateTime
Definition: mapidefs.h:65
TCHAR file_path[MAX_PATH]
Definition: sndrec32.cpp:57
Definition: fci.c:126

Referenced by test_http_protocol_url().

◆ DEFINE_EXPECT() [1/61]

DEFINE_EXPECT ( GetBindInfo  )

◆ DEFINE_EXPECT() [2/61]

DEFINE_EXPECT ( ReportProgress_MIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [3/61]

DEFINE_EXPECT ( ReportProgress_DIRECTBIND  )

◆ DEFINE_EXPECT() [4/61]

DEFINE_EXPECT ( ReportProgress_RAWMIMETYPE  )

◆ DEFINE_EXPECT() [5/61]

DEFINE_EXPECT ( ReportProgress_FINDINGRESOURCE  )

◆ DEFINE_EXPECT() [6/61]

DEFINE_EXPECT ( ReportProgress_CONNECTING  )

◆ DEFINE_EXPECT() [7/61]

DEFINE_EXPECT ( ReportProgress_SENDINGREQUEST  )

◆ DEFINE_EXPECT() [8/61]

DEFINE_EXPECT ( ReportProgress_CACHEFILENAMEAVAILABLE  )

◆ DEFINE_EXPECT() [9/61]

DEFINE_EXPECT ( ReportProgress_VERIFIEDMIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [10/61]

DEFINE_EXPECT ( ReportProgress_PROTOCOLCLASSID  )

◆ DEFINE_EXPECT() [11/61]

DEFINE_EXPECT ( ReportProgress_COOKIE_SENT  )

◆ DEFINE_EXPECT() [12/61]

DEFINE_EXPECT ( ReportProgress_REDIRECTING  )

◆ DEFINE_EXPECT() [13/61]

DEFINE_EXPECT ( ReportProgress_ENCODING  )

◆ DEFINE_EXPECT() [14/61]

DEFINE_EXPECT ( ReportProgress_ACCEPTRANGES  )

◆ DEFINE_EXPECT() [15/61]

DEFINE_EXPECT ( ReportProgress_PROXYDETECTING  )

◆ DEFINE_EXPECT() [16/61]

DEFINE_EXPECT ( ReportProgress_LOADINGMIMEHANDLER  )

◆ DEFINE_EXPECT() [17/61]

DEFINE_EXPECT ( ReportProgress_DECODING  )

◆ DEFINE_EXPECT() [18/61]

DEFINE_EXPECT ( ReportData  )

◆ DEFINE_EXPECT() [19/61]

DEFINE_EXPECT ( ReportData2  )

◆ DEFINE_EXPECT() [20/61]

DEFINE_EXPECT ( ReportResult  )

◆ DEFINE_EXPECT() [21/61]

DEFINE_EXPECT ( GetBindString_ACCEPT_MIMES  )

◆ DEFINE_EXPECT() [22/61]

DEFINE_EXPECT ( GetBindString_USER_AGENT  )

◆ DEFINE_EXPECT() [23/61]

DEFINE_EXPECT ( GetBindString_POST_COOKIE  )

◆ DEFINE_EXPECT() [24/61]

DEFINE_EXPECT ( GetBindString_URL  )

◆ DEFINE_EXPECT() [25/61]

DEFINE_EXPECT ( GetBindString_ROOTDOC_URL  )

◆ DEFINE_EXPECT() [26/61]

DEFINE_EXPECT ( QueryService_HttpNegotiate  )

◆ DEFINE_EXPECT() [27/61]

DEFINE_EXPECT ( QueryService_InternetProtocol  )

◆ DEFINE_EXPECT() [28/61]

DEFINE_EXPECT ( QueryService_HttpSecurity  )

◆ DEFINE_EXPECT() [29/61]

DEFINE_EXPECT ( QueryService_IBindCallbackRedirect  )

◆ DEFINE_EXPECT() [30/61]

DEFINE_EXPECT ( QueryInterface_IWinInetInfo  )

◆ DEFINE_EXPECT() [31/61]

DEFINE_EXPECT ( QueryInterface_IWinInetHttpInfo  )

◆ DEFINE_EXPECT() [32/61]

DEFINE_EXPECT ( BeginningTransaction  )

◆ DEFINE_EXPECT() [33/61]

DEFINE_EXPECT ( GetRootSecurityId  )

◆ DEFINE_EXPECT() [34/61]

DEFINE_EXPECT ( OnResponse  )

◆ DEFINE_EXPECT() [35/61]

DEFINE_EXPECT ( Switch  )

◆ DEFINE_EXPECT() [36/61]

DEFINE_EXPECT ( Continue  )

◆ DEFINE_EXPECT() [37/61]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [38/61]

DEFINE_EXPECT ( Start  )

◆ DEFINE_EXPECT() [39/61]

DEFINE_EXPECT ( StartEx  )

◆ DEFINE_EXPECT() [40/61]

DEFINE_EXPECT ( Terminate  )

◆ DEFINE_EXPECT() [41/61]

DEFINE_EXPECT ( Read  )

◆ DEFINE_EXPECT() [42/61]

DEFINE_EXPECT ( Read2  )

◆ DEFINE_EXPECT() [43/61]

DEFINE_EXPECT ( SetPriority  )

◆ DEFINE_EXPECT() [44/61]

DEFINE_EXPECT ( LockRequest  )

◆ DEFINE_EXPECT() [45/61]

DEFINE_EXPECT ( UnlockRequest  )

◆ DEFINE_EXPECT() [46/61]

DEFINE_EXPECT ( Abort  )

◆ DEFINE_EXPECT() [47/61]

DEFINE_EXPECT ( MimeFilter_CreateInstance  )

◆ DEFINE_EXPECT() [48/61]

DEFINE_EXPECT ( MimeFilter_Start  )

◆ DEFINE_EXPECT() [49/61]

DEFINE_EXPECT ( MimeFilter_ReportData  )

◆ DEFINE_EXPECT() [50/61]

DEFINE_EXPECT ( MimeFilter_ReportResult  )

◆ DEFINE_EXPECT() [51/61]

DEFINE_EXPECT ( MimeFilter_Terminate  )

◆ DEFINE_EXPECT() [52/61]

DEFINE_EXPECT ( MimeFilter_LockRequest  )

◆ DEFINE_EXPECT() [53/61]

DEFINE_EXPECT ( MimeFilter_UnlockRequest  )

◆ DEFINE_EXPECT() [54/61]

DEFINE_EXPECT ( MimeFilter_Read  )

◆ DEFINE_EXPECT() [55/61]

DEFINE_EXPECT ( MimeFilter_Switch  )

◆ DEFINE_EXPECT() [56/61]

DEFINE_EXPECT ( MimeFilter_Continue  )

◆ DEFINE_EXPECT() [57/61]

DEFINE_EXPECT ( Stream_Seek  )

◆ DEFINE_EXPECT() [58/61]

DEFINE_EXPECT ( Stream_Read  )

◆ DEFINE_EXPECT() [59/61]

DEFINE_EXPECT ( Redirect  )

◆ DEFINE_EXPECT() [60/61]

DEFINE_EXPECT ( outer_QI_test  )

◆ DEFINE_EXPECT() [61/61]

DEFINE_EXPECT ( Protocol_destructor  )

◆ file_protocol_start()

static BOOL file_protocol_start ( IInternetProtocol protocol,
LPCWSTR  url,
IInternetProtocolEx protocolex,
IUri uri,
BOOL  is_first 
)
static

Definition at line 2761 of file protocol.c.

2763 {
2764  HRESULT hres;
2765 
2766  SET_EXPECT(GetBindInfo);
2767  if(!(bindf & BINDF_FROMURLMON))
2768  SET_EXPECT(ReportProgress_DIRECTBIND);
2769  if(is_first) {
2770  SET_EXPECT(ReportProgress_SENDINGREQUEST);
2771  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
2772  if(bindf & BINDF_FROMURLMON)
2773  SET_EXPECT(ReportProgress_VERIFIEDMIMETYPEAVAILABLE);
2774  else
2775  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2776  }
2777  SET_EXPECT(ReportData);
2778  if(is_first)
2779  SET_EXPECT(ReportResult);
2780 
2782 
2783  if(protocolex) {
2784  hres = IInternetProtocolEx_StartEx(protocolex, uri, &protocol_sink, &bind_info, 0, 0);
2785  ok(hres == S_OK, "StartEx failed: %08x\n", hres);
2786  }else {
2787  hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0);
2788  if(hres == INET_E_RESOURCE_NOT_FOUND) {
2789  win_skip("Start failed\n");
2790  return FALSE;
2791  }
2792  ok(hres == S_OK, "Start failed: %08x\n", hres);
2793  }
2794 
2795  CHECK_CALLED(GetBindInfo);
2796  if(!(bindf & BINDF_FROMURLMON))
2797  CLEAR_CALLED(ReportProgress_DIRECTBIND); /* Not called by IE10 */
2798  if(is_first) {
2799  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
2800  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
2801  if(bindf & BINDF_FROMURLMON)
2802  CHECK_CALLED(ReportProgress_VERIFIEDMIMETYPEAVAILABLE);
2803  else
2804  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2805  }
2806  CHECK_CALLED(ReportData);
2807  if(is_first)
2808  CHECK_CALLED(ReportResult);
2809 
2810  return TRUE;
2811 }
#define TRUE
Definition: types.h:120
static DWORD bindf
Definition: protocol.c:150
const char * uri
Definition: sec_mgr.c:1594
#define CLEAR_CALLED(func)
Definition: protocol.c:67
static IInternetBindInfo bind_info
Definition: protocol.c:1524
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
static HRESULT expect_hrResult
Definition: protocol.c:145
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1218
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55
#define win_skip
Definition: test.h:141

Referenced by test_file_protocol_url().

◆ HRESULT()

static HRESULT ( WINAPI pCoInternetGetSession)
static

◆ http_protocol_start()

static BOOL http_protocol_start ( LPCWSTR  url,
BOOL  use_iuri 
)
static

Definition at line 3182 of file protocol.c.

3183 {
3184  static BOOL got_user_agent = FALSE;
3185  IUri *uri = NULL;
3186  HRESULT hres;
3187 
3188  if(use_iuri && pCreateUri) {
3189  hres = pCreateUri(url, 0, 0, &uri);
3190  ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
3191  }
3192 
3193  SET_EXPECT(GetBindInfo);
3194  if (!(bindf & BINDF_FROMURLMON))
3195  SET_EXPECT(ReportProgress_DIRECTBIND);
3196  if(!got_user_agent)
3197  SET_EXPECT(GetBindString_USER_AGENT);
3198  SET_EXPECT(GetBindString_ROOTDOC_URL);
3199  SET_EXPECT(GetBindString_ACCEPT_MIMES);
3200  SET_EXPECT(QueryService_HttpNegotiate);
3201  SET_EXPECT(BeginningTransaction);
3202  SET_EXPECT(GetRootSecurityId);
3203  if(http_post_test) {
3204  SET_EXPECT(GetBindString_POST_COOKIE);
3205  if(http_post_test == TYMED_ISTREAM)
3207  }
3208  if(bind_from_cache) {
3209  SET_EXPECT(OnResponse);
3210  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
3211  SET_EXPECT(ReportData);
3212  }
3213 
3214  if(uri) {
3215  IInternetProtocolEx *protocolex;
3216 
3217  hres = IInternetProtocol_QueryInterface(async_protocol, &IID_IInternetProtocolEx, (void**)&protocolex);
3218  ok(hres == S_OK, "Could not get IInternetProtocolEx iface: %08x\n", hres);
3219 
3220  hres = IInternetProtocolEx_StartEx(protocolex, uri, &protocol_sink, &bind_info, 0, 0);
3221  ok(hres == S_OK, "Start failed: %08x\n", hres);
3222 
3223  IInternetProtocolEx_Release(protocolex);
3224  IUri_Release(uri);
3225  }else {
3226  hres = IInternetProtocol_Start(async_protocol, url, &protocol_sink, &bind_info, 0, 0);
3227  ok(hres == S_OK, "Start failed: %08x\n", hres);
3228  }
3229  if(FAILED(hres))
3230  return FALSE;
3231 
3232  CHECK_CALLED(GetBindInfo);
3233  if (!(bindf & BINDF_FROMURLMON))
3234  CHECK_CALLED(ReportProgress_DIRECTBIND);
3235  if (!got_user_agent)
3236  {
3237  CHECK_CALLED(GetBindString_USER_AGENT);
3238  got_user_agent = TRUE;
3239  }
3240  CLEAR_CALLED(GetBindString_ROOTDOC_URL); /* New in IE11 */
3241  CHECK_CALLED(GetBindString_ACCEPT_MIMES);
3242  CHECK_CALLED(QueryService_HttpNegotiate);
3243  CHECK_CALLED(BeginningTransaction);
3244  /* GetRootSecurityId called on WinXP but not on Win98 */
3245  CLEAR_CALLED(GetRootSecurityId);
3246  if(http_post_test) {
3247  CHECK_CALLED(GetBindString_POST_COOKIE);
3248  if(http_post_test == TYMED_ISTREAM)
3250  }
3251  if(bind_from_cache) {
3252  CHECK_CALLED(OnResponse);
3253  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
3254  CHECK_CALLED(ReportData);
3255  }
3256 
3257  return TRUE;
3258 }
static BOOL bind_from_cache
Definition: protocol.c:161
#define TRUE
Definition: types.h:120
static DWORD bindf
Definition: protocol.c:150
const char * uri
Definition: sec_mgr.c:1594
#define CLEAR_CALLED(func)
Definition: protocol.c:67
static HRESULT WINAPI Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: protocol.c:540
unsigned int BOOL
Definition: ntddk_ex.h:94
static IInternetBindInfo bind_info
Definition: protocol.c:1524
smooth NULL
Definition: ftsmooth.c:416
static DWORD http_post_test
Definition: protocol.c:158
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
static IInternetProtocol * async_protocol
Definition: protocol.c:147
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1218
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55

Referenced by test_http_protocol_url().

◆ HttpNegotiate_AddRef()

static ULONG WINAPI HttpNegotiate_AddRef ( IHttpNegotiate2 iface)
static

Definition at line 301 of file protocol.c.

302 {
303  return 2;
304 }

◆ HttpNegotiate_BeginningTransaction()

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

Definition at line 311 of file protocol.c.

313 {
314  LPWSTR addl_headers;
315 
316  static const WCHAR wszHeaders[] =
317  {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ','a','p','p','l','i','c','a','t',
318  'i','o','n','/','x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o',
319  'd','e','d','\r','\n',0};
320 
321  CHECK_EXPECT(BeginningTransaction);
322 
323  if(binding_test)
324  ok(!lstrcmpW(szURL, binding_urls[tested_protocol]), "szURL != http_url\n");
325  else
326  ok(!lstrcmpW(szURL, http_url), "szURL != http_url\n");
327  ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
328  ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
329  if(pszAdditionalHeaders)
330  {
331  ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
332  if (http_post_test)
333  {
334  addl_headers = CoTaskMemAlloc(sizeof(wszHeaders));
335  memcpy(addl_headers, wszHeaders, sizeof(wszHeaders));
336  *pszAdditionalHeaders = addl_headers;
337  }
338  }
339 
340  return S_OK;
341 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static enum @1650 tested_protocol
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
static LPCWSTR http_url
Definition: protocol.c:146
smooth NULL
Definition: ftsmooth.c:416
static DWORD http_post_test
Definition: protocol.c:158
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const WCHAR binding_urls[][130]
Definition: protocol.c:201
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static BOOL binding_test
Definition: protocol.c:156
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

◆ HttpNegotiate_GetRootSecurityId()

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

Definition at line 356 of file protocol.c.

358 {
359  static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
360 
361  CHECK_EXPECT(GetRootSecurityId);
362 
363  ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
364  ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
365  ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
366 
367  if(pcbSecurityId) {
368  ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
369  *pcbSecurityId = sizeof(sec_id);
370  }
371 
372  if(pbSecurityId)
373  memcpy(pbSecurityId, sec_id, sizeof(sec_id));
374 
375  return E_FAIL;
376 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define E_FAIL
Definition: ddrawi.h:102
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
smooth NULL
Definition: ftsmooth.c:416
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define ok(value,...)
Definition: atltest.h:57

◆ HttpNegotiate_OnResponse()

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

Definition at line 343 of file protocol.c.

345 {
346  CHECK_EXPECT(OnResponse);
347 
348  ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode);
349  ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n");
350  ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n");
351  ok(pszAdditionalRequestHeaders == NULL, "pszAdditionalHeaders != NULL\n");
352 
353  return S_OK;
354 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ HttpNegotiate_QueryInterface()

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

Definition at line 288 of file protocol.c.

289 {
291  || IsEqualGUID(&IID_IHttpNegotiate, riid)
292  || IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
293  *ppv = iface;
294  return S_OK;
295  }
296 
297  ok(0, "unexpected call\n");
298  return E_NOINTERFACE;
299 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ HttpNegotiate_Release()

static ULONG WINAPI HttpNegotiate_Release ( IHttpNegotiate2 iface)
static

Definition at line 306 of file protocol.c.

307 {
308  return 1;
309 }

◆ HttpSecurity_AddRef()

static ULONG WINAPI HttpSecurity_AddRef ( IHttpSecurity iface)
static

Definition at line 243 of file protocol.c.

244 {
245  return 2;
246 }

◆ HttpSecurity_GetWindow()

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

Definition at line 253 of file protocol.c.

254 {
255  trace("HttpSecurity_GetWindow\n");
256 
257  return S_FALSE;
258 }
#define S_FALSE
Definition: winerror.h:2357
#define trace
Definition: atltest.h:70

◆ HttpSecurity_OnSecurityProblem()

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

Definition at line 260 of file protocol.c.

261 {
262  win_skip("Security problem: %u\n", dwProblem);
264  "Expected got %u security problem\n", dwProblem);
265 
266  /* Only retry once */
267  if (security_problem)
268  return E_ABORT;
269 
271  if(dwProblem == ERROR_INTERNET_INVALID_CA)
272  return E_ABORT;
273  SET_EXPECT(BeginningTransaction);
274 
275  return RPC_E_RETRY;
276 }
#define TRUE
Definition: types.h:120
#define ERROR_INTERNET_SEC_CERT_REV_FAILED
Definition: wininet.h:2044
#define E_ABORT
Definition: winerror.h:2366
#define ERROR_INTERNET_INVALID_CA
Definition: wininet.h:2033
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define RPC_E_RETRY
Definition: winerror.h:2485
#define win_skip
Definition: test.h:141
static BOOL security_problem
Definition: protocol.c:159

◆ HttpSecurity_QueryInterface()

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

Definition at line 231 of file protocol.c.

232 {
234  || IsEqualGUID(&IID_IHttpSecurity, riid)) {
235  *ppv = iface;
236  return S_OK;
237  }
238 
239  ok(0, "unexpected call\n");
240  return E_NOINTERFACE;
241 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ HttpSecurity_Release()

static ULONG WINAPI HttpSecurity_Release ( IHttpSecurity iface)
static

Definition at line 248 of file protocol.c.

249 {
250  return 1;
251 }

◆ impl_from_IInternetPriority()

static Protocol* impl_from_IInternetPriority ( IInternetPriority iface)
static

Definition at line 1526 of file protocol.c.

1527 {
1528  return CONTAINING_RECORD(iface, Protocol, IInternetPriority_iface);
1529 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by InternetPriority_AddRef(), and InternetPriority_Release().

◆ impl_from_IInternetProtocolEx()

static Protocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
static

Definition at line 1618 of file protocol.c.

1619 {
1620  return CONTAINING_RECORD(iface, Protocol, IInternetProtocolEx_iface);
1621 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ProtocolEmul_AddRef(), ProtocolEmul_QueryInterface(), and ProtocolEmul_Release().

◆ impl_from_IUnknown()

static Protocol* impl_from_IUnknown ( IUnknown iface)
static

Definition at line 2217 of file protocol.c.

2218 {
2219  return CONTAINING_RECORD(iface, Protocol, IUnknown_inner);
2220 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ProtocolUnk_AddRef(), ProtocolUnk_QueryInterface(), and ProtocolUnk_Release().

◆ init_test()

static void init_test ( int  prot,
DWORD  flags 
)
static

Definition at line 2674 of file protocol.c.

2675 {
2676  tested_protocol = prot;
2677  binding_test = (flags & TEST_BINDING) != 0;
2679  prot_read = 0;
2680  prot_state = 0;
2682  mimefilter_test = (flags & TEST_FILTER) != 0;
2683  no_mime = (flags & TEST_NOMIME) != 0;
2684  filter_state = 0;
2685  post_stream_read = 0;
2691  filtered_sink = NULL;
2692  http_is_first = (flags & TEST_FIRST_HTTP) != 0;
2695  test_async_req = (flags & TEST_ASYNCREQ) != 0;
2696  direct_read = (flags & TEST_DIRECT_READ) != 0;
2697  emulate_prot = (flags & TEST_EMULATEPROT) != 0;
2699  short_read = (flags & TEST_SHORT_READ) != 0;
2700  http_post_test = TYMED_NULL;
2702  test_abort = (flags & TEST_ABORT) != 0;
2703  impl_protex = (flags & TEST_IMPLPROTEX) != 0;
2704  empty_file = (flags & TEST_EMPTY) != 0;
2709 
2710  bindinfo_options = 0;
2712  bindinfo_options |= BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS;
2713 
2715 }
static HANDLE event_continue_done
Definition: protocol.c:155
static HANDLE event_continue
Definition: protocol.c:155
static BOOL bind_from_cache
Definition: protocol.c:161
#define TEST_NOMIME
Definition: protocol.c:2647
#define TRUE
Definition: types.h:120
enum @1649 state
static IInternetProtocol * binding_protocol
Definition: protocol.c:151
#define TEST_DISABLEAUTOREDIRECT
Definition: protocol.c:2649
static HANDLE event_complete2
Definition: protocol.c:155
static BOOL test_redirect
Definition: protocol.c:148
static enum @1650 tested_protocol
#define TEST_EMPTY
Definition: protocol.c:2646
#define TEST_REDIRECT
Definition: protocol.c:2641
static int post_stream_read
Definition: protocol.c:149
static BOOL async_read_pending
Definition: protocol.c:160
static BOOL http_is_first
Definition: protocol.c:148
#define TEST_FILTER
Definition: protocol.c:2635
static BOOL emulate_prot
Definition: protocol.c:160
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:150
static HANDLE event_complete
Definition: protocol.c:155
#define TEST_ABORT
Definition: protocol.c:2642
#define TEST_SHORT_READ
Definition: protocol.c:2640
#define TEST_DIRECT_READ
Definition: protocol.c:2637
static DWORD filter_state
Definition: protocol.c:158
static BOOL empty_file
Definition: protocol.c:161
static BOOL wait_for_switch
Definition: protocol.c:160
static DWORD http_post_test
Definition: protocol.c:158
static BOOL test_abort
Definition: protocol.c:160
static BOOL file_with_hash
Definition: protocol.c:161
#define TEST_BINDING
Definition: protocol.c:2634
static BOOL test_async_req
Definition: protocol.c:159
static BOOL no_mime
Definition: protocol.c:161
static IInternetProtocol * async_protocol
Definition: protocol.c:147
static BOOL redirect_on_continue
Definition: protocol.c:148
#define TEST_FROMCACHE
Definition: protocol.c:2648
GLbitfield flags
Definition: glext.h:7161
static BOOL reuse_protocol_thread
Definition: protocol.c:161
static BOOL short_read
Definition: protocol.c:160
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
static BOOL mimefilter_test
Definition: protocol.c:160
static BOOL first_data_notif
Definition: protocol.c:148
static BOOL impl_protex
Definition: protocol.c:159
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
static BOOL binding_test
Definition: protocol.c:156
#define TEST_IMPLPROTEX
Definition: protocol.c:2645
static DWORD prot_read
Definition: protocol.c:158
static int prot_state
Definition: protocol.c:149
#define TEST_EMULATEPROT
Definition: protocol.c:2639
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:153
static BOOL direct_read
Definition: protocol.c:160
#define TEST_ASYNCREQ
Definition: protocol.c:2643
static BOOL security_problem
Definition: protocol.c:159
#define TEST_FIRST_HTTP
Definition: protocol.c:2636
static void register_filter(BOOL do_register)
Definition: protocol.c:2651

Referenced by test_binding(), test_CreateBinding(), test_file_protocol(), test_ftp_protocol(), test_http_protocol_url(), and test_mk_protocol().

◆ InternetPriority_AddRef()

static ULONG WINAPI InternetPriority_AddRef ( IInternetPriority iface)
static

Definition at line 1538 of file protocol.c.

1539 {
1541  This->outer_ref++;
1542  return IUnknown_AddRef(This->outer);
1543 }
static Protocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: protocol.c:1526

◆ InternetPriority_GetPriority()

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

Definition at line 1559 of file protocol.c.

1560 {
1561  ok(0, "unexpected call\n");
1562  return E_NOTIMPL;
1563 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetPriority_QueryInterface()

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

Definition at line 1531 of file protocol.c.

1533 {
1534  ok(0, "unexpected call\n");
1535  return E_NOINTERFACE;
1536 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ InternetPriority_Release()

static ULONG WINAPI InternetPriority_Release ( IInternetPriority iface)
static

Definition at line 1545 of file protocol.c.

1546 {
1548  This->outer_ref--;
1549  return IUnknown_Release(This->outer);
1550 }
static Protocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: protocol.c:1526

◆ InternetPriority_SetPriority()

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

Definition at line 1552 of file protocol.c.

1553 {
1555  ok(nPriority == ex_priority, "nPriority=%d\n", nPriority);
1556  return S_OK;
1557 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static DWORD ex_priority
Definition: protocol.c:150
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ InternetProtocolInfo_AddRef()

static ULONG WINAPI InternetProtocolInfo_AddRef ( IInternetProtocolInfo iface)
static

Definition at line 2499 of file protocol.c.

2500 {
2501  return 2;
2502 }

◆ InternetProtocolInfo_CombineUrl()

static HRESULT WINAPI InternetProtocolInfo_CombineUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzBaseUrl,
LPCWSTR  pwzRelativeUrl,
DWORD  dwCombineFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 2517 of file protocol.c.

2520 {
2521  ok(0, "unexpected call\n");
2522  return E_NOTIMPL;
2523 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_CompareUrl()

static HRESULT WINAPI InternetProtocolInfo_CompareUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl1,
LPCWSTR  pwzUrl2,
DWORD  dwCompareFlags 
)
static

Definition at line 2525 of file protocol.c.

2527 {
2528  ok(0, "unexpected call\n");
2529  return E_NOTIMPL;
2530 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_ParseUrl()

static HRESULT WINAPI InternetProtocolInfo_ParseUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
PARSEACTION  ParseAction,
DWORD  dwParseFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 2509 of file protocol.c.

2512 {
2513  ok(0, "unexpected call %d\n", ParseAction);
2514  return E_NOTIMPL;
2515 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_QueryInfo()

static HRESULT WINAPI InternetProtocolInfo_QueryInfo ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
QUERYOPTION  OueryOption,
DWORD  dwQueryFlags,
LPVOID  pBuffer,
DWORD  cbBuffer,
DWORD pcbBuf,
DWORD  dwReserved 
)
static

Definition at line 2532 of file protocol.c.

2535 {
2536  ok(0, "unexpected call\n");
2537  return E_NOTIMPL;
2538 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_QueryInterface()

static HRESULT WINAPI InternetProtocolInfo_QueryInterface ( IInternetProtocolInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2493 of file protocol.c.

2494 {
2495  ok(0, "unexpected call\n");
2496  return E_NOINTERFACE;
2497 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ InternetProtocolInfo_Release()

static ULONG WINAPI InternetProtocolInfo_Release ( IInternetProtocolInfo iface)
static

Definition at line 2504 of file protocol.c.

2505 {
2506  return 1;
2507 }

◆ MimeFilter_CreateInstance()

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

Definition at line 2613 of file protocol.c.

2614 {
2616 
2617  ok(!outer, "outer = %p\n", outer);
2618  ok(IsEqualGUID(&IID_IInternetProtocol, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2619 
2620  *ppv = &MimeProtocol;
2621  return S_OK;
2622 }
static IInternetProtocolEx MimeProtocol
Definition: protocol.c:2491
#define CHECK_EXPECT(func)
Definition: protocol.c:49
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static HRESULT WINAPI MimeFilter_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: protocol.c:2613

Referenced by protocol_start(), and ProtocolEmul_Continue().

◆ MimeProtocol_LockRequest()

static HRESULT WINAPI MimeProtocol_LockRequest ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 2445 of file protocol.c.

2446 {
2447  HRESULT hres;
2448 
2449  CHECK_EXPECT(MimeFilter_LockRequest);
2450 
2451  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
2452 
2454  hres = IInternetProtocol_LockRequest(filtered_protocol, dwOptions);
2455  ok(hres == S_OK, "LockRequest failed: %08x\n", hres);
2457 
2458  return S_OK;
2459 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define CHECK_EXPECT(func)
Definition: protocol.c:49
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55

◆ MimeProtocol_QueryInterface()

static HRESULT WINAPI MimeProtocol_QueryInterface ( IInternetProtocolEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2292 of file protocol.c.

2293 {
2294  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
2295  *ppv = iface;
2296  return S_OK;
2297  }
2298 
2299  if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
2300  *ppv = &mime_protocol_sink;
2301  return S_OK;
2302  }
2303 
2304  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2305  *ppv = NULL;
2306  return E_NOINTERFACE;
2307 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IInternetProtocolSink mime_protocol_sink
Definition: protocol.c:1364
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ MimeProtocol_Read()

static HRESULT WINAPI MimeProtocol_Read ( IInternetProtocolEx iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 2412 of file protocol.c.

2414 {
2415  BYTE buf[2096];
2416  DWORD read = 0;
2417  HRESULT hres;
2418 
2419  CHECK_EXPECT(MimeFilter_Read);
2420 
2421  ok(pv != NULL, "pv == NULL\n");
2422  ok(cb != 0, "cb == 0\n");
2423  ok(pcbRead != NULL, "pcbRead == NULL\n");
2424 
2425  if(read_report_data)
2426  SET_EXPECT(Read2);
2427  else
2428  SET_EXPECT(Read);
2429  hres = IInternetProtocol_Read(filtered_protocol, buf, sizeof(buf), &read);
2430  ok(hres == S_OK || hres == S_FALSE || hres == E_PENDING, "Read failed: %08x\n", hres);
2431  if(read_report_data)
2432  CHECK_CALLED(Read2);
2433  else
2434  CHECK_CALLED(Read);
2435 
2436  if(pcbRead) {
2437  ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
2438  *pcbRead = read;
2439  }
2440 
2441  memset(pv, 'x', read);
2442  return hres;
2443 }
_In_ BOOLEAN Read
Definition: strmini.h:479
#define CHECK_EXPECT(func)
Definition: protocol.c:49
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static int read_report_data
Definition: protocol.c:149
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
unsigned char BYTE
Definition: mem.h:68
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55
#define E_PENDING
Definition: dinput.h:172
#define memset(x, y, z)
Definition: compat.h:39
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

◆ MimeProtocol_Start()

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

Definition at line 2309 of file protocol.c.

2312 {
2314  LPOLESTR url_str = NULL;
2315  DWORD fetched = 0;
2316  BINDINFO bindinfo;
2317  DWORD cbindf = 0;
2318  HRESULT hres;
2319 
2320  CHECK_EXPECT(MimeFilter_Start);
2321 
2322  ok(!lstrcmpW(szUrl, pjpegW), "wrong url %s\n", wine_dbgstr_w(szUrl));
2323  ok(grfPI == (PI_FILTER_MODE|PI_FORCE_ASYNC), "grfPI=%x, expected PI_FILTER_MODE|PI_FORCE_ASYNC\n", grfPI);
2324  ok(dwReserved, "dwReserved == 0\n");
2325  ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
2326  ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
2327 
2328  if(binding_test) {
2329  ok(pOIProtSink != binding_sink, "pOIProtSink == protocol_sink\n");
2330  ok(pOIBindInfo == prot_bind_info, "pOIBindInfo != bind_info\n");
2331  }else {
2332  ok(pOIProtSink == &protocol_sink, "pOIProtSink != protocol_sink\n");
2333  ok(pOIBindInfo == &bind_info, "pOIBindInfo != bind_info\n");
2334  }
2335 
2336  data = (void*)dwReserved;
2337  ok(data->cbSize == sizeof(*data), "data->cbSize = %d\n", data->cbSize);
2338  ok(!data->pProtocolSink, "data->pProtocolSink != NULL\n");
2339  ok(data->pProtocol != NULL, "data->pProtocol == NULL\n");
2340  ok(!data->pUnk, "data->pUnk != NULL\n");
2341  ok(!data->dwFilterFlags, "data->dwProtocolFlags = %x\n", data->dwFilterFlags);
2342  if(binding_test) {
2343  IInternetProtocolSink *prot_sink;
2344 
2345  IInternetProtocol_QueryInterface(data->pProtocol, &IID_IInternetProtocolSink, (void**)&prot_sink);
2346  ok(prot_sink == pOIProtSink, "QI(data->pProtocol, IID_IInternetProtocolSink) != pOIProtSink\n");
2347  IInternetProtocolSink_Release(prot_sink);
2348 
2349  ok(data->pProtocol != binding_protocol, "data->pProtocol == binding_protocol\n");
2350 
2351  filtered_protocol = data->pProtocol;
2352  IInternetProtocol_AddRef(filtered_protocol);
2353  }else {
2354  IInternetProtocol *prot;
2355 
2356  IInternetProtocol_QueryInterface(data->pProtocol, &IID_IInternetProtocol, (void**)&prot);
2357  ok(prot == async_protocol, "QI(data->pProtocol, IID_IInternetProtocol) != async_protocol\n");
2358  IInternetProtocol_Release(prot);
2359 
2360  ok(data->pProtocol != async_protocol, "data->pProtocol == async_protocol\n");
2361  }
2362 
2363  filtered_sink = pOIProtSink;
2364 
2365  SET_EXPECT(ReportProgress_DECODING);
2366  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DECODING, pjpegW);
2367  ok(hres == S_OK, "ReportProgress(BINDSTATUS_DECODING) failed: %08x\n", hres);
2368  CHECK_CALLED(ReportProgress_DECODING);
2369 
2370  SET_EXPECT(GetBindInfo);
2371  memset(&bindinfo, 0, sizeof(bindinfo));
2372  bindinfo.cbSize = sizeof(bindinfo);
2373  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &cbindf, &bindinfo);
2374  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2375  ok(cbindf == (bindf|BINDF_FROMURLMON), "cbindf = %x, expected %x\n", cbindf, bindf);
2376  CHECK_CALLED(GetBindInfo);
2377 
2378  SET_EXPECT(GetBindString_URL);
2379  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_URL, &url_str, 1, &fetched);
2380  ok(hres == S_OK, "GetBindString(BINDSTRING_URL) failed: %08x\n", hres);
2381  ok(fetched == 1, "fetched = %d\n", fetched);
2382  ok(!lstrcmpW(url_str, binding_urls[tested_protocol]), "wrong url_str %s\n", wine_dbgstr_w(url_str));
2383  CoTaskMemFree(url_str);
2384  CHECK_CALLED(GetBindString_URL);
2385 
2386  return S_OK;
2387 }
static IInternetProtocol * binding_protocol
Definition: protocol.c:151
#define CHECK_EXPECT(func)
Definition: protocol.c:49
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
static IInternetProtocolSink * binding_sink
Definition: protocol.c:153
static DWORD bindf
Definition: protocol.c:150
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static enum @1650 tested_protocol
static LPOLESTR
Definition: stg_prop.c:27
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
static IInternetBindInfo bind_info
Definition: protocol.c:1524
static const WCHAR pjpegW[]
Definition: protocol.c:142
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static IInternetProtocol * async_protocol
Definition: protocol.c:147
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1218
GET_FEATURE_FROM_THREAD_RESTRICTED struct _tagPROTOCOLFILTERDATA PROTOCOLFILTERDATA
static const WCHAR binding_urls[][130]
Definition: protocol.c:201
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
static BOOL binding_test
Definition: protocol.c:156
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:153
#define memset(x, y, z)
Definition: compat.h:39
static IInternetBindInfo * prot_bind_info
Definition: protocol.c:152

◆ MimeProtocol_Terminate()

static HRESULT WINAPI MimeProtocol_Terminate ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 2396 of file protocol.c.

2397 {
2398  HRESULT hres;
2399 
2400  CHECK_EXPECT(MimeFilter_Terminate);
2401 
2402  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
2403 
2404  SET_EXPECT(Terminate);
2405  hres = IInternetProtocol_Terminate(filtered_protocol, dwOptions);
2406  ok(hres == S_OK, "Terminate failed: %08x\n", hres);
2407  CHECK_CALLED(Terminate);
2408 
2409  return S_OK;
2410 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define CHECK_EXPECT(func)
Definition: protocol.c:49
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55

◆ MimeProtocol_UnlockRequest()

static HRESULT WINAPI MimeProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 2461 of file protocol.c.

2462 {
2463  HRESULT hres;
2464 
2465  CHECK_EXPECT(MimeFilter_UnlockRequest);
2466 
2468  hres = IInternetProtocol_UnlockRequest(filtered_protocol);
2469  ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
2471 
2472  return S_OK;
2473 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
HRESULT hres
Definition: protocol.c:465
VOID UnlockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: lock.c:180
LONG HRESULT
Definition: typedefs.h:77
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55

◆ MimeProtocolSink_AddRef()

static ULONG WINAPI MimeProtocolSink_AddRef ( IInternetProtocolSink iface)
static

Definition at line 1232 of file protocol.c.

1233 {
1234  return 2;
1235 }

◆ MimeProtocolSink_QueryInterface()

static HRESULT WINAPI MimeProtocolSink_QueryInterface ( IInternetProtocolSink iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1220 of file protocol.c.

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

◆ MimeProtocolSink_Release()

static ULONG WINAPI MimeProtocolSink_Release ( IInternetProtocolSink iface)
static

Definition at line 1237 of file protocol.c.

1238 {
1239  return 1;
1240 }

◆ MimeProtocolSink_ReportData()

static HRESULT WINAPI MimeProtocolSink_ReportData ( IInternetProtocolSink iface,
DWORD  grfBSCF,
ULONG  ulProgress,
ULONG  ulProgressMax 
)
static

Definition at line 1276 of file protocol.c.

1278 {
1279  DWORD read = 0;
1280  BYTE buf[8192];
1281  HRESULT hres;
1283 
1284  CHECK_EXPECT(MimeFilter_ReportData);
1285 
1286  if(!filter_state && !no_mime) {
1287  SET_EXPECT(Read);
1288  hres = IInternetProtocol_Read(filtered_protocol, buf, sizeof(buf), &read);
1289  if(tested_protocol == HTTP_TEST)
1290  ok(hres == S_OK || hres == E_PENDING || hres == S_FALSE, "Read failed: %08x\n", hres);
1291  else
1292  ok(hres == S_OK, "Read failed: %08x\n", hres);
1293  CHECK_CALLED(Read);
1294 
1295  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1296  hres = IInternetProtocolSink_ReportProgress(filtered_sink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, text_htmlW);
1297  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
1298  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1299 
1300  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1301  hres = IInternetProtocolSink_ReportProgress(filtered_sink, BINDSTATUS_MIMETYPEAVAILABLE, text_htmlW);
1302  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
1303  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1304 
1305  /* FIXME: test BINDSTATUS_CACHEFILENAMEAVAILABLE */
1306  }
1307 
1308  if(no_mime && prot_read<200) {
1309  SET_EXPECT(Read);
1310  }else if(no_mime && prot_read<300) {
1311  report_mime = TRUE;
1312  SET_EXPECT(Read);
1313  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1314  SET_EXPECT(ReportData);
1315  }else if(!read_report_data) {
1316  SET_EXPECT(ReportData);
1317  }
1318  hres = IInternetProtocolSink_ReportData(filtered_sink, grfBSCF, ulProgress, ulProgressMax);
1319  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1320  if(no_mime && prot_read<=200) {
1321  CHECK_CALLED(Read);
1322  }else if(report_mime) {
1323  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1324  CHECK_CALLED(ReportData);
1325  }else if(!read_report_data) {
1326  CHECK_CALLED(ReportData);
1327  }
1328 
1329  if(!filter_state)
1330  filter_state = 1;
1331 
1332  return S_OK;
1333 }
static const WCHAR text_htmlW[]
Definition: protocol.c:138
static BOOL report_mime
Definition: htmldoc.c:202
_In_ BOOLEAN Read
Definition: strmini.h:479
#define TRUE
Definition: types.h:120
#define CHECK_EXPECT(func)
Definition: protocol.c:49
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static enum @1650 tested_protocol
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
static DWORD filter_state
Definition: protocol.c:158
static int read_report_data
Definition: protocol.c:149
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BOOL no_mime
Definition: protocol.c:161
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
static IInternetProtocol * filtered_protocol
Definition: protocol.c:151
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
static DWORD prot_read
Definition: protocol.c:158
#define CHECK_CALLED(func)
Definition: protocol.c:55
#define E_PENDING
Definition: dinput.h:172
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:153
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

◆ MimeProtocolSink_ReportProgress()

static HRESULT WINAPI MimeProtocolSink_ReportProgress ( IInternetProtocolSink iface,
ULONG  ulStatusCode,
LPCWSTR  szStatusText 
)
static

Definition at line 1256 of file protocol.c.

1258 {
1259  switch(ulStatusCode) {
1260  case BINDSTATUS_LOADINGMIMEHANDLER:
1261  /*
1262  * IE9 for some reason (bug?) calls this on mime handler's protocol sink instead of the
1263  * main protocol sink. We check ReportProgress_LOADINGMIMEHANDLER both here and in
1264  * ProtocolSink_ReportProgress to workaround it.
1265  */
1266  CHECK_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
1267  ok(!szStatusText, "szStatusText = %s\n", wine_dbgstr_w(szStatusText));
1268  break;
1269  default:
1270  ok(0, "Unexpected status code %d\n", ulStatusCode);
1271  }
1272 
1273  return S_OK;
1274 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ MimeProtocolSink_ReportResult()

static HRESULT WINAPI MimeProtocolSink_ReportResult ( IInternetProtocolSink iface,
HRESULT  hrResult,
DWORD  dwError,
LPCWSTR  szResult 
)
static

Definition at line 1335 of file protocol.c.

1337 {
1338  HRESULT hres;
1339 
1340  CHECK_EXPECT(MimeFilter_ReportResult);
1341 
1342  ok(hrResult == S_OK, "hrResult = %08x\n", hrResult);
1343  ok(dwError == ERROR_SUCCESS, "dwError = %u\n", dwError);
1344  ok(!szResult, "szResult = %s\n", wine_dbgstr_w(szResult));
1345 
1346  SET_EXPECT(ReportResult);
1347  hres = IInternetProtocolSink_ReportResult(filtered_sink, hrResult, dwError, szResult);
1348  ok(SUCCEEDED(hres), "ReportResult failed: %08x\n", hres);
1349  CHECK_CALLED(ReportResult);
1350 
1351  return S_OK;
1352 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define ERROR_SUCCESS
Definition: deptool.c:10
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:153
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ MimeProtocolSink_Switch()

static HRESULT WINAPI MimeProtocolSink_Switch ( IInternetProtocolSink iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 1242 of file protocol.c.

1243 {
1244  HRESULT hres;
1245 
1246  CHECK_EXPECT(MimeFilter_Switch);
1247 
1248  SET_EXPECT(Switch);
1249  hres = IInternetProtocolSink_Switch(filtered_sink, pProtocolData);
1250  ok(hres == S_OK, "Switch failed: %08x\n", hres);
1251  CHECK_CALLED(Switch);
1252 
1253  return S_OK;
1254 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:153

◆ outer_AddRef()

static ULONG WINAPI outer_AddRef ( IUnknown iface)
static

Definition at line 4111 of file protocol.c.

4112 {
4113  return 2;
4114 }

◆ outer_QueryInterface()

static HRESULT WINAPI outer_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 4100 of file protocol.c.

4101 {
4103  CHECK_EXPECT(outer_QI_test);
4104  *ppv = (IUnknown*)0xdeadbeef;
4105  return S_OK;
4106  }
4107  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
4108  return E_NOINTERFACE;
4109 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CHECK_EXPECT(func)
Definition: protocol.c:49
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
static const IID outer_test_iid
Definition: protocol.c:4098
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ outer_Release()

static ULONG WINAPI outer_Release ( IUnknown iface)
static

Definition at line 4116 of file protocol.c.

4117 {
4118  return 1;
4119 }

◆ Protocol_Abort()

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

Definition at line 1584 of file protocol.c.

1586 {
1587  HRESULT hres;
1588 
1589  CHECK_EXPECT(Abort);
1590 
1591  SET_EXPECT(ReportResult);
1592  hres = IInternetProtocolSink_ReportResult(binding_sink, S_OK, ERROR_SUCCESS, NULL);
1593  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1594  CHECK_CALLED(ReportResult);
1595 
1596  return S_OK;
1597 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static IInternetProtocolSink * binding_sink
Definition: protocol.c:153
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
#define CHECK_CALLED(func)
Definition: protocol.c:55

◆ Protocol_AddRef()

static ULONG WINAPI Protocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 1574 of file protocol.c.

1575 {
1576  return 2;
1577 }

◆ Protocol_Continue()

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

Definition at line 2389 of file protocol.c.

2391 {
2392  CHECK_EXPECT(MimeFilter_Continue);
2393  return E_NOTIMPL;
2394 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Protocol_Release()

static ULONG WINAPI Protocol_Release ( IInternetProtocolEx iface)
static

Definition at line 1579 of file protocol.c.

1580 {
1581  return 1;
1582 }

◆ Protocol_Resume()

static HRESULT WINAPI Protocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 1605 of file protocol.c.

1606 {
1607  ok(0, "unexpected call\n");
1608  return E_NOTIMPL;
1609 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Protocol_Seek()

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

Definition at line 1611 of file protocol.c.

1613 {
1614  ok(0, "unexpected call\n");
1615  return E_NOTIMPL;
1616 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ protocol_start()

static void protocol_start ( IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  pi 
)
static

Definition at line 1743 of file protocol.c.

1744 {
1745  BINDINFO bindinfo, exp_bindinfo;
1746  DWORD cbindf = 0;
1747  HRESULT hres;
1748 
1749  ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
1750  ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
1751  ok(pOIProtSink != &protocol_sink, "unexpected pOIProtSink\n");
1752  ok(pOIBindInfo != &bind_info, "unexpected pOIBindInfo\n");
1753  ok(!pi, "pi = %x\n", pi);
1754 
1755  if(binding_test)
1756  ok(pOIProtSink == binding_sink, "pOIProtSink != binding_sink\n");
1757 
1758  memset(&bindinfo, 0, sizeof(bindinfo));
1759  bindinfo.cbSize = sizeof(bindinfo);
1760  memcpy(&exp_bindinfo, &bindinfo, sizeof(bindinfo));
1761  if(test_redirect)
1762  exp_bindinfo.dwOptions = bindinfo_options;
1763  SET_EXPECT(GetBindInfo);
1764  if(redirect_on_continue && (bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
1765  SET_EXPECT(QueryService_IBindCallbackRedirect);
1766  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &cbindf, &bindinfo);
1767  if(redirect_on_continue && (bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
1768  CHECK_CALLED(QueryService_IBindCallbackRedirect);
1769  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
1770  CHECK_CALLED(GetBindInfo);
1771  ok(cbindf == (bindf|BINDF_FROMURLMON), "bindf = %x, expected %x\n",
1772  cbindf, (bindf|BINDF_FROMURLMON));
1773  ok(!memcmp(&exp_bindinfo, &bindinfo, sizeof(bindinfo)), "unexpected bindinfo\n");
1774  pReleaseBindInfo(&bindinfo);
1775 
1776  SET_EXPECT(ReportProgress_SENDINGREQUEST);
1777  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, emptyW);
1778  ok(hres == S_OK, "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
1779  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
1780 
1784  IHttpNegotiate2 *http_negotiate2;
1785  LPWSTR ua = (LPWSTR)0xdeadbeef, accept_mimes[256];
1786  LPWSTR additional_headers = NULL;
1787  BYTE sec_id[100];
1788  DWORD fetched = 0, size = 100;
1789  DWORD tid;
1790 
1791  SET_EXPECT(GetBindString_USER_AGENT);
1792  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
1793  &ua, 1, &fetched);
1794  CHECK_CALLED(GetBindString_USER_AGENT);
1795  ok(hres == S_OK, "GetBindString(BINDSTRING_USER_AGETNT) failed: %08x\n", hres);
1796  ok(fetched == 1, "fetched = %d, expected 254\n", fetched);
1797  ok(ua != NULL, "ua = %p\n", ua);
1798  ok(!lstrcmpW(ua, user_agentW), "unexpected user agent %s\n", wine_dbgstr_w(ua));
1799  CoTaskMemFree(ua);
1800 
1801  fetched = 256;
1802  SET_EXPECT(GetBindString_ACCEPT_MIMES);
1803  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
1804  accept_mimes, 256, &fetched);
1805  CHECK_CALLED(GetBindString_ACCEPT_MIMES);
1806 
1807  ok(hres == S_OK,
1808  "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
1809  ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
1810  ok(!lstrcmpW(acc_mimeW, accept_mimes[0]), "unexpected mimes %s\n", wine_dbgstr_w(accept_mimes[0]));
1811  CoTaskMemFree(accept_mimes[0]);
1812 
1813  hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
1814  (void**)&service_provider);
1815  ok(hres == S_OK, "QueryInterface failed: %08x\n", hres);
1816 
1817  SET_EXPECT(QueryService_HttpNegotiate);
1818  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
1819  &IID_IHttpNegotiate, (void**)&http_negotiate);
1820  CHECK_CALLED(QueryService_HttpNegotiate);
1821  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
1822 
1823  SET_EXPECT(BeginningTransaction);
1824  hres = IHttpNegotiate_BeginningTransaction(http_negotiate, binding_urls[tested_protocol],
1825  NULL, 0, &additional_headers);
1826  CHECK_CALLED(BeginningTransaction);
1827  IHttpNegotiate_Release(http_negotiate);
1828  ok(hres == S_OK, "BeginningTransction failed: %08x\n", hres);
1829  ok(additional_headers == NULL, "additional_headers=%p\n", additional_headers);
1830 
1831  SET_EXPECT(QueryService_HttpNegotiate);
1832  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
1833  &IID_IHttpNegotiate2, (void**)&http_negotiate2);
1834  CHECK_CALLED(QueryService_HttpNegotiate);
1835  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
1836 
1837  size = 512;
1838  SET_EXPECT(GetRootSecurityId);
1839  hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &size, 0);
1840  CHECK_CALLED(GetRootSecurityId);
1841  IHttpNegotiate2_Release(http_negotiate2);
1842  ok(hres == E_FAIL, "GetRootSecurityId failed: %08x, expected E_FAIL\n", hres);
1843  ok(size == 13, "size=%d\n", size);
1844 
1845  IServiceProvider_Release(service_provider);
1846 
1848  CreateThread(NULL, 0, thread_proc, NULL, 0, &tid);
1849  return;
1850  }
1851 
1852  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
1853  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
1854  BINDSTATUS_CACHEFILENAMEAVAILABLE, expect_wsz = emptyW);
1855  ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
1856  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
1857 
1858  if(mimefilter_test) {
1860  SET_EXPECT(MimeFilter_Start);
1861  SET_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
1862  }
1863  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1864  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
1866  ok(hres == S_OK,
1867  "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
1868  if(mimefilter_test) {
1870  CHECK_CALLED(MimeFilter_Start);
1871  CHECK_CALLED(ReportProgress_LOADINGMIMEHANDLER);
1872  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1873  }else {
1874  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1875  }
1876 
1877  if(mimefilter_test)
1878  SET_EXPECT(MimeFilter_ReportData);
1879  else
1880  SET_EXPECT(ReportData);
1881  hres = IInternetProtocolSink_ReportData(pOIProtSink,
1882  BSCF_FIRSTDATANOTIFICATION | (tested_protocol == ITS_TEST ? BSCF_DATAFULLYAVAILABLE : BSCF_LASTDATANOTIFICATION),
1883  13, 13);
1884  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1885  if(mimefilter_test)
1886  CHECK_CALLED(MimeFilter_ReportData);
1887  else
1888  CHECK_CALLED(ReportData);
1889 
1890  if(tested_protocol == ITS_TEST) {
1891  SET_EXPECT(ReportData);
1892  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA, NULL);
1893  ok(hres == S_OK, "ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
1894  CHECK_CALLED(ReportData);
1895  }
1896 
1897  if(tested_protocol == BIND_TEST) {
1898  hres = IInternetProtocol_Terminate(binding_protocol, 0);
1899  ok(hres == E_FAIL, "Termiante failed: %08x\n", hres);
1900  }
1901 
1902  if(mimefilter_test)
1903  SET_EXPECT(MimeFilter_ReportResult);
1904  else
1905  SET_EXPECT(ReportResult);
1906  hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
1907  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1908  if(mimefilter_test)
1909  CHECK_CALLED(MimeFilter_ReportResult);
1910  else
1911  CHECK_CALLED(ReportResult);
1912 }
static const WCHAR text_htmlW[]
Definition: protocol.c:138
static IInternetProtocol * binding_protocol
Definition: protocol.c:151
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
static IInternetProtocolSink * binding_sink
Definition: protocol.c:153
static DWORD bindf
Definition: protocol.c:150
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static const WCHAR user_agentW[]
Definition: protocol.c:137
static LPCWSTR expect_wsz
Definition: protocol.c:146
static BOOL test_redirect
Definition: protocol.c:148
static enum @1650 tested_protocol
#define E_FAIL
Definition: ddrawi.h:102
static DWORD WINAPI thread_proc(PVOID arg)
Definition: protocol.c:1656
static const WCHAR acc_mimeW[]
Definition: protocol.c:136
static IInternetBindInfo bind_info
Definition: protocol.c:1524
static const WCHAR pjpegW[]
Definition: protocol.c:142
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:150
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL redirect_on_continue
Definition: protocol.c:148
static DWORD pi
Definition: protocol.c:150
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
static BOOL reuse_protocol_thread
Definition: protocol.c:161
static const WCHAR emptyW[]
Definition: protocol.c:141
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1218
static BOOL mimefilter_test
Definition: protocol.c:160
static const WCHAR binding_urls[][130]
Definition: protocol.c:201
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static HRESULT WINAPI MimeFilter_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: protocol.c:2613
#define SET_EXPECT(func)
Definition: protocol.c:40
static BOOL binding_test
Definition: protocol.c:156
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:387
static IServiceProvider service_provider
Definition: protocol.c:489
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
static TfClientId tid

◆ Protocol_Suspend()

static HRESULT WINAPI Protocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 1599 of file protocol.c.

1600 {
1601  ok(0, "unexpected call\n");
1602  return E_NOTIMPL;
1603 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProtocolEmul_AddRef()

static ULONG WINAPI ProtocolEmul_AddRef ( IInternetProtocolEx iface)
static

Definition at line 1642 of file protocol.c.

1643 {
1645  This->outer_ref++;
1646  return IUnknown_AddRef(This->outer);
1647 }
static Protocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: protocol.c:1618

◆ ProtocolEmul_Continue()

static HRESULT WINAPI ProtocolEmul_Continue ( IInternetProtocolEx iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 1925 of file protocol.c.

1927 {
1928  DWORD bscf = 0, pr;
1929  HRESULT hres;
1930 
1932 
1933  ok(pProtocolData != NULL, "pProtocolData == NULL\n");
1934  if(!pProtocolData || tested_protocol == BIND_TEST)
1935  return S_OK;
1936  if(binding_test) {
1937  ok(pProtocolData != &protocoldata, "pProtocolData == &protocoldata\n");
1938  ok(pProtocolData->grfFlags == protocoldata.grfFlags, "grfFlags wrong %x/%x\n",
1939  pProtocolData->grfFlags, protocoldata.grfFlags );
1940  ok(pProtocolData->dwState == protocoldata.dwState, "dwState wrong %x/%x\n",
1941  pProtocolData->dwState, protocoldata.dwState );
1942  ok(pProtocolData->pData == protocoldata.pData, "pData wrong %p/%p\n",
1943  pProtocolData->pData, protocoldata.pData );
1944  ok(pProtocolData->cbData == protocoldata.cbData, "cbData wrong %x/%x\n",
1945  pProtocolData->cbData, protocoldata.cbData );
1946  }
1947 
1948  switch(prot_state) {
1949  case 1: {
1952  static const WCHAR header[] = {'?',0};
1953  static const WCHAR redirect_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',
1954  '/','t','e','s','t','s','/','h','e','l','l','o','.','h','t','m','l',0};
1955 
1956  if(redirect_on_continue) {
1959 
1960  if(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)
1961  SET_EXPECT(Redirect);
1962  SET_EXPECT(ReportProgress_REDIRECTING);
1963  SET_EXPECT(Terminate);
1964  SET_EXPECT(Protocol_destructor);
1965  SET_EXPECT(QueryService_InternetProtocol);
1966  SET_EXPECT(CreateInstance);
1967  SET_EXPECT(ReportProgress_PROTOCOLCLASSID);
1969  SET_EXPECT(Start);
1970  hres = IInternetProtocolSink_ReportResult(binding_sink, INET_E_REDIRECT_FAILED, ERROR_SUCCESS, redirect_urlW);
1971  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1972  if(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)
1973  CHECK_CALLED(Redirect);
1974  CHECK_CALLED(ReportProgress_REDIRECTING);
1975  CHECK_CALLED(Terminate);
1976  CHECK_CALLED(Protocol_destructor);
1977  CHECK_CALLED(QueryService_InternetProtocol);
1978  CHECK_CALLED(CreateInstance);
1979  CHECK_CALLED(ReportProgress_PROTOCOLCLASSID);
1982 
1983  return S_OK;
1984  }
1985 
1986  hres = IInternetProtocolSink_QueryInterface(binding_sink, &IID_IServiceProvider,
1987  (void**)&service_provider);
1988  ok(hres == S_OK, "Could not get IServiceProvicder\n");
1989 
1990  SET_EXPECT(QueryService_HttpNegotiate);
1991  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
1992  &IID_IHttpNegotiate, (void**)&http_negotiate);
1993  IServiceProvider_Release(service_provider);
1994  CHECK_CALLED(QueryService_HttpNegotiate);
1995  ok(hres == S_OK, "Could not get IHttpNegotiate\n");
1996 
1997  SET_EXPECT(OnResponse);
1998  hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
1999  IHttpNegotiate_Release(http_negotiate);
2000  CHECK_CALLED(OnResponse);
2001  IHttpNegotiate_Release(http_negotiate);
2002  ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
2003 
2004  if(mimefilter_test) {
2006  SET_EXPECT(MimeFilter_Start);
2007  SET_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
2008  }else if(!(pi & PI_MIMEVERIFICATION)) {
2009  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2010  }
2011  hres = IInternetProtocolSink_ReportProgress(binding_sink,
2012  BINDSTATUS_MIMETYPEAVAILABLE, mimefilter_test ? pjpegW : text_htmlW);
2013  if(mimefilter_test) {
2015  CHECK_CALLED(MimeFilter_Start);
2016  CHECK_CALLED(ReportProgress_LOADINGMIMEHANDLER);
2017  }else if(!(pi & PI_MIMEVERIFICATION)) {
2018  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2019  }
2020  ok(hres == S_OK,
2021  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
2022 
2023  bscf |= BSCF_FIRSTDATANOTIFICATION;
2024  break;
2025  }
2026  case 2:
2027  case 3:
2028  bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
2029  break;
2030  }
2031 
2032  pr = prot_read;
2033  if(mimefilter_test)
2034  SET_EXPECT(MimeFilter_ReportData);
2035  if((!mimefilter_test || no_mime) && (pi & PI_MIMEVERIFICATION)) {
2036  if(pr < 200)
2037  SET_EXPECT(Read); /* checked in ReportData for short_read */
2038  if(pr == 200) {
2039  if(!mimefilter_test)
2040  SET_EXPECT(Read); /* checked in BINDSTATUS_MIMETYPEAVAILABLE or ReportData */
2041  SET_EXPECT(GetBindInfo);
2042  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2043  }
2044  if(pr >= 200)
2045  SET_EXPECT(ReportData);
2046  }else {
2047  SET_EXPECT(ReportData);
2048  }
2049 
2050  hres = IInternetProtocolSink_ReportData(binding_sink, bscf, pr, 400);
2051  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
2052 
2053  if(mimefilter_test) {
2054  SET_EXPECT(MimeFilter_ReportData);
2055  }else if(pi & PI_MIMEVERIFICATION) {
2056  if(!short_read && pr < 200)
2057  CHECK_CALLED(Read);
2058  if(pr == 200) {
2059  CLEAR_CALLED(GetBindInfo); /* IE9 */
2060  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2061  }
2062  }else {
2063  CHECK_CALLED(ReportData);
2064  }
2065 
2066  if(prot_state == 3)
2067  prot_state = 4;
2068 
2069  return S_OK;
2070 }
static const WCHAR text_htmlW[]
Definition: protocol.c:138
_In_ BOOLEAN Read
Definition: strmini.h:479
#define TRUE
Definition: types.h:120
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static IInternetProtocolSink * binding_sink
Definition: protocol.c:153
static enum @1650 tested_protocol
static PROTOCOLDATA protocoldata
Definition: protocol.c:157
#define CLEAR_CALLED(func)
Definition: protocol.c:67
static const WCHAR pjpegW[]
Definition: protocol.c:142
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:150
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static BOOL no_mime
Definition: protocol.c:161
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL redirect_on_continue
Definition: protocol.c:148
Definition: partlist.h:33
static DWORD pi
Definition: protocol.c:150
volatile int Continue
Definition: gdblib.c:102
#define todo_wine
Definition: test.h:154
#define CHECK_NOT_CALLED(func)
Definition: protocol.c:61
static BOOL reuse_protocol_thread
Definition: protocol.c:161
static BOOL short_read
Definition: protocol.c:160
static BOOL mimefilter_test
Definition: protocol.c:160
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static HRESULT WINAPI MimeFilter_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: protocol.c:2613
#define SET_EXPECT(func)
Definition: protocol.c:40
static BOOL binding_test
Definition: protocol.c:156
static DWORD prot_read
Definition: protocol.c:158
#define CHECK_CALLED(func)
Definition: protocol.c:55
static int prot_state
Definition: protocol.c:149
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:387
static IServiceProvider service_provider
Definition: protocol.c:489
struct CFHEADER header
Definition: fdi.c:109

◆ ProtocolEmul_LockRequest()

static HRESULT WINAPI ProtocolEmul_LockRequest ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 2177 of file protocol.c.

2178 {
2180  ok(dwOptions == 0, "dwOptions=%x\n", dwOptions);
2181  return S_OK;
2182 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define CHECK_EXPECT(func)
Definition: protocol.c:49
PVOID LockRequest(PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Output, KPROCESSOR_MODE *LockMode)
Definition: lock.c:24
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ProtocolEmul_QueryInterface()

static HRESULT WINAPI ProtocolEmul_QueryInterface ( IInternetProtocolEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1623 of file protocol.c.

1624 {
1626 
1627  static const IID unknown_iid = {0x7daf9908,0x8415,0x4005,{0x95,0xae, 0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
1628  static const IID unknown_iid2 = {0x5b7ebc0c,0xf630,0x4cea,{0x89,0xd3,0x5a,0xf0,0x38,0xed,0x05,0x5c}};
1629 
1630  /* FIXME: Why is it calling here instead of outer IUnknown? */
1631  if(IsEqualGUID(riid, &IID_IInternetPriority)) {
1632  *ppv = &This->IInternetPriority_iface;
1633  IInternetPriority_AddRef(&This->IInternetPriority_iface);
1634  return S_OK;
1635  }
1636  if(!IsEqualGUID(riid, &unknown_iid) && !IsEqualGUID(riid, &unknown_iid2)) /* IE10 */
1637  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
1638  *ppv = NULL;
1639  return E_NOINTERFACE;
1640 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static Protocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: protocol.c:1618

◆ ProtocolEmul_Read()

static HRESULT WINAPI ProtocolEmul_Read ( IInternetProtocolEx iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 2079 of file protocol.c.

2081 {
2082  if(read_report_data)
2083  CHECK_EXPECT2(Read2);
2084 
2085  if(mimefilter_test || short_read) {
2086  if(!read_report_data)
2088  }else if((pi & PI_MIMEVERIFICATION)) {
2089  if(!read_report_data)
2091 
2092  if(prot_read < 300) {
2093  ok(pv != expect_pv, "pv == expect_pv\n&qu