Module: wine Branch: master Commit: 32ffc7cb8a1c39800dc4ae6a43079b17d18feb08 URL: http://source.winehq.org/git/wine.git/?a=commit;h=32ffc7cb8a1c39800dc4ae6a43...
Author: Louis. Lenders xerox_xerox2000@yahoo.co.uk Date: Mon Oct 30 20:50:32 2006 +0000
msvcrt: Add stub for _setmaxstdio + tiny test.
---
dlls/msvcrt/file.c | 14 ++++++++++++++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/file.c | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 1956a7c..1624f84 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3090,6 +3090,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..dc78679 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 bd4bd5f..d33d7ab 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -788,6 +788,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; @@ -818,4 +824,5 @@ START_TEST(file) test_file_put_get(); test_tmpnam(); test_get_osfhandle(); + test_setmaxstdio(); }