From 945e16c281fc8bc3d6ead7ba95b34b24af39d1d3 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Fri, 17 Feb 2012 21:57:38 +0100 Subject: [PATCH] kernel32: Enhance bare fd check by checking that the handle is a real console handle. --- dlls/kernel32/console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 6d429f095f5..4410a31badb 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -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;