mountmgr: Make creating a backup optional for shell folders.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cd37863832
commit
fefb5da4ba
|
@ -335,13 +335,16 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize )
|
|||
if (status != STATUS_BUFFER_TOO_SMALL) return status;
|
||||
}
|
||||
|
||||
if (!(backup = HeapAlloc( GetProcessHeap(), 0, strlen(buffer) + sizeof(".backup" ) )))
|
||||
if (input->create_backup)
|
||||
{
|
||||
status = STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
if (!(backup = HeapAlloc( GetProcessHeap(), 0, strlen(buffer) + sizeof(".backup" ) )))
|
||||
{
|
||||
status = STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
strcpy( backup, buffer );
|
||||
strcat( backup, ".backup" );
|
||||
}
|
||||
strcpy( backup, buffer );
|
||||
strcat( backup, ".backup" );
|
||||
|
||||
if (!lstat( buffer, &st )) /* move old folder/link out of the way */
|
||||
{
|
||||
|
|
|
@ -80,6 +80,7 @@ struct mountmgr_unix_drive
|
|||
|
||||
struct mountmgr_shell_folder
|
||||
{
|
||||
BOOL create_backup;
|
||||
ULONG folder_offset;
|
||||
ULONG folder_size;
|
||||
ULONG symlink_offset;
|
||||
|
|
|
@ -362,6 +362,7 @@ void set_shell_folder( const WCHAR *path, const char *dest )
|
|||
if (dest) len += strlen(dest) + 1;
|
||||
|
||||
if (!(ioctl = HeapAlloc( GetProcessHeap(), 0, len ))) return;
|
||||
ioctl->create_backup = TRUE;
|
||||
ioctl->folder_offset = sizeof(*ioctl);
|
||||
ioctl->folder_size = nt_name.Length;
|
||||
memcpy( (char *)ioctl + ioctl->folder_offset, nt_name.Buffer, nt_name.Length );
|
||||
|
|
Loading…
Reference in New Issue