Author: pschweitzer Date: Wed May 28 18:39:51 2014 New Revision: 63491
URL: http://svn.reactos.org/svn/reactos?rev=63491&view=rev Log: [KERNEL32] - Directly call CopyFileExW() from CopyFileA() - ReactOSify CopyFileW()
Modified: trunk/reactos/dll/win32/kernel32/client/file/copy.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/copy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] Wed May 28 18:39:51 2014 @@ -351,18 +351,33 @@ */ BOOL WINAPI -CopyFileA ( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName, - BOOL bFailIfExists -) -{ - return CopyFileExA (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); +CopyFileA(IN LPCSTR lpExistingFileName, + IN LPCSTR lpNewFileName, + IN BOOL bFailIfExists) +{ + BOOL Result = FALSE; + UNICODE_STRING lpNewFileNameW; + PUNICODE_STRING lpExistingFileNameW; + + lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName); + if (!lpExistingFileNameW) + { + return FALSE; + } + + if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName)) + { + Result = CopyFileExW(lpExistingFileNameW->Buffer, + lpNewFileNameW.Buffer, + NULL, + NULL, + NULL, + (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0)); + + RtlFreeUnicodeString(&lpNewFileNameW); + } + + return Result; }
@@ -371,18 +386,16 @@ */ BOOL WINAPI -CopyFileW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - BOOL bFailIfExists -) -{ - return CopyFileExW (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); +CopyFileW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN BOOL bFailIfExists) +{ + return CopyFileExW(lpExistingFileName, + lpNewFileName, + NULL, + NULL, + NULL, + (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0)); }