X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2Fwin32%2Fkernel32%2Fclient%2Ffile%2Fcopy.c;h=99b96c19c64a2536c27b53eed8ac599b590342b6;hp=9601e1082671dfe0d433a49574d3c90ef0edf475;hb=6e7d12ef45a5d7e67199128704ebde4bfac14386;hpb=0184d61735f700679f64fdf18f41d1cdcd49b54d diff --git a/reactos/dll/win32/kernel32/client/file/copy.c b/reactos/dll/win32/kernel32/client/file/copy.c index 9601e108267..99b96c19c64 100644 --- a/reactos/dll/win32/kernel32/client/file/copy.c +++ b/reactos/dll/win32/kernel32/client/file/copy.c @@ -351,18 +351,33 @@ CopyFileExA(IN LPCSTR lpExistingFileName, */ BOOL WINAPI -CopyFileA ( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName, - BOOL bFailIfExists -) +CopyFileA(IN LPCSTR lpExistingFileName, + IN LPCSTR lpNewFileName, + IN BOOL bFailIfExists) { - return CopyFileExA (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - 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 @@ CopyFileA ( */ BOOL WINAPI -CopyFileW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - BOOL bFailIfExists -) +CopyFileW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN BOOL bFailIfExists) { - return CopyFileExW (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); + return CopyFileExW(lpExistingFileName, + lpNewFileName, + NULL, + NULL, + NULL, + (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0)); }