Use tcdrain() instead of tcflush() to implement FlushFileBuffers() for a COM port.

Alexandre Julliard julliard at winehq.org
Mon Aug 26 10:13:46 CDT 2013


Wolfgang Walter <wine at stwm.de> writes:

> @@ -2749,19 +2752,46 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock
>  {
>      NTSTATUS ret;
>      HANDLE hEvent = NULL;
> -
> -    SERVER_START_REQ( flush_file )
> -    {
> -        req->handle = wine_server_obj_handle( hFile );
> -        ret = wine_server_call( req );
> -        hEvent = wine_server_ptr_handle( reply->event );
> +    enum server_fd_type type;
> +    unsigned int options;
> +    int needs_close;
> +    int unix_handle;
> +
> +    ret = server_get_unix_fd( hFile, FILE_WRITE_DATA, &unix_handle,
> +                              &needs_close, &type, &options );
> +    if (ret) return ret;

You probably don't want to fail just because there's no unix fd.

> +    if (ret == STATUS_SUCCESS && IoStatusBlock) {
> +        IoStatusBlock->u.Status = ret;
>      }

This is an unrelated change and should be a separate patch, with tests
(also for failures cases),

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list