From fc686705cdd33947aae4085d51bad4c828f37faa Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 7 Sep 2016 09:31:52 +0000 Subject: [PATCH] [CRT] Sync _cputs() with Wine Staging 1.9.16. CORE-11866 CORE-8546 svn path=/trunk/; revision=72606 --- reactos/media/doc/README.WINE | 1 + reactos/sdk/lib/crt/conio/cputs.c | 35 +++++++++++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index e56c6a58ef5..1c160ac7023 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -287,6 +287,7 @@ kernel32 - reactos/dll/win32/kernel32/winnls/string/sortkey.c # Synced to WineStaging-1.9.16 msvcrt - + reactos/sdk/lib/crt/conio/cputs.c # Synced to WineStaging-1.9.16 reactos/sdk/lib/crt/except/cpp.c # Synced at 20080528 reactos/sdk/lib/crt/except/cppexcept.c # Synced at 20071111 reactos/sdk/lib/crt/process/_cwait.c # Synced to WineStaging-1.7.37 diff --git a/reactos/sdk/lib/crt/conio/cputs.c b/reactos/sdk/lib/crt/conio/cputs.c index 74445273ec0..bf0d8d09cff 100644 --- a/reactos/sdk/lib/crt/conio/cputs.c +++ b/reactos/sdk/lib/crt/conio/cputs.c @@ -1,26 +1,29 @@ -/* - * COPYRIGHT: LGPL - See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/sdk/crt/conio/cputs.c - * PURPOSE: Writes a character to stdout - * PROGRAMER: Aleksey Bragin - */ +/* Imported from msvcrt/console.c */ #include -/* - * @implemented +/********************************************************************* + * _cputs (MSVCRT.@) */ -int _cputs(const char *_str) +int CDECL _cputs(const char* str) { DWORD count; - int retval = EOF; - HANDLE console_out = GetStdHandle(STD_OUTPUT_HANDLE); + int len, retval = -1; +#ifdef __REACTOS__ /* r54651 */ + HANDLE MSVCRT_console_out = GetStdHandle(STD_OUTPUT_HANDLE); +#endif + + if (!MSVCRT_CHECK_PMT(str != NULL)) return -1; + len = strlen(str); - //LOCK_CONSOLE; - if (WriteConsoleA(console_out, _str, strlen(_str), &count, NULL) - && count == 1) +#ifndef __REACTOS__ /* r54651 */ + LOCK_CONSOLE; +#endif + if (WriteConsoleA(MSVCRT_console_out, str, len, &count, NULL) + && count == len) retval = 0; - //UNLOCK_CONSOLE; +#ifndef __REACTOS__ /* r54651 */ + UNLOCK_CONSOLE; +#endif return retval; } -- 2.17.1