Skip to content

Commit fc68670

Browse files
committed
[CRT] Sync _cputs() with Wine Staging 1.9.16. CORE-11866 CORE-8546
svn path=/trunk/; revision=72606
1 parent dc4261f commit fc68670

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

reactos/media/doc/README.WINE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ kernel32 -
287287
reactos/dll/win32/kernel32/winnls/string/sortkey.c # Synced to WineStaging-1.9.16
288288

289289
msvcrt -
290+
reactos/sdk/lib/crt/conio/cputs.c # Synced to WineStaging-1.9.16
290291
reactos/sdk/lib/crt/except/cpp.c # Synced at 20080528
291292
reactos/sdk/lib/crt/except/cppexcept.c # Synced at 20071111
292293
reactos/sdk/lib/crt/process/_cwait.c # Synced to WineStaging-1.7.37

reactos/sdk/lib/crt/conio/cputs.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
/*
2-
* COPYRIGHT: LGPL - See COPYING in the top level directory
3-
* PROJECT: ReactOS system libraries
4-
* FILE: lib/sdk/crt/conio/cputs.c
5-
* PURPOSE: Writes a character to stdout
6-
* PROGRAMER: Aleksey Bragin
7-
*/
1+
/* Imported from msvcrt/console.c */
82

93
#include <precomp.h>
104

11-
/*
12-
* @implemented
5+
/*********************************************************************
6+
* _cputs (MSVCRT.@)
137
*/
14-
int _cputs(const char *_str)
8+
int CDECL _cputs(const char* str)
159
{
1610
DWORD count;
17-
int retval = EOF;
18-
HANDLE console_out = GetStdHandle(STD_OUTPUT_HANDLE);
11+
int len, retval = -1;
12+
#ifdef __REACTOS__ /* r54651 */
13+
HANDLE MSVCRT_console_out = GetStdHandle(STD_OUTPUT_HANDLE);
14+
#endif
15+
16+
if (!MSVCRT_CHECK_PMT(str != NULL)) return -1;
17+
len = strlen(str);
1918

20-
//LOCK_CONSOLE;
21-
if (WriteConsoleA(console_out, _str, strlen(_str), &count, NULL)
22-
&& count == 1)
19+
#ifndef __REACTOS__ /* r54651 */
20+
LOCK_CONSOLE;
21+
#endif
22+
if (WriteConsoleA(MSVCRT_console_out, str, len, &count, NULL)
23+
&& count == len)
2324
retval = 0;
24-
//UNLOCK_CONSOLE;
25+
#ifndef __REACTOS__ /* r54651 */
26+
UNLOCK_CONSOLE;
27+
#endif
2528
return retval;
2629
}

0 commit comments

Comments
 (0)