msvcr: Add _getch_nolock implementation.

oldstable
Piotr Caban 2015-06-11 17:54:13 +02:00 committed by Alexandre Julliard
parent d0cb2519b6
commit 3bd60974a9
6 changed files with 20 additions and 9 deletions

View File

@ -890,7 +890,7 @@
@ cdecl _get_wpgmptr(ptr) @ cdecl _get_wpgmptr(ptr)
@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _getch() @ cdecl _getch()
@ stub _getch_nolock @ cdecl _getch_nolock()
@ cdecl _getche() @ cdecl _getche()
@ stub _getche_nolock @ stub _getche_nolock
@ cdecl _getcwd(str long) MSVCRT__getcwd @ cdecl _getcwd(str long) MSVCRT__getcwd

View File

@ -1238,7 +1238,7 @@
@ cdecl _get_wpgmptr(ptr) @ cdecl _get_wpgmptr(ptr)
@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _getch() @ cdecl _getch()
@ stub _getch_nolock @ cdecl _getch_nolock()
@ cdecl _getche() @ cdecl _getche()
@ stub _getche_nolock @ stub _getche_nolock
@ cdecl _getcwd(str long) MSVCRT__getcwd @ cdecl _getcwd(str long) MSVCRT__getcwd

View File

@ -1236,7 +1236,7 @@
@ cdecl _get_wpgmptr(ptr) @ cdecl _get_wpgmptr(ptr)
@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _getch() @ cdecl _getch()
@ stub _getch_nolock @ cdecl _getch_nolock()
@ cdecl _getche() @ cdecl _getche()
@ stub _getche_nolock @ stub _getche_nolock
@ cdecl _getcwd(str long) MSVCRT__getcwd @ cdecl _getcwd(str long) MSVCRT__getcwd

View File

@ -564,7 +564,7 @@
@ cdecl _get_wpgmptr(ptr) @ cdecl _get_wpgmptr(ptr)
@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _getch() @ cdecl _getch()
@ stub _getch_nolock @ cdecl _getch_nolock()
@ cdecl _getche() @ cdecl _getche()
@ stub _getche_nolock @ stub _getche_nolock
@ cdecl _getcwd(str long) MSVCRT__getcwd @ cdecl _getcwd(str long) MSVCRT__getcwd

View File

@ -541,7 +541,7 @@
@ cdecl _get_wpgmptr(ptr) @ cdecl _get_wpgmptr(ptr)
@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _getch() @ cdecl _getch()
@ stub _getch_nolock @ cdecl _getch_nolock()
@ cdecl _getche() @ cdecl _getche()
@ stub _getche_nolock @ stub _getche_nolock
@ cdecl _getcwd(str long) MSVCRT__getcwd @ cdecl _getcwd(str long) MSVCRT__getcwd

View File

@ -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; int retval = MSVCRT_EOF;
LOCK_CONSOLE;
if (__MSVCRT_console_buffer != MSVCRT_EOF) if (__MSVCRT_console_buffer != MSVCRT_EOF)
{ {
retval = __MSVCRT_console_buffer; retval = __MSVCRT_console_buffer;
@ -179,10 +178,22 @@ int CDECL _getch(void)
if (mode) if (mode)
SetConsoleMode(MSVCRT_console_in, mode); SetConsoleMode(MSVCRT_console_in, mode);
} }
UNLOCK_CONSOLE;
return retval; return retval;
} }
/*********************************************************************
* _getch (MSVCRT.@)
*/
int CDECL _getch(void)
{
int ret;
LOCK_CONSOLE;
ret = _getch_nolock();
UNLOCK_CONSOLE;
return ret;
}
/********************************************************************* /*********************************************************************
* _putch (MSVCRT.@) * _putch (MSVCRT.@)
*/ */