ReactOS  0.4.14-dev-583-g2a1ba2c
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 (CreateInstance_no_aggregation)
 
 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 LONG obj_refcount (void *obj)
 
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
 
static BOOL no_aggregation
 
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 2689 of file protocol.c.

◆ TEST_ASYNCREQ

#define TEST_ASYNCREQ   0x0200

Definition at line 2690 of file protocol.c.

◆ TEST_BINDING

#define TEST_BINDING   0x0001

Definition at line 2681 of file protocol.c.

◆ TEST_DIRECT_READ

#define TEST_DIRECT_READ   0x0008

Definition at line 2684 of file protocol.c.

◆ TEST_DISABLEAUTOREDIRECT

#define TEST_DISABLEAUTOREDIRECT   0x8000

Definition at line 2696 of file protocol.c.

◆ TEST_EMPTY

#define TEST_EMPTY   0x1000

Definition at line 2693 of file protocol.c.

◆ TEST_EMULATEPROT

#define TEST_EMULATEPROT   0x0020

Definition at line 2686 of file protocol.c.

◆ TEST_FILTER

#define TEST_FILTER   0x0002

Definition at line 2682 of file protocol.c.

◆ TEST_FIRST_HTTP

#define TEST_FIRST_HTTP   0x0004

Definition at line 2683 of file protocol.c.

◆ TEST_FROMCACHE

#define TEST_FROMCACHE   0x4000

Definition at line 2695 of file protocol.c.

◆ TEST_IMPLPROTEX

#define TEST_IMPLPROTEX   0x0800

Definition at line 2692 of file protocol.c.

◆ TEST_NOMIME

#define TEST_NOMIME   0x2000

Definition at line 2694 of file protocol.c.

◆ TEST_POST

#define TEST_POST   0x0010

Definition at line 2685 of file protocol.c.

◆ TEST_REDIRECT

#define TEST_REDIRECT   0x0080

Definition at line 2688 of file protocol.c.

◆ TEST_SHORT_READ

#define TEST_SHORT_READ   0x0040

Definition at line 2687 of file protocol.c.

◆ TEST_USEIURI

#define TEST_USEIURI   0x0400

Definition at line 2691 of file protocol.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
STATE_CONNECTING 
STATE_SENDINGREQUEST 
STATE_STARTDOWNLOADING 
STATE_DOWNLOADING 

Definition at line 165 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 172 of file protocol.c.

172  {
173  FILE_TEST,
174  HTTP_TEST,
175  HTTPS_TEST,
176  FTP_TEST,
177  MK_TEST,
178  ITS_TEST,
179  BIND_TEST
static enum @1668 tested_protocol

Function Documentation

◆ BindCallbackRedirect_AddRef()

static ULONG WINAPI BindCallbackRedirect_AddRef ( IBindCallbackRedirect iface)
static

Definition at line 404 of file protocol.c.

405 {
406  return 2;
407 }

◆ BindCallbackRedirect_QueryInterface()

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

Definition at line 397 of file protocol.c.

398 {
399  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
400  *ppv = NULL;
401  return E_NOINTERFACE;
402 }
#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 414 of file protocol.c.

415 {
416  CHECK_EXPECT(Redirect);
417  *cancel = VARIANT_FALSE;
418  return S_OK;
419 }
#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 409 of file protocol.c.

410 {
411  return 1;
412 }

◆ BindInfo_AddRef()

static ULONG WINAPI BindInfo_AddRef ( IInternetBindInfo iface)
static

Definition at line 1411 of file protocol.c.

1412 {
1413  return 2;
1414 }

◆ BindInfo_GetBindInfo()

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

Definition at line 1421 of file protocol.c.

1422 {
1423  DWORD cbSize;
1424 
1425  CHECK_EXPECT(GetBindInfo);
1426 
1427  ok(grfBINDF != NULL, "grfBINDF == NULL\n");
1428  ok(pbindinfo != NULL, "pbindinfo == NULL\n");
1429  ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize);
1430 
1431  *grfBINDF = bindf;
1432  if(binding_test)
1433  *grfBINDF |= BINDF_FROMURLMON;
1434  cbSize = pbindinfo->cbSize;
1435  memset(pbindinfo, 0, cbSize);
1436  pbindinfo->cbSize = cbSize;
1437  pbindinfo->dwOptions = bindinfo_options;
1438 
1439  if(http_post_test)
1440  {
1441  pbindinfo->cbstgmedData = sizeof(post_data)-1;
1442  pbindinfo->dwBindVerb = BINDVERB_POST;
1443  pbindinfo->stgmedData.tymed = http_post_test;
1444 
1445  if(http_post_test == TYMED_HGLOBAL) {
1446  HGLOBAL data;
1447 
1448  /* Must be GMEM_FIXED, GMEM_MOVABLE does not work properly */
1449  data = GlobalAlloc(GPTR, sizeof(post_data));
1450  memcpy(data, post_data, sizeof(post_data));
1451  U(pbindinfo->stgmedData).hGlobal = data;
1452  }else {
1453  U(pbindinfo->stgmedData).pstm = &Stream;
1454  }
1455  }
1456 
1457  return S_OK;
1458 }
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:151
#define U(x)
Definition: wordpad.c:44
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:151
static DWORD http_post_test
Definition: protocol.c:159
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:217
#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:157
#define memset(x, y, z)
Definition: compat.h:39
static IStream Stream
Definition: protocol.c:629

◆ BindInfo_GetBindString()

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

Definition at line 1460 of file protocol.c.

1462 {
1463  ok(ppwzStr != NULL, "ppwzStr == NULL\n");
1464  ok(pcElFetched != NULL, "pcElFetched == NULL\n");
1465 
1466  switch(ulStringType) {
1467  case BINDSTRING_ACCEPT_MIMES:
1468  CHECK_EXPECT(GetBindString_ACCEPT_MIMES);
1469  ok(cEl == 256, "cEl=%d, expected 256\n", cEl);
1470  if(pcElFetched) {
1471  ok(*pcElFetched == 256, "*pcElFetched=%d, expected 256\n", *pcElFetched);
1472  *pcElFetched = 1;
1473  }
1474  if(ppwzStr) {
1475  *ppwzStr = CoTaskMemAlloc(sizeof(acc_mimeW));
1476  memcpy(*ppwzStr, acc_mimeW, sizeof(acc_mimeW));
1477  }
1478  return S_OK;
1479  case BINDSTRING_USER_AGENT:
1480  CHECK_EXPECT(GetBindString_USER_AGENT);
1481  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1482  if(pcElFetched) {
1483  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1484  *pcElFetched = 1;
1485  }
1486  if(ppwzStr) {
1487  *ppwzStr = CoTaskMemAlloc(sizeof(user_agentW));
1488  memcpy(*ppwzStr, user_agentW, sizeof(user_agentW));
1489  }
1490  return S_OK;
1491  case BINDSTRING_POST_COOKIE:
1492  CHECK_EXPECT(GetBindString_POST_COOKIE);
1493  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1494  if(pcElFetched)
1495  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1496  return S_OK;
1497  case BINDSTRING_URL: {
1498  DWORD size;
1499 
1500  CHECK_EXPECT(GetBindString_URL);
1501  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1502  ok(*pcElFetched == 0, "*pcElFetch=%d, expected 0\n", *pcElFetched);
1503  *pcElFetched = 1;
1504 
1506  *ppwzStr = CoTaskMemAlloc(size);
1507  memcpy(*ppwzStr, binding_urls[tested_protocol], size);
1508  return S_OK;
1509  }
1510  case BINDSTRING_ROOTDOC_URL:
1511  CHECK_EXPECT(GetBindString_ROOTDOC_URL);
1512  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1513  return E_NOTIMPL;
1514  case BINDSTRING_ENTERPRISE_ID:
1515  ok(cEl == 1, "cEl=%d, expected 1\n", cEl);
1516  return E_NOTIMPL;
1517  default:
1518  ok(0, "unexpected ulStringType %d\n", ulStringType);
1519  }
1520 
1521  return E_NOTIMPL;
1522 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static const WCHAR user_agentW[]
Definition: protocol.c:138
#define lstrlenW
Definition: compat.h:415
static const WCHAR acc_mimeW[]
Definition: protocol.c:137
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:203
#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:404
static enum @1668 tested_protocol

◆ BindInfo_QueryInterface()

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

Definition at line 1402 of file protocol.c.

1403 {
1404  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetBindInfo, riid)) {
1405  *ppv = iface;
1406  return S_OK;
1407  }
1408  return E_NOINTERFACE;
1409 }
#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:4112

◆ BindInfo_Release()

static ULONG WINAPI BindInfo_Release ( IInternetBindInfo iface)
static

Definition at line 1416 of file protocol.c.

1417 {
1418  return 1;
1419 }

◆ call_continue()

static void call_continue ( PROTOCOLDATA *  protocol_data)
static

Definition at line 646 of file protocol.c.

647 {
648  HRESULT hres;
649 
650  if (winetest_debug > 1)
651  trace("continue in state %d\n", state);
652 
653  if(state == STATE_CONNECTING) {
655  if (http_is_first){
656  CLEAR_CALLED(ReportProgress_FINDINGRESOURCE);
657  CLEAR_CALLED(ReportProgress_PROXYDETECTING);
658  }
659  CLEAR_CALLED(ReportProgress_CONNECTING);
660  }
662  todo_wine CHECK_CALLED(ReportProgress_SENDINGREQUEST);
663  else if (tested_protocol != HTTPS_TEST)
664  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
665  if(test_redirect && !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
666  CHECK_CALLED(ReportProgress_REDIRECTING);
668  }
669 
670  switch(state) {
673  SET_EXPECT(ReportProgress_SENDINGREQUEST);
674  break;
677  && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))) {
678  SET_EXPECT(OnResponse);
680  SET_EXPECT(ReportProgress_ACCEPTRANGES);
681  SET_EXPECT(ReportProgress_ENCODING);
682  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
683  if(bindf & BINDF_NEEDFILE)
684  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
685  }
686  default:
687  break;
688  }
689 
690  if(state != STATE_SENDINGREQUEST && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)))
691  SET_EXPECT(ReportData);
692  hres = IInternetProtocol_Continue(async_protocol, protocol_data);
693  ok(hres == S_OK, "Continue failed: %08x\n", hres);
695  CLEAR_CALLED(ReportData);
696  else if(state != STATE_SENDINGREQUEST && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)))
697  CHECK_CALLED(ReportData);
698 
699  switch(state) {
702  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
704  break;
706  if(!security_problem) {
709  && (!test_redirect || !(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))) {
710  CHECK_CALLED(OnResponse);
712  CHECK_CALLED(ReportProgress_ACCEPTRANGES);
713  else if(test_redirect || test_abort)
714  CLEAR_CALLED(ReportProgress_ACCEPTRANGES);
715  CLEAR_CALLED(ReportProgress_ENCODING);
716  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
717  if(bindf & BINDF_NEEDFILE)
718  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
719  }
720  }
721  else
722  {
724  SET_EXPECT(ReportProgress_CONNECTING);
725  }
726  default:
727  break;
728  }
729 }
static DWORD bindf
Definition: protocol.c:151
static BOOL test_redirect
Definition: protocol.c:149
#define CLEAR_CALLED(func)
Definition: protocol.c:67
int winetest_debug
static BOOL http_is_first
Definition: protocol.c:149
static DWORD bindinfo_options
Definition: protocol.c:151
static BOOL empty_file
Definition: protocol.c:162
static BOOL test_abort
Definition: protocol.c:161
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:160
static IInternetProtocol * async_protocol
Definition: protocol.c:148
#define todo_wine
Definition: test.h:163
#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:520
#define CHECK_CALLED(func)
Definition: protocol.c:55
static enum @1668 tested_protocol
static BOOL security_problem
Definition: protocol.c:160
enum @1667 state

Referenced by ProtocolSink_Switch(), and test_http_protocol_url().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 2598 of file protocol.c.

2599 {
2600  return 2;
2601 }

◆ ClassFactory_CreateInstance()

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

Definition at line 2608 of file protocol.c.

2610 {
2611  Protocol *ret;
2612 
2613  ok(ppv != NULL, "ppv == NULL\n");
2614 
2615  if(!pOuter) {
2616  CHECK_EXPECT(CreateInstance_no_aggregation);
2617  ok(IsEqualGUID(&IID_IInternetProtocol, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2618  }else {
2619  CHECK_EXPECT(CreateInstance);
2620  ok(pOuter == (IUnknown*)prot_bind_info, "pOuter != protocol_unk\n");
2621  ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2622  if (no_aggregation) {
2623  *ppv = NULL;
2624  return CLASS_E_NOAGGREGATION;
2625  }
2626  }
2627 
2628  ret = heap_alloc(sizeof(*ret));
2629  ret->IUnknown_inner.lpVtbl = &ProtocolUnkVtbl;
2630  ret->IInternetProtocolEx_iface.lpVtbl = &ProtocolVtbl;
2631  ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl;
2632  ret->outer = pOuter;
2633  ret->inner_ref = 1;
2634  ret->outer_ref = 0;
2635 
2636  protocol_emul = ret;
2637  if (!pOuter)
2638  *ppv = &ret->IInternetProtocolEx_iface;
2639  else
2640  *ppv = &ret->IUnknown_inner;
2641  return S_OK;
2642 }
static BOOL no_aggregation
Definition: protocol.c:163
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static const IInternetProtocolExVtbl ProtocolVtbl
Definition: protocol.c:2230
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:191
const GUID IID_IUnknown
static const IUnknownVtbl ProtocolUnkVtbl
Definition: protocol.c:2321
int ret
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
static const IInternetPriorityVtbl InternetPriorityVtbl
Definition: protocol.c:1582
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IInternetBindInfo * prot_bind_info
Definition: protocol.c:153

◆ ClassFactory_LockServer()

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

Definition at line 2644 of file protocol.c.

2645 {
2646  ok(0, "unexpected call\n");
2647  return S_OK;
2648 }
#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 2587 of file protocol.c.

2588 {
2589  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
2590  *ppv = &protocol_info;
2591  return S_OK;
2592  }
2593 
2594  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
2595  return E_NOINTERFACE;
2596 }
#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:2585
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 2603 of file protocol.c.

2604 {
2605  return 1;
2606 }

◆ create_cache_entry()

static void create_cache_entry ( const WCHAR urlw)
static

Definition at line 3184 of file protocol.c.

3185 {
3186  FILETIME now, tomorrow, yesterday;
3187  char file_path[MAX_PATH];
3188  BYTE content[1000];
3189  ULARGE_INTEGER li;
3190  const char *url;
3191  HANDLE file;
3192  DWORD size;
3193  unsigned i;
3194  BOOL res;
3195 
3196  BYTE cache_headers[] = "HTTP/1.1 200 OK\r\n\r\n";
3197 
3198  trace("Testing cache read...\n");
3199 
3200  url = w2a(urlw);
3201 
3202  for(i = 0; i < sizeof(content); i++)
3203  content[i] = '0' + (i%10);
3204 
3206  li.u.HighPart = now.dwHighDateTime;
3207  li.u.LowPart = now.dwLowDateTime;
3208  li.QuadPart += (LONGLONG)10000000 * 3600 * 24;
3209  tomorrow.dwHighDateTime = li.u.HighPart;
3210  tomorrow.dwLowDateTime = li.u.LowPart;
3211  li.QuadPart -= (LONGLONG)10000000 * 3600 * 24 * 2;
3212  yesterday.dwHighDateTime = li.u.HighPart;
3213  yesterday.dwLowDateTime = li.u.LowPart;
3214 
3215  res = CreateUrlCacheEntryA(url, sizeof(content), "", file_path, 0);
3216  ok(res, "CreateUrlCacheEntryA failed: %u\n", GetLastError());
3217 
3219  ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
3220 
3221  WriteFile(file, content, sizeof(content), &size, NULL);
3222  CloseHandle(file);
3223 
3224  res = CommitUrlCacheEntryA(url, file_path, tomorrow, yesterday, NORMAL_CACHE_ENTRY,
3225  cache_headers, sizeof(cache_headers)-1, "", 0);
3226  ok(res, "CommitUrlCacheEntryA failed: %u\n", GetLastError());
3227 }
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:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
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:993
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI CreateUrlCacheEntryA(LPCSTR lpszUrlName, DWORD dwExpectedFileSize, LPCSTR lpszFileExtension, LPSTR lpszFileName, DWORD dwReserved)
Definition: urlcache.c:2808
#define NORMAL_CACHE_ENTRY
Definition: wininet.h:2087
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
#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:3075
static const char * w2a(LPCWSTR str)
Definition: protocol.c:232
GLuint res
Definition: glext.h:9613
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
struct _ULARGE_INTEGER::@3769 u
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/62]

DEFINE_EXPECT ( GetBindInfo  )

◆ DEFINE_EXPECT() [2/62]

DEFINE_EXPECT ( ReportProgress_MIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [3/62]

DEFINE_EXPECT ( ReportProgress_DIRECTBIND  )

◆ DEFINE_EXPECT() [4/62]

DEFINE_EXPECT ( ReportProgress_RAWMIMETYPE  )

◆ DEFINE_EXPECT() [5/62]

DEFINE_EXPECT ( ReportProgress_FINDINGRESOURCE  )

◆ DEFINE_EXPECT() [6/62]

DEFINE_EXPECT ( ReportProgress_CONNECTING  )

◆ DEFINE_EXPECT() [7/62]

DEFINE_EXPECT ( ReportProgress_SENDINGREQUEST  )

◆ DEFINE_EXPECT() [8/62]

DEFINE_EXPECT ( ReportProgress_CACHEFILENAMEAVAILABLE  )

◆ DEFINE_EXPECT() [9/62]

DEFINE_EXPECT ( ReportProgress_VERIFIEDMIMETYPEAVAILABLE  )

◆ DEFINE_EXPECT() [10/62]

DEFINE_EXPECT ( ReportProgress_PROTOCOLCLASSID  )

◆ DEFINE_EXPECT() [11/62]

DEFINE_EXPECT ( ReportProgress_COOKIE_SENT  )

◆ DEFINE_EXPECT() [12/62]

DEFINE_EXPECT ( ReportProgress_REDIRECTING  )

◆ DEFINE_EXPECT() [13/62]

DEFINE_EXPECT ( ReportProgress_ENCODING  )

◆ DEFINE_EXPECT() [14/62]

DEFINE_EXPECT ( ReportProgress_ACCEPTRANGES  )

◆ DEFINE_EXPECT() [15/62]

DEFINE_EXPECT ( ReportProgress_PROXYDETECTING  )

◆ DEFINE_EXPECT() [16/62]

DEFINE_EXPECT ( ReportProgress_LOADINGMIMEHANDLER  )

◆ DEFINE_EXPECT() [17/62]

DEFINE_EXPECT ( ReportProgress_DECODING  )

◆ DEFINE_EXPECT() [18/62]

DEFINE_EXPECT ( ReportData  )

◆ DEFINE_EXPECT() [19/62]

DEFINE_EXPECT ( ReportData2  )

◆ DEFINE_EXPECT() [20/62]

DEFINE_EXPECT ( ReportResult  )

◆ DEFINE_EXPECT() [21/62]

DEFINE_EXPECT ( GetBindString_ACCEPT_MIMES  )

◆ DEFINE_EXPECT() [22/62]

DEFINE_EXPECT ( GetBindString_USER_AGENT  )

◆ DEFINE_EXPECT() [23/62]

DEFINE_EXPECT ( GetBindString_POST_COOKIE  )

◆ DEFINE_EXPECT() [24/62]

DEFINE_EXPECT ( GetBindString_URL  )

◆ DEFINE_EXPECT() [25/62]

DEFINE_EXPECT ( GetBindString_ROOTDOC_URL  )

◆ DEFINE_EXPECT() [26/62]

DEFINE_EXPECT ( QueryService_HttpNegotiate  )

◆ DEFINE_EXPECT() [27/62]

DEFINE_EXPECT ( QueryService_InternetProtocol  )

◆ DEFINE_EXPECT() [28/62]

DEFINE_EXPECT ( QueryService_HttpSecurity  )

◆ DEFINE_EXPECT() [29/62]

DEFINE_EXPECT ( QueryService_IBindCallbackRedirect  )

◆ DEFINE_EXPECT() [30/62]

DEFINE_EXPECT ( QueryInterface_IWinInetInfo  )

◆ DEFINE_EXPECT() [31/62]

DEFINE_EXPECT ( QueryInterface_IWinInetHttpInfo  )

◆ DEFINE_EXPECT() [32/62]

DEFINE_EXPECT ( BeginningTransaction  )

◆ DEFINE_EXPECT() [33/62]

DEFINE_EXPECT ( GetRootSecurityId  )

◆ DEFINE_EXPECT() [34/62]

DEFINE_EXPECT ( OnResponse  )

◆ DEFINE_EXPECT() [35/62]

DEFINE_EXPECT ( Switch  )

◆ DEFINE_EXPECT() [36/62]

DEFINE_EXPECT ( Continue  )

◆ DEFINE_EXPECT() [37/62]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [38/62]

DEFINE_EXPECT ( CreateInstance_no_aggregation  )

◆ DEFINE_EXPECT() [39/62]

DEFINE_EXPECT ( Start  )

◆ DEFINE_EXPECT() [40/62]

DEFINE_EXPECT ( StartEx  )

◆ DEFINE_EXPECT() [41/62]

DEFINE_EXPECT ( Terminate  )

◆ DEFINE_EXPECT() [42/62]

DEFINE_EXPECT ( Read  )

◆ DEFINE_EXPECT() [43/62]

DEFINE_EXPECT ( Read2  )

◆ DEFINE_EXPECT() [44/62]

DEFINE_EXPECT ( SetPriority  )

◆ DEFINE_EXPECT() [45/62]

DEFINE_EXPECT ( LockRequest  )

◆ DEFINE_EXPECT() [46/62]

DEFINE_EXPECT ( UnlockRequest  )

◆ DEFINE_EXPECT() [47/62]

DEFINE_EXPECT ( Abort  )

◆ DEFINE_EXPECT() [48/62]

DEFINE_EXPECT ( MimeFilter_CreateInstance  )

◆ DEFINE_EXPECT() [49/62]

DEFINE_EXPECT ( MimeFilter_Start  )

◆ DEFINE_EXPECT() [50/62]

DEFINE_EXPECT ( MimeFilter_ReportData  )

◆ DEFINE_EXPECT() [51/62]

DEFINE_EXPECT ( MimeFilter_ReportResult  )

◆ DEFINE_EXPECT() [52/62]

DEFINE_EXPECT ( MimeFilter_Terminate  )

◆ DEFINE_EXPECT() [53/62]

DEFINE_EXPECT ( MimeFilter_LockRequest  )

◆ DEFINE_EXPECT() [54/62]

DEFINE_EXPECT ( MimeFilter_UnlockRequest  )

◆ DEFINE_EXPECT() [55/62]

DEFINE_EXPECT ( MimeFilter_Read  )

◆ DEFINE_EXPECT() [56/62]

DEFINE_EXPECT ( MimeFilter_Switch  )

◆ DEFINE_EXPECT() [57/62]

DEFINE_EXPECT ( MimeFilter_Continue  )

◆ DEFINE_EXPECT() [58/62]

DEFINE_EXPECT ( Stream_Seek  )

◆ DEFINE_EXPECT() [59/62]

DEFINE_EXPECT ( Stream_Read  )

◆ DEFINE_EXPECT() [60/62]

DEFINE_EXPECT ( Redirect  )

◆ DEFINE_EXPECT() [61/62]

DEFINE_EXPECT ( outer_QI_test  )

◆ DEFINE_EXPECT() [62/62]

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 2808 of file protocol.c.

2810 {
2811  HRESULT hres;
2812 
2813  SET_EXPECT(GetBindInfo);
2814  if(!(bindf & BINDF_FROMURLMON))
2815  SET_EXPECT(ReportProgress_DIRECTBIND);
2816  if(is_first) {
2817  SET_EXPECT(ReportProgress_SENDINGREQUEST);
2818  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
2819  if(bindf & BINDF_FROMURLMON)
2820  SET_EXPECT(ReportProgress_VERIFIEDMIMETYPEAVAILABLE);
2821  else
2822  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2823  }
2824  SET_EXPECT(ReportData);
2825  if(is_first)
2826  SET_EXPECT(ReportResult);
2827 
2829 
2830  if(protocolex) {
2831  hres = IInternetProtocolEx_StartEx(protocolex, uri, &protocol_sink, &bind_info, 0, 0);
2832  ok(hres == S_OK, "StartEx failed: %08x\n", hres);
2833  }else {
2834  hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0);
2835  if(hres == INET_E_RESOURCE_NOT_FOUND) {
2836  win_skip("Start failed\n");
2837  return FALSE;
2838  }
2839  ok(hres == S_OK, "Start failed: %08x\n", hres);
2840  }
2841 
2842  CHECK_CALLED(GetBindInfo);
2843  if(!(bindf & BINDF_FROMURLMON))
2844  CLEAR_CALLED(ReportProgress_DIRECTBIND); /* Not called by IE10 */
2845  if(is_first) {
2846  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
2847  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
2848  if(bindf & BINDF_FROMURLMON)
2849  CHECK_CALLED(ReportProgress_VERIFIEDMIMETYPEAVAILABLE);
2850  else
2851  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2852  }
2853  CHECK_CALLED(ReportData);
2854  if(is_first)
2855  CHECK_CALLED(ReportResult);
2856 
2857  return TRUE;
2858 }
#define TRUE
Definition: types.h:120
static DWORD bindf
Definition: protocol.c:151
const char * uri
Definition: sec_mgr.c:1594
#define CLEAR_CALLED(func)
Definition: protocol.c:67
static IInternetBindInfo bind_info
Definition: protocol.c:1532
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:146
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1226
#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:150

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 3229 of file protocol.c.

3230 {
3231  static BOOL got_user_agent = FALSE;
3232  IUri *uri = NULL;
3233  HRESULT hres;
3234 
3235  if(use_iuri && pCreateUri) {
3236  hres = pCreateUri(url, 0, 0, &uri);
3237  ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
3238  }
3239 
3240  SET_EXPECT(GetBindInfo);
3241  if (!(bindf & BINDF_FROMURLMON))
3242  SET_EXPECT(ReportProgress_DIRECTBIND);
3243  if(!got_user_agent)
3244  SET_EXPECT(GetBindString_USER_AGENT);
3245  SET_EXPECT(GetBindString_ROOTDOC_URL);
3246  SET_EXPECT(GetBindString_ACCEPT_MIMES);
3247  SET_EXPECT(QueryService_HttpNegotiate);
3248  SET_EXPECT(BeginningTransaction);
3249  SET_EXPECT(GetRootSecurityId);
3250  if(http_post_test) {
3251  SET_EXPECT(GetBindString_POST_COOKIE);
3252  if(http_post_test == TYMED_ISTREAM)
3254  }
3255  if(bind_from_cache) {
3256  SET_EXPECT(OnResponse);
3257  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
3258  SET_EXPECT(ReportData);
3259  }
3260 
3261  if(uri) {
3262  IInternetProtocolEx *protocolex;
3263 
3264  hres = IInternetProtocol_QueryInterface(async_protocol, &IID_IInternetProtocolEx, (void**)&protocolex);
3265  ok(hres == S_OK, "Could not get IInternetProtocolEx iface: %08x\n", hres);
3266 
3267  hres = IInternetProtocolEx_StartEx(protocolex, uri, &protocol_sink, &bind_info, 0, 0);
3268  ok(hres == S_OK, "Start failed: %08x\n", hres);
3269 
3270  IInternetProtocolEx_Release(protocolex);
3271  IUri_Release(uri);
3272  }else {
3273  hres = IInternetProtocol_Start(async_protocol, url, &protocol_sink, &bind_info, 0, 0);
3274  ok(hres == S_OK, "Start failed: %08x\n", hres);
3275  }
3276  if(FAILED(hres))
3277  return FALSE;
3278 
3279  CHECK_CALLED(GetBindInfo);
3280  if (!(bindf & BINDF_FROMURLMON))
3281  CHECK_CALLED(ReportProgress_DIRECTBIND);
3282  if (!got_user_agent)
3283  {
3284  CHECK_CALLED(GetBindString_USER_AGENT);
3285  got_user_agent = TRUE;
3286  }
3287  CLEAR_CALLED(GetBindString_ROOTDOC_URL); /* New in IE11 */
3288  CHECK_CALLED(GetBindString_ACCEPT_MIMES);
3289  CHECK_CALLED(QueryService_HttpNegotiate);
3290  CHECK_CALLED(BeginningTransaction);
3291  /* GetRootSecurityId called on WinXP but not on Win98 */
3292  CLEAR_CALLED(GetRootSecurityId);
3293  if(http_post_test) {
3294  CHECK_CALLED(GetBindString_POST_COOKIE);
3295  if(http_post_test == TYMED_ISTREAM)
3297  }
3298  if(bind_from_cache) {
3299  CHECK_CALLED(OnResponse);
3300  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
3301  CHECK_CALLED(ReportData);
3302  }
3303 
3304  return TRUE;
3305 }
static BOOL bind_from_cache
Definition: protocol.c:162
#define TRUE
Definition: types.h:120
static DWORD bindf
Definition: protocol.c:151
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:548
unsigned int BOOL
Definition: ntddk_ex.h:94
static IInternetBindInfo bind_info
Definition: protocol.c:1532
smooth NULL
Definition: ftsmooth.c:416
static DWORD http_post_test
Definition: protocol.c:159
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:148
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1226
#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 309 of file protocol.c.

310 {
311  return 2;
312 }

◆ HttpNegotiate_BeginningTransaction()

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

Definition at line 319 of file protocol.c.

321 {
322  LPWSTR addl_headers;
323 
324  static const WCHAR wszHeaders[] =
325  {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ','a','p','p','l','i','c','a','t',
326  'i','o','n','/','x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o',
327  'd','e','d','\r','\n',0};
328 
329  CHECK_EXPECT(BeginningTransaction);
330 
331  if(binding_test)
332  ok(!lstrcmpW(szURL, binding_urls[tested_protocol]), "szURL != http_url\n");
333  else
334  ok(!lstrcmpW(szURL, http_url), "szURL != http_url\n");
335  ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved);
336  ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n");
337  if(pszAdditionalHeaders)
338  {
339  ok(*pszAdditionalHeaders == NULL, "*pszAdditionalHeaders != NULL\n");
340  if (http_post_test)
341  {
342  addl_headers = CoTaskMemAlloc(sizeof(wszHeaders));
343  memcpy(addl_headers, wszHeaders, sizeof(wszHeaders));
344  *pszAdditionalHeaders = addl_headers;
345  }
346  }
347 
348  return S_OK;
349 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
_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:147
smooth NULL
Definition: ftsmooth.c:416
static DWORD http_post_test
Definition: protocol.c:159
__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:203
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static BOOL binding_test
Definition: protocol.c:157
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
static enum @1668 tested_protocol

◆ HttpNegotiate_GetRootSecurityId()

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

Definition at line 364 of file protocol.c.

366 {
367  static const BYTE sec_id[] = {'h','t','t','p',':','t','e','s','t',1,0,0,0};
368 
369  CHECK_EXPECT(GetRootSecurityId);
370 
371  ok(!dwReserved, "dwReserved=%ld, expected 0\n", dwReserved);
372  ok(pbSecurityId != NULL, "pbSecurityId == NULL\n");
373  ok(pcbSecurityId != NULL, "pcbSecurityId == NULL\n");
374 
375  if(pcbSecurityId) {
376  ok(*pcbSecurityId == 512, "*pcbSecurityId=%d, expected 512\n", *pcbSecurityId);
377  *pcbSecurityId = sizeof(sec_id);
378  }
379 
380  if(pbSecurityId)
381  memcpy(pbSecurityId, sec_id, sizeof(sec_id));
382 
383  return E_FAIL;
384 }
#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 351 of file protocol.c.

353 {
354  CHECK_EXPECT(OnResponse);
355 
356  ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode);
357  ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n");
358  ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n");
359  ok(pszAdditionalRequestHeaders == NULL, "pszAdditionalHeaders != NULL\n");
360 
361  return S_OK;
362 }
#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 296 of file protocol.c.

297 {
299  || IsEqualGUID(&IID_IHttpNegotiate, riid)
300  || IsEqualGUID(&IID_IHttpNegotiate2, riid)) {
301  *ppv = iface;
302  return S_OK;
303  }
304 
305  ok(0, "unexpected call\n");
306  return E_NOINTERFACE;
307 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HttpNegotiate_Release()

static ULONG WINAPI HttpNegotiate_Release ( IHttpNegotiate2 iface)
static

Definition at line 314 of file protocol.c.

315 {
316  return 1;
317 }

◆ HttpSecurity_AddRef()

static ULONG WINAPI HttpSecurity_AddRef ( IHttpSecurity iface)
static

Definition at line 251 of file protocol.c.

252 {
253  return 2;
254 }

◆ HttpSecurity_GetWindow()

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

Definition at line 261 of file protocol.c.

262 {
263  trace("HttpSecurity_GetWindow\n");
264 
265  return S_FALSE;
266 }
#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 268 of file protocol.c.

269 {
270  win_skip("Security problem: %u\n", dwProblem);
272  "Expected got %u security problem\n", dwProblem);
273 
274  /* Only retry once */
275  if (security_problem)
276  return E_ABORT;
277 
279  if(dwProblem == ERROR_INTERNET_INVALID_CA)
280  return E_ABORT;
281  SET_EXPECT(BeginningTransaction);
282 
283  return RPC_E_RETRY;
284 }
#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:150
static BOOL security_problem
Definition: protocol.c:160

◆ HttpSecurity_QueryInterface()

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

Definition at line 239 of file protocol.c.

240 {
242  || IsEqualGUID(&IID_IHttpSecurity, riid)) {
243  *ppv = iface;
244  return S_OK;
245  }
246 
247  ok(0, "unexpected call\n");
248  return E_NOINTERFACE;
249 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HttpSecurity_Release()

static ULONG WINAPI HttpSecurity_Release ( IHttpSecurity iface)
static

Definition at line 256 of file protocol.c.

257 {
258  return 1;
259 }

◆ impl_from_IInternetPriority()

static Protocol* impl_from_IInternetPriority ( IInternetPriority iface)
static

Definition at line 1534 of file protocol.c.

1535 {
1536  return CONTAINING_RECORD(iface, Protocol, IInternetPriority_iface);
1537 }
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 1634 of file protocol.c.

1635 {
1636  return CONTAINING_RECORD(iface, Protocol, IInternetProtocolEx_iface);
1637 }
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 2247 of file protocol.c.

2248 {
2249  return CONTAINING_RECORD(iface, Protocol, IUnknown_inner);
2250 }
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 2721 of file protocol.c.

2722 {
2723  tested_protocol = prot;
2724  binding_test = (flags & TEST_BINDING) != 0;
2726  prot_read = 0;
2727  prot_state = 0;
2729  mimefilter_test = (flags & TEST_FILTER) != 0;
2730  no_mime = (flags & TEST_NOMIME) != 0;
2731  filter_state = 0;
2732  post_stream_read = 0;
2738  filtered_sink = NULL;
2739  http_is_first = (flags & TEST_FIRST_HTTP) != 0;
2742  test_async_req = (flags & TEST_ASYNCREQ) != 0;
2743  direct_read = (flags & TEST_DIRECT_READ) != 0;
2744  emulate_prot = (flags & TEST_EMULATEPROT) != 0;
2746  short_read = (flags & TEST_SHORT_READ) != 0;
2747  http_post_test = TYMED_NULL;
2749  test_abort = (flags & TEST_ABORT) != 0;
2750  impl_protex = (flags & TEST_IMPLPROTEX) != 0;
2751  empty_file = (flags & TEST_EMPTY) != 0;
2756 
2757  bindinfo_options = 0;
2759  bindinfo_options |= BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS;
2760 
2762 }
static HANDLE event_continue_done
Definition: protocol.c:156
static HANDLE event_continue
Definition: protocol.c:156
static BOOL bind_from_cache
Definition: protocol.c:162
#define TEST_NOMIME
Definition: protocol.c:2694
#define TRUE
Definition: types.h:120
static IInternetProtocol * binding_protocol
Definition: protocol.c:152
#define TEST_DISABLEAUTOREDIRECT
Definition: protocol.c:2696
static HANDLE event_complete2
Definition: protocol.c:156
static BOOL test_redirect
Definition: protocol.c:149
#define TEST_EMPTY
Definition: protocol.c:2693
#define TEST_REDIRECT
Definition: protocol.c:2688
static int post_stream_read
Definition: protocol.c:150
static BOOL async_read_pending
Definition: protocol.c:161
static BOOL http_is_first
Definition: protocol.c:149
#define TEST_FILTER
Definition: protocol.c:2682
static BOOL emulate_prot
Definition: protocol.c:161
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:151
static HANDLE event_complete
Definition: protocol.c:156
#define TEST_ABORT
Definition: protocol.c:2689
#define TEST_SHORT_READ
Definition: protocol.c:2687
#define TEST_DIRECT_READ
Definition: protocol.c:2684
static DWORD filter_state
Definition: protocol.c:159
static BOOL empty_file
Definition: protocol.c:162
static BOOL wait_for_switch
Definition: protocol.c:161
static DWORD http_post_test
Definition: protocol.c:159
static BOOL test_abort
Definition: protocol.c:161
static BOOL file_with_hash
Definition: protocol.c:162
#define TEST_BINDING
Definition: protocol.c:2681
static BOOL test_async_req
Definition: protocol.c:160
static BOOL no_mime
Definition: protocol.c:162
static IInternetProtocol * async_protocol
Definition: protocol.c:148
static BOOL redirect_on_continue
Definition: protocol.c:149
#define TEST_FROMCACHE
Definition: protocol.c:2695
GLbitfield flags
Definition: glext.h:7161
static BOOL reuse_protocol_thread
Definition: protocol.c:162
static BOOL short_read
Definition: protocol.c:161
static IInternetProtocol * filtered_protocol
Definition: protocol.c:152
static BOOL mimefilter_test
Definition: protocol.c:161
static BOOL first_data_notif
Definition: protocol.c:149
static BOOL impl_protex
Definition: protocol.c:160
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
static BOOL binding_test
Definition: protocol.c:157
#define TEST_IMPLPROTEX
Definition: protocol.c:2692
static DWORD prot_read
Definition: protocol.c:159
static int prot_state
Definition: protocol.c:150
#define TEST_EMULATEPROT
Definition: protocol.c:2686
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:154
static BOOL direct_read
Definition: protocol.c:161
#define TEST_ASYNCREQ
Definition: protocol.c:2690
static enum @1668 tested_protocol
static BOOL security_problem
Definition: protocol.c:160
#define TEST_FIRST_HTTP
Definition: protocol.c:2683
static void register_filter(BOOL do_register)
Definition: protocol.c:2698
enum @1667 state

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 1546 of file protocol.c.

1547 {
1549  if (This->outer)
1550  {
1551  This->outer_ref++;
1552  return IUnknown_AddRef(This->outer);
1553  }
1554  return IUnknown_AddRef(&This->IUnknown_inner);
1555 }
static Protocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: protocol.c:1534

◆ InternetPriority_GetPriority()

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

Definition at line 1575 of file protocol.c.

1576 {
1577  ok(0, "unexpected call\n");
1578  return E_NOTIMPL;
1579 }
#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 1539 of file protocol.c.

1541 {
1542  ok(0, "unexpected call\n");
1543  return E_NOINTERFACE;
1544 }
#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 1557 of file protocol.c.

1558 {
1560  if (This->outer)
1561  {
1562  This->outer_ref--;
1563  return IUnknown_Release(This->outer);
1564  }
1565  return IUnknown_Release(&This->IUnknown_inner);
1566 }
static Protocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: protocol.c:1534

◆ InternetPriority_SetPriority()

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

Definition at line 1568 of file protocol.c.

1569 {
1571  ok(nPriority == ex_priority, "nPriority=%d\n", nPriority);
1572  return S_OK;
1573 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
static DWORD ex_priority
Definition: protocol.c:151
#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 2534 of file protocol.c.

2535 {
2536  return 2;
2537 }

◆ 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 2552 of file protocol.c.

2555 {
2556  ok(0, "unexpected call\n");
2557  return E_NOTIMPL;
2558 }
#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 2560 of file protocol.c.

2562 {
2563  ok(0, "unexpected call\n");
2564  return E_NOTIMPL;
2565 }
#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 2544 of file protocol.c.

2547 {
2548  ok(0, "unexpected call %d\n", ParseAction);
2549  return E_NOTIMPL;
2550 }
#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 2567 of file protocol.c.

2570 {
2571  ok(0, "unexpected call\n");
2572  return E_NOTIMPL;
2573 }
#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 2528 of file protocol.c.

2529 {
2530  ok(0, "unexpected call\n");
2531  return E_NOINTERFACE;
2532 }
#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 2539 of file protocol.c.

2540 {
2541  return 1;
2542 }

◆ MimeFilter_CreateInstance()

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

Definition at line 2660 of file protocol.c.

2661 {
2663 
2664  ok(!outer, "outer = %p\n", outer);
2665  ok(IsEqualGUID(&IID_IInternetProtocol, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2666 
2667  *ppv = &MimeProtocol;
2668  return S_OK;
2669 }
static IInternetProtocolEx MimeProtocol
Definition: protocol.c:2526
#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:4112
static HRESULT WINAPI MimeFilter_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: protocol.c:2660

Referenced by protocol_start(), and ProtocolEmul_Continue().

◆ MimeProtocol_LockRequest()

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

Definition at line 2480 of file protocol.c.

2481 {
2482  HRESULT hres;
2483 
2484  CHECK_EXPECT(MimeFilter_LockRequest);
2485 
2486  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
2487 
2489  hres = IInternetProtocol_LockRequest(filtered_protocol, dwOptions);
2490  ok(hres == S_OK, "LockRequest failed: %08x\n", hres);
2492 
2493  return S_OK;
2494 }
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:152
#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 2327 of file protocol.c.

2328 {
2329  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocol, riid)) {
2330  *ppv = iface;
2331  return S_OK;
2332  }
2333 
2334  if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
2335  *ppv = &mime_protocol_sink;
2336  return S_OK;
2337  }
2338 
2339  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2340  *ppv = NULL;
2341  return E_NOINTERFACE;
2342 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static IInternetProtocolSink mime_protocol_sink
Definition: protocol.c:1372
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ MimeProtocol_Read()

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

Definition at line 2447 of file protocol.c.

2449 {
2450  BYTE buf[2096];
2451  DWORD read = 0;
2452  HRESULT hres;
2453 
2454  CHECK_EXPECT(MimeFilter_Read);
2455 
2456  ok(pv != NULL, "pv == NULL\n");
2457  ok(cb != 0, "cb == 0\n");
2458  ok(pcbRead != NULL, "pcbRead == NULL\n");
2459 
2460  if(read_report_data)
2461  SET_EXPECT(Read2);
2462  else
2463  SET_EXPECT(Read);
2464  hres = IInternetProtocol_Read(filtered_protocol, buf, sizeof(buf), &read);
2465  ok(hres == S_OK || hres == S_FALSE || hres == E_PENDING, "Read failed: %08x\n", hres);
2466  if(read_report_data)
2467  CHECK_CALLED(Read2);
2468  else
2469  CHECK_CALLED(Read);
2470 
2471  if(pcbRead) {
2472  ok(*pcbRead == 0, "*pcbRead=%d, expected 0\n", *pcbRead);
2473  *pcbRead = read;
2474  }
2475 
2476  memset(pv, 'x', read);
2477  return hres;
2478 }
_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:150
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
static IInternetProtocol * filtered_protocol
Definition: protocol.c:152
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define SET_EXPECT(func)
Definition: protocol.c:40
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
#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 2344 of file protocol.c.

2347 {
2349  LPOLESTR url_str = NULL;
2350  DWORD fetched = 0;
2351  BINDINFO bindinfo;
2352  DWORD cbindf = 0;
2353  HRESULT hres;
2354 
2355  CHECK_EXPECT(MimeFilter_Start);
2356 
2357  ok(!lstrcmpW(szUrl, pjpegW), "wrong url %s\n", wine_dbgstr_w(szUrl));
2358  ok(grfPI == (PI_FILTER_MODE|PI_FORCE_ASYNC), "grfPI=%x, expected PI_FILTER_MODE|PI_FORCE_ASYNC\n", grfPI);
2359  ok(dwReserved, "dwReserved == 0\n");
2360  ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
2361  ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
2362 
2363  if(binding_test) {
2364  ok(pOIProtSink != binding_sink, "pOIProtSink == protocol_sink\n");
2365  ok(pOIBindInfo == prot_bind_info, "pOIBindInfo != bind_info\n");
2366  }else {
2367  ok(pOIProtSink == &protocol_sink, "pOIProtSink != protocol_sink\n");
2368  ok(pOIBindInfo == &bind_info, "pOIBindInfo != bind_info\n");
2369  }
2370 
2371  data = (void*)dwReserved;
2372  ok(data->cbSize == sizeof(*data), "data->cbSize = %d\n", data->cbSize);
2373  ok(!data->pProtocolSink, "data->pProtocolSink != NULL\n");
2374  ok(data->pProtocol != NULL, "data->pProtocol == NULL\n");
2375  ok(!data->pUnk, "data->pUnk != NULL\n");
2376  ok(!data->dwFilterFlags, "data->dwProtocolFlags = %x\n", data->dwFilterFlags);
2377  if(binding_test) {
2378  IInternetProtocolSink *prot_sink;
2379 
2380  IInternetProtocol_QueryInterface(data->pProtocol, &IID_IInternetProtocolSink, (void**)&prot_sink);
2381  ok(prot_sink == pOIProtSink, "QI(data->pProtocol, IID_IInternetProtocolSink) != pOIProtSink\n");
2382  IInternetProtocolSink_Release(prot_sink);
2383 
2384  ok(data->pProtocol != binding_protocol, "data->pProtocol == binding_protocol\n");
2385 
2386  filtered_protocol = data->pProtocol;
2387  IInternetProtocol_AddRef(filtered_protocol);
2388  }else {
2389  IInternetProtocol *prot;
2390 
2391  IInternetProtocol_QueryInterface(data->pProtocol, &IID_IInternetProtocol, (void**)&prot);
2392  ok(prot == async_protocol, "QI(data->pProtocol, IID_IInternetProtocol) != async_protocol\n");
2393  IInternetProtocol_Release(prot);
2394 
2395  ok(data->pProtocol != async_protocol, "data->pProtocol == async_protocol\n");
2396  }
2397 
2398  filtered_sink = pOIProtSink;
2399 
2400  SET_EXPECT(ReportProgress_DECODING);
2401  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DECODING, pjpegW);
2402  ok(hres == S_OK, "ReportProgress(BINDSTATUS_DECODING) failed: %08x\n", hres);
2403  CHECK_CALLED(ReportProgress_DECODING);
2404 
2405  SET_EXPECT(GetBindInfo);
2406  memset(&bindinfo, 0, sizeof(bindinfo));
2407  bindinfo.cbSize = sizeof(bindinfo);
2408  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &cbindf, &bindinfo);
2409  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2410  ok(cbindf == (bindf|BINDF_FROMURLMON), "cbindf = %x, expected %x\n", cbindf, bindf);
2411  CHECK_CALLED(GetBindInfo);
2412 
2413  SET_EXPECT(GetBindString_URL);
2414  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_URL, &url_str, 1, &fetched);
2415  ok(hres == S_OK, "GetBindString(BINDSTRING_URL) failed: %08x\n", hres);
2416  ok(fetched == 1, "fetched = %d\n", fetched);
2417  ok(!lstrcmpW(url_str, binding_urls[tested_protocol]), "wrong url_str %s\n", wine_dbgstr_w(url_str));
2418  CoTaskMemFree(url_str);
2419  CHECK_CALLED(GetBindString_URL);
2420 
2421  return S_OK;
2422 }
static IInternetProtocol * binding_protocol
Definition: protocol.c:152
#define CHECK_EXPECT(func)
Definition: protocol.c:49
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static IInternetProtocolSink * binding_sink
Definition: protocol.c:154
static DWORD bindf
Definition: protocol.c:151
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
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:1532
static const WCHAR pjpegW[]
Definition: protocol.c:143
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:148
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static IInternetProtocol * filtered_protocol
Definition: protocol.c:152
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1226
GET_FEATURE_FROM_THREAD_RESTRICTED struct _tagPROTOCOLFILTERDATA PROTOCOLFILTERDATA
static const WCHAR binding_urls[][130]
Definition: protocol.c:203
#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:157
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:154
#define memset(x, y, z)
Definition: compat.h:39
static enum @1668 tested_protocol
static IInternetBindInfo * prot_bind_info
Definition: protocol.c:153

◆ MimeProtocol_Terminate()

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

Definition at line 2431 of file protocol.c.

2432 {
2433  HRESULT hres;
2434 
2435  CHECK_EXPECT(MimeFilter_Terminate);
2436 
2437  ok(!dwOptions, "dwOptions = %x\n", dwOptions);
2438 
2439  SET_EXPECT(Terminate);
2440  hres = IInternetProtocol_Terminate(filtered_protocol, dwOptions);
2441  ok(hres == S_OK, "Terminate failed: %08x\n", hres);
2442  CHECK_CALLED(Terminate);
2443 
2444  return S_OK;
2445 }
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:152
#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 2496 of file protocol.c.

2497 {
2498  HRESULT hres;
2499 
2500  CHECK_EXPECT(MimeFilter_UnlockRequest);
2501 
2503  hres = IInternetProtocol_UnlockRequest(filtered_protocol);
2504  ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
2506 
2507  return S_OK;
2508 }
#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:152
#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 1240 of file protocol.c.

1241 {
1242  return 2;
1243 }

◆ MimeProtocolSink_QueryInterface()

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

Definition at line 1228 of file protocol.c.

1229 {
1231  || IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
1232  *ppv = iface;
1233  return S_OK;
1234  }
1235 
1236  ok(0, "unexpected call\n");
1237  return E_NOTIMPL;
1238 }
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:4112

◆ MimeProtocolSink_Release()

static ULONG WINAPI MimeProtocolSink_Release ( IInternetProtocolSink iface)
static

Definition at line 1245 of file protocol.c.

1246 {
1247  return 1;
1248 }

◆ MimeProtocolSink_ReportData()

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

Definition at line 1284 of file protocol.c.

1286 {
1287  DWORD read = 0;
1288  BYTE buf[8192];
1289  HRESULT hres;
1291 
1292  CHECK_EXPECT(MimeFilter_ReportData);
1293 
1294  if(!filter_state && !no_mime) {
1295  SET_EXPECT(Read);
1296  hres = IInternetProtocol_Read(filtered_protocol, buf, sizeof(buf), &read);
1297  if(tested_protocol == HTTP_TEST)
1298  ok(hres == S_OK || hres == E_PENDING || hres == S_FALSE, "Read failed: %08x\n", hres);
1299  else
1300  ok(hres == S_OK, "Read failed: %08x\n", hres);
1301  CHECK_CALLED(Read);
1302 
1303  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1304  hres = IInternetProtocolSink_ReportProgress(filtered_sink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, text_htmlW);
1305  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
1306  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1307 
1308  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1309  hres = IInternetProtocolSink_ReportProgress(filtered_sink, BINDSTATUS_MIMETYPEAVAILABLE, text_htmlW);
1310  ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
1311  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1312 
1313  /* FIXME: test BINDSTATUS_CACHEFILENAMEAVAILABLE */
1314  }
1315 
1316  if(no_mime && prot_read<200) {
1317  SET_EXPECT(Read);
1318  }else if(no_mime && prot_read<300) {
1319  report_mime = TRUE;
1320  SET_EXPECT(Read);
1321  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1322  SET_EXPECT(ReportData);
1323  }else if(!read_report_data) {
1324  SET_EXPECT(ReportData);
1325  }
1326  hres = IInternetProtocolSink_ReportData(filtered_sink, grfBSCF, ulProgress, ulProgressMax);
1327  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1328  if(no_mime && prot_read<=200) {
1329  CHECK_CALLED(Read);
1330  }else if(report_mime) {
1331  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1332  CHECK_CALLED(ReportData);
1333  }else if(!read_report_data) {
1334  CHECK_CALLED(ReportData);
1335  }
1336 
1337  if(!filter_state)
1338  filter_state = 1;
1339 
1340  return S_OK;
1341 }
static const WCHAR text_htmlW[]
Definition: protocol.c:139
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
static DWORD filter_state
Definition: protocol.c:159
static int read_report_data
Definition: protocol.c:150
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BOOL no_mime
Definition: protocol.c:162
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
static IInternetProtocol * filtered_protocol
Definition: protocol.c:152
#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:159
#define CHECK_CALLED(func)
Definition: protocol.c:55
#define E_PENDING
Definition: dinput.h:172
static IInternetProtocolSink * filtered_sink
Definition: protocol.c:154
static enum @1668 tested_protocol
_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 1264 of file protocol.c.

1266 {
1267  switch(ulStatusCode) {
1268  case BINDSTATUS_LOADINGMIMEHANDLER:
1269  /*
1270  * IE9 for some reason (bug?) calls this on mime handler's protocol sink instead of the
1271  * main protocol sink. We check ReportProgress_LOADINGMIMEHANDLER both here and in
1272  * ProtocolSink_ReportProgress to workaround it.
1273  */
1274  CHECK_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
1275  ok(!szStatusText, "szStatusText = %s\n", wine_dbgstr_w(szStatusText));
1276  break;
1277  default:
1278  ok(0, "Unexpected status code %d\n", ulStatusCode);
1279  }
1280 
1281  return S_OK;
1282 }
#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 1343 of file protocol.c.

1345 {
1346  HRESULT hres;
1347 
1348  CHECK_EXPECT(MimeFilter_ReportResult);
1349 
1350  ok(hrResult == S_OK, "hrResult = %08x\n", hrResult);
1351  ok(dwError == ERROR_SUCCESS, "dwError = %u\n", dwError);
1352  ok(!szResult, "szResult = %s\n", wine_dbgstr_w(szResult));
1353 
1354  SET_EXPECT(ReportResult);
1355  hres = IInternetProtocolSink_ReportResult(filtered_sink, hrResult, dwError, szResult);
1356  ok(SUCCEEDED(hres), "ReportResult failed: %08x\n", hres);
1357  CHECK_CALLED(ReportResult);
1358 
1359  return S_OK;
1360 }
#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:154
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ MimeProtocolSink_Switch()

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

Definition at line 1250 of file protocol.c.

1251 {
1252  HRESULT hres;
1253 
1254  CHECK_EXPECT(MimeFilter_Switch);
1255 
1256  SET_EXPECT(Switch);
1257  hres = IInternetProtocolSink_Switch(filtered_sink, pProtocolData);
1258  ok(hres == S_OK, "Switch failed: %08x\n", hres);
1259  CHECK_CALLED(Switch);
1260 
1261  return S_OK;
1262 }
#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:154

◆ obj_refcount()

static LONG obj_refcount ( void obj)
static

Definition at line 219 of file protocol.c.

220 {
221  IUnknown_AddRef((IUnknown *)obj);
222  return IUnknown_Release((IUnknown *)obj);
223 }

Referenced by test_CreateBinding().

◆ outer_AddRef()

static ULONG WINAPI outer_AddRef ( IUnknown iface)
static

Definition at line 4205 of file protocol.c.

4206 {
4207  return 2;
4208 }

◆ outer_QueryInterface()

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

Definition at line 4194 of file protocol.c.

4195 {
4197  CHECK_EXPECT(outer_QI_test);
4198  *ppv = (IUnknown*)0xdeadbeef;
4199  return S_OK;
4200  }
4201  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
4202  return E_NOINTERFACE;
4203 }
#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:4192
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ outer_Release()

static ULONG WINAPI outer_Release ( IUnknown iface)
static

Definition at line 4210 of file protocol.c.

4211 {
4212  return 1;
4213 }

◆ Protocol_Abort()

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

Definition at line 1600 of file protocol.c.

1602 {
1603  HRESULT hres;
1604 
1605  CHECK_EXPECT(Abort);
1606 
1607  SET_EXPECT(ReportResult);
1608  hres = IInternetProtocolSink_ReportResult(binding_sink, S_OK, ERROR_SUCCESS, NULL);
1609  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1610  CHECK_CALLED(ReportResult);
1611 
1612  return S_OK;
1613 }
#define CHECK_EXPECT(func)
Definition: protocol.c:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static IInternetProtocolSink * binding_sink
Definition: protocol.c:154
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 1590 of file protocol.c.

1591 {
1592  return 2;
1593 }

◆ Protocol_Continue()

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

Definition at line 2424 of file protocol.c.

2426 {
2427  CHECK_EXPECT(MimeFilter_Continue);
2428  return E_NOTIMPL;
2429 }
#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 1595 of file protocol.c.

1596 {
1597  return 1;
1598 }

◆ Protocol_Resume()

static HRESULT WINAPI Protocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 1621 of file protocol.c.

1622 {
1623  ok(0, "unexpected call\n");
1624  return E_NOTIMPL;
1625 }
#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 1627 of file protocol.c.

1629 {
1630  ok(0, "unexpected call\n");
1631  return E_NOTIMPL;
1632 }
#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 1773 of file protocol.c.

1774 {
1775  BINDINFO bindinfo, exp_bindinfo;
1776  DWORD cbindf = 0;
1777  HRESULT hres;
1778 
1779  ok(pOIProtSink != NULL, "pOIProtSink == NULL\n");
1780  ok(pOIBindInfo != NULL, "pOIBindInfo == NULL\n");
1781  ok(pOIProtSink != &protocol_sink, "unexpected pOIProtSink\n");
1782  ok(pOIBindInfo != &bind_info, "unexpected pOIBindInfo\n");
1783  ok(!pi, "pi = %x\n", pi);
1784 
1785  if(binding_test)
1786  ok(pOIProtSink == binding_sink, "pOIProtSink != binding_sink\n");
1787 
1788  memset(&bindinfo, 0, sizeof(bindinfo));
1789  bindinfo.cbSize = sizeof(bindinfo);
1790  memcpy(&exp_bindinfo, &bindinfo, sizeof(bindinfo));
1791  if(test_redirect)
1792  exp_bindinfo.dwOptions = bindinfo_options;
1793  SET_EXPECT(GetBindInfo);
1794  if(redirect_on_continue && (bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
1795  SET_EXPECT(QueryService_IBindCallbackRedirect);
1796  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &cbindf, &bindinfo);
1797  if(redirect_on_continue && (bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS))
1798  CHECK_CALLED(QueryService_IBindCallbackRedirect);
1799  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
1800  CHECK_CALLED(GetBindInfo);
1801  ok(cbindf == (bindf|BINDF_FROMURLMON), "bindf = %x, expected %x\n",
1802  cbindf, (bindf|BINDF_FROMURLMON));
1803  ok(!memcmp(&exp_bindinfo, &bindinfo, sizeof(bindinfo)), "unexpected bindinfo\n");
1804  pReleaseBindInfo(&bindinfo);
1805 
1806  SET_EXPECT(ReportProgress_SENDINGREQUEST);
1807  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, emptyW);
1808  ok(hres == S_OK, "ReportProgress(BINDSTATUS_SENDINGREQUEST) failed: %08x\n", hres);
1809  CHECK_CALLED(ReportProgress_SENDINGREQUEST);
1810 
1814  IHttpNegotiate2 *http_negotiate2;
1815  LPWSTR ua = (LPWSTR)0xdeadbeef, accept_mimes[256];
1816  LPWSTR additional_headers = NULL;
1817  BYTE sec_id[100];
1818  DWORD fetched = 0, size = 100;
1819  DWORD tid;
1820 
1821  SET_EXPECT(GetBindString_USER_AGENT);
1822  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT,
1823  &ua, 1, &fetched);
1824  CHECK_CALLED(GetBindString_USER_AGENT);
1825  ok(hres == S_OK, "GetBindString(BINDSTRING_USER_AGETNT) failed: %08x\n", hres);
1826  ok(fetched == 1, "fetched = %d, expected 254\n", fetched);
1827  ok(ua != NULL, "ua = %p\n", ua);
1828  ok(!lstrcmpW(ua, user_agentW), "unexpected user agent %s\n", wine_dbgstr_w(ua));
1829  CoTaskMemFree(ua);
1830 
1831  fetched = 256;
1832  SET_EXPECT(GetBindString_ACCEPT_MIMES);
1833  hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_ACCEPT_MIMES,
1834  accept_mimes, 256, &fetched);
1835  CHECK_CALLED(GetBindString_ACCEPT_MIMES);
1836 
1837  ok(hres == S_OK,
1838  "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
1839  ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
1840  ok(!lstrcmpW(acc_mimeW, accept_mimes[0]), "unexpected mimes %s\n", wine_dbgstr_w(accept_mimes[0]));
1841  CoTaskMemFree(accept_mimes[0]);
1842 
1843  hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
1844  (void**)&service_provider);
1845  ok(hres == S_OK, "QueryInterface failed: %08x\n", hres);
1846 
1847  SET_EXPECT(QueryService_HttpNegotiate);
1848  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
1849  &IID_IHttpNegotiate, (void**)&http_negotiate);
1850  CHECK_CALLED(QueryService_HttpNegotiate);
1851  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
1852 
1853  SET_EXPECT(BeginningTransaction);
1854  hres = IHttpNegotiate_BeginningTransaction(http_negotiate, binding_urls[tested_protocol],
1855  NULL, 0, &additional_headers);
1856  CHECK_CALLED(BeginningTransaction);
1857  IHttpNegotiate_Release(http_negotiate);
1858  ok(hres == S_OK, "BeginningTransction failed: %08x\n", hres);
1859  ok(additional_headers == NULL, "additional_headers=%p\n", additional_headers);
1860 
1861  SET_EXPECT(QueryService_HttpNegotiate);
1862  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
1863  &IID_IHttpNegotiate2, (void**)&http_negotiate2);
1864  CHECK_CALLED(QueryService_HttpNegotiate);
1865  ok(hres == S_OK, "QueryService failed: %08x\n", hres);
1866 
1867  size = 512;
1868  SET_EXPECT(GetRootSecurityId);
1869  hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, sec_id, &size, 0);
1870  CHECK_CALLED(GetRootSecurityId);
1871  IHttpNegotiate2_Release(http_negotiate2);
1872  ok(hres == E_FAIL, "GetRootSecurityId failed: %08x, expected E_FAIL\n", hres);
1873  ok(size == 13, "size=%d\n", size);
1874 
1875  IServiceProvider_Release(service_provider);
1876 
1878  CreateThread(NULL, 0, thread_proc, NULL, 0, &tid);
1879  return;
1880  }
1881 
1882  SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
1883  hres = IInternetProtocolSink_ReportProgress(pOIProtSink,
1884  BINDSTATUS_CACHEFILENAMEAVAILABLE, expect_wsz = emptyW);
1885  ok(hres == S_OK, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres);
1886  CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
1887 
1888  if(mimefilter_test) {
1890  SET_EXPECT(MimeFilter_Start);
1891  SET_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
1892  }
1893  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
1894  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
1896  ok(hres == S_OK,
1897  "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres);
1898  if(mimefilter_test) {
1900  CHECK_CALLED(MimeFilter_Start);
1901  CHECK_CALLED(ReportProgress_LOADINGMIMEHANDLER);
1902  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1903  }else {
1904  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
1905  }
1906 
1907  if(mimefilter_test)
1908  SET_EXPECT(MimeFilter_ReportData);
1909  else
1910  SET_EXPECT(ReportData);
1911  hres = IInternetProtocolSink_ReportData(pOIProtSink,
1912  BSCF_FIRSTDATANOTIFICATION | (tested_protocol == ITS_TEST ? BSCF_DATAFULLYAVAILABLE : BSCF_LASTDATANOTIFICATION),
1913  13, 13);
1914  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
1915  if(mimefilter_test)
1916  CHECK_CALLED(MimeFilter_ReportData);
1917  else
1918  CHECK_CALLED(ReportData);
1919 
1920  if(tested_protocol == ITS_TEST) {
1921  SET_EXPECT(ReportData);
1922  hres = IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_BEGINDOWNLOADDATA, NULL);
1923  ok(hres == S_OK, "ReportProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres);
1924  CHECK_CALLED(ReportData);
1925  }
1926 
1927  if(tested_protocol == BIND_TEST) {
1928  hres = IInternetProtocol_Terminate(binding_protocol, 0);
1929  ok(hres == E_FAIL, "Termiante failed: %08x\n", hres);
1930  }
1931 
1932  if(mimefilter_test)
1933  SET_EXPECT(MimeFilter_ReportResult);
1934  else
1935  SET_EXPECT(ReportResult);
1936  hres = IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
1937  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
1938  if(mimefilter_test)
1939  CHECK_CALLED(MimeFilter_ReportResult);
1940  else
1941  CHECK_CALLED(ReportResult);
1942 }
static const WCHAR text_htmlW[]
Definition: protocol.c:139
static IInternetProtocol * binding_protocol
Definition: protocol.c:152
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static IInternetProtocolSink * binding_sink
Definition: protocol.c:154
static DWORD bindf
Definition: protocol.c:151
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:138
static LPCWSTR expect_wsz
Definition: protocol.c:147
static BOOL test_redirect
Definition: protocol.c:149
#define E_FAIL
Definition: ddrawi.h:102
static DWORD WINAPI thread_proc(PVOID arg)
Definition: protocol.c:1686
static const WCHAR acc_mimeW[]
Definition: protocol.c:137
static IInternetBindInfo bind_info
Definition: protocol.c:1532
static const WCHAR pjpegW[]
Definition: protocol.c:143
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:151
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:149
static DWORD pi
Definition: protocol.c:151
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
static BOOL reuse_protocol_thread
Definition: protocol.c:162
static const WCHAR emptyW[]
Definition: protocol.c:142
static IInternetProtocolSink protocol_sink
Definition: protocol.c:1226
static BOOL mimefilter_test
Definition: protocol.c:161
static const WCHAR binding_urls[][130]
Definition: protocol.c:203
#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:2660
#define SET_EXPECT(func)
Definition: protocol.c:40
static BOOL binding_test
Definition: protocol.c:157
#define CHECK_CALLED(func)
Definition: protocol.c:55
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:395
static IServiceProvider service_provider
Definition: protocol.c:497
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
static TfClientId tid
static enum @1668 tested_protocol

◆ Protocol_Suspend()

static HRESULT WINAPI Protocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 1615 of file protocol.c.

1616 {
1617  ok(0, "unexpected call\n");
1618  return E_NOTIMPL;
1619 }
#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 1664 of file protocol.c.

1665 {
1667  if (This->outer)
1668  {
1669  This->outer_ref++;
1670  return IUnknown_AddRef(This->outer);
1671  }
1672  return IUnknown_AddRef(&This->IUnknown_inner);
1673 }
static Protocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: protocol.c:1634

◆ ProtocolEmul_Continue()

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

Definition at line 1955 of file protocol.c.

1957 {
1958  DWORD bscf = 0, pr;
1959  HRESULT hres;
1960 
1962 
1963  ok(pProtocolData != NULL, "pProtocolData == NULL\n");
1964  if(!pProtocolData || tested_protocol == BIND_TEST)
1965  return S_OK;
1966  if(binding_test) {
1967  ok(pProtocolData != &protocoldata, "pProtocolData == &protocoldata\n");
1968  ok(pProtocolData->grfFlags == protocoldata.grfFlags, "grfFlags wrong %x/%x\n",
1969  pProtocolData->grfFlags, protocoldata.grfFlags );
1970  ok(pProtocolData->dwState == protocoldata.dwState, "dwState wrong %x/%x\n",
1971  pProtocolData->dwState, protocoldata.dwState );
1972  ok(pProtocolData->pData == protocoldata.pData, "pData wrong %p/%p\n",
1973  pProtocolData->pData, protocoldata.pData );
1974  ok(pProtocolData->cbData == protocoldata.cbData, "cbData wrong %x/%x\n",
1975  pProtocolData->cbData, protocoldata.cbData );
1976  }
1977 
1978  switch(prot_state) {
1979  case 1: {
1982  static const WCHAR header[] = {'?',0};
1983  static const WCHAR redirect_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',
1984  '/','t','e','s','t','s','/','h','e','l','l','o','.','h','t','m','l',0};
1985 
1986  if(redirect_on_continue) {
1989 
1990  if(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)
1991  SET_EXPECT(Redirect);
1992  SET_EXPECT(ReportProgress_REDIRECTING);
1993  SET_EXPECT(Terminate);
1994  SET_EXPECT(Protocol_destructor);
1995  SET_EXPECT(QueryService_InternetProtocol);
1996  SET_EXPECT(CreateInstance);
1997  SET_EXPECT(ReportProgress_PROTOCOLCLASSID);
1999  SET_EXPECT(Start);
2000  hres = IInternetProtocolSink_ReportResult(binding_sink, INET_E_REDIRECT_FAILED, ERROR_SUCCESS, redirect_urlW);
2001  ok(hres == S_OK, "ReportResult failed: %08x\n", hres);
2002  if(bindinfo_options & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)
2003  CHECK_CALLED(Redirect);
2004  CHECK_CALLED(ReportProgress_REDIRECTING);
2005  CHECK_CALLED(Terminate);
2006  CHECK_CALLED(Protocol_destructor);
2007  CHECK_CALLED(QueryService_InternetProtocol);
2008  CHECK_CALLED(CreateInstance);
2009  CHECK_CALLED(ReportProgress_PROTOCOLCLASSID);
2012 
2013  return S_OK;
2014  }
2015 
2016  hres = IInternetProtocolSink_QueryInterface(binding_sink, &IID_IServiceProvider,
2017  (void**)&service_provider);
2018  ok(hres == S_OK, "Could not get IServiceProvicder\n");
2019 
2020  SET_EXPECT(QueryService_HttpNegotiate);
2021  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
2022  &IID_IHttpNegotiate, (void**)&http_negotiate);
2023  IServiceProvider_Release(service_provider);
2024  CHECK_CALLED(QueryService_HttpNegotiate);
2025  ok(hres == S_OK, "Could not get IHttpNegotiate\n");
2026 
2027  SET_EXPECT(OnResponse);
2028  hres = IHttpNegotiate_OnResponse(http_negotiate, 200, header, NULL, NULL);
2029  IHttpNegotiate_Release(http_negotiate);
2030  CHECK_CALLED(OnResponse);
2031  IHttpNegotiate_Release(http_negotiate);
2032  ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
2033 
2034  if(mimefilter_test) {
2036  SET_EXPECT(MimeFilter_Start);
2037  SET_EXPECT(ReportProgress_LOADINGMIMEHANDLER);
2038  }else if(!(pi & PI_MIMEVERIFICATION)) {
2039  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2040  }
2041  hres = IInternetProtocolSink_ReportProgress(binding_sink,
2042  BINDSTATUS_MIMETYPEAVAILABLE, mimefilter_test ? pjpegW : text_htmlW);
2043  if(mimefilter_test) {
2045  CHECK_CALLED(MimeFilter_Start);
2046  CHECK_CALLED(ReportProgress_LOADINGMIMEHANDLER);
2047  }else if(!(pi & PI_MIMEVERIFICATION)) {
2048  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2049  }
2050  ok(hres == S_OK,
2051  "ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres);
2052 
2053  bscf |= BSCF_FIRSTDATANOTIFICATION;
2054  break;
2055  }
2056  case 2:
2057  case 3:
2058  bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
2059  break;
2060  }
2061 
2062  pr = prot_read;
2063  if(mimefilter_test)
2064  SET_EXPECT(MimeFilter_ReportData);
2065  if((!mimefilter_test || no_mime) && (pi & PI_MIMEVERIFICATION)) {
2066  if(pr < 200)
2067  SET_EXPECT(Read); /* checked in ReportData for short_read */
2068  if(pr == 200) {
2069  if(!mimefilter_test)
2070  SET_EXPECT(Read); /* checked in BINDSTATUS_MIMETYPEAVAILABLE or ReportData */
2071  SET_EXPECT(GetBindInfo);
2072  SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
2073  }
2074  if(pr >= 200)
2075  SET_EXPECT(ReportData);
2076  }else {
2077  SET_EXPECT(ReportData);
2078  }
2079 
2080  hres = IInternetProtocolSink_ReportData(binding_sink, bscf, pr, 400);
2081  ok(hres == S_OK, "ReportData failed: %08x\n", hres);
2082 
2083  if(mimefilter_test) {
2084  SET_EXPECT(MimeFilter_ReportData);
2085  }else if(pi & PI_MIMEVERIFICATION) {
2086  if(!short_read && pr < 200)
2087  CHECK_CALLED(Read);
2088  if(pr == 200) {
2089  CLEAR_CALLED(GetBindInfo); /* IE9 */
2090  CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
2091  }
2092  }else {
2093  CHECK_CALLED(ReportData);
2094  }
2095 
2096  if(prot_state == 3)
2097  prot_state = 4;
2098 
2099  return S_OK;
2100 }
static const WCHAR text_htmlW[]
Definition: protocol.c:139
_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:154
static PROTOCOLDATA protocoldata
Definition: protocol.c:158
#define CLEAR_CALLED(func)
Definition: protocol.c:67
static const WCHAR pjpegW[]
Definition: protocol.c:143
smooth NULL
Definition: ftsmooth.c:416
static DWORD bindinfo_options
Definition: protocol.c:151
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:162
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL redirect_on_continue
Definition: protocol.c:149
Definition: partlist.h:33
static DWORD pi
Definition: protocol.c:151
volatile int Continue
Definition: gdblib.c:102
#define todo_wine
Definition: test.h:163
#define CHECK_NOT_CALLED(func)
Definition: protocol.c:61
static BOOL reuse_protocol_thread
Definition: protocol.c:162
static BOOL short_read
Definition: protocol.c:161
static BOOL mimefilter_test
Definition: protocol.c:161
#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:2660
#define SET_EXPECT(func)
Definition: protocol.c:40
static BOOL binding_test
Definition: protocol.c:157
static DWORD prot_read
Definition: protocol.c:159
#define CHECK_CALLED(func)
Definition: protocol.c:55
static int prot_state
Definition: protocol.c:150
static IHttpNegotiate2 http_negotiate
Definition: protocol.c:395
static IServiceProvider service_provider
Definition: protocol.c:497
static enum @1668 tested_protocol

◆ ProtocolEmul_LockRequest()

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

Definition at line 2207 of file protocol.c.

2208 {
2210  ok(dwOptions == 0, "dwOptions=%x\n", dwOptions);
2211  return S_OK;
2212 }
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 1639 of file protocol.c.

1640 {
1642 
1643  static const IID unknown_iid = {0x7daf9908,0x8415,0x4005,{0x95,0xae, 0xbd,0x27,0xf6,0xe3,0xdc,0x00}};
1644  static const IID unknown_iid2 = {0x5b7ebc0c,0xf630,0x4cea,{0x89,0xd3,0x5a,0xf0,0x38,0xed,0x05,0x5c}};
1645 
1646  if(IsEqualGUID(riid, &IID_IInternetProtocolEx)) {
1647  *ppv = &This->IInternetProtocolEx_iface;
1648  IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1649  return S_OK;
1650  }
1651 
1652  /* FIXME: Why is it calling here instead of outer IUnknown? */
1653  if(IsEqualGUID(riid, &IID_IInternetPriority)) {
1654  *ppv = &This->IInternetPriority_iface;
1655  IInternetPriority_AddRef(&This->IInternetPriority_iface);
1656  return S_OK;
1657  }
165