kernel32: Fix writing to a pipe in WriteConsoleW().

Eric Pouech eric.pouech at
Fri Sep 2 02:31:00 CDT 2011

Le 01/09/2011 16:22, Francois Gouget a écrit :
> On Wed, 24 Aug 2011, Eric Pouech wrote:
> [...]
>> you can safely provide the patches with protecting WriteConsole and friends
>> with a if (!is_console_handle(???)) return FALSE; line
> Would something like the attached patch be ok?
> As far as I can see all the other APIs pretty much immediately pass the
> handle to wineserver which I expect will complain if it's not a console
> handle.
> Further notes:
>   * Performing the 'console handle check' locally would likely be faster
>     but, except for WriteConsole maybe, this should usually be the case
>     and is probably not performance critical anyway.
>   * There are a few cases where we check for invalid parameters and
>     return an error before the handle is checked by wineserver. It's
>     possible that in such cases Windows checks the handle first. But
>     unless we know of applications that need the right error code in
>     these corner cases it does not justify adding an explicit check.
actually, a couple of API support the "bare" handles and those should be 
protected (what your patch does)
otherwise, wineserver iwill fail on them
this patch looks ok, but you have to reverse the previous one as well

Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wine-devel mailing list