kernel32: Prevent endless loop if NtQuerySystemInformation fails

Sebastian Lackner sebastian at fds-team.de
Wed Jan 1 13:07:42 CST 2014


The current implementation of fetch_process_thread in toolhelp.c never
fails - because it just retries forever. I don't think that this was the
original intention, at least it looks suspicious. This patch returns
with FALSE if NtQuerySystemInformation fails with an unknown status code.

---
 dlls/kernel32/toolhelp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------- next part --------------
>From 9667b643cc72a1fc6dc5988e4984e917d44c50bd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian at fds-team.de>
Date: Tue, 31 Dec 2013 17:48:42 +0100
Subject: kernel32: Prevent endless loop if NtQuerySystemInformation fails

---
 dlls/kernel32/toolhelp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/kernel32/toolhelp.c b/dlls/kernel32/toolhelp.c
index 94c1a78..49e14ff 100644
--- a/dlls/kernel32/toolhelp.c
+++ b/dlls/kernel32/toolhelp.c
@@ -209,7 +209,7 @@ static BOOL fetch_process_thread( DWORD flags, SYSTEM_PROCESS_INFORMATION** pspi
             break;
         default:
             SetLastError( RtlNtStatusToDosError( status ) );
-            break;
+            return FALSE;
         }
     }
 }
-- 
1.7.9.5



More information about the wine-patches mailing list