Do not set the iSubItem part of the struct for LVM_HITTEST,
[wine/multimedia.git] / dlls / crtdll / mbstring.c
blob4927d21d1933b7293dc944ff0e1261a7cd0f6b9e
1 /*
2 * CRTDLL multi-byte string functions
4 * Copyright 1999 Alexandre Julliard
5 */
7 #include "windef.h"
8 #include "winbase.h"
9 #include "winnls.h"
10 #include "crtdll.h"
13 /*********************************************************************
14 * CRTDLL__mbsinc (CRTDLL.205)
16 LPSTR __cdecl CRTDLL__mbsinc( LPCSTR str )
18 if (IsDBCSLeadByte( *str )) str++;
19 return (LPSTR)(str + 1);
23 /*********************************************************************
24 * CRTDLL__mbslen (CRTDLL.206)
26 INT __cdecl CRTDLL__mbslen( LPCSTR str )
28 INT len;
29 for (len = 0; *str; len++, str++) if (IsDBCSLeadByte(str[0]) && str[1]) str++;
30 return len;
34 /*********************************************************************
35 * CRTDLL_mbtowc (CRTDLL.430)
37 INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n )
39 if (n <= 0) return 0;
40 if (!str) return 0;
41 if (!MultiByteToWideChar( CP_ACP, 0, str, n, dst, 1 )) return 0;
42 /* return the number of bytes from src that have been used */
43 if (!*str) return 0;
44 if (n >= 2 && IsDBCSLeadByte(*str) && str[1]) return 2;
45 return 1;