Mike McCormack : shell32: Use kernel functions in preference to libwine ones.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 24 05:57:00 CDT 2006


Module: wine
Branch: master
Commit: e5d9b2f189f79e454a635ee448f7bd6903c5c42e
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=e5d9b2f189f79e454a635ee448f7bd6903c5c42e

Author: Mike McCormack <mike at codeweavers.com>
Date:   Thu Aug 24 19:16:26 2006 +0900

shell32: Use kernel functions in preference to libwine ones.

---

 dlls/shell32/shell32_main.h |    4 ++--
 dlls/shell32/shlfileop.c    |   29 ++++++++++++++---------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 4463da5..a17eec4 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -200,8 +200,8 @@ inline static void __SHCloneStrWtoA(char
 
 inline static void __SHCloneStrW(WCHAR ** target, const WCHAR * source)
 {
-	*target = SHAlloc( (strlenW(source)+1) * sizeof(WCHAR) );
-	strcpyW(*target, source);
+	*target = SHAlloc( (lstrlenW(source)+1) * sizeof(WCHAR) );
+	lstrcpyW(*target, source);
 }
 
 inline static WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 8391ba6..6ea52b0 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -40,7 +40,6 @@ #define NO_SHLWAPI_STREAM
 #include "shlwapi.h"
 #include "shell32_main.h"
 #include "undocshell.h"
-#include "wine/unicode.h"
 #include "wine/debug.h"
 #include "xdg.h"
 
@@ -781,11 +780,11 @@ static inline void grow_list(FILE_LIST *
  */
 static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile)
 {
-    DWORD dwLen = strlenW(szFile) + 1;
+    DWORD dwLen = lstrlenW(szFile) + 1;
     LPWSTR ptr;
 
     feFile->szFullPath = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
-    strcpyW(feFile->szFullPath, szFile);
+    lstrcpyW(feFile->szFullPath, szFile);
 
     ptr = StrRChrW(szFile, NULL, '\\');
     if (ptr)
@@ -794,9 +793,9 @@ static void add_file_to_entry(FILE_ENTRY
         feFile->szDirectory = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
         lstrcpynW(feFile->szDirectory, szFile, dwLen);
 
-        dwLen = strlenW(feFile->szFullPath) - dwLen + 1;
+        dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1;
         feFile->szFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
-        strcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */
+        lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */
     }
     feFile->bFromWildcard = FALSE;
 }
@@ -809,11 +808,11 @@ static LPWSTR wildcard_to_file(LPWSTR sz
     ptr = StrRChrW(szWildCard, NULL, '\\');
     dwDirLen = ptr - szWildCard + 1;
 
-    dwFullLen = dwDirLen + strlenW(szFileName) + 1;
+    dwFullLen = dwDirLen + lstrlenW(szFileName) + 1;
     szFullPath = HeapAlloc(GetProcessHeap(), 0, dwFullLen * sizeof(WCHAR));
 
     lstrcpynW(szFullPath, szWildCard, dwDirLen + 1);
-    strcatW(szFullPath, szFileName);
+    lstrcatW(szFullPath, szFileName);
 
     return szFullPath;
 }
@@ -878,7 +877,7 @@ static HRESULT parse_file_list(FILE_LIST
         }
         else
         {
-            strcpyW(szCurFile, ptr);
+            lstrcpyW(szCurFile, ptr);
             flList->feFiles[i].bFromRelative = FALSE;
         }
 
@@ -900,7 +899,7 @@ static HRESULT parse_file_list(FILE_LIST
         }
 
         /* advance to the next string */
-        ptr += strlenW(ptr) + 1;
+        ptr += lstrlenW(ptr) + 1;
         i++;
     }
     flList->dwNumFiles = i;
@@ -939,13 +938,13 @@ static void copy_dir_to_dir(LPSHFILEOPST
     if (PathFileExistsW(szDestPath))
         PathCombineW(szTo, szDestPath, feFrom->szFilename);
     else
-        strcpyW(szTo, szDestPath);
+        lstrcpyW(szTo, szDestPath);
 
-    szTo[strlenW(szTo) + 1] = '\0';
+    szTo[lstrlenW(szTo) + 1] = '\0';
     SHNotifyCreateDirectoryW(szTo, NULL);
 
     PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
-    szFrom[strlenW(szFrom) + 1] = '\0';
+    szFrom[lstrlenW(szFrom) + 1] = '\0';
 
     memcpy(&fileOp, lpFileOp, sizeof(fileOp));
     fileOp.pFrom = szFrom;
@@ -1181,10 +1180,10 @@ static void move_dir_to_dir(LPSHFILEOPST
     SHNotifyCreateDirectoryW(szDestPath, NULL);
 
     PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
-    szFrom[strlenW(szFrom) + 1] = '\0';
+    szFrom[lstrlenW(szFrom) + 1] = '\0';
 
-    strcpyW(szTo, szDestPath);
-    szTo[strlenW(szDestPath) + 1] = '\0';
+    lstrcpyW(szTo, szDestPath);
+    szTo[lstrlenW(szDestPath) + 1] = '\0';
 
     memcpy(&fileOp, lpFileOp, sizeof(fileOp));
     fileOp.pFrom = szFrom;




More information about the wine-cvs mailing list