https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23e96deb0b19c1867f0fa…
commit 23e96deb0b19c1867f0fa25d9747457eee299aa9
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Tue Dec 8 18:17:50 2020 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Tue Jan 5 11:03:13 2021 +0100
[WINESYNC] wininet: Correctly return error status from InternetSetFilePointer() stub.
Fixes Freestyle 2: Street Basketball update check failure.
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 67295a7844b94ccbfce85dbee22a76f12c9f5b36 by Paul Gofman
<pgofman(a)codeweavers.com>
---
dll/win32/wininet/internet.c | 4 +++-
modules/rostests/winetests/wininet/http.c | 35 +++++++++++++++++++++++++++++++
sdk/tools/winesync/wininet.cfg | 2 +-
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/dll/win32/wininet/internet.c b/dll/win32/wininet/internet.c
index eda3bc7da42..e70278ba045 100644
--- a/dll/win32/wininet/internet.c
+++ b/dll/win32/wininet/internet.c
@@ -2103,7 +2103,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/modules/rostests/winetests/wininet/http.c
b/modules/rostests/winetests/wininet/http.c
index 725a1882d24..882f293b856 100644
--- a/modules/rostests/winetests/wininet/http.c
+++ b/modules/rostests/winetests/wininet/http.c
@@ -591,6 +591,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();
@@ -817,10 +819,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;
@@ -831,6 +846,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 || broken(GetLastError()
== 0xdeadbeef)),
+ "Got unexpected length %#x, GetLastError() %u.\n", length,
GetLastError());
+ }
+
SetLastError(0xdeadbeef);
res = InternetReadFile(NULL, buffer, 100, &length);
ok(!res, "InternetReadFile should have failed\n");
diff --git a/sdk/tools/winesync/wininet.cfg b/sdk/tools/winesync/wininet.cfg
index 6757964181c..70eed2c360e 100644
--- a/sdk/tools/winesync/wininet.cfg
+++ b/sdk/tools/winesync/wininet.cfg
@@ -5,4 +5,4 @@ files:
include/wininet.h: sdk/include/psdk/wininet.h
include/winineti.h: sdk/include/psdk/winineti.h
tags:
- wine: bcdb58cc7959afd5fa35ab039e6564934888b4c0
+ wine: 67295a7844b94ccbfce85dbee22a76f12c9f5b36