Commit in reactos/lib/kernel32/string on MAIN
lstring.c+53-41.11 -> 1.12
- Implement lstr[i]cmp[AW] using CompareString[AW] and properly handle NULL parameters.

reactos/lib/kernel32/string
lstring.c 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- lstring.c	4 Jul 2004 18:11:49 -0000	1.11
+++ lstring.c	4 Dec 2004 19:52:55 -0000	1.12
@@ -21,7 +21,19 @@
 	 LPCSTR lpString2
 	 )
 {
-  return strcmp(lpString1,lpString2);
+   int Result;
+    
+   if (lpString1 == lpString2)
+      return 0;
+   if (lpString1 == NULL)
+      return -1;
+   if (lpString2 == NULL)
+      return 1;
+
+   Result = CompareStringA(GetThreadLocale(), 0, lpString1, -1, lpString2, -1);
+   if (Result) Result -= 2;
+    
+   return Result;
 }
 
 
@@ -35,7 +47,20 @@
 	  LPCSTR lpString2
 	  )
 {
-  return _stricmp(lpString1,lpString2); 
+   int Result;
+    
+   if (lpString1 == lpString2)
+      return 0;
+   if (lpString1 == NULL)
+      return -1;
+   if (lpString2 == NULL)
+      return 1;
+
+   Result = CompareStringA(GetThreadLocale(), NORM_IGNORECASE, lpString1, -1,
+                           lpString2, -1);
+   if (Result) Result -= 2;
+    
+   return Result;
 }
 
 
@@ -145,7 +170,19 @@
 	 LPCWSTR lpString2
 	 )
 {
-  return wcscmp(lpString1,lpString2);
+   int Result;
+    
+   if (lpString1 == lpString2)
+      return 0;
+   if (lpString1 == NULL)
+      return -1;
+   if (lpString2 == NULL)
+      return 1;
+
+   Result = CompareStringW(GetThreadLocale(), 0, lpString1, -1, lpString2, -1);
+   if (Result) Result -= 2;
+    
+   return Result;
 }
 
 
@@ -159,7 +196,19 @@
     LPCWSTR lpString2
     )
 {
-  return _wcsicmp(lpString1,lpString2);
+   int Result;
+    
+   if (lpString1 == lpString2)
+      return 0;
+   if (lpString1 == NULL)
+      return -1;
+   if (lpString2 == NULL)
+      return 1;
+
+   Result = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpString1, -1, lpString2, -1);
+   if (Result) Result -= 2;
+    
+   return Result;
 }
 
 
CVSspam 0.2.8