httpapi: Start the http service in HttpInitialize().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38245 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d73fc3e82a
commit
efacf6f455
@ -1,5 +1,6 @@
|
|||||||
MODULE = httpapi.dll
|
MODULE = httpapi.dll
|
||||||
IMPORTLIB = httpapi
|
IMPORTLIB = httpapi
|
||||||
|
IMPORTS = advapi32
|
||||||
|
|
||||||
EXTRADLLFLAGS = -mno-cygwin
|
EXTRADLLFLAGS = -mno-cygwin
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "wine/http.h"
|
#include "wine/http.h"
|
||||||
|
#include "winsvc.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/heap.h"
|
#include "wine/heap.h"
|
||||||
@ -52,11 +53,41 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID lpv )
|
|||||||
* NO_ERROR if function succeeds, or error code if function fails
|
* NO_ERROR if function succeeds, or error code if function fails
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ULONG WINAPI HttpInitialize( HTTPAPI_VERSION version, ULONG flags, PVOID reserved )
|
ULONG WINAPI HttpInitialize(HTTPAPI_VERSION version, ULONG flags, void *reserved)
|
||||||
{
|
{
|
||||||
FIXME( "({%d,%d}, 0x%x, %p): stub!\n", version.HttpApiMajorVersion,
|
static const WCHAR httpW[] = {'h','t','t','p',0};
|
||||||
|
SC_HANDLE manager, service;
|
||||||
|
|
||||||
|
TRACE("version %u.%u, flags %#x, reserved %p.\n", version.HttpApiMajorVersion,
|
||||||
version.HttpApiMinorVersion, flags, reserved);
|
version.HttpApiMinorVersion, flags, reserved);
|
||||||
return NO_ERROR;
|
|
||||||
|
if (flags & ~HTTP_INITIALIZE_SERVER)
|
||||||
|
{
|
||||||
|
FIXME("Unhandled flags %#x.\n", flags);
|
||||||
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(manager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT)))
|
||||||
|
return GetLastError();
|
||||||
|
|
||||||
|
if (!(service = OpenServiceW(manager, httpW, SERVICE_START)))
|
||||||
|
{
|
||||||
|
ERR("Failed to open HTTP service, error %u.\n", GetLastError());
|
||||||
|
CloseServiceHandle(manager);
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StartServiceW(service, 0, NULL) && GetLastError() != ERROR_SERVICE_ALREADY_RUNNING)
|
||||||
|
{
|
||||||
|
ERR("Failed to start HTTP service, error %u.\n", GetLastError());
|
||||||
|
CloseServiceHandle(service);
|
||||||
|
CloseServiceHandle(manager);
|
||||||
|
return GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseServiceHandle(service);
|
||||||
|
CloseServiceHandle(manager);
|
||||||
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -122,8 +122,7 @@ static void test_v1_server(void)
|
|||||||
/* Non-zero reserved parameter is accepted on XP/2k3. */
|
/* Non-zero reserved parameter is accepted on XP/2k3. */
|
||||||
queue = NULL;
|
queue = NULL;
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Unexpected ret value %u.\n", ret);
|
ok(!ret, "Unexpected ret value %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ok(!!queue, "Unexpected handle value %p.\n", queue);
|
ok(!!queue, "Unexpected handle value %p.\n", queue);
|
||||||
|
|
||||||
queue2 = NULL;
|
queue2 = NULL;
|
||||||
@ -314,8 +313,7 @@ static void test_v1_completion_port(void)
|
|||||||
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
|
|
||||||
port = CreateIoCompletionPort(queue, NULL, 123, 0);
|
port = CreateIoCompletionPort(queue, NULL, 123, 0);
|
||||||
ok(!!port, "Failed to create completion port, error %u.\n", GetLastError());
|
ok(!!port, "Failed to create completion port, error %u.\n", GetLastError());
|
||||||
@ -391,8 +389,7 @@ static void test_v1_multiple_requests(void)
|
|||||||
ovl2.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
ovl2.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
@ -493,8 +490,7 @@ static void test_v1_short_buffer(void)
|
|||||||
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
@ -569,8 +565,7 @@ static void test_v1_entity_body(void)
|
|||||||
req_body[i] = i / 111;
|
req_body[i] = i / 111;
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
@ -716,8 +711,7 @@ static void test_v1_bad_request(void)
|
|||||||
SOCKET s;
|
SOCKET s;
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
@ -774,8 +768,7 @@ static void test_v1_cooked_url(void)
|
|||||||
"\r\n";
|
"\r\n";
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
@ -849,8 +842,7 @@ static void test_v1_unknown_tokens(void)
|
|||||||
"\r\n";
|
"\r\n";
|
||||||
|
|
||||||
ret = HttpCreateHttpHandle(&queue, 0);
|
ret = HttpCreateHttpHandle(&queue, 0);
|
||||||
todo_wine ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
if (ret) return;
|
|
||||||
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
ret = HttpAddUrl(queue, localhost_urlW, NULL);
|
||||||
ok(!ret, "Got error %u.\n", ret);
|
ok(!ret, "Got error %u.\n", ret);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user