Fixes Freestyle 2: Street Basketball update check failure.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/wininet/internet.c | 4 +++- dlls/wininet/tests/http.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index fb02488934d..91bff2ece93 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -2096,7 +2096,9 @@ DWORD WINAPI InternetSetFilePointer(HINTERNET hFile, LONG lDistanceToMove, PVOID pReserved, DWORD dwMoveContext, DWORD_PTR dwContext) { FIXME("(%p %d %p %d %lx): stub\n", hFile, lDistanceToMove, pReserved, dwMoveContext, dwContext); - return FALSE; + + SetLastError(ERROR_INTERNET_INVALID_OPERATION); + return INVALID_SET_FILE_POINTER; }
/*********************************************************************** diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index fc984f6d33d..1c872a97345 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -590,6 +590,8 @@ static void InternetReadFile_test(int flags, const test_data_t *test) DWORD length, length2, index, exlen = 0, post_len = 0; const char *types[2] = { "*", NULL }; HINTERNET hi, hic = 0, hor = 0; + DWORD contents_length, accepts_ranges; + BOOL not_supported;
trace("Starting InternetReadFile test with flags 0x%x on url %s\n",flags,test->url); reset_events(); @@ -816,10 +818,23 @@ static void InternetReadFile_test(int flags, const test_data_t *test) res = HttpQueryInfoA(hor,HTTP_QUERY_CONTENT_LENGTH,&buffer,&length,&index); trace("Option HTTP_QUERY_CONTENT_LENGTH -> %i %s (%u)\n",res,buffer,GetLastError()); if(test->flags & TESTF_COMPRESSED) + { ok(!res && GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "expected ERROR_HTTP_HEADER_NOT_FOUND, got %x (%u)\n", res, GetLastError()); + contents_length = 0; + } + else + { + contents_length = atoi(buffer); + } ok(!res || index == 1, "Index was not incremented although result is %x (index = %u)\n", res, index);
+ length = 64; + *buffer = 0; + res = HttpQueryInfoA(hor,HTTP_QUERY_ACCEPT_RANGES,&buffer,&length,0x0); + trace("Option HTTP_QUERY_ACCEPT_RANGES -> %i %s (%u)\n",res,buffer,GetLastError()); + accepts_ranges = res && !strcmp(buffer, "bytes"); + length = 100; res = HttpQueryInfoA(hor,HTTP_QUERY_CONTENT_TYPE,buffer,&length,0x0); buffer[length]=0; @@ -830,6 +845,26 @@ static void InternetReadFile_test(int flags, const test_data_t *test) buffer[length]=0; trace("Option HTTP_QUERY_CONTENT_ENCODING -> %i %s\n",res,buffer);
+ SetLastError(0xdeadbeef); + length = InternetSetFilePointer(hor, 0, NULL, FILE_END, 0); + not_supported = length == INVALID_SET_FILE_POINTER + && GetLastError() == ERROR_INTERNET_INVALID_OPERATION; + if (accepts_ranges) + todo_wine ok((length == contents_length && (GetLastError() == ERROR_SUCCESS + || broken(GetLastError() == 0xdeadbeef))) || broken(not_supported), + "Got unexpected length %#x, GetLastError() %u, contents_length %u, accepts_ranges %#x.\n", + length, GetLastError(), contents_length, accepts_ranges); + else + ok(not_supported, "Got unexpected length %#x, GetLastError() %u.\n", length, GetLastError()); + + if (length != INVALID_SET_FILE_POINTER) + { + SetLastError(0xdeadbeef); + length = InternetSetFilePointer(hor, 0, NULL, FILE_BEGIN, 0); + ok(!length && GetLastError() == ERROR_SUCCESS, "Got unexpected length %#x, GetLastError() %u.\n", + length, GetLastError()); + } + SetLastError(0xdeadbeef); res = InternetReadFile(NULL, buffer, 100, &length); ok(!res, "InternetReadFile should have failed\n");
Hi,
While running your changed tests, 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=81717
Your paranoid android.
=== w2008s64 (32 bit report) ===
wininet: http.c:864: Test failed: Got unexpected length 0, GetLastError() 3735928559. http.c:864: Test failed: Got unexpected length 0, GetLastError() 3735928559.
=== w8adm (32 bit report) ===
wininet: http.c:705: Test failed: req_error = 12007 http.c:716: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 1 times, received 0 times http.c:729: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 0 times http.c:730: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 0 times http.c:731: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 0 times http.c:732: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 1 times, received 0 times http.c:741: Test failed: flags = 8, expected 0 http.c:755: Test failed: Expected any header character, got 0x00 http.c:782: Test failed: Expected 0x0000, got 7777 http.c:945: Test failed: Returned zero size in response to request complete http.c:376: Test failed: unexpected status 10 (INTERNET_STATUS_RESOLVING_NAME) http.c:376: Test failed: unexpected status 11 (INTERNET_STATUS_NAME_RESOLVED) http.c:726: Test failed: expected status 10 (INTERNET_STATUS_RESOLVING_NAME) 0 times, received 1 times http.c:727: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 0 times, received 1 times
=== w10pro64 (32 bit report) ===
wininet: http.c:376: Test failed: unexpected status 20 (INTERNET_STATUS_CONNECTING_TO_SERVER)
=== w2008s64 (64 bit report) ===
wininet: http.c:864: Test failed: Got unexpected length 0, GetLastError() 3735928559. http.c:864: Test failed: Got unexpected length 0, GetLastError() 3735928559.
=== w864 (64 bit report) ===
wininet: http.c:376: Test failed: unexpected status 30 (INTERNET_STATUS_SENDING_REQUEST) http.c:376: Test failed: unexpected status 31 (INTERNET_STATUS_REQUEST_SENT) http.c:376: Test failed: unexpected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) http.c:376: Test failed: unexpected status 50 (INTERNET_STATUS_CLOSING_CONNECTION) http.c:376: Test failed: unexpected status 51 (INTERNET_STATUS_CONNECTION_CLOSED) http.c:3352: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 2 times http.c:3353: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 2 times http.c:3354: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 2 times
=== w10pro64 (64 bit report) ===
wininet: http.c:376: Test failed: unexpected status 20 (INTERNET_STATUS_CONNECTING_TO_SERVER)
=== debiant (32 bit Japanese:Japan report) ===
wininet: http.c:7629: Test failed: HttpQueryInfoA failed 12018 http.c:7630: Test failed: header missing
=== debiant (32 bit Chinese:China report) ===
wininet: http.c:5002: Test failed: expected 1 pending read, got 2