Commit 0df41c35 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernelbase: Also parse hostnames for news schemes in UrlGetPart().

parent 05e82ba1
...@@ -4347,12 +4347,15 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p ...@@ -4347,12 +4347,15 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
case URL_PART_HOSTNAME: case URL_PART_HOSTNAME:
switch (scheme) switch (scheme)
{ {
case URL_SCHEME_FILE:
case URL_SCHEME_FTP: case URL_SCHEME_FTP:
case URL_SCHEME_HTTP:
case URL_SCHEME_GOPHER: case URL_SCHEME_GOPHER:
case URL_SCHEME_TELNET: case URL_SCHEME_HTTP:
case URL_SCHEME_FILE:
case URL_SCHEME_HTTPS: case URL_SCHEME_HTTPS:
case URL_SCHEME_TELNET:
case URL_SCHEME_NEWS:
case URL_SCHEME_NNTP:
case URL_SCHEME_SNEWS:
break; break;
default: default:
*out_len = 0; *out_len = 0;
......
...@@ -728,11 +728,11 @@ static void test_UrlGetPart(void) ...@@ -728,11 +728,11 @@ static void test_UrlGetPart(void)
{"local://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"local://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"mailto://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"mailto://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"mk://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"mk://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"news://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, {"news://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"},
{"nntp://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, {"nntp://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"},
{"res://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"res://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"shell://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"shell://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"snews://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, {"snews://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"},
{"telnet://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, {"telnet://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"},
{"vbscript://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"vbscript://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
{"wais://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, {"wais://hostname/", URL_PART_HOSTNAME, 0, E_FAIL},
...@@ -742,9 +742,9 @@ static void test_UrlGetPart(void) ...@@ -742,9 +742,9 @@ static void test_UrlGetPart(void)
{"gopher://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "gopher:hostname"}, {"gopher://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "gopher:hostname"},
{"http://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:hostname"}, {"http://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:hostname"},
{"https://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "https:hostname"}, {"https://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "https:hostname"},
{"news://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "news:hostname", .todo_hr = TRUE}, {"news://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "news:hostname"},
{"nntp://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "nntp:hostname", .todo_hr = TRUE}, {"nntp://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "nntp:hostname"},
{"snews://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "snews:hostname", .todo_hr = TRUE}, {"snews://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "snews:hostname"},
{"telnet://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "telnet:hostname"}, {"telnet://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "telnet:hostname"},
}; };
...@@ -876,8 +876,7 @@ static void test_UrlGetPart(void) ...@@ -876,8 +876,7 @@ static void test_UrlGetPart(void)
{ {
ok(size == wcslen(bufferW), "Got size %u.\n", size); ok(size == wcslen(bufferW), "Got size %u.\n", size);
MultiByteToWideChar(CP_ACP, 0, buffer, -1, expectW, ARRAY_SIZE(expectW)); MultiByteToWideChar(CP_ACP, 0, buffer, -1, expectW, ARRAY_SIZE(expectW));
todo_wine_if (strstr(url, "news") || strstr(url, "nntp")) ok(!wcscmp(bufferW, expectW), "Got result %s.\n", debugstr_w(bufferW));
ok(!wcscmp(bufferW, expectW), "Got result %s.\n", debugstr_w(bufferW));
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment