[2/6] ntdll: Add support to NtWriteFile for special offset -1.

Alexandre Julliard julliard at winehq.org
Fri Sep 6 05:05:43 CDT 2013


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> ---
>  dlls/ntdll/file.c       |  3 +++
>  dlls/ntdll/tests/file.c | 15 ---------------
>  2 files changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
> index 9420df5..9d5b02a 100644
> --- a/dlls/ntdll/file.c
> +++ b/dlls/ntdll/file.c
> @@ -967,6 +967,9 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
>              goto done;
>          }
>  
> +        if (offset && offset->QuadPart == (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */)
> +            offset->QuadPart = lseek( unix_handle, 0, SEEK_END );
> +

This looks very wrong, offset belongs to the caller.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list