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:
akallabeth
2025-05-20 14:58:57 +02:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -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)
{

View File

@@ -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);