From 81d946aef87b60fa5a013eda5656c10726c5bd0a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 30 Jan 2019 16:23:25 +1100 Subject: [PATCH] httpapi: Fake success from HttpCreateServerSession Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46549 --- dlls/httpapi/httpapi_main.c | 10 +++++++++- dlls/httpapi/tests/httpapi.c | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/httpapi/httpapi_main.c b/dlls/httpapi/httpapi_main.c index 3ab03995e4..44e72c6f41 100644 --- a/dlls/httpapi/httpapi_main.c +++ b/dlls/httpapi/httpapi_main.c @@ -190,7 +190,15 @@ ULONG WINAPI HttpAddUrl( HANDLE handle, PCWSTR url, PVOID reserved ) ULONG WINAPI HttpCreateServerSession( HTTPAPI_VERSION version, HTTP_SERVER_SESSION_ID *id, ULONG reserved ) { FIXME( "({%d,%d}, %p, %d): stub!\n", version.HttpApiMajorVersion, version.HttpApiMinorVersion, id, reserved ); - return ERROR_ACCESS_DENIED; + + if(!id || reserved) + return ERROR_INVALID_PARAMETER; + if((version.HttpApiMajorVersion != 1 && version.HttpApiMajorVersion != 2) || version.HttpApiMinorVersion != 0) + return ERROR_REVISION_MISMATCH; + + *id = 0xabcdefff; + + return NO_ERROR; } /*********************************************************************** diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c index e1437552a8..e090390b89 100644 --- a/dlls/httpapi/tests/httpapi.c +++ b/dlls/httpapi/tests/httpapi.c @@ -92,25 +92,26 @@ static void test_HttpCreateServerSession(void) version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, NULL, 0); -todo_wine + ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); + + version.HttpApiMajorVersion = 1; + version.HttpApiMinorVersion = 0; + ret = pHttpCreateServerSession(version, &session, 1); ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return value %u.\n", ret); version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 1; ret = pHttpCreateServerSession(version, &session, 0); -todo_wine ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %u.\n", ret); version.HttpApiMajorVersion = 3; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); -todo_wine ok(ret == ERROR_REVISION_MISMATCH, "Unexpected return value %u.\n", ret); version.HttpApiMajorVersion = 2; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); -todo_wine ok(!ret, "Unexpected return value %u.\n", ret); ret = pHttpCloseServerSession(session); todo_wine @@ -119,7 +120,6 @@ todo_wine version.HttpApiMajorVersion = 1; version.HttpApiMinorVersion = 0; ret = pHttpCreateServerSession(version, &session, 0); -todo_wine ok(!ret, "Unexpected return value %u.\n", ret); ret = pHttpCloseServerSession(session); todo_wine -- 2.20.1