<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>I looked further into the problem I set out to fix, and realize that this patch is pretty terrible. The real bug is 22006 <a href="http://bugs.winehq.org/show_bug.cgi?id=22006">http://bugs.winehq.org/show_bug.cgi?id=22006</a> and affects the game Continuum <a href="http://appdb.winehq.org/appview.php?iVersionId=3703">http://appdb.winehq.org/appview.php?iVersionId=3703</a> basically, OpenProcess doesn't enfore ACLs
<br>
<br>I am a user of the game, and the instructions that other users have provided involve a patch which allow the game to function. I was applying the patch from the git source, and wanted to try my hand at submitting a patch. The patch provided is described in the appdb page, and I thought I would improve it. 
<br>
<br>That patch (not the one I submitted) wouldn't leak any handles, since it returns null before attempting NtOpenProcess when (access &amp; PROCESS_VM_WRITE). I'm not sure if that is proper behavior, but it still seems dangerous to me.
<br>
<br>Long story short, please disregard this patch, and while I will continue my efforts, any suggestions on how to approach bug 22006 would be greatly appreciated.
<br>
<br>Many thanks,
<br>Henry Blum
<br>
<br>----- Original message -----
<br>&gt; 08.05.2010 9:10, Henry Blum wrote:
<br>&gt; &gt; ---
<br>&gt; &gt;&nbsp; dlls/kernel32/process.c |&nbsp; &nbsp; &nbsp; 2 +-
<br>&gt; &gt;&nbsp; 1 files changed, 1 insertions(+), 1 deletions(-)
<br>&gt; &gt;
<br>&gt; &gt; diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
<br>&gt; &gt; index 9a1f2f5..6dcad8f 100644
<br>&gt; &gt; --- a/dlls/kernel32/process.c
<br>&gt; &gt; +++ b/dlls/kernel32/process.c
<br>&gt; &gt; @@ -2657,7 +2657,7 @@ HANDLE WINAPI OpenProcess( DWORD access, BOOL
<br>&gt; &gt; inherit, DWORD id )
<br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (GetVersion() &amp; 0x80000000) access = PROCESS_ALL_ACCESS;
<br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status = NtOpenProcess(&amp;handle, access, &amp;attr, &amp;cid);
<br>&gt; &gt; -&nbsp; &nbsp; &nbsp; if (status != STATUS_SUCCESS)
<br>&gt; &gt; +&nbsp; &nbsp; &nbsp; if (status != STATUS_SUCCESS || (access &amp; PROCESS_VM_WRITE))
<br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
<br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetLastError( RtlNtStatusToDosError(status) );
<br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return NULL;
<br>&gt;
<br>&gt; Wouldn't this pretend operation failed for every request with
<br>&gt; PROCESS_VM_WRITE, even if NtOpenProcess succeeded, and leak a handle?
<br>&gt; Which bug should it fix?
<br><br></p>
</body>
</html>