Piotr Caban : msvcr: Add _getche_nolock implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 12 07:36:12 CDT 2015


Module: wine
Branch: master
Commit: 57754bdb296b05a6e081c3e6727cef55a4f7fe68
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=57754bdb296b05a6e081c3e6727cef55a4f7fe68

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jun 11 17:54:39 2015 +0200

msvcr: Add _getche_nolock implementation.

---

 dlls/msvcr100/msvcr100.spec |  2 +-
 dlls/msvcr110/msvcr110.spec |  2 +-
 dlls/msvcr120/msvcr120.spec |  2 +-
 dlls/msvcr80/msvcr80.spec   |  2 +-
 dlls/msvcr90/msvcr90.spec   |  2 +-
 dlls/msvcrt/console.c       | 23 +++++++++++++++++------
 6 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 49b9232..002ed36 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -892,7 +892,7 @@
 @ cdecl _getch()
 @ cdecl _getch_nolock()
 @ cdecl _getche()
-@ stub _getche_nolock
+@ cdecl _getche_nolock()
 @ cdecl _getcwd(str long) MSVCRT__getcwd
 @ cdecl _getdcwd(long str long) MSVCRT__getdcwd
 @ stub _getdcwd_nolock
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 80e46e0..7b06c5f 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -1240,7 +1240,7 @@
 @ cdecl _getch()
 @ cdecl _getch_nolock()
 @ cdecl _getche()
-@ stub _getche_nolock
+@ cdecl _getche_nolock()
 @ cdecl _getcwd(str long) MSVCRT__getcwd
 @ cdecl _getdcwd(long str long) MSVCRT__getdcwd
 @ cdecl _getdiskfree(long ptr) MSVCRT__getdiskfree
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index dba6752..64eb2f5 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -1238,7 +1238,7 @@
 @ cdecl _getch()
 @ cdecl _getch_nolock()
 @ cdecl _getche()
-@ stub _getche_nolock
+@ cdecl _getche_nolock()
 @ cdecl _getcwd(str long) MSVCRT__getcwd
 @ cdecl _getdcwd(long str long) MSVCRT__getdcwd
 @ cdecl _getdiskfree(long ptr) MSVCRT__getdiskfree
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index c45f447..0bef364 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -566,7 +566,7 @@
 @ cdecl _getch()
 @ cdecl _getch_nolock()
 @ cdecl _getche()
-@ stub _getche_nolock
+@ cdecl _getche_nolock()
 @ cdecl _getcwd(str long) MSVCRT__getcwd
 @ cdecl _getdcwd(long str long) MSVCRT__getdcwd
 @ stub _getdcwd_nolock
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 6948d02..fafed02 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -543,7 +543,7 @@
 @ cdecl _getch()
 @ cdecl _getch_nolock()
 @ cdecl _getche()
-@ stub _getche_nolock
+@ cdecl _getche_nolock()
 @ cdecl _getcwd(str long) MSVCRT__getcwd
 @ cdecl _getdcwd(long str long) MSVCRT__getdcwd
 @ stub _getdcwd_nolock
diff --git a/dlls/msvcrt/console.c b/dlls/msvcrt/console.c
index 8801fc0..ed8b728 100644
--- a/dlls/msvcrt/console.c
+++ b/dlls/msvcrt/console.c
@@ -217,20 +217,31 @@ int CDECL _putch(int c)
 }
 
 /*********************************************************************
- *		_getche (MSVCRT.@)
+ *		_getche_nolock (MSVCR80.@)
  */
-int CDECL _getche(void)
+int CDECL _getche_nolock(void)
 {
   int retval;
-  LOCK_CONSOLE;
-  retval = _getch();
+  retval = _getch_nolock();
   if (retval != MSVCRT_EOF)
-    retval = _putch(retval);
-  UNLOCK_CONSOLE;
+    retval = _putch_nolock(retval);
   return retval;
 }
 
 /*********************************************************************
+ *		_getche (MSVCRT.@)
+ */
+int CDECL _getche(void)
+{
+    int ret;
+
+    LOCK_CONSOLE;
+    ret = _getche_nolock();
+    UNLOCK_CONSOLE;
+    return ret;
+}
+
+/*********************************************************************
  *		_cgets (MSVCRT.@)
  */
 char* CDECL _cgets(char* str)




More information about the wine-cvs mailing list