diff --git a/dlls/urlmon/session.c b/dlls/urlmon/session.c index 163ee081c69..ef1881c34d4 100644 --- a/dlls/urlmon/session.c +++ b/dlls/urlmon/session.c @@ -92,7 +92,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, heap_free(wszKey); if(res != ERROR_SUCCESS) { TRACE("Could not open protocol handler key\n"); - return E_FAIL; + return MK_E_SYNTAX; } size = sizeof(str_clsid); @@ -100,7 +100,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, RegCloseKey(hkey); if(res != ERROR_SUCCESS || type != REG_SZ) { WARN("Could not get protocol CLSID res=%d\n", res); - return E_FAIL; + return MK_E_SYNTAX; } hres = CLSIDFromString(str_clsid, &clsid); @@ -115,7 +115,8 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, if(!ret) return S_OK; - return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)ret); + hres = CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)ret); + return SUCCEEDED(hres) ? S_OK : MK_E_SYNTAX; } static HRESULT register_namespace(IClassFactory *cf, REFIID clsid, LPCWSTR protocol, BOOL urlmon_protocol) @@ -247,7 +248,7 @@ HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, BOOL *urlmon_protocol, I hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]), &schema_len, 0); if(FAILED(hres) || !schema_len) - return schema_len ? hres : E_FAIL; + return schema_len ? hres : MK_E_SYNTAX; EnterCriticalSection(&session_cs); diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 15c3bc44e81..cbbf51440b9 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -3028,6 +3028,17 @@ static void test_CreateBinding(void) hres = IInternetSession_UnregisterNameSpace(session, &ClassFactory, wsz_test); ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres); + hres = IInternetSession_CreateBinding(session, NULL, test_url, NULL, NULL, &protocol, 0); + ok(hres == S_OK, "CreateBinding failed: %08x\n", hres); + ok(protocol != NULL, "protocol == NULL\n"); + + SET_EXPECT(QueryService_InternetProtocol); + hres = IInternetProtocol_Start(protocol, test_url, &protocol_sink, &bind_info, 0, 0); + ok(hres == MK_E_SYNTAX, "Start failed: %08x, expected MK_E_SYNTAX\n", hres); + CHECK_CALLED(QueryService_InternetProtocol); + + IInternetProtocol_Release(protocol); + IInternetSession_Release(session); } @@ -3181,8 +3192,8 @@ START_TEST(protocol) pReleaseBindInfo = (void*) GetProcAddress(hurlmon, "ReleaseBindInfo"); pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri"); - if (!pCoInternetGetSession || !pReleaseBindInfo) { - win_skip("Various needed functions not present in IE 4.0\n"); + if(!GetProcAddress(hurlmon, "CompareSecurityIds")) { + win_skip("Various needed functions not present, too old IE\n"); return; }