diff --git a/reactos/lib/msvcrt/mbstring/islead.c b/reactos/lib/msvcrt/mbstring/islead.c index d1594cf5b56..0b42072f083 100644 --- a/reactos/lib/msvcrt/mbstring/islead.c +++ b/reactos/lib/msvcrt/mbstring/islead.c @@ -4,7 +4,7 @@ /* * @unimplemented */ -int isleadbyte(char *mbstr) +int isleadbyte(int byte) { return 0; //return IsDBCSLeadByteEx(0,*c); diff --git a/reactos/lib/msvcrt/mbstring/mbspbrk.c b/reactos/lib/msvcrt/mbstring/mbspbrk.c index 4af316b53d8..ed0b9d4b6de 100644 --- a/reactos/lib/msvcrt/mbstring/mbspbrk.c +++ b/reactos/lib/msvcrt/mbstring/mbspbrk.c @@ -1,4 +1,7 @@ #include + +int isleadbyte(int byte); + /* * not correct * @@ -6,14 +9,17 @@ */ unsigned char * _mbspbrk(const unsigned char *s1, const unsigned char *s2) { - const char *scanp; - int c, sc; + const unsigned char* p; - while ((c = *s1++) != 0) + while (*s1) { - for (scanp = s2; (sc = *scanp++) != 0;) - if (sc == c) - return (unsigned char *)((char *)s1 - (char *)1); + for (p = s2; *p; p += (isleadbyte(*p) ? 2 : 1)) + { + if (*p == *s1) + if (!isleadbyte(*p) || (*(p+1) == *(s1 + 1))) + return (unsigned char*)s1; + } + s1 += (isleadbyte(*s1) ? 2 : 1); } - return 0; + return NULL; } diff --git a/reactos/lib/msvcrt/mbstring/mbsrchr.c b/reactos/lib/msvcrt/mbstring/mbsrchr.c index 9d8f1797045..e0486172186 100644 --- a/reactos/lib/msvcrt/mbstring/mbsrchr.c +++ b/reactos/lib/msvcrt/mbstring/mbsrchr.c @@ -10,24 +10,32 @@ #include -size_t _mbclen2(const unsigned int s); +char *strrchr(const char* szSearch, int cFor); +extern int __mb_cur_max; /* * @implemented */ unsigned char * _mbsrchr(const unsigned char *src, unsigned int val) { - char *s = (char *)src; - short cc = val; - const char *sp=(char *)0; + if (__mb_cur_max > 1) + { + unsigned int c; + unsigned char *match = NULL; - while (*s) - { - if (*(short *)s == cc) - sp = s; - s+= _mbclen2(*s); - } - if (cc == 0) - sp = s; - return (char *)sp; + if (!src) + return NULL; + + while (1) + { + c = _mbsnextc(src); + if (c == val) + match = (unsigned char*)src; + if (!c) + return match; + src += (c > 255) ? 2 : 1; + } + } + + return strrchr(src, val); } diff --git a/reactos/subsys/win32k/include/painting.h b/reactos/subsys/win32k/include/painting.h index 501ef194522..59ba11799aa 100644 --- a/reactos/subsys/win32k/include/painting.h +++ b/reactos/subsys/win32k/include/painting.h @@ -10,7 +10,7 @@ BOOL FASTCALL IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags); BOOL FASTCALL -IntGetPaintMessage(PWINDOW_OBJECT Window, PW32THREAD Thread, MSG *Message, BOOL Remove); +IntGetPaintMessage(HWND hWnd, PW32THREAD Thread, MSG *Message, BOOL Remove); BOOL STDCALL NtUserValidateRgn(HWND hWnd, HRGN hRgn); diff --git a/reactos/subsys/win32k/ntuser/painting.c b/reactos/subsys/win32k/ntuser/painting.c index d0321cf0b19..a11b64f9147 100644 --- a/reactos/subsys/win32k/ntuser/painting.c +++ b/reactos/subsys/win32k/ntuser/painting.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: painting.c,v 1.40 2003/11/30 20:03:47 navaraf Exp $ + * $Id: painting.c,v 1.41 2003/12/06 20:58:27 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -678,7 +678,7 @@ IntFindWindowToRepaint(HWND hWnd, PW32THREAD Thread) } BOOL FASTCALL -IntGetPaintMessage(PWINDOW_OBJECT Wnd, PW32THREAD Thread, MSG *Message, +IntGetPaintMessage(HWND hWnd, PW32THREAD Thread, MSG *Message, BOOL Remove) { PWINDOW_OBJECT Window; @@ -687,8 +687,8 @@ IntGetPaintMessage(PWINDOW_OBJECT Wnd, PW32THREAD Thread, MSG *Message, if (!MessageQueue->PaintPosted) return FALSE; - if (Wnd) - Message->hwnd = IntFindWindowToRepaint(Wnd->Self, PsGetWin32Thread()); + if (hWnd) + Message->hwnd = IntFindWindowToRepaint(hWnd, PsGetWin32Thread()); else Message->hwnd = IntFindWindowToRepaint(NULL, PsGetWin32Thread());