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>
This commit is contained in:
Jacek Caban 2018-09-19 16:18:22 +02:00 committed by Alexandre Julliard
parent f76208879e
commit 6435f844dd
2 changed files with 3 additions and 2 deletions

View File

@ -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 );

View File

@ -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);