Added patch to restore original error code in rpcrt4 when ReadFile fails with ERROR_MORE_DATA.

This commit is contained in:
Sebastian Lackner 2015-06-03 22:31:02 +02:00
parent 78327e5ead
commit fd6ff0999c
6 changed files with 92 additions and 90 deletions

2
debian/changelog vendored
View File

@ -17,6 +17,8 @@ wine-staging (1.7.45) UNRELEASED; urgency=low
* Added patch to silence test failures in ntdll/directory tests.
* Added patches for support of FileLinkInformation (fixes Wine Staging Bug
#297).
* Added patch to restore original error code in rpcrt4 when ReadFile fails
with ERROR_MORE_DATA.
* Removed patch to fix NULL pointer dereference in get_frame_by_name
(identical patch accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Sun, 31 May 2015 14:46:37 +0200

View File

@ -1,28 +0,0 @@
From 0f3d7e07b53bd1a7c8735bb2c0fa3da0b75dcb96 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 8 May 2015 21:53:30 +0200
Subject: advapi32: Fix error handling in OpenSCManagerW.
---
dlls/advapi32/service.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 0eb0a47..111009d 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -868,8 +868,9 @@ SC_HANDLE WINAPI OpenSCManagerW( LPCWSTR lpMachineName, LPCWSTR lpDatabaseName,
DWORD r;
r = SERV_OpenSCManagerW(lpMachineName, lpDatabaseName, dwDesiredAccess, &handle);
- if (r!=ERROR_SUCCESS)
- SetLastError(r);
+
+ /* last error could still be ERROR_MORE_DATA, so set error unconditionally */
+ SetLastError(r);
return handle;
}
--
2.4.0

View File

@ -1 +0,0 @@
Category: stable

View File

@ -1,5 +1,5 @@
Fixes: [16550] Fix for ConnectNamedPort return value in overlapped mode
Fixes: [17195] Support for named pipe message mode (Linux only)
Fixes: Improve ReadDataAvailable handling in FilePipeLocalInformation class
Depends: advapi32-OpenSCManagerW
Depends: rpcrt4-Pipe_Transport
Category: stable

View File

@ -81,7 +81,6 @@ patch_enable_all ()
enable_Pipelight="$1"
enable_Staging="$1"
enable_advapi32_LsaLookupSids="$1"
enable_advapi32_OpenSCManagerW="$1"
enable_browseui_ACLShell_IEnumString="$1"
enable_browseui_Progress_Dialog="$1"
enable_category_stable="$1"
@ -196,6 +195,7 @@ patch_enable_all ()
enable_opengl32_Revert_Disable_Ext="$1"
enable_quartz_MediaSeeking_Positions="$1"
enable_riched20_IText_Interface="$1"
enable_rpcrt4_Pipe_Transport="$1"
enable_rpcrt4_Use_After_Free="$1"
enable_secur32_ANSI_NTLM_Credentials="$1"
enable_server_ACL_Compat="$1"
@ -314,9 +314,6 @@ patch_enable ()
advapi32-LsaLookupSids)
enable_advapi32_LsaLookupSids="$2"
;;
advapi32-OpenSCManagerW)
enable_advapi32_OpenSCManagerW="$2"
;;
browseui-ACLShell_IEnumString)
enable_browseui_ACLShell_IEnumString="$2"
;;
@ -659,6 +656,9 @@ patch_enable ()
riched20-IText_Interface)
enable_riched20_IText_Interface="$2"
;;
rpcrt4-Pipe_Transport)
enable_rpcrt4_Pipe_Transport="$2"
;;
rpcrt4-Use_After_Free)
enable_rpcrt4_Use_After_Free="$2"
;;
@ -1297,9 +1297,6 @@ if test "$enable_category_stable" -eq 1; then
if test "$enable_Staging" -gt 1; then
abort "Patchset Staging disabled, but category-stable depends on that."
fi
if test "$enable_advapi32_OpenSCManagerW" -gt 1; then
abort "Patchset advapi32-OpenSCManagerW disabled, but category-stable depends on that."
fi
if test "$enable_combase_String" -gt 1; then
abort "Patchset combase-String disabled, but category-stable depends on that."
fi
@ -1554,7 +1551,6 @@ if test "$enable_category_stable" -eq 1; then
fi
enable_Compiler_Warnings=1
enable_Staging=1
enable_advapi32_OpenSCManagerW=1
enable_combase_String=1
enable_configure_Absolute_RPATH=1
enable_d3d11_D3D11CreateDeviceAndSwapChain=1
@ -1816,10 +1812,10 @@ if test "$enable_ntdll_CLI_Images" -eq 1; then
fi
if test "$enable_kernel32_Named_Pipe" -eq 1; then
if test "$enable_advapi32_OpenSCManagerW" -gt 1; then
abort "Patchset advapi32-OpenSCManagerW disabled, but kernel32-Named_Pipe depends on that."
if test "$enable_rpcrt4_Pipe_Transport" -gt 1; then
abort "Patchset rpcrt4-Pipe_Transport disabled, but kernel32-Named_Pipe depends on that."
fi
enable_advapi32_OpenSCManagerW=1
enable_rpcrt4_Pipe_Transport=1
fi
if test "$enable_kernel32_CopyFileEx" -eq 1; then
@ -1833,13 +1829,6 @@ if test "$enable_kernel32_CopyFileEx" -eq 1; then
enable_ntdll_FileDispositionInformation=1
fi
if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
if test "$enable_server_File_Permissions" -gt 1; then
abort "Patchset server-File_Permissions disabled, but ntdll-FileDispositionInformation depends on that."
fi
enable_server_File_Permissions=1
fi
if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
if test "$enable_kernel32_SetFileCompletionNotificationMode" -gt 1; then
abort "Patchset kernel32-SetFileCompletionNotificationMode disabled, but kernel32-SetFileInformationByHandle depends on that."
@ -1847,6 +1836,13 @@ if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
enable_kernel32_SetFileCompletionNotificationMode=1
fi
if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
if test "$enable_server_File_Permissions" -gt 1; then
abort "Patchset server-File_Permissions disabled, but ntdll-FileDispositionInformation depends on that."
fi
enable_server_File_Permissions=1
fi
if test "$enable_dxva2_Video_Decoder" -eq 1; then
if test "$enable_winecfg_Staging" -gt 1; then
abort "Patchset winecfg-Staging disabled, but dxva2-Video_Decoder depends on that."
@ -2109,18 +2105,6 @@ if test "$enable_advapi32_LsaLookupSids" -eq 1; then
) >> "$patchlist"
fi
# Patchset advapi32-OpenSCManagerW
# |
# | Modified files:
# | * dlls/advapi32/service.c
# |
if test "$enable_advapi32_OpenSCManagerW" -eq 1; then
patch_apply advapi32-OpenSCManagerW/0001-advapi32-Fix-error-handling-in-OpenSCManagerW.patch
(
echo '+ { "Sebastian Lackner", "advapi32: Fix error handling in OpenSCManagerW.", 1 },';
) >> "$patchlist"
fi
# Patchset browseui-ACLShell_IEnumString
# |
# | This patchset fixes the following Wine bugs:
@ -2970,36 +2954,6 @@ if test "$enable_kernel32_CompareStringEx" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-SetFileCompletionNotificationMode
# |
# | This patchset fixes the following Wine bugs:
# | * [#38493] Add stub for kernel32.SetFileCompletionNotificationModes (for Steam in Win7 mode)
# |
# | Modified files:
# | * dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec, dlls/kernel32/file.c,
# | dlls/kernel32/kernel32.spec, include/winbase.h
# |
if test "$enable_kernel32_SetFileCompletionNotificationMode" -eq 1; then
patch_apply kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch
(
echo '+ { "Olivier F. R. Dierick", "kernel32: Implement SetFileCompletionNotificationModes as a stub.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-SetFileInformationByHandle
# |
# | Modified files:
# | * dlls/kernel32/file.c, include/winbase.h
# |
if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch
patch_apply kernel32-SetFileInformationByHandle/0002-kernel32-Implement-SetFileInformationByHandle.patch
(
echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },';
echo '+ { "Michael Müller", "kernel32: Implement SetFileInformationByHandle.", 1 },';
) >> "$patchlist"
fi
# Patchset server-File_Permissions
# |
# | Modified files:
@ -3071,6 +3025,36 @@ if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-SetFileCompletionNotificationMode
# |
# | This patchset fixes the following Wine bugs:
# | * [#38493] Add stub for kernel32.SetFileCompletionNotificationModes (for Steam in Win7 mode)
# |
# | Modified files:
# | * dlls/api-ms-win-core-kernel32-legacy-l1-1-0/api-ms-win-core-kernel32-legacy-l1-1-0.spec, dlls/kernel32/file.c,
# | dlls/kernel32/kernel32.spec, include/winbase.h
# |
if test "$enable_kernel32_SetFileCompletionNotificationMode" -eq 1; then
patch_apply kernel32-SetFileCompletionNotificationMode/0001-kernel32-Implement-SetFileCompletionNotificationMode.patch
(
echo '+ { "Olivier F. R. Dierick", "kernel32: Implement SetFileCompletionNotificationModes as a stub.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-SetFileInformationByHandle
# |
# | Modified files:
# | * dlls/kernel32/file.c, include/winbase.h
# |
if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch
patch_apply kernel32-SetFileInformationByHandle/0002-kernel32-Implement-SetFileInformationByHandle.patch
(
echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },';
echo '+ { "Michael Müller", "kernel32: Implement SetFileInformationByHandle.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-CopyFileEx
# |
# | This patchset fixes the following Wine bugs:
@ -3168,6 +3152,18 @@ if test "$enable_kernel32_GetVolumePathName" -eq 1; then
) >> "$patchlist"
fi
# Patchset rpcrt4-Pipe_Transport
# |
# | Modified files:
# | * dlls/rpcrt4/rpc_transport.c
# |
if test "$enable_rpcrt4_Pipe_Transport" -eq 1; then
patch_apply rpcrt4-Pipe_Transport/0001-rpcrt4-Restore-original-error-code-when-ReadFile-fai.patch
(
echo '+ { "Sebastian Lackner", "rpcrt4: Restore original error code when ReadFile fails with ERROR_MORE_DATA.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-Named_Pipe
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,33 @@
From ae614670d37cba3ece225bdfcbb512be8617a747 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 3 Jun 2015 22:28:44 +0200
Subject: rpcrt4: Restore original error code when ReadFile fails with
ERROR_MORE_DATA.
---
dlls/rpcrt4/rpc_transport.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index 8c0263b..977dd20 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -416,6 +416,7 @@ static int rpcrt4_conn_np_read(RpcConnection *Connection,
char *buf = buffer;
BOOL ret = TRUE;
unsigned int bytes_left = count;
+ DWORD err = GetLastError();
while (bytes_left)
{
@@ -428,6 +429,7 @@ static int rpcrt4_conn_np_read(RpcConnection *Connection,
bytes_left -= bytes_read;
buf += bytes_read;
}
+ if (ret) SetLastError(err);
return ret ? count : -1;
}
--
2.4.2