dlls/shlwapi

Stefan Weyergraf stefan at weyergraf.de
Sun Oct 21 04:08:25 CDT 2001


Hi !
This implements functions 151 and 153 in shlwapi. it removes the FIXMEs
when starting gnucleus.exe. sorry its a only a diff -u within
dlls/shlwapi.
-------------- next part --------------
--- ordinal.c.orig	Mon Oct  1 22:52:53 2001
+++ ordinal.c	Sat Oct  6 15:32:19 2001
@@ -188,12 +188,19 @@
 /*************************************************************************
  *      @	[SHLWAPI.151]
  *
- *      pStr "HTTP/1.1", dw1 0x5
+ *      strncmpA
  */
-DWORD WINAPI SHLWAPI_151(LPSTR pStr, LPVOID ptr, DWORD dw1)
+DWORD WINAPI SHLWAPI_151(LPSTR str1, LPSTR str2, DWORD len)
 {
-  FIXME("('%s', %p, %08lx): stub\n", pStr, ptr, dw1);
-  return 0;
+  if (!len)
+    return 0;
+
+  while (--len && *str1 && *str1 == *str2)
+  {
+    str1++;
+    str2++;
+  }
+  return *str1 - *str2;
 }
 
 /*************************************************************************
@@ -214,11 +221,24 @@
 
 /*************************************************************************
  *      @	[SHLWAPI.153]
+ *
+ *	strnicmpA
  */
-DWORD WINAPI SHLWAPI_153(LPSTR str1, LPSTR str2, DWORD dw3)
+DWORD WINAPI SHLWAPI_153(LPSTR str1, LPSTR str2, DWORD len)
 {
-    FIXME("'%s' '%s' %08lx - stub\n", str1, str2, dw3);
+  char c1, c2;
+  if (!len)
     return 0;
+/* bug in MS implementation here */
+/* *str1 and *str2 not initially tested for being != 0 */
+  do {
+    c1 = *(str1++);
+    if ((c1 >= 'A') && (c1 <= 'Z')) c1 += 'a'-'A';
+    c2 = *(str2++);
+    if ((c2 >= 'A') && (c2 <= 'Z')) c2 += 'a'-'A';
+  } while (--len && c1 && c1 == c2);
+
+  return c1 - c2;
 }
 
 /*************************************************************************



More information about the wine-patches mailing list