Author: pschweitzer
Date: Tue Feb 22 19:07:45 2011
New Revision: 50869
URL:
http://svn.reactos.org/svn/reactos?rev=50869&view=rev
Log:
[KERNEL32]
Don't make CopyFileExA() rely on Wine's strings conversions functions
Modified:
trunk/reactos/dll/win32/kernel32/file/copy.c
Modified: trunk/reactos/dll/win32/kernel32/file/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/co…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/copy.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/copy.c [iso-8859-1] Tue Feb 22 19:07:45 2011
@@ -314,37 +314,36 @@
*/
BOOL
WINAPI
-CopyFileExA (
- LPCSTR lpExistingFileName,
- LPCSTR lpNewFileName,
- LPPROGRESS_ROUTINE lpProgressRoutine,
- LPVOID lpData,
- BOOL *pbCancel,
- DWORD dwCopyFlags
- )
-{
- PWCHAR ExistingFileNameW;
- PWCHAR NewFileNameW;
- BOOL Result;
-
- if (!(ExistingFileNameW = FilenameA2W(lpExistingFileName, FALSE)))
- return FALSE;
-
- if (!(NewFileNameW = FilenameA2W(lpNewFileName, TRUE)))
- return FALSE;
-
- Result = CopyFileExW (ExistingFileNameW ,
- NewFileNameW ,
- lpProgressRoutine,
- lpData,
- pbCancel,
- dwCopyFlags);
-
- RtlFreeHeap (RtlGetProcessHeap (),
- 0,
- NewFileNameW);
-
- return Result;
+CopyFileExA(IN LPCSTR lpExistingFileName,
+ IN LPCSTR lpNewFileName,
+ IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
+ IN LPVOID lpData OPTIONAL,
+ IN LPBOOL pbCancel OPTIONAL,
+ IN DWORD dwCopyFlags)
+{
+ BOOL Result = FALSE;
+ UNICODE_STRING lpNewFileNameW;
+ PUNICODE_STRING lpExistingFileNameW;
+
+ lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
+ if (!lpExistingFileName)
+ {
+ return FALSE;
+ }
+
+ if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName))
+ {
+ Result = CopyFileExW(lpExistingFileNameW->Buffer,
+ lpNewFileNameW.Buffer,
+ lpProgressRoutine,
+ lpData,
+ pbCancel,
+ dwCopyFlags);
+
+ RtlFreeUnicodeString(&lpNewFileNameW);
+ }
+
+ return Result;
}