[ros-diffs] [cwittich] 44725: [crt] import _wcsupr_s from wine 1.1.35

cwittich at svn.reactos.org cwittich at svn.reactos.org
Wed Dec 23 11:56:54 CET 2009


Author: cwittich
Date: Wed Dec 23 11:56:54 2009
New Revision: 44725

URL: http://svn.reactos.org/svn/reactos?rev=44725&view=rev
Log:
[crt]
import _wcsupr_s from wine 1.1.35

Modified:
    trunk/reactos/dll/win32/msvcrt/msvcrt.def
    trunk/reactos/lib/sdk/crt/string/wcs.c

Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.def?rev=44725&r1=44724&r2=44725&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] Wed Dec 23 11:56:54 2009
@@ -852,6 +852,7 @@
   _mbsnbcpy_s
   wcscpy_s
   wcsncpy_s
+  _wcsupr_s
   _ftol2=_ftol
   _ftol2_sse=_ftol
   strcat_s

Modified: trunk/reactos/lib/sdk/crt/string/wcs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/wcs.c?rev=44725&r1=44724&r2=44725&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/wcs.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/wcs.c [iso-8859-1] Wed Dec 23 11:56:54 2009
@@ -107,6 +107,35 @@
   wchar_t* ret = str;
   while (*str) *str++ = c;
   return ret;
+}
+
+/******************************************************************
+ *		_wcsupr_s (MSVCRT.@)
+ *
+ */
+INT CDECL _wcsupr_s( wchar_t* str, size_t n )
+{
+  wchar_t* ptr = str;
+
+  if (!str || !n)
+  {
+    if (str) *str = '\0';
+    __set_errno(EINVAL);
+    return EINVAL;
+  }
+
+  while (n--)
+  {
+    if (!*ptr) return 0;
+    *ptr = toupperW(*ptr);
+    ptr++;
+  }
+
+  /* MSDN claims that the function should return and set errno to
+   * ERANGE, which doesn't seem to be true based on the tests. */
+  *str = '\0';
+  __set_errno(EINVAL);
+  return EINVAL;
 }
 
 /*********************************************************************




More information about the Ros-diffs mailing list