Added patch to fix handling of GetOverlappedResult when status remains STATUS_PENDING.

This commit is contained in:
Sebastian Lackner 2016-03-13 07:28:01 +01:00
parent 290c1cfb3d
commit b7e52ca2fe
3 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,48 @@
From d424317603a8ddce1475af26071374642edba457 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 13 Mar 2016 07:25:01 +0100
Subject: kernel32: Fix handling of GetOverlappedResult when status remains
STATUS_PENDING.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Spotted by Michael Müller.
---
dlls/kernel32/file.c | 2 ++
dlls/kernel32/tests/file.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index b6dba6a..a518e08 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -625,7 +625,9 @@ BOOL WINAPI GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped,
if (WaitForSingleObject( lpOverlapped->hEvent ? lpOverlapped->hEvent : hFile,
INFINITE ) == WAIT_FAILED)
return FALSE;
+
status = lpOverlapped->Internal;
+ if (status == STATUS_PENDING) status = STATUS_SUCCESS;
}
*lpTransferred = lpOverlapped->InternalHigh;
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 8353c21..a066692 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -3361,6 +3361,11 @@ static void test_overlapped(void)
"wrong error %u\n", GetLastError() );
ok( r == FALSE, "should return false\n");
+ r = GetOverlappedResult( 0, &ov, &result, TRUE );
+ ok( r == TRUE, "should return TRUE\n" );
+ ok( result == 0xabcd, "wrong result %u\n", result );
+ ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", ov.Internal );
+
ResetEvent( ov.hEvent );
SetLastError( 0xb00 );
--
2.7.1

View File

@ -0,0 +1 @@
Fixes: Fix handling of GetOverlappedResult when status remains STATUS_PENDING

View File

@ -171,6 +171,7 @@ patch_enable_all ()
enable_kernel32_FreeUserPhysicalPages="$1"
enable_kernel32_GetCurrentPackageFamilyName="$1"
enable_kernel32_GetFinalPathNameByHandle="$1"
enable_kernel32_GetOverlappedResult="$1"
enable_kernel32_LocaleNameToLCID="$1"
enable_kernel32_Named_Pipe="$1"
enable_kernel32_NeedCurrentDirectoryForExePath="$1"
@ -677,6 +678,9 @@ patch_enable ()
kernel32-GetFinalPathNameByHandle)
enable_kernel32_GetFinalPathNameByHandle="$2"
;;
kernel32-GetOverlappedResult)
enable_kernel32_GetOverlappedResult="$2"
;;
kernel32-LocaleNameToLCID)
enable_kernel32_LocaleNameToLCID="$2"
;;
@ -4072,6 +4076,18 @@ if test "$enable_kernel32_FindFirstFile" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-GetOverlappedResult
# |
# | Modified files:
# | * dlls/kernel32/file.c, dlls/kernel32/tests/file.c
# |
if test "$enable_kernel32_GetOverlappedResult" -eq 1; then
patch_apply kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch
(
echo '+ { "Sebastian Lackner", "kernel32: Fix handling of GetOverlappedResult when status remains STATUS_PENDING.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-LocaleNameToLCID
# |
# | This patchset fixes the following Wine bugs: