[PATCH 0/1] MR10254: winhttp: Stub WinHttpSetOption( WINHTTP_OPTION_DECOMPRESSION ).
From: Paul Gofman <pgofman@codeweavers.com> --- dlls/winhttp/session.c | 5 +++++ dlls/winhttp/tests/winhttp.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 1844ebc8571..057bded02c0 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -1452,6 +1452,11 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D hdr->context = *(DWORD_PTR *)buffer; return TRUE; } + + case WINHTTP_OPTION_DECOMPRESSION: + FIXME( "WINHTTP_OPTION_DECOMPRESSION, %#lx stub.\n", *(DWORD *)buffer ); + return TRUE; + default: if (hdr->vtbl->set_option) ret = hdr->vtbl->set_option( hdr, option, buffer, buflen ); else diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 2b179871c76..7db65d76c38 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -165,6 +165,17 @@ static void test_WinHttpQueryOption(void) ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %lu\n", GetLastError()); + feature = WINHTTP_DECOMPRESSION_FLAG_ALL; + ret = WinHttpSetOption(session, WINHTTP_OPTION_DECOMPRESSION, &feature, sizeof(feature)); + ok(ret, "failed to set option %lu\n", GetLastError()); + + feature = 0xdeadbeef; + size = sizeof(feature); + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(session, WINHTTP_OPTION_DECOMPRESSION, &feature, &size); + ok(!ret, "should fail to query option\n"); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() ); + SetLastError(0xdeadbeef); request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0); @@ -261,6 +272,17 @@ static void test_WinHttpQueryOption(void) ret = WinHttpSetOption(request, WINHTTP_OPTION_CONNECT_RETRIES, &feature, sizeof(feature)); ok(ret, "failed to set WINHTTP_OPTION_CONNECT_RETRIES %lu\n", GetLastError()); + feature = WINHTTP_DECOMPRESSION_FLAG_ALL; + ret = WinHttpSetOption(request, WINHTTP_OPTION_DECOMPRESSION, &feature, sizeof(feature)); + ok(ret, "failed to set option %lu\n", GetLastError()); + + feature = 0xdeadbeef; + size = sizeof(feature); + SetLastError(0xdeadbeef); + ret = WinHttpQueryOption(request, WINHTTP_OPTION_DECOMPRESSION, &feature, &size); + ok(!ret, "should fail to query option\n"); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() ); + SetLastError(0xdeadbeef); ret = WinHttpCloseHandle(request); ok(ret, "WinHttpCloseHandle failed on closing request: %lu\n", GetLastError()); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10254
That helps Killer Inn to connect to Square Enix servers. I've seen this option requested previously, while absence wasn't causing failures. One supposed effect of that option is that winhttp should set Accept-Encoding header, and if it doesn't do that servers do not actually send compressed data that winhttp would need to decompress. So I think having success here without implementation is not much likely to cause regressions (apps could set the header themselves of course but probably have no reasons to do it). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10254#note_131423
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10254
participants (3)
-
Hans Leidekker (@hans) -
Paul Gofman -
Paul Gofman (@gofman)