msvcrt:add stub for _setmaxstdio + tiny test

Louis. Lenders xerox_xerox2000 at yahoo.co.uk
Mon Oct 30 14:50:32 CST 2006


Skipped content of type multipart/alternative-------------- next part --------------
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 146e0f3..f2ecaee 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -3089,6 +3089,20 @@ int CDECL _getmaxstdio(void)
 }
 
 /*********************************************************************
+ *		_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;
+}
+
+/*********************************************************************
  *		__pioinfo (MSVCRT.@)
  * FIXME: see MSVCRT_MAX_FILES define.
  */
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 6a46798..7384133 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -431,7 +431,7 @@ # extern _pwctype
 @ cdecl _seterrormode(long)
 @ cdecl -i386 -norelay _setjmp(ptr) MSVCRT__setjmp
 @ cdecl -i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3
-@ stub _setmaxstdio #(long)
+@ cdecl _setmaxstdio (long)
 @ cdecl _setmbcp(long)
 @ cdecl _setmode(long long)
 @ stub _setsystime #(ptr long)
diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c
index d269765..99a0958 100644
--- a/dlls/msvcrt/tests/file.c
+++ b/dlls/msvcrt/tests/file.c
@@ -778,6 +778,12 @@ static void test_get_osfhandle(void)
     _unlink(fname);
 }
 
+static void test_setmaxstdio(void)
+{
+    ok(2048 == _setmaxstdio(2048),"_setmaxstdio returned %d instead of 2048\n",_setmaxstdio(2048));
+    ok(-1 == _setmaxstdio(2049),"_setmaxstdio returned %d instead of -1\n",_setmaxstdio(2049));
+}
+
 START_TEST(file)
 {
     int arg_c;
@@ -808,4 +814,5 @@ START_TEST(file)
     test_file_put_get();
     test_tmpnam();
     test_get_osfhandle();
+    test_setmaxstdio();
 }


More information about the wine-patches mailing list