Index: dlls/msvcrt/mbcs.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/mbcs.c,v
retrieving revision 1.30
diff -u -r1.30 mbcs.c
--- dlls/msvcrt/mbcs.c	25 Feb 2005 14:07:57 -0000	1.30
+++ dlls/msvcrt/mbcs.c	5 Apr 2005 20:29:51 -0000
@@ -24,6 +24,7 @@
  */
 
 #include "msvcrt.h"
+#include "msvcrt/mbctype.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
@@ -1143,4 +1144,37 @@
         str += (MSVCRT_isleadbyte(*str)?2:1);
     }
     return NULL;
+}
+
+/*********************************************************************
+ *		_mbsbtype (MSVCRT.@)
+ */
+int _mbsbtype(const unsigned char* mbstr, size_t count) {
+  const unsigned char* str;
+  const unsigned char* start = mbstr;
+
+  str = mbstr + count;
+
+  /** from _ismbslead */
+  if (MSVCRT___mb_cur_max > 1)
+  {
+    while (start < str) {
+      if (!*start) {
+	return _MBC_ILLEGAL;
+      }
+      start += MSVCRT_isleadbyte(*str) ? 2 : 1;
+    }
+
+  }
+  if (!*str) { /** TODO: check *str validity */
+    return _MBC_ILLEGAL;
+  }
+  if (start == str && MSVCRT_isleadbyte(*str)) {
+    return _MBC_LEAD;
+  }
+  if (start == str && MSVCRT_isleadbyte(str[-1])) {
+    return _MBC_TRAIL;
+  }
+
+  return _MBC_SINGLE;
 }
Index: include/msvcrt/mbctype.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/mbctype.h,v
retrieving revision 1.5
diff -u -r1.5 mbctype.h
--- include/msvcrt/mbctype.h	25 Jun 2004 01:19:15 -0000	1.5
+++ include/msvcrt/mbctype.h	5 Apr 2005 20:29:51 -0000
@@ -27,6 +27,12 @@
 extern "C" {
 #endif
 
+/* return values for _mbsbtype  and _mbbtype */
+#define _MBC_SINGLE    0 
+#define _MBC_LEAD      1  
+#define _MBC_TRAIL     2
+#define _MBC_ILLEGAL (-1)
+
 unsigned char* __p__mbctype(void);
 #define _mbctype                   (__p__mbctype())
 
