Comctl32.StrStrIW implementation

Dmitry Timoshkov dmitry at baikal.ru
Thu Dec 12 01:22:54 CST 2002


"Robert Shearman" <R.J.Shearman at warwick.ac.uk> wrote:

> StrStrIW is used by native Regedit when searching the registry. This patch
> enables this function of Regedit to work.
> 
> ChangeLog:
> - Implement StrStrIW (find a string inside a string)

> + first = towlower (*lpStr2);
> + while (len1 >= len2) {
> + if (towlower(*lpStr1) == first) {

It almost always is a bad idea to use unicode or locale dependant functions
from a system libc (isalpha() in your other patch). It could sometimes produce
bad side effects due to different unicode implementations and the fact that
Wine's default ANSI code page often is not the same as a one used by an underlying
system. The best way to avoid discrepancies is to use Win32 APIs to deal
with locale sensitive data. Other way to avoid use of the libc locale
dependant functions is to delegate all the work to unicode version of
the API and leaving to ANSI version only simple work of converting strings
to unicode and adopting the returned data if necessary.

-- 
Dmitry.






More information about the wine-devel mailing list