Index: trunk/src/kernel32/KERNEL32.DEF
===================================================================
--- trunk/src/kernel32/KERNEL32.DEF	(revision 7885)
+++ trunk/src/kernel32/KERNEL32.DEF	(revision 7886)
@@ -1,3 +1,3 @@
-; $Id: KERNEL32.DEF,v 1.131 2002-02-11 09:43:05 sandervl Exp $
+; $Id: KERNEL32.DEF,v 1.132 2002-02-12 12:00:41 sandervl Exp $
 
 ;Basis is Windows95 KERNEL32
@@ -1206,2 +1206,36 @@
     _dbg_ThreadPushCall@4                                         @3107 NONAME
     _dbg_ThreadPopCall@0                                          @3108 NONAME
+
+; Char functions (forwarders from user32)
+    _CharLowerA@4                                                 @3127 NONAME
+    _CharLowerBuffA@8                                             @3128 NONAME
+    _CharLowerBuffW@8                                             @3129 NONAME
+    _CharLowerW@4                                                 @3130 NONAME
+    _CharNextA@4                                                  @3131 NONAME
+    _CharNextExA@12                                               @3132 NONAME
+    _CharNextExW@12                                               @3133 NONAME
+    _CharNextW@4                                                  @3134 NONAME
+    _CharPrevA@8                                                  @3135 NONAME
+    _CharPrevExA@16                                               @3136 NONAME
+    _CharPrevExW@16                                               @3137 NONAME
+    _CharPrevW@8                                                  @3138 NONAME
+    _CharToOemA@8                                                 @3139 NONAME
+    _CharToOemBuffA@12                                            @3140 NONAME
+    _CharToOemBuffW@12                                            @3141 NONAME
+    _CharToOemW@8                                                 @3142 NONAME
+    _CharUpperA@4                                                 @3143 NONAME
+    _CharUpperBuffA@8                                             @3144 NONAME
+    _CharUpperBuffW@8                                             @3145 NONAME
+    _CharUpperW@4                                                 @3146 NONAME
+    _OemToCharA@8                                                 @3149 NONAME
+    _OemToCharBuffA@12                                            @3150 NONAME
+    _OemToCharBuffW@12                                            @3151 NONAME
+    _OemToCharW@8                                                 @3152 NONAME
+    _IsCharAlphaA@4                                               @3153 NONAME
+    _IsCharAlphaNumericA@4                                        @3154 NONAME
+    _IsCharAlphaNumericW@4                                        @3155 NONAME
+    _IsCharAlphaW@4                                               @3156 NONAME
+    _IsCharLowerA@4                                               @3157 NONAME
+    _IsCharLowerW@4                                               @3158 NONAME
+    _IsCharUpperA@4                                               @3159 NONAME
+    _IsCharUpperW@4                                               @3160 NONAME
Index: trunk/src/kernel32/char.cpp
===================================================================
--- trunk/src/kernel32/char.cpp	(revision 7885)
+++ trunk/src/kernel32/char.cpp	(revision 7886)
@@ -1,13 +1,142 @@
-#include <odinwrap.h>
-#include <os2sel.h>
-
+/* $Id: char.cpp,v 1.3 2002-02-12 12:00:41 sandervl Exp $ */
+
+/*
+ * USER string functions
+ *
+ * Based on WINE code (dlls\user\lstr.c)
+ *
+ * Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
+ * Copyright 1996 Alexandre Julliard
+ * Copyright 1996 Marcus Meissner
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 #include <os2win.h>
-#include <stdlib.h>
-#include <string.h>
-#include <winnls.h>
-
-#include "unicode.h"
-#include <heapstring.h>
-#include "handlemanager.h"
+
+#include "winnls.h"
+
+#include <misc.h>
+#include <wine\unicode.h>
+
+
+#define DBG_LOCALLOG	DBG_char
+#include "dbglocal.h"
+
+
+
+/***********************************************************************
+ *           CharNextA   (USER32.@)
+ */
+LPSTR WINAPI CharNextA( LPCSTR ptr )
+{
+    dprintf2(("CharNextA %x", ptr));
+    if (!*ptr) return (LPSTR)ptr;
+    if (IsDBCSLeadByte( ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
+    return (LPSTR)(ptr + 1);
+}
+
+
+/***********************************************************************
+ *           CharNextExA   (USER32.@)
+ */
+LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
+{
+    dprintf2(("CharNextExA %d %x %x", codepage, ptr, flags));
+
+    if (!*ptr) return (LPSTR)ptr;
+    if (IsDBCSLeadByteEx( codepage, ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
+    return (LPSTR)(ptr + 1);
+}
+
+
+/***********************************************************************
+ *           CharNextExW   (USER32.@)
+ */
+LPWSTR WINAPI CharNextExW( WORD codepage, LPCWSTR ptr, DWORD flags )
+{
+    dprintf2(("CharNextExW %d %x %x", codepage, ptr, flags));
+    /* doesn't make sense, there are no codepages for Unicode */
+    return NULL;
+}
+
+
+/***********************************************************************
+ *           CharNextW   (USER32.@)
+ */
+LPWSTR WINAPI CharNextW(LPCWSTR x)
+{
+    dprintf2(("CharNextW %x", x));
+
+    if (*x) x++;
+
+    return (LPWSTR)x;
+}
+
+
+/***********************************************************************
+ *           CharPrevA   (USER32.@)
+ */
+LPSTR WINAPI CharPrevA( LPCSTR start, LPCSTR ptr )
+{
+    dprintf2(("CharPrevA %x %x", start, ptr));
+
+    while (*start && (start < ptr))
+    {
+        LPCSTR next = CharNextA( start );
+        if (next >= ptr) break;
+        start = next;
+    }
+    return (LPSTR)start;
+}
+
+
+/***********************************************************************
+ *           CharPrevExA   (USER32.@)
+ */
+LPSTR WINAPI CharPrevExA( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags )
+{
+    dprintf2(("CharPrevExA %d %x %x %x", codepage, start, ptr, flags));
+
+    while (*start && (start < ptr))
+    {
+        LPCSTR next = CharNextExA( codepage, start, flags );
+        if (next > ptr) break;
+        start = next;
+    }
+    return (LPSTR)start;
+}
+
+
+/***********************************************************************
+ *           CharPrevExW   (USER32.@)
+ */
+LPWSTR WINAPI CharPrevExW( WORD codepage, LPCWSTR start, LPCWSTR ptr, DWORD flags )
+{
+    /* doesn't make sense, there are no codepages for Unicode */
+    dprintf2(("CharPrevExW %d %x %x %x", codepage, start, ptr, flags));
+    return NULL;
+}
+
+
+/***********************************************************************
+ *           CharPrevW   (USER32.@)
+ */
+LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x)
+{
+    dprintf2(("CharPrevW %x %x", start, x));
+
+    if (x>start) return (LPWSTR)(x-1);
+    else return (LPWSTR)x;
+}
+
 
 /***********************************************************************
@@ -41,4 +170,25 @@
 
 
+/***********************************************************************
+ *           CharToOemBuffW   (USER32.@)
+ */
+BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
+{
+   dprintf2(("CharToOemBuffW %x %x %d", s, d, len));
+
+   if ( !s || !d ) return TRUE;
+    WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL );
+    return TRUE;
+}
+
+
+/***********************************************************************
+ *           CharToOemW   (USER32.@)
+ */
+BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
+{
+    return CharToOemBuffW( s, d, strlenW( s ) + 1 );
+}
+
 
 /***********************************************************************
@@ -70,2 +220,234 @@
 }
 
+
+/***********************************************************************
+ *           OemToCharBuffW   (USER32.@)
+ */
+BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
+{
+    dprintf2(("OemToCharBuffW %x %x %d", s, d, len));
+
+    MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
+    return TRUE;
+}
+
+
+/***********************************************************************
+ *           OemToCharW   (USER32.@)
+ */
+BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
+{
+    return OemToCharBuffW( s, d, strlen( s ) + 1 );
+}
+
+
+/***********************************************************************
+ *           CharLowerA   (USER32.@)
+ * FIXME: handle current locale
+ */
+LPSTR WINAPI CharLowerA(LPSTR x)
+{
+    LPSTR	s;
+
+    dprintf2(("CharLowerA %x", x));
+
+    if (HIWORD(x))
+    {
+        s=x;
+        while (*s)
+        {
+            *s=tolower(*s);
+            s++;
+        }
+        return x;
+    }
+    else return (LPSTR)tolower((char)(int)x);
+}
+
+
+/***********************************************************************
+ *           CharUpperA   (USER32.@)
+ * FIXME: handle current locale
+ */
+LPSTR WINAPI CharUpperA(LPSTR x)
+{
+    dprintf2(("CharUpperA %x", x));
+
+    if (HIWORD(x))
+    {
+        LPSTR s = x;
+        while (*s)
+        {
+            *s=toupper(*s);
+            s++;
+        }
+        return x;
+    }
+    return (LPSTR)toupper((char)(int)x);
+}
+
+
+/***********************************************************************
+ *           CharLowerW   (USER32.@)
+ */
+LPWSTR WINAPI CharLowerW(LPWSTR x)
+{
+    dprintf2(("CharLowerW %x", x));
+    if (HIWORD(x)) return strlwrW(x);
+    else return (LPWSTR)((UINT)tolowerW(LOWORD(x)));
+}
+
+
+/***********************************************************************
+ *           CharUpperW   (USER32.@)
+ * FIXME: handle current locale
+ */
+LPWSTR WINAPI CharUpperW(LPWSTR x)
+{
+    dprintf2(("CharUpperW %x", x));
+    if (HIWORD(x)) return struprW(x);
+    else return (LPWSTR)((UINT)toupperW(LOWORD(x)));
+}
+
+
+/***********************************************************************
+ *           CharLowerBuffA   (USER32.@)
+ * FIXME: handle current locale
+ */
+DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len )
+{
+    DWORD ret = len;
+
+    dprintf2(("CharLowerBuffA %x %d", str, len));
+
+    if (!str) return 0; /* YES */
+    for (; len; len--, str++) *str = tolower(*str);
+    return ret;
+}
+
+
+/***********************************************************************
+ *           CharLowerBuffW   (USER32.@)
+ */
+DWORD WINAPI CharLowerBuffW( LPWSTR str, DWORD len )
+{
+    DWORD ret = len;
+
+    dprintf2(("CharLowerBuffW %x %d", str, len));
+
+    if (!str) return 0; /* YES */
+    for (; len; len--, str++) *str = tolowerW(*str);
+    return ret;
+}
+
+
+/***********************************************************************
+ *           CharUpperBuffA   (USER32.@)
+ * FIXME: handle current locale
+ */
+DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
+{
+    DWORD ret = len;
+
+    dprintf2(("CharUpperBuffA %x %d", str, len));
+
+    if (!str) return 0; /* YES */
+    for (; len; len--, str++) *str = toupper(*str);
+    return ret;
+}
+
+
+/***********************************************************************
+ *           CharUpperBuffW   (USER32.@)
+ */
+DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
+{
+    DWORD ret = len;
+
+    dprintf2(("CharUpperBuffW %x %d", str, len));
+
+    if (!str) return 0; /* YES */
+    for (; len; len--, str++) *str = toupperW(*str);
+    return ret;
+}
+
+
+/***********************************************************************
+ *           IsCharLowerA   (USER.436) (USER32.@)
+ * FIXME: handle current locale
+ */
+BOOL WINAPI IsCharLowerA(CHAR x)
+{
+    dprintf2(("IsCharLowerA %x", x));
+    return islower(x);
+}
+
+
+/***********************************************************************
+ *           IsCharLowerW   (USER32.@)
+ */
+BOOL WINAPI IsCharLowerW(WCHAR x)
+{
+    dprintf2(("IsCharLowerW %x", x));
+    return get_char_typeW(x) & C1_LOWER;
+}
+
+
+/***********************************************************************
+ *           IsCharUpperA   (USER.435) (USER32.@)
+ * FIXME: handle current locale
+ */
+BOOL WINAPI IsCharUpperA(CHAR x)
+{
+    dprintf2(("IsCharUpperA %x", x));
+    return isupper(x);
+}
+
+
+/***********************************************************************
+ *           IsCharUpperW   (USER32.@)
+ */
+BOOL WINAPI IsCharUpperW(WCHAR x)
+{
+    dprintf2(("IsCharUpperW %x", x));
+    return get_char_typeW(x) & C1_UPPER;
+}
+
+
+/***********************************************************************
+ *           IsCharAlphaNumericW   (USER32.@)
+ */
+BOOL WINAPI IsCharAlphaNumericW(WCHAR x)
+{
+    dprintf2(("IsCharAlphaNumericW %x", x));
+    return get_char_typeW(x) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
+}
+
+
+/***********************************************************************
+ *           IsCharAlphaW   (USER32.@)
+ */
+BOOL WINAPI IsCharAlphaW(WCHAR x)
+{
+    dprintf2(("IsCharAlphaW %x", x));
+    return get_char_typeW(x) & (C1_ALPHA|C1_LOWER|C1_UPPER);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsCharAlphaA( CHAR x)
+{
+    WCHAR wch;
+
+    dprintf(("USER32: IsCharAlphaA %x", x));
+    MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
+    return IsCharAlphaW(wch);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsCharAlphaNumericA( CHAR x)
+{
+    dprintf(("USER32: IsCharAlphaNumericA %x", x));
+    return (get_char_typeW(x) & C1_ALPHA) != 0;
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/kernel32/dbglocal.cpp
===================================================================
--- trunk/src/kernel32/dbglocal.cpp	(revision 7885)
+++ trunk/src/kernel32/dbglocal.cpp	(revision 7886)
@@ -1,3 +1,3 @@
-/* $Id: dbglocal.cpp,v 1.22 2002-02-09 11:52:22 sandervl Exp $ */
+/* $Id: dbglocal.cpp,v 1.23 2002-02-12 12:00:41 sandervl Exp $ */
 
 /*
@@ -135,5 +135,6 @@
 "memory",
 "system",
-"string"
+"string",
+"char"
 };
 //******************************************************************************
Index: trunk/src/kernel32/dbglocal.h
===================================================================
--- trunk/src/kernel32/dbglocal.h	(revision 7885)
+++ trunk/src/kernel32/dbglocal.h	(revision 7886)
@@ -133,5 +133,6 @@
 #define DBG_system         113
 #define DBG_string         114
-#define DBG_MAXFILES       115
+#define DBG_char           115
+#define DBG_MAXFILES       116
 
 extern USHORT DbgEnabledKERNEL32[DBG_MAXFILES];
Index: trunk/src/kernel32/dbgwrap.cpp
===================================================================
--- trunk/src/kernel32/dbgwrap.cpp	(revision 7885)
+++ trunk/src/kernel32/dbgwrap.cpp	(revision 7886)
@@ -899,2 +899,37 @@
 DEBUGWRAP4(SetUnhandledExceptionFilter);
 DEBUGWRAP4(UnhandledExceptionFilter);
+
+#undef DBG_LOCALLOG
+#define DBG_LOCALLOG    DBG_char
+DEBUGWRAP4(CharLowerA)
+DEBUGWRAP8(CharLowerBuffA)
+DEBUGWRAP8(CharLowerBuffW)
+DEBUGWRAP4(CharLowerW)
+DEBUGWRAP4(CharNextA)
+DEBUGWRAP12(CharNextExA)
+DEBUGWRAP12(CharNextExW)
+DEBUGWRAP4(CharNextW)
+DEBUGWRAP8(CharPrevA)
+DEBUGWRAP16(CharPrevExA)
+DEBUGWRAP16(CharPrevExW)
+DEBUGWRAP8(CharPrevW)
+DEBUGWRAP8(CharToOemA)
+DEBUGWRAP12(CharToOemBuffA)
+DEBUGWRAP12(CharToOemBuffW)
+DEBUGWRAP8(CharToOemW)
+DEBUGWRAP4(CharUpperA)
+DEBUGWRAP8(CharUpperBuffA)
+DEBUGWRAP8(CharUpperBuffW)
+DEBUGWRAP4(CharUpperW)
+DEBUGWRAP4(IsCharAlphaA)
+DEBUGWRAP4(IsCharAlphaNumericA)
+DEBUGWRAP4(IsCharAlphaNumericW)
+DEBUGWRAP4(IsCharAlphaW)
+DEBUGWRAP4(IsCharLowerA)
+DEBUGWRAP4(IsCharLowerW)
+DEBUGWRAP4(IsCharUpperA)
+DEBUGWRAP4(IsCharUpperW)
+DEBUGWRAP8(OemToCharA)
+DEBUGWRAP12(OemToCharBuffA)
+DEBUGWRAP12(OemToCharBuffW)
+DEBUGWRAP8(OemToCharW)
Index: trunk/src/kernel32/kernel32dbg.def
===================================================================
--- trunk/src/kernel32/kernel32dbg.def	(revision 7885)
+++ trunk/src/kernel32/kernel32dbg.def	(revision 7886)
@@ -1,3 +1,3 @@
-; $Id: kernel32dbg.def,v 1.7 2002-02-12 11:43:32 sandervl Exp $
+; $Id: kernel32dbg.def,v 1.8 2002-02-12 12:00:42 sandervl Exp $
 
 ;Basis is Windows95 KERNEL32
@@ -1206,2 +1206,36 @@
     _dbg_ThreadPushCall@4                                         @3107 NONAME
     _dbg_ThreadPopCall@0                                          @3108 NONAME
+
+; Char functions (forwarders from user32)
+    _DbgCharLowerA@4                                                 @3127 NONAME
+    _DbgCharLowerBuffA@8                                             @3128 NONAME
+    _DbgCharLowerBuffW@8                                             @3129 NONAME
+    _DbgCharLowerW@4                                                 @3130 NONAME
+    _DbgCharNextA@4                                                  @3131 NONAME
+    _DbgCharNextExA@12                                               @3132 NONAME
+    _DbgCharNextExW@12                                               @3133 NONAME
+    _DbgCharNextW@4                                                  @3134 NONAME
+    _DbgCharPrevA@8                                                  @3135 NONAME
+    _DbgCharPrevExA@16                                               @3136 NONAME
+    _DbgCharPrevExW@16                                               @3137 NONAME
+    _DbgCharPrevW@8                                                  @3138 NONAME
+    _DbgCharToOemA@8                                                 @3139 NONAME
+    _DbgCharToOemBuffA@12                                            @3140 NONAME
+    _DbgCharToOemBuffW@12                                            @3141 NONAME
+    _DbgCharToOemW@8                                                 @3142 NONAME
+    _DbgCharUpperA@4                                                 @3143 NONAME
+    _DbgCharUpperBuffA@8                                             @3144 NONAME
+    _DbgCharUpperBuffW@8                                             @3145 NONAME
+    _DbgCharUpperW@4                                                 @3146 NONAME
+    _DbgOemToCharA@8                                                 @3149 NONAME
+    _DbgOemToCharBuffA@12                                            @3150 NONAME
+    _DbgOemToCharBuffW@12                                            @3151 NONAME
+    _DbgOemToCharW@8                                                 @3152 NONAME
+    _DbgIsCharAlphaA@4                                               @3153 NONAME
+    _DbgIsCharAlphaNumericA@4                                        @3154 NONAME
+    _DbgIsCharAlphaNumericW@4                                        @3155 NONAME
+    _DbgIsCharAlphaW@4                                               @3156 NONAME
+    _DbgIsCharLowerA@4                                               @3157 NONAME
+    _DbgIsCharLowerW@4                                               @3158 NONAME
+    _DbgIsCharUpperA@4                                               @3159 NONAME
+    _DbgIsCharUpperW@4                                               @3160 NONAME
