Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/winhttp/session.c | 6 +++--- dlls/winhttp/tests/winhttp.c | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index b54e77bc4e..c878d68eb3 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -225,7 +225,7 @@ static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffe return TRUE; default: FIXME("unimplemented option %u\n", option); - set_last_error( ERROR_INVALID_PARAMETER ); + set_last_error( ERROR_WINHTTP_INVALID_OPTION ); return FALSE; } } @@ -1024,8 +1024,8 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe return TRUE; default: FIXME("unimplemented option %u\n", option); - set_last_error( ERROR_INVALID_PARAMETER ); - return TRUE; + set_last_error( ERROR_WINHTTP_INVALID_OPTION ); + return FALSE; } }
diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 4399cf6df4..302974c699 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2267,12 +2267,36 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError());
+ SetLastError(0xdeadbeef); + ret = WinHttpSetOption(ses, 0, buffer, sizeof(buffer)); + ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(ses, 0, buffer, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + con = WinHttpConnect(ses, localhostW, port, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError());
+ SetLastError(0xdeadbeef); + ret = WinHttpSetOption(con, 0, buffer, sizeof(buffer)); + todo_wine ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(con, 0, buffer, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + req = WinHttpOpenRequest(con, verb, path, NULL, NULL, NULL, 0); ok(req != NULL, "failed to open a request %u\n", GetLastError());
+ SetLastError(0xdeadbeef); + ret = WinHttpSetOption(req, 0, buffer, sizeof(buffer)); + ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(req, 0, buffer, &size); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); ok(ret, "failed to send request %u\n", GetLastError());
Hi,
While running your changed tests on Windows, 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=38168
Your paranoid android.
=== w2003std (32 bit winhttp) === winhttp.c:3903: Test failed: got 80072f0d
=== wvistau64 (32 bit winhttp) === winhttp.c:2304: Test failed: failed to receive response 12152 winhttp.c:2309: Test failed: failed to query status code 12019 winhttp.c:2310: Test failed: request failed unexpectedly 3735928559 winhttp.c:2325: Test failed: failed to query for raw headers: 12019 winhttp.c:2326: Test failed: WinHttpQueryHeaders returned invalid end of header string winhttp.c:2332: Test failed: failed to query for raw headers: 12019 winhttp.c:2333: Test failed: WinHttpQueryHeaders returned invalid end of header string winhttp.c:2335: Test failed: returned string has too many NULL characters winhttp.c:2340: Test failed: failed to read data 12019 winhttp.c:2341: Test failed: count was wrong winhttp.c:2342: Test failed: http data wrong