Comctl32.StrStrIW implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)
Index: wine/dlls/comctl32/comctl32.spec
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comctl32.spec,v
retrieving revision 1.36
diff -u -r1.36 comctl32.spec
--- wine/dlls/comctl32/comctl32.spec	4 Nov 2002 23:53:46 -0000	1.36
+++ wine/dlls/comctl32/comctl32.spec	11 Dec 2002 20:27:56 -0000
@@ -74,7 +74,7 @@
 360 stdcall -noname StrCmpNW(wstr wstr long) COMCTL32_StrCmpNW
 361 stdcall -noname StrCmpNIW(wstr wstr long) COMCTL32_StrCmpNIW
 362 stdcall -noname StrStrW(wstr wstr) COMCTL32_StrStrW
-363 stub -noname StrStrIW
+363 stdcall -noname StrStrIW(wstr wstr) COMCTL32_StrStrIW
 364 stdcall -noname StrSpnW(wstr wstr) COMCTL32_StrSpnW
 365 stdcall -noname StrToIntW(wstr) COMCTL32_StrToIntW
 366 stub -noname StrChrIA
Index: wine/dlls/comctl32/comctl32undoc.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comctl32undoc.c,v
retrieving revision 1.73
diff -u -r1.73 comctl32undoc.c
--- wine/dlls/comctl32/comctl32undoc.c	23 Oct 2002 23:32:19 -0000	1.73
+++ wine/dlls/comctl32/comctl32undoc.c	11 Dec 2002 20:28:01 -0000
@@ -2425,7 +2425,6 @@
     return (NULL);
 }

-
 /**************************************************************************
  * StrToIntA [COMCTL32.357] Converts a string to a signed integer.
  */
@@ -2434,6 +2433,38 @@
 COMCTL32_StrToIntA (LPSTR lpString)
 {
     return atoi(lpString);
+}
+
+/**************************************************************************
+ * StrStrIW [COMCTL32.363]
+ */
+
+LPWSTR WINAPI
+COMCTL32_StrStrIW (LPCWSTR lpStr1, LPCWSTR lpStr2)
+{
+    INT len1, len2, i;
+    WCHAR  first;
+
+    if (*lpStr2 == 0)
+	return ((LPWSTR)lpStr1);
+    len1 = 0;
+    while (lpStr1[len1] != 0) ++len1;
+    len2 = 0;
+    while (lpStr2[len2] != 0) ++len2;
+    if (len2 == 0)
+	return ((LPWSTR)(lpStr1 + len1));
+    first = towlower (*lpStr2);
+    while (len1 >= len2) {
+	if (towlower(*lpStr1) == first) {
+	    for (i = 1; i < len2; ++i)
+		if (towlower (lpStr1[i]) != towlower(lpStr2[i]))
+		    break;
+	    if (i >= len2)
+		return ((LPWSTR)lpStr1);
+        }
+	++lpStr1; --len1;
+    }
+    return (NULL);
 }

 /**************************************************************************

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux