From 574ced0dc6f019d11c7c0c67d4b655985b1c24e7 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 2 Dec 2020 20:06:11 +0100 Subject: [PATCH] server: Fix handling of STATUS_ALERTED in get_next_console_request. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/console.c | 14 ++++++++++++++ server/console.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index cab036243dc..918ecac8ac4 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -268,6 +268,8 @@ static void testWriteSimple(HANDLE hCon) const char* mytest = "abcdefg"; int mylen = strlen(mytest); COORD c = {0, 0}; + DWORD len; + BOOL ret; simple_write_console(hCon, mytest); @@ -278,6 +280,18 @@ static void testWriteSimple(HANDLE hCon) okCURSOR(hCon, c); okCHAR(hCon, c, ' ', DEFAULT_ATTRIB); + + ret = WriteFile(hCon, mytest, mylen, &len, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); + ok(len == mylen, "unexpected len = %u\n", len); + + for (c.X = 0; c.X < 2 * mylen; c.X++) + { + okCHAR(hCon, c, mytest[c.X % mylen], TEST_ATTRIB); + } + + okCURSOR(hCon, c); + okCHAR(hCon, c, ' ', DEFAULT_ATTRIB); } static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) diff --git a/server/console.c b/server/console.c index dc3785e8726..d1f948b23a6 100644 --- a/server/console.c +++ b/server/console.c @@ -1520,7 +1520,6 @@ DECL_HANDLER(get_next_console_request) if ((iosb->out_data = memdup( get_req_data(), iosb->out_size ))) { iosb->result = iosb->out_size; - status = STATUS_ALERTED; } else if (!status) { @@ -1528,6 +1527,7 @@ DECL_HANDLER(get_next_console_request) iosb->out_size = 0; } } + if (iosb->result) status = STATUS_ALERTED; } else { -- 2.11.4.GIT