Added check for PROCESS_VM_WRITE, without which, some programs go into an infinite loop Henry Blum <henry.blum at gmail.com>

Andrey Turkin andrey.turkin at gmail.com
Sun May 9 00:51:09 CDT 2010


08.05.2010 9:10, Henry Blum wrote:
> ---
>  dlls/kernel32/process.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
> index 9a1f2f5..6dcad8f 100644
> --- a/dlls/kernel32/process.c
> +++ b/dlls/kernel32/process.c
> @@ -2657,7 +2657,7 @@ HANDLE WINAPI OpenProcess( DWORD access, BOOL 
> inherit, DWORD id )
>      if (GetVersion() & 0x80000000) access = PROCESS_ALL_ACCESS;
>       status = NtOpenProcess(&handle, access, &attr, &cid);
> -    if (status != STATUS_SUCCESS)
> +    if (status != STATUS_SUCCESS || (access & PROCESS_VM_WRITE))
>      {
>          SetLastError( RtlNtStatusToDosError(status) );
>          return NULL;

Wouldn't this pretend operation failed for every request with 
PROCESS_VM_WRITE, even if NtOpenProcess succeeded, and leak a handle? 
Which bug should it fix?



More information about the wine-devel mailing list