mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Merge pull request #11601 from ljaeh0121/fix/drive_process_irp_set_information
[channel,drive] Fix failure when renaming non-empty directories
This commit is contained in:
@@ -755,7 +755,10 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232098.aspx */
|
||||
/* http://msdn.microsoft.com/en-us/library/cc241371.aspx */
|
||||
if (file->is_dir && !PathIsDirectoryEmptyW(file->fullpath))
|
||||
break; /* TODO: SetLastError ??? */
|
||||
{
|
||||
SetLastError(ERROR_DIR_NOT_EMPTY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (Length)
|
||||
{
|
||||
|
||||
@@ -122,6 +122,10 @@ static NTSTATUS drive_map_windows_err(DWORD fs_errno)
|
||||
rc = STATUS_OBJECT_PATH_NOT_FOUND;
|
||||
break;
|
||||
|
||||
case ERROR_DIR_NOT_EMPTY:
|
||||
rc = STATUS_DIRECTORY_NOT_EMPTY;
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = STATUS_UNSUCCESSFUL;
|
||||
WLog_ERR(TAG, "Error code not found: %" PRIu32 "", fs_errno);
|
||||
@@ -436,9 +440,6 @@ static UINT drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp)
|
||||
irp->IoStatus = drive_map_windows_err(GetLastError());
|
||||
}
|
||||
|
||||
if (file && file->is_dir && !PathIsDirectoryEmptyW(file->fullpath))
|
||||
irp->IoStatus = STATUS_DIRECTORY_NOT_EMPTY;
|
||||
|
||||
Stream_Write_UINT32(irp->output, Length);
|
||||
|
||||
WINPR_ASSERT(irp->Complete);
|
||||
|
||||
Reference in New Issue
Block a user