Comctl32.StrStrIW implementation

Robert Shearman R.J.Shearman at warwick.ac.uk
Thu Dec 12 08:05:17 CST 2002


> -----Original Message-----
> From: Dmitry Timoshkov [mailto:dmitry at baikal.ru]
> Sent: 12 December 2002 07:23
> To: Robert Shearman
> Cc: wine-devel at winehq.com
> Subject: Re: Comctl32.StrStrIW implementation
>
>
> "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.

Good point. Here's a revised patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: comctl32.diff
Type: application/octet-stream
Size: 2150 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20021212/81baa50a/comctl32.obj


More information about the wine-patches mailing list