[PATCH v2 1/5] ntdll: add support for IOCTL_COPYCHUNK.
Chip Davis
cdavis at codeweavers.com
Wed Aug 4 13:46:05 CDT 2021
August 4, 2021 11:40 AM, "Alex Xu (Hello71)" <alex_y_xu at yahoo.ca> wrote:
> diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
> index 45e444d8576..4e355ef8809 100644
> --- a/dlls/ntdll/unix/file.c
> +++ b/dlls/ntdll/unix/file.c
> @@ -333,6 +333,7 @@ NTSTATUS errno_to_status( int err )
> TRACE( "errno = %d\n", err );
> switch (err)
> {
> + case 0: return STATUS_SUCCESS;
Most syscalls do not clear errno(3) to 0 on success; instead, they leave it untouched. copy_file_range(2) is no exception. This is why we don't have a case for that.
> case EAGAIN: return STATUS_SHARING_VIOLATION;
> case EBADF: return STATUS_INVALID_HANDLE;
> case EBUSY: return STATUS_DEVICE_BUSY;
> @@ -364,6 +365,7 @@ NTSTATUS errno_to_status( int err )
> #endif
> case ENOEXEC: /* ?? */
> case EEXIST: /* ?? */
> + case ENOMEM: return STATUS_NO_MEMORY;
This is the wrong place for that. It will cause the ENOEXEC and EEXIST cases to return STATUS_NO_MEMORY, and I don't think we want that.
Chip
More information about the wine-devel
mailing list