kernel32: Enhance bare fd check by checking that the handle is a real console handle.

oldstable
Eric Pouech 2012-02-17 21:57:38 +01:00 committed by Alexandre Julliard
parent 21498d6c11
commit 945e16c281
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ static int get_console_bare_fd(HANDLE hin)
{
int fd;
if (wine_server_handle_to_fd(wine_server_ptr_handle(console_handle_unmap(hin)),
if (is_console_handle(hin) &&
wine_server_handle_to_fd(wine_server_ptr_handle(console_handle_unmap(hin)),
0, &fd, NULL) == STATUS_SUCCESS)
return fd;
return -1;