diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 21ce10af743..a04ff262b70 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -2239,7 +2239,15 @@ BOOL WINAPI GetConsoleCursorInfo(HANDLE hCon, LPCONSOLE_CURSOR_INFO cinfo) } SERVER_END_REQ; - TRACE("(%p) returning (%d,%d)\n", hCon, cinfo->dwSize, cinfo->bVisible); + if (!ret) return FALSE; + + if (!cinfo) + { + SetLastError(ERROR_INVALID_ACCESS); + ret = FALSE; + } + else TRACE("(%p) returning (%d,%d)\n", hCon, cinfo->dwSize, cinfo->bVisible); + return ret; } diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 2e0a78d0d94..6eed56bd07f 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -168,12 +168,9 @@ static void testCursorInfo(HANDLE hCon) SetLastError(0xdeadbeef); ret = GetConsoleCursorInfo(hCon, NULL); - todo_wine - { ok(!ret, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_ACCESS, "GetLastError: expecting %u got %u\n", ERROR_INVALID_ACCESS, GetLastError()); - } } static void testWriteSimple(HANDLE hCon, COORD sbSize)