[KERNEL32]

Don't make CopyFileExA() rely on Wine's strings conversions functions

svn path=/trunk/; revision=50869
This commit is contained in:
Pierre Schweitzer 2011-02-22 19:07:45 +00:00
parent 8dc411563b
commit 41ee0f405e

View file

@ -314,37 +314,36 @@ CopyFileExW (
*/ */
BOOL BOOL
WINAPI WINAPI
CopyFileExA ( CopyFileExA(IN LPCSTR lpExistingFileName,
LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName,
LPCSTR lpNewFileName, IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
LPPROGRESS_ROUTINE lpProgressRoutine, IN LPVOID lpData OPTIONAL,
LPVOID lpData, IN LPBOOL pbCancel OPTIONAL,
BOOL *pbCancel, IN DWORD dwCopyFlags)
DWORD dwCopyFlags
)
{ {
PWCHAR ExistingFileNameW; BOOL Result = FALSE;
PWCHAR NewFileNameW; UNICODE_STRING lpNewFileNameW;
BOOL Result; PUNICODE_STRING lpExistingFileNameW;
if (!(ExistingFileNameW = FilenameA2W(lpExistingFileName, FALSE))) lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName);
return FALSE; if (!lpExistingFileName)
{
return FALSE;
}
if (!(NewFileNameW = FilenameA2W(lpNewFileName, TRUE))) if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName))
return FALSE; {
Result = CopyFileExW(lpExistingFileNameW->Buffer,
lpNewFileNameW.Buffer,
lpProgressRoutine,
lpData,
pbCancel,
dwCopyFlags);
Result = CopyFileExW (ExistingFileNameW , RtlFreeUnicodeString(&lpNewFileNameW);
NewFileNameW , }
lpProgressRoutine,
lpData,
pbCancel,
dwCopyFlags);
RtlFreeHeap (RtlGetProcessHeap (), return Result;
0,
NewFileNameW);
return Result;
} }