Commit fefb5da4 authored by Alexandre Julliard's avatar Alexandre Julliard

mountmgr: Make creating a backup optional for shell folders.

parent cd378638
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment