diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 6e404f20380..49b9232ebc7 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1234,7 +1234,7 @@ @ cdecl _purecall() @ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _putch(long) -@ stub _putch_nolock +@ cdecl _putch_nolock(long) @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 28de3ab6025..80e46e0f693 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1592,7 +1592,7 @@ @ cdecl _purecall() @ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _putch(long) -@ stub _putch_nolock +@ cdecl _putch_nolock(long) @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index c8ba7f7d1d2..dba67521a7c 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1600,7 +1600,7 @@ @ cdecl _purecall() @ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _putch(long) -@ stub _putch_nolock +@ cdecl _putch_nolock(long) @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 15708056e11..c45f4472ecf 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -909,7 +909,7 @@ @ cdecl _purecall() @ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _putch(long) -@ stub _putch_nolock +@ cdecl _putch_nolock(long) @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index cab59222a3f..6948d029d59 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -884,7 +884,7 @@ @ cdecl _purecall() @ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _putch(long) -@ stub _putch_nolock +@ cdecl _putch_nolock(long) @ cdecl _putenv(str) @ cdecl _putenv_s(str str) @ cdecl _putw(long ptr) MSVCRT__putw diff --git a/dlls/msvcrt/console.c b/dlls/msvcrt/console.c index 82e8fb23cc3..8801fc054b2 100644 --- a/dlls/msvcrt/console.c +++ b/dlls/msvcrt/console.c @@ -194,18 +194,26 @@ int CDECL _getch(void) return ret; } +/********************************************************************* + * _putch_nolock (MSVCR80.@) + */ +int CDECL _putch_nolock(int c) +{ + DWORD count; + if (WriteConsoleA(MSVCRT_console_out, &c, 1, &count, NULL) && count == 1) + return c; + return MSVCRT_EOF; +} + /********************************************************************* * _putch (MSVCRT.@) */ int CDECL _putch(int c) { - int retval = MSVCRT_EOF; - DWORD count; - LOCK_CONSOLE; - if (WriteConsoleA(MSVCRT_console_out, &c, 1, &count, NULL) && count == 1) - retval = c; - UNLOCK_CONSOLE; - return retval; + LOCK_CONSOLE; + c = _putch_nolock(c); + UNLOCK_CONSOLE; + return c; } /*********************************************************************