mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
kernel32: Create the backup in the same directory.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9f60413630
commit
adfb042819
1 changed files with 4 additions and 2 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "ddk/ntddk.h"
|
||||
#include "kernel_private.h"
|
||||
#include "fileapi.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "wine/exception.h"
|
||||
#include "wine/unicode.h"
|
||||
|
@ -502,8 +503,9 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa
|
|||
static const WCHAR prefixW[] = {'r','f',0};
|
||||
WCHAR temp_path[MAX_PATH], temp_file[MAX_PATH];
|
||||
|
||||
if (!GetTempPathW( ARRAY_SIZE(temp_path), temp_path )
|
||||
|| !GetTempFileNameW( temp_path, prefixW, 0, temp_file )
|
||||
lstrcpynW( temp_path, lpReplacedFileName, ARRAY_SIZE( temp_path ) );
|
||||
PathRemoveFileSpecW( temp_path );
|
||||
if (!GetTempFileNameW( temp_path, prefixW, 0, temp_file )
|
||||
|| !MoveFileExW( lpReplacedFileName, temp_file, MOVEFILE_REPLACE_EXISTING ))
|
||||
return FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue