[1/5] ntdll: Add support to NtWriteFile for special offset -1. Take 3.

Alexandre Julliard julliard at winehq.org
Tue Sep 10 04:00:32 CDT 2013


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> @@ -961,16 +961,23 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
>  
>      if (type == FD_TYPE_FILE)
>      {
> +        off_t off;
> +
>          if (!(options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT)) && !offset)
>          {
>              status = STATUS_INVALID_PARAMETER;
>              goto done;
>          }
>  
> -        if (offset && offset->QuadPart != (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */)
> +        off = offset ? offset->QuadPart : (off_t)-2 /* FILE_USE_FILE_POINTER_POSITION */;
> +
> +        if (off == (off_t)-1 /* FILE_WRITE_TO_END_OF_FILE */)
> +            off = lseek( unix_handle, 0, SEEK_END );

You are not supposed to change the position for the asynchronous case.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list