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)