Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/httpapi/httpapi_main.c | 9 +++------ dlls/httpapi/tests/httpapi.c | 31 ++++++++++++------------------- 2 files changed, 15 insertions(+), 25 deletions(-)
diff --git a/dlls/httpapi/httpapi_main.c b/dlls/httpapi/httpapi_main.c index 6be4d11d35f..52fa6cc1d80 100644 --- a/dlls/httpapi/httpapi_main.c +++ b/dlls/httpapi/httpapi_main.c @@ -27,8 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(http);
-static const WCHAR device_nameW[] = {'\','D','e','v','i','c','e','\','H','t','t','p','\','R','e','q','Q','u','e','u','e',0}; - static WCHAR *heap_strdupW(const WCHAR *str) { int len = wcslen(str) + 1; @@ -53,7 +51,6 @@ static WCHAR *heap_strdupW(const WCHAR *str) */ ULONG WINAPI HttpInitialize(HTTPAPI_VERSION version, ULONG flags, void *reserved) { - static const WCHAR httpW[] = {'h','t','t','p',0}; SC_HANDLE manager, service;
TRACE("version %u.%u, flags %#x, reserved %p.\n", version.HttpApiMajorVersion, @@ -68,7 +65,7 @@ ULONG WINAPI HttpInitialize(HTTPAPI_VERSION version, ULONG flags, void *reserved if (!(manager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT))) return GetLastError();
- if (!(service = OpenServiceW(manager, httpW, SERVICE_START))) + if (!(service = OpenServiceW(manager, L"http", SERVICE_START))) { ERR("Failed to open HTTP service, error %u.\n", GetLastError()); CloseServiceHandle(manager); @@ -205,7 +202,7 @@ ULONG WINAPI HttpCreateHttpHandle(HANDLE *handle, ULONG reserved) if (!handle) return ERROR_INVALID_PARAMETER;
- RtlInitUnicodeString(&string, device_nameW); + RtlInitUnicodeString(&string, L"\Device\Http\ReqQueue"); attr.ObjectName = &string; return RtlNtStatusToDosError(NtCreateFile(handle, 0, &attr, &iosb, NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OPEN, FILE_NON_DIRECTORY_FILE, NULL, 0)); @@ -752,7 +749,7 @@ ULONG WINAPI HttpCreateRequestQueue(HTTPAPI_VERSION version, const WCHAR *name, if (flags) FIXME("Unhandled flags %#x.\n", flags);
- RtlInitUnicodeString(&string, device_nameW); + RtlInitUnicodeString(&string, L"\Device\Http\ReqQueue"); attr.ObjectName = &string; if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT; diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c index b6bfbbccf04..c54158d45a2 100644 --- a/dlls/httpapi/tests/httpapi.c +++ b/dlls/httpapi/tests/httpapi.c @@ -33,13 +33,6 @@
#include "wine/test.h"
-static const WCHAR invalid_url1[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t',':','5','0','0','0','0',0}; -static const WCHAR invalid_url2[] = {'l','o','c','a','l','h','o','s','t',':','5','0','0','0','0',0}; -static const WCHAR invalid_url3[] = {'l','o','c','a','l','h','o','s','t',':','5','0','0','0','0','/',0}; -static const WCHAR invalid_url4[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t','/',0}; -static const WCHAR invalid_url5[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t',':','/',0}; -static const WCHAR invalid_url6[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t',':','0','/',0}; - static ULONG (WINAPI *pHttpAddUrlToUrlGroup)(HTTP_URL_GROUP_ID id, const WCHAR *url, HTTP_URL_CONTEXT context, ULONG reserved); static ULONG (WINAPI *pHttpCreateServerSession)(HTTPAPI_VERSION version, HTTP_SERVER_SESSION_ID *session_id, ULONG reserved); static ULONG (WINAPI *pHttpCreateRequestQueue)(HTTPAPI_VERSION version, const WCHAR *name, SECURITY_ATTRIBUTES *sa, ULONG flags, HANDLE *handle); @@ -205,17 +198,17 @@ static void test_v1_server(void)
ret = HttpAddUrl(NULL, L"http://localhost:50000/", NULL); ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_INVALID_PARAMETER /* < Vista */, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url1, NULL); + ret = HttpAddUrl(queue, L"http://localhost:50000", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url2, NULL); + ret = HttpAddUrl(queue, L"localhost:50000", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url3, NULL); + ret = HttpAddUrl(queue, L"localhost:50000/", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url4, NULL); + ret = HttpAddUrl(queue, L"http://localhost/", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url5, NULL); + ret = HttpAddUrl(queue, L"http://localhost:/", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = HttpAddUrl(queue, invalid_url6, NULL); + ret = HttpAddUrl(queue, L"http://localhost:0/", NULL); ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); port = add_url_v1(queue); swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); @@ -1273,17 +1266,17 @@ static void test_v2_server(void)
port = add_url_v2(group);
- ret = pHttpAddUrlToUrlGroup(group, invalid_url1, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:50000", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = pHttpAddUrlToUrlGroup(group, invalid_url2, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"localhost:50000", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = pHttpAddUrlToUrlGroup(group, invalid_url3, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"localhost:50000/", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = pHttpAddUrlToUrlGroup(group, invalid_url4, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"http://localhost/", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = pHttpAddUrlToUrlGroup(group, invalid_url5, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:/", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); - ret = pHttpAddUrlToUrlGroup(group, invalid_url6, 0xdeadbeef, 0); + ret = pHttpAddUrlToUrlGroup(group, L"http://localhost:0/", 0xdeadbeef, 0); todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret); swprintf(url, ARRAY_SIZE(url), L"http://localhost:%u/", port); ret = pHttpAddUrlToUrlGroup(group, url, 0xdeadbeef, 0);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=79737
Your paranoid android.
=== w10pro64 (32 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID ff00000260000001. httpapi.c:1369: Test failed: Got SSL connection ID ff0000006000001a. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64_2scr (32 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID fd00000060000002. httpapi.c:1369: Test failed: Got SSL connection ID fe00000260000004. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64_ar (32 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID ff00000260000001. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64_he (32 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID ff00000160000001. httpapi.c:1369: Test failed: Got SSL connection ID ff0000026000000a. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64_ja (32 bit report) ===
httpapi: httpapi.c:1369: Test failed: Got SSL connection ID ff0000016000000d. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64_zh_CN (32 bit report) ===
httpapi: httpapi.c:1369: Test failed: Got SSL connection ID fd00000260000001. httpapi.c:1372: Test failed: Got request info 0064E40C.
=== w10pro64 (64 bit report) ===
httpapi: httpapi.c:1372: Test failed: Got request info 000000000064E428.
=== w10pro64_2scr (64 bit report) ===
httpapi: httpapi.c:1369: Test failed: Got SSL connection ID ff00000060000009. httpapi.c:1372: Test failed: Got request info 000000000064E428.
=== w10pro64_ar (64 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID fd00000060000002. httpapi.c:1369: Test failed: Got SSL connection ID fe00000060000005. httpapi.c:1372: Test failed: Got request info 000000000064E428.
=== w10pro64_he (64 bit report) ===
httpapi: httpapi.c:305: Test failed: Got SSL connection ID fd00000160000002. httpapi.c:1369: Test failed: Got SSL connection ID ff00000060000009. httpapi.c:1372: Test failed: Got request info 000000000064E428.
=== w10pro64_ja (64 bit report) ===
httpapi: httpapi.c:1369: Test failed: Got SSL connection ID ff00000260000006. httpapi.c:1372: Test failed: Got request info 000000000064E428.
=== w10pro64_zh_CN (64 bit report) ===
httpapi: httpapi.c:1369: Test failed: Got SSL connection ID ff00000260000005. httpapi.c:1372: Test failed: Got request info 000000000064E428.