From 7a3bc88055d52d61c3cc97b61639737efcc8b97b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 7 Aug 2015 22:37:26 +0200 Subject: [PATCH] Added patch with stubs for additional wininet options in InternetSetOption (fixes Wine Staging Bug #443). --- README.md | 3 +- debian/changelog | 2 + patches/patchinstall.sh | 22 ++++++++ ...e-correct-function-name-in-ok-messag.patch | 51 +++++++++++++++++++ ...g-proxy-should-return-success-when-n.patch | 26 ++++++++++ ...TERNET_OPTION_SETTINGS_CHANGED-on-co.patch | 44 ++++++++++++++++ ...ort-for-INTERNET_OPTION_SETTINGS_CHA.patch | 47 +++++++++++++++++ patches/wininet-Internet_Settings/definition | 1 + 8 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 patches/wininet-Internet_Settings/0001-wininet-Print-the-correct-function-name-in-ok-messag.patch create mode 100644 patches/wininet-Internet_Settings/0002-wininet-Disabling-proxy-should-return-success-when-n.patch create mode 100644 patches/wininet-Internet_Settings/0003-wininet-Allow-INTERNET_OPTION_SETTINGS_CHANGED-on-co.patch create mode 100644 patches/wininet-Internet_Settings/0004-wininet-Add-support-for-INTERNET_OPTION_SETTINGS_CHA.patch create mode 100644 patches/wininet-Internet_Settings/definition diff --git a/README.md b/README.md index 27dbe305..34b2b69e 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [2]:** +**Bug fixes and features included in the next upcoming release [3]:** * Add stub dlls required for MSVC 2015 runtime library (Windows 10) +* Add stubs for additional wininet options in InternetSetOption * Improve stubs for dxgi MakeWindowAssociation and GetWindowAssociation diff --git a/debian/changelog b/debian/changelog index 405e75e2..e83df21c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ wine-staging (1.7.49) UNRELEASED; urgency=low * Added patch to improve stubs for dxgi MakeWindowAssociation and GetWindowAssociation. * Added patch for stub dlls required by the MSVC 2015 runtime library. + * Added patch with stubs for additional wininet options in InternetSetOption + (fixes Wine Staging Bug #443). * Removed patch to avoid race-conditions with long running threadpool tasks (accepted upstream). * Removed patch to add support for ThreadQuerySetWin32StartAddress info class diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 42a815ed..c80e7b6f 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -273,6 +273,7 @@ patch_enable_all () enable_winex11_wglShareLists="$1" enable_winhttp_System_Proxy_Autoconfig="$1" enable_wininet_Cleanup="$1" + enable_wininet_Internet_Settings="$1" enable_wininet_ParseX509EncodedCertificateForListBoxEntry="$1" enable_winmm_Delay_Import_Depends="$1" enable_winscard_SCardListReaders="$1" @@ -894,6 +895,9 @@ patch_enable () wininet-Cleanup) enable_wininet_Cleanup="$2" ;; + wininet-Internet_Settings) + enable_wininet_Internet_Settings="$2" + ;; wininet-ParseX509EncodedCertificateForListBoxEntry) enable_wininet_ParseX509EncodedCertificateForListBoxEntry="$2" ;; @@ -5631,6 +5635,24 @@ if test "$enable_wininet_Cleanup" -eq 1; then ) >> "$patchlist" fi +# Patchset wininet-Internet_Settings +# | +# | Modified files: +# | * dlls/wininet/internet.c, dlls/wininet/tests/internet.c +# | +if test "$enable_wininet_Internet_Settings" -eq 1; then + patch_apply wininet-Internet_Settings/0001-wininet-Print-the-correct-function-name-in-ok-messag.patch + patch_apply wininet-Internet_Settings/0002-wininet-Disabling-proxy-should-return-success-when-n.patch + patch_apply wininet-Internet_Settings/0003-wininet-Allow-INTERNET_OPTION_SETTINGS_CHANGED-on-co.patch + patch_apply wininet-Internet_Settings/0004-wininet-Add-support-for-INTERNET_OPTION_SETTINGS_CHA.patch + ( + echo '+ { "Sebastian Lackner", "wininet: Print the correct function name in ok() messages.", 1 },'; + echo '+ { "Michael Müller", "wininet: Disabling proxy should return success when no proxy was enabled.", 1 },'; + echo '+ { "Michael Müller", "wininet: Allow INTERNET_OPTION_SETTINGS_CHANGED on connections.", 1 },'; + echo '+ { "Michael Müller", "wininet: Add support for INTERNET_OPTION_SETTINGS_CHANGED in InternetSetOption.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wininet-ParseX509EncodedCertificateForListBoxEntry # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wininet-Internet_Settings/0001-wininet-Print-the-correct-function-name-in-ok-messag.patch b/patches/wininet-Internet_Settings/0001-wininet-Print-the-correct-function-name-in-ok-messag.patch new file mode 100644 index 00000000..5758ee6d --- /dev/null +++ b/patches/wininet-Internet_Settings/0001-wininet-Print-the-correct-function-name-in-ok-messag.patch @@ -0,0 +1,51 @@ +From d09b181f7f9cbba7d9b28e3a5db4058f852b5688 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 7 Aug 2015 22:16:08 +0200 +Subject: wininet: Print the correct function name in ok() messages. + +--- + dlls/wininet/tests/internet.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c +index 5e09525..2efde07 100644 +--- a/dlls/wininet/tests/internet.c ++++ b/dlls/wininet/tests/internet.c +@@ -1111,29 +1111,29 @@ static void test_InternetSetOption(void) + SetLastError(0xdeadbeef); + ulArg = 11; + ret = InternetSetOptionA(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); +- ok(ret == FALSE, "InternetQueryOption should've failed\n"); ++ ok(ret == FALSE, "InternetSetOption should've failed\n"); + ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError()); + + SetLastError(0xdeadbeef); + ulArg = 11; + ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, 20); +- ok(ret == FALSE, "InternetQueryOption should've failed\n"); ++ ok(ret == FALSE, "InternetSetOption should've failed\n"); + ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %d\n", GetLastError()); + + ulArg = 11; + ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); +- ok(ret == TRUE, "InternetQueryOption should've succeeded\n"); ++ ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + SetLastError(0xdeadbeef); + ulArg = 4; + ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); +- ok(ret == FALSE, "InternetQueryOption should've failed\n"); ++ ok(ret == FALSE, "InternetSetOption should've failed\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); + + SetLastError(0xdeadbeef); + ulArg = 16; + ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); +- ok(ret == FALSE, "InternetQueryOption should've failed\n"); ++ ok(ret == FALSE, "InternetSetOption should've failed\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); + + ret = InternetCloseHandle(req); +-- +2.5.0 + diff --git a/patches/wininet-Internet_Settings/0002-wininet-Disabling-proxy-should-return-success-when-n.patch b/patches/wininet-Internet_Settings/0002-wininet-Disabling-proxy-should-return-success-when-n.patch new file mode 100644 index 00000000..fc274e73 --- /dev/null +++ b/patches/wininet-Internet_Settings/0002-wininet-Disabling-proxy-should-return-success-when-n.patch @@ -0,0 +1,26 @@ +From e79956abb099aa58f3b4a2859f8595434e3132e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 7 Aug 2015 02:44:31 +0200 +Subject: wininet: Disabling proxy should return success when no proxy was + enabled. + +--- + dlls/wininet/internet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c +index ee04f40..b004c68 100644 +--- a/dlls/wininet/internet.c ++++ b/dlls/wininet/internet.c +@@ -359,7 +359,7 @@ static LONG INTERNET_SaveProxySettings( proxyinfo_t *lpwpi ) + } + else + { +- if ((ret = RegDeleteValueW( key, szProxyServer ))) ++ if ((ret = RegDeleteValueW( key, szProxyServer )) && ret != ERROR_FILE_NOT_FOUND) + { + RegCloseKey( key ); + return ret; +-- +2.5.0 + diff --git a/patches/wininet-Internet_Settings/0003-wininet-Allow-INTERNET_OPTION_SETTINGS_CHANGED-on-co.patch b/patches/wininet-Internet_Settings/0003-wininet-Allow-INTERNET_OPTION_SETTINGS_CHANGED-on-co.patch new file mode 100644 index 00000000..ff1d001d --- /dev/null +++ b/patches/wininet-Internet_Settings/0003-wininet-Allow-INTERNET_OPTION_SETTINGS_CHANGED-on-co.patch @@ -0,0 +1,44 @@ +From 22a5c051cf024f7ca12e8fcde6cb0d925c53ac7e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 7 Aug 2015 03:44:39 +0200 +Subject: wininet: Allow INTERNET_OPTION_SETTINGS_CHANGED on connections. + +--- + dlls/wininet/internet.c | 3 +++ + dlls/wininet/tests/internet.c | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c +index b004c68..2f4be7b 100644 +--- a/dlls/wininet/internet.c ++++ b/dlls/wininet/internet.c +@@ -3045,6 +3045,9 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, + ret = (res == ERROR_SUCCESS); + break; + } ++ case INTERNET_OPTION_SETTINGS_CHANGED: ++ FIXME("INTERNET_OPTION_SETTINGS_CHANGED; STUB\n"); ++ break; + default: + FIXME("Option %d STUB\n",dwOption); + SetLastError(ERROR_INTERNET_INVALID_OPTION); +diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c +index 2efde07..3274ef7 100644 +--- a/dlls/wininet/tests/internet.c ++++ b/dlls/wininet/tests/internet.c +@@ -1136,6 +1136,12 @@ static void test_InternetSetOption(void) + ok(ret == FALSE, "InternetSetOption should've failed\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); + ++ ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); ++ ok(ret == TRUE, "InternetSetOption should've succeeded\n"); ++ ++ ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); ++ ok(ret == TRUE, "InternetSetOption should've succeeded\n"); ++ + ret = InternetCloseHandle(req); + ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError()); + ret = InternetCloseHandle(con); +-- +2.5.0 + diff --git a/patches/wininet-Internet_Settings/0004-wininet-Add-support-for-INTERNET_OPTION_SETTINGS_CHA.patch b/patches/wininet-Internet_Settings/0004-wininet-Add-support-for-INTERNET_OPTION_SETTINGS_CHA.patch new file mode 100644 index 00000000..f73e1bf2 --- /dev/null +++ b/patches/wininet-Internet_Settings/0004-wininet-Add-support-for-INTERNET_OPTION_SETTINGS_CHA.patch @@ -0,0 +1,47 @@ +From d49d4f54ace573abdf2919ce791ded8bf2242ce3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 7 Aug 2015 04:22:12 +0200 +Subject: wininet: Add support for INTERNET_OPTION_SETTINGS_CHANGED in + InternetSetOption. + +--- + dlls/wininet/internet.c | 3 +++ + dlls/wininet/tests/internet.c | 8 ++++++++ + 2 files changed, 11 insertions(+) + +diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c +index 2f4be7b..899c30b 100644 +--- a/dlls/wininet/internet.c ++++ b/dlls/wininet/internet.c +@@ -3048,6 +3048,9 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, + case INTERNET_OPTION_SETTINGS_CHANGED: + FIXME("INTERNET_OPTION_SETTINGS_CHANGED; STUB\n"); + break; ++ case INTERNET_OPTION_REFRESH: ++ FIXME("INTERNET_OPTION_REFRESH; STUB\n"); ++ break; + default: + FIXME("Option %d STUB\n",dwOption); + SetLastError(ERROR_INTERNET_INVALID_OPTION); +diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c +index 3274ef7..dd03758 100644 +--- a/dlls/wininet/tests/internet.c ++++ b/dlls/wininet/tests/internet.c +@@ -1142,6 +1142,14 @@ static void test_InternetSetOption(void) + ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + ++ ret = InternetSetOptionA(ses, INTERNET_OPTION_REFRESH, NULL, 0); ++ ok(ret == TRUE, "InternetSetOption should've succeeded\n"); ++ ++ SetLastError(0xdeadbeef); ++ ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0); ++ todo_wine ok(ret == FALSE, "InternetSetOption should've failed\n"); ++ todo_wine ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError()); ++ + ret = InternetCloseHandle(req); + ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError()); + ret = InternetCloseHandle(con); +-- +2.5.0 + diff --git a/patches/wininet-Internet_Settings/definition b/patches/wininet-Internet_Settings/definition new file mode 100644 index 00000000..0b98a2f4 --- /dev/null +++ b/patches/wininet-Internet_Settings/definition @@ -0,0 +1 @@ +Fixes: Add stubs for additional wininet options in InternetSetOption