urlmon: Return correct error in get_protocol_handler for unknown protocol types.
This commit is contained in:
parent
9b42e7f7e3
commit
a7852b5128
|
@ -92,7 +92,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
|
||||||
heap_free(wszKey);
|
heap_free(wszKey);
|
||||||
if(res != ERROR_SUCCESS) {
|
if(res != ERROR_SUCCESS) {
|
||||||
TRACE("Could not open protocol handler key\n");
|
TRACE("Could not open protocol handler key\n");
|
||||||
return E_FAIL;
|
return MK_E_SYNTAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = sizeof(str_clsid);
|
size = sizeof(str_clsid);
|
||||||
|
@ -100,7 +100,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
if(res != ERROR_SUCCESS || type != REG_SZ) {
|
if(res != ERROR_SUCCESS || type != REG_SZ) {
|
||||||
WARN("Could not get protocol CLSID res=%d\n", res);
|
WARN("Could not get protocol CLSID res=%d\n", res);
|
||||||
return E_FAIL;
|
return MK_E_SYNTAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = CLSIDFromString(str_clsid, &clsid);
|
hres = CLSIDFromString(str_clsid, &clsid);
|
||||||
|
@ -115,7 +115,8 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
|
||||||
if(!ret)
|
if(!ret)
|
||||||
return S_OK;
|
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)
|
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]),
|
hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
|
||||||
&schema_len, 0);
|
&schema_len, 0);
|
||||||
if(FAILED(hres) || !schema_len)
|
if(FAILED(hres) || !schema_len)
|
||||||
return schema_len ? hres : E_FAIL;
|
return schema_len ? hres : MK_E_SYNTAX;
|
||||||
|
|
||||||
EnterCriticalSection(&session_cs);
|
EnterCriticalSection(&session_cs);
|
||||||
|
|
||||||
|
|
|
@ -3028,6 +3028,17 @@ static void test_CreateBinding(void)
|
||||||
hres = IInternetSession_UnregisterNameSpace(session, &ClassFactory, wsz_test);
|
hres = IInternetSession_UnregisterNameSpace(session, &ClassFactory, wsz_test);
|
||||||
ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);
|
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);
|
IInternetSession_Release(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3181,8 +3192,8 @@ START_TEST(protocol)
|
||||||
pReleaseBindInfo = (void*) GetProcAddress(hurlmon, "ReleaseBindInfo");
|
pReleaseBindInfo = (void*) GetProcAddress(hurlmon, "ReleaseBindInfo");
|
||||||
pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
|
pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
|
||||||
|
|
||||||
if (!pCoInternetGetSession || !pReleaseBindInfo) {
|
if(!GetProcAddress(hurlmon, "CompareSecurityIds")) {
|
||||||
win_skip("Various needed functions not present in IE 4.0\n");
|
win_skip("Various needed functions not present, too old IE\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue