Module: wine Branch: master Commit: 6435f844dde0fa2f97944378c59392e8befdba8f URL: https://source.winehq.org/git/wine.git/?a=commit;h=6435f844dde0fa2f97944378c...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Sep 19 16:18:22 2018 +0200
winhttp: Set last error in WinHttpQueryAuthSchemes when no auth scheme is found.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winhttp/request.c | 1 + dlls/winhttp/tests/winhttp.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 72cebdd..33d8682 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -965,6 +965,7 @@ BOOL WINAPI WinHttpQueryAuthSchemes( HINTERNET hrequest, LPDWORD supported, LPDW *target = WINHTTP_AUTH_TARGET_PROXY; ret = TRUE; } + else set_last_error( ERROR_INVALID_OPERATION );
release_object( &request->hdr ); if (ret) set_last_error( ERROR_SUCCESS ); diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 5f0935f..9138d6a 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2441,7 +2441,7 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); error = GetLastError(); ok(!ret, "unexpected success\n"); - todo_wine ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); + ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); ok(supported == 0xdeadbeef, "got %x\n", supported); ok(first == 0xdeadbeef, "got %x\n", first); ok(target == 0xdeadbeef, "got %x\n", target); @@ -2528,7 +2528,7 @@ static void test_basic_authentication(int port) ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); error = GetLastError(); ok(!ret, "expected failure\n"); - todo_wine ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); + ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); ok(supported == 0xdeadbeef, "got %x\n", supported); ok(first == 0xdeadbeef, "got %x\n", first); ok(target == 0xdeadbeef, "got %x\n", target);