diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 9b474018ce9..6e404f20380 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -890,7 +890,7 @@ @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch() -@ stub _getch_nolock +@ cdecl _getch_nolock() @ cdecl _getche() @ stub _getche_nolock @ cdecl _getcwd(str long) MSVCRT__getcwd diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 66ec34c6b54..28de3ab6025 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1238,7 +1238,7 @@ @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch() -@ stub _getch_nolock +@ cdecl _getch_nolock() @ cdecl _getche() @ stub _getche_nolock @ cdecl _getcwd(str long) MSVCRT__getcwd diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 2a3a8138019..c8ba7f7d1d2 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1236,7 +1236,7 @@ @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch() -@ stub _getch_nolock +@ cdecl _getch_nolock() @ cdecl _getche() @ stub _getche_nolock @ cdecl _getcwd(str long) MSVCRT__getcwd diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index e3de8ac7c63..15708056e11 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -564,7 +564,7 @@ @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch() -@ stub _getch_nolock +@ cdecl _getch_nolock() @ cdecl _getche() @ stub _getche_nolock @ cdecl _getcwd(str long) MSVCRT__getcwd diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 2de0526f3d0..cab59222a3f 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -541,7 +541,7 @@ @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch() -@ stub _getch_nolock +@ cdecl _getch_nolock() @ cdecl _getche() @ stub _getche_nolock @ cdecl _getcwd(str long) MSVCRT__getcwd diff --git a/dlls/msvcrt/console.c b/dlls/msvcrt/console.c index 27c0ac2a63f..82e8fb23cc3 100644 --- a/dlls/msvcrt/console.c +++ b/dlls/msvcrt/console.c @@ -113,13 +113,12 @@ static const struct {unsigned vk; unsigned ch[4][2];} enh_map[] = { }; /********************************************************************* - * _getch (MSVCRT.@) + * _getch_nolock (MSVCR80.@) */ -int CDECL _getch(void) +int CDECL _getch_nolock(void) { int retval = MSVCRT_EOF; - LOCK_CONSOLE; if (__MSVCRT_console_buffer != MSVCRT_EOF) { retval = __MSVCRT_console_buffer; @@ -179,10 +178,22 @@ int CDECL _getch(void) if (mode) SetConsoleMode(MSVCRT_console_in, mode); } - UNLOCK_CONSOLE; return retval; } +/********************************************************************* + * _getch (MSVCRT.@) + */ +int CDECL _getch(void) +{ + int ret; + + LOCK_CONSOLE; + ret = _getch_nolock(); + UNLOCK_CONSOLE; + return ret; +} + /********************************************************************* * _putch (MSVCRT.@) */