34#define DEFINE_EXPECT(func) \
35 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
37#define SET_EXPECT(func) \
38 expect_ ## func = TRUE
40#define CHECK_EXPECT(func) \
42 ok(expect_ ##func, "unexpected call " #func "\n"); \
43 expect_ ## func = FALSE; \
44 called_ ## func = TRUE; \
47#define SET_CALLED(func) \
48 expect_ ## func = called_ ## func = FALSE
50#define CHECK_CALLED(func) \
52 ok(called_ ## func, "expected " #func "\n"); \
56DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);
113 ok(0,
"unexpected call\n");
120 switch(ulStatusCode) {
121 case BINDSTATUS_BEGINDOWNLOADDATA:
123 ok(!szStatusText,
"szStatusText != NULL\n");
125 case BINDSTATUS_SENDINGREQUEST:
128 ok(!
lstrcmpW(szStatusText,
L"blank.html"),
"unexpected szStatusText\n");
130 ok(szStatusText ==
NULL,
"szStatusText != NULL\n");
132 case BINDSTATUS_MIMETYPEAVAILABLE:
134 ok(!
lstrcmpW(szStatusText,
L"text/html"),
"unexpected szStatusText\n");
136 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
140 case BINDSTATUS_DIRECTBIND:
142 ok(!szStatusText,
"szStatusText != NULL\n");
145 ok(0,
"unexpected ulStatusCode %ld\n", ulStatusCode);
157 ok(ulProgress == ulProgressMax,
"ulProgress != ulProgressMax\n");
159 ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE),
"grcf = %08lx\n", grfBSCF);
161 ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION),
"grcf = %08lx\n", grfBSCF);
170 ok(
cb == 13,
"cb=%lu expected 13\n",
cb);
171 ok(!
memcmp(
buf,
"<html></html>", 13),
"unexpected data\n");
183 ok(dwError == 0,
"dwError = %ld\n", dwError);
184 ok(!szResult,
"szResult != NULL\n");
226 ok(grfBINDF !=
NULL,
"grfBINDF == NULL\n");
228 ok(!*grfBINDF,
"*grfBINDF != 0\n");
229 ok(pbindinfo !=
NULL,
"pbindinfo == NULL\n");
230 ok(pbindinfo->cbSize ==
sizeof(BINDINFO),
"wrong size of pbindinfo: %ld\n", pbindinfo->cbSize);
239 ok(0,
"unexpected call\n");
264 ok(
hres == expected_hres,
"expected: %08lx got: %08lx\n", expected_hres,
hres);
270#define protocol_start(p,u,e) _protocol_start(__LINE__,p,u,e)
282 SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
299 SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
312 SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
330 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
336 IInternetProtocol_Release(
protocol);
342 ok(
cb == 13,
"cb=%lu expected 13\n",
cb);
343 ok(!
memcmp(
buf,
"<html></html>", 13),
"unexpected data\n");
345 ok(!
ref,
"protocol ref=%ld\n",
ref);
348 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
355 "Read returned %08lx\n",
hres);
356 ok(
cb == 0xdeadbeef,
"cb=%lu expected 0xdeadbeef\n",
cb);
361 ok(
cb == 2,
"cb=%lu expected 2\n",
cb);
364 ok(
cb == 11,
"cb=%lu, expected 11\n",
cb);
367 ok(
cb == 0,
"cb=%lu expected 0\n",
cb);
371 ok(!
ref,
"protocol ref=%ld\n",
ref);
374 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
387 ok(
cb == 11,
"cb=%lu, expected 11\n",
cb);
389 ok(!
ref,
"protocol ref=%ld\n",
ref);
392 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
403 ok(
cb == 2,
"cb=%lu, expected 2\n",
cb);
408 ok(
cb == 2,
"cb=%lu, expected 2\n",
cb);
413 ok(
cb == 2,
"cb=%lu expected 2\n",
cb);
415 ok(!
ref,
"protocol ref=%ld\n",
ref);
418 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
424 ok(!
ref,
"protocol ref=%ld\n",
ref);
437 {
L"its:test.chm::/blank.html",
L"test.html", 0,
S_OK,
L"its:test.chm::/test.html"},
439 {
L"its:test.chm::/blank.html",
L"/test.html", 0,
S_OK,
L"its:test.chm::/test.html"},
442 {
L"its:test.chm::/blank.html",
L"dir/test.html", 0,
S_OK,
L"its:test.chm::/dir/test.html"},
443 {
L"test.html",
L"test.chm::/test.html", 0, 0x80041001,
NULL},
444 {
L"its:test:.chm::/blank.html",
L"test.html", 0,
S_OK,
L"its:test:.chm::/test.html"},
445 {
L"its:test.chm::/dir/blank.html",
L"test.html", 0,
S_OK,
L"its:test.chm::/dir/test.html"},
446 {
L"its:test.chm::blank.html",
L"test.html", 0,
S_OK,
L"its:test.chm::blank.htmltest.html"},
447 {
L"ms-its:test.chm::/dir/blank.html",
L"test.html", 0,
S_OK,
L"ms-its:test.chm::/dir/test.html"},
448 {
L"mk:@MSITStore:test.chm::/dir/blank.html",
L"test.html", 0,
S_OK,
L"mk:@MSITStore:test.chm::/dir/test.html"},
449 {
L"xxx:test.chm::/dir/blank.html",
L"test.html", 0, INET_E_USE_DEFAULT_PROTOCOLHANDLER,
NULL},
450 {
L"its:test.chm::/dir/blank.html",
L"/test.html", 0,
S_OK,
L"its:test.chm::/test.html"},
451 {
L"its:test.chm::/blank.html",
L"#frag", 0,
S_OK,
L"its:test.chm::/blank.html#frag"},
452 {
L"its:test.chm::/blank.html#hash",
L"#frag", 0,
S_OK,
L"its:test.chm::/blank.html#hash#frag"},
453 {
L"its:test.chm::/blank.html",
L"test.html#frag", 0,
S_OK,
L"its:test.chm::/test.html#frag"},
454 {
L"its:test.chm::/blank.html",
L"/test.html#frag", 0,
S_OK,
L"its:test.chm::/test.html#frag"},
455 {
L"its:test.chm::/blank.html",
L"?query", 0,
S_OK,
L"its:test.chm::/?query"},
456 {
L"its:test.chm::/blank.html#frag/blank",
L"test.html", 0,
S_OK,
L"its:test.chm::/blank.html#frag/test.html"},
466 hres = IInternetProtocol_QueryInterface(
protocol, &IID_IInternetProtocolInfo, (
void**)&
info);
467 ok(
hres ==
S_OK,
"Could not get IInternetProtocolInfo interface: %08lx\n",
hres);
471 for(
i = PARSE_CANONICALIZE;
i <= PARSE_UNESCAPE;
i++) {
472 if(
i != PARSE_CANONICALIZE &&
i != PARSE_SECURITY_URL) {
475 ok(
hres == INET_E_DEFAULT_ACTION,
476 "[%ld] failed: %08lx, expected INET_E_DEFAULT_ACTION\n",
i,
hres);
488 : 0xdeadbeef),
"[%ld] unexpected size=%ld\n",
i,
size);
492 ok(
buf[0] == 0xfefe,
"buf changed\n");
497 hres = IInternetProtocolInfo_CombineUrl(
info,
L"its:test.chm::/blank.html",
L"test.html", 0,
buf,
501 ok(
buf[0] == 0xfefe,
"buf changed\n");
503 IInternetProtocolInfo_Release(
info);
514 static const WCHAR wrong_url1[] =
L"its:test.chm::/blan.html";
515 static const WCHAR wrong_url2[] =
L"its:tes.chm::b/lank.html";
516 static const WCHAR wrong_url3[] =
L"its:test.chm/blank.html";
517 static const WCHAR wrong_url4[] =
L"mk:@MSITStor:test.chm::/blank.html";
518 static const WCHAR wrong_url5[] =
L"file:tes.chm::/blank.html";
525 "CoGetClassObject failed: %08lx\n",
hres);
529 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (
void**)&
info);
533 ok(
hres ==
S_OK,
"Could not get IClassFactory interface\n");
538 ok(
hres ==
S_OK,
"Could not get IInternetProtocol: %08lx\n",
hres);
547 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
548 "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
hres);
551 ok(
hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
552 "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n",
hres);
555 ok(!
ref,
"protocol ref=%ld\n",
ref);
565 bindf = BINDF_FROMURLMON | BINDF_NEEDFILE;
569 IClassFactory_Release(
factory);
572 IUnknown_Release(unk);
586 "CoGetClassObject failed: %08lx\n",
hres);
597 IClassFactory_Release(
cf);
628static const IID outer_test_iid = {0xabcabc00,0,0,{0,0,0,0,0,0,0,0x66}};
670 hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (
void**)&unk2);
671 ok(
hres ==
S_OK,
"Could not get IInternetProtocol iface: %08lx\n",
hres);
676 ok(
hres ==
S_OK,
"Could not get IInternetProtocol iface: %08lx\n",
hres);
677 ok(unk3 == (
IUnknown*)0xdeadbeef,
"unexpected unk2\n");
679 IUnknown_Release(unk2);
680 IUnknown_Release(unk);
682 unk = (
void*)0xdeadbeef;
685 ok(!unk,
"unk = %p\n", unk);
const GUID IID_IClassFactory
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD clscontext, COSERVERINFO *server_info, REFIID riid, void **obj)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
GLenum GLuint GLenum GLsizei const GLchar * buf
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
static IInternetProtocolSink protocol_sink
static IInternetBindInfo bind_info
static const struct @1928 combine_tests[]
static HRESULT _protocol_start(unsigned line, IInternetProtocol *protocol, LPCWSTR url, BOOL expect_mime)
static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
static HRESULT WINAPI ProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
static const WCHAR blank_url1[]
static const IUnknownVtbl outer_vtbl
static const WCHAR blank_url3[]
static ULONG WINAPI BindInfo_Release(IInternetBindInfo *iface)
static IInternetBindInfoVtbl bind_info_vtbl
static IInternetProtocolSinkVtbl protocol_sink_vtbl
static ULONG WINAPI outer_AddRef(IUnknown *iface)
static void delete_chm(void)
static const WCHAR blank_url9[]
#define CHECK_EXPECT(func)
static ULONG WINAPI ProtocolSink_Release(IInternetProtocolSink *iface)
static const WCHAR blank_url2[]
static void test_its_protocol_info(IInternetProtocol *protocol)
#define DEFINE_EXPECT(func)
static const IID outer_test_iid
static const WCHAR blank_url7[]
static HRESULT WINAPI BindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv)
static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
static HRESULT WINAPI ProtocolSink_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppv)
static void test_mk_protocol(void)
static const WCHAR blank_url8[]
#define protocol_start(p, u, e)
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static const WCHAR blank_url5[]
static HRESULT expect_hrResult
static const WCHAR cache_file1[]
static const WCHAR cache_file3[]
static void test_protocol_url(IClassFactory *factory, LPCWSTR url, BOOL expect_mime)
static void test_com_aggregation(const CLSID *clsid)
static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT expected_hres)
static BOOL create_chm(void)
#define CHECK_CALLED(func)
static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
static void test_its_protocol(void)
static enum @1927 test_protocol
static const WCHAR cache_file2[]
static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
static const WCHAR * cache_file
static const WCHAR blank_url4[]
const WCHAR * combined_url
static HRESULT WINAPI BindInfo_GetBindString(IInternetBindInfo *iface, ULONG ulStringType, LPOLESTR *ppwzStr, ULONG cEl, ULONG *pcElFetched)
static ULONG WINAPI BindInfo_AddRef(IInternetBindInfo *iface)
static const WCHAR blank_url6[]
static IInternetProtocol * read_protocol
static ULONG WINAPI ProtocolSink_AddRef(IInternetProtocolSink *iface)
static ULONG WINAPI outer_Release(IUnknown *iface)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define URL_DONT_ESCAPE_EXTRA_INFO
#define URL_ESCAPE_SPACES_ONLY
#define MAKEINTRESOURCEA(i)
static __inline const char * wine_dbgstr_guid(const GUID *id)
DWORD WINAPI GetLastError(void)
#define REGDB_E_CLASSNOTREG
#define INET_E_DATA_NOT_AVAILABLE
#define STG_E_INVALIDNAME
#define STG_E_FILENOTFOUND
#define CLASS_E_NOAGGREGATION