Piotr Caban : msvcrt: Improved _getmaxstdio and _setmaxstdio implementation .

Alexandre Julliard julliard at winehq.org
Thu May 19 13:32:12 CDT 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu May 19 15:31:33 2011 +0200

msvcrt: Improved _getmaxstdio and _setmaxstdio implementation.

---

 dlls/msvcrt/file.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index bf98579..07c31ba 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -3766,20 +3766,19 @@ int CDECL MSVCRT_wprintf_s(const MSVCRT_wchar_t *format, ...)
  */
 int CDECL _getmaxstdio(void)
 {
-    FIXME("stub, always returns 512\n");
-    return 512;
+    return MSVCRT_max_streams;
 }
 
 /*********************************************************************
- *		_setmaxstdio_ (MSVCRT.@)
+ *		_setmaxstdio (MSVCRT.@)
  */
 int CDECL _setmaxstdio(int newmax)
 {
-    int res;
-    if( newmax > 2048)
-      res = -1;
-    else
-      res = newmax;
-    FIXME("stub: setting new maximum for number of simultaneously open files not implemented,returning %d\n",res);
-    return res;
+    TRACE("%d\n", newmax);
+
+    if(newmax<_IOB_ENTRIES || newmax>MSVCRT_MAX_FILES || newmax<MSVCRT_stream_idx)
+        return -1;
+
+    MSVCRT_max_streams = newmax;
+    return MSVCRT_max_streams;
 }




More information about the wine-cvs mailing list