winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
342 discussions
Start a n
N
ew thread
Henri Verbeet : d2d1: Properly set an error state when adding the vertex fails in d2d_geometry_sink_BeginFigure ().
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: e37ba63d2f0bc5b7383d6c751901a7a6b53453bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e37ba63d2f0bc5b7383d6c751…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 5 13:16:02 2016 +0100 d2d1: Properly set an error state when adding the vertex fails in d2d_geometry_sink_BeginFigure(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/geometry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c index afbf339..cb6fab8 100644 --- a/dlls/d2d1/geometry.c +++ b/dlls/d2d1/geometry.c @@ -1777,7 +1777,11 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i } if (!d2d_figure_add_vertex(&geometry->u.path.figures[geometry->u.path.figure_count - 1], start_point)) + { ERR("Failed to add vertex.\n"); + geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR; + return; + } geometry->u.path.state = D2D_GEOMETRY_STATE_FIGURE; ++geometry->u.path.segment_count;
1
0
0
0
Jacek Caban : server: Use async object to transfer IRP result to client.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: d055d3d121efd9cab4d6356ca375f8122267007c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d055d3d121efd9cab4d6356ca…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Dec 4 21:22:05 2016 +0100 server: Use async object to transfer IRP result to client. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/file.c | 3 +-- include/wine/server_protocol.h | 40 +++++++++++++++---------------- server/async.c | 32 +++++++++++++++++++++++++ server/device.c | 53 +++--------------------------------------- server/protocol.def | 19 +++++++-------- server/request.h | 13 +++++------ server/trace.c | 29 +++++++++++------------ 7 files changed, 85 insertions(+), 104 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d055d3d121efd9cab4d63…
1
0
0
0
Jacek Caban : server: Store iosb in async object.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 64dc8f5c48e7bffb17d3e0853d5f758d6ee3f9ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64dc8f5c48e7bffb17d3e0853…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Dec 4 21:21:46 2016 +0100 server: Store iosb in async object. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 9 ++++++++- server/change.c | 2 +- server/device.c | 2 +- server/fd.c | 6 +++--- server/file.h | 4 ++-- server/mailslot.c | 2 +- server/named_pipe.c | 6 +++--- server/serial.c | 2 +- server/sock.c | 4 ++-- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/server/async.c b/server/async.c index 568b440..562fcd0 100644 --- a/server/async.c +++ b/server/async.c @@ -47,6 +47,7 @@ struct async int signaled; struct event *event; async_data_t data; /* data for async I/O call */ + struct iosb *iosb; /* I/O status block */ }; static void async_dump( struct object *obj, int verbose ); @@ -141,6 +142,7 @@ static void async_destroy( struct object *obj ) if (async->timeout) remove_timeout_user( async->timeout ); if (async->event) release_object( async->event ); + if (async->iosb) release_object( async->iosb ); release_object( async->queue ); release_object( async->thread ); } @@ -172,6 +174,7 @@ void async_terminate( struct async *async, unsigned int status ) } async->status = status; + if (async->iosb && async->iosb->status == STATUS_PENDING) async->iosb->status = status; if (async->data.callback) { @@ -225,7 +228,8 @@ void free_async_queue( struct async_queue *queue ) } /* create an async on a given queue of a fd */ -struct async *create_async( struct thread *thread, struct async_queue *queue, const async_data_t *data ) +struct async *create_async( struct thread *thread, struct async_queue *queue, const async_data_t *data, + struct iosb *iosb ) { struct event *event = NULL; struct async *async; @@ -247,6 +251,9 @@ struct async *create_async( struct thread *thread, struct async_queue *queue, co async->queue = (struct async_queue *)grab_object( queue ); async->signaled = 0; + if (iosb) async->iosb = (struct iosb *)grab_object( iosb ); + else async->iosb = NULL; + list_add_tail( &queue->queue, &async->queue_entry ); list_add_tail( &thread->process->asyncs, &async->process_entry ); grab_object( async ); diff --git a/server/change.c b/server/change.c index ee30b98..d7ebf3b 100644 --- a/server/change.c +++ b/server/change.c @@ -1246,7 +1246,7 @@ DECL_HANDLER(read_directory_changes) return; /* requests don't timeout */ - if (!(async = fd_queue_async( dir->fd, &req->async, ASYNC_TYPE_WAIT ))) goto end; + if (!(async = fd_queue_async( dir->fd, &req->async, NULL, ASYNC_TYPE_WAIT ))) goto end; /* assign it once */ if (!dir->filter) diff --git a/server/device.c b/server/device.c index 99d5204..60a15e2 100644 --- a/server/device.c +++ b/server/device.c @@ -488,7 +488,7 @@ static obj_handle_t queue_irp( struct device_file *file, struct irp_call *irp, if (blocking && !(handle = alloc_handle( current->process, irp, SYNCHRONIZE, 0 ))) return 0; - if (!(irp->async = fd_queue_async( file->fd, async_data, ASYNC_TYPE_WAIT ))) + if (!(irp->async = fd_queue_async( file->fd, async_data, irp->iosb, ASYNC_TYPE_WAIT ))) { if (handle) close_handle( current->process, handle ); return 0; diff --git a/server/fd.c b/server/fd.c index faf27bc..3ccd0f8 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2030,7 +2030,7 @@ void default_poll_event( struct fd *fd, int event ) else if (!fd->inode) set_fd_events( fd, fd->fd_ops->get_poll_events( fd ) ); } -struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type ) +struct async *fd_queue_async( struct fd *fd, const async_data_t *data, struct iosb *iosb, int type ) { struct async_queue *queue; struct async *async; @@ -2054,7 +2054,7 @@ struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type assert(0); } - if ((async = create_async( current, queue, data )) && type != ASYNC_TYPE_WAIT) + if ((async = create_async( current, queue, data, iosb )) && type != ASYNC_TYPE_WAIT) { if (!fd->inode) set_fd_events( fd, fd->fd_ops->get_poll_events( fd ) ); @@ -2096,7 +2096,7 @@ void default_fd_queue_async( struct fd *fd, const async_data_t *data, int type, { struct async *async; - if ((async = fd_queue_async( fd, data, type ))) + if ((async = fd_queue_async( fd, data, NULL, type ))) { release_object( async ); set_error( STATUS_PENDING ); diff --git a/server/file.h b/server/file.h index 0a144ee..94322c7 100644 --- a/server/file.h +++ b/server/file.h @@ -97,7 +97,7 @@ extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *ent extern unsigned int default_fd_map_access( struct object *obj, unsigned int access ); extern int default_fd_get_poll_events( struct fd *fd ); extern void default_poll_event( struct fd *fd, int event ); -extern struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type ); +extern struct async *fd_queue_async( struct fd *fd, const async_data_t *data, struct iosb *iosb, int type ); extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status ); extern void fd_reselect_async( struct fd *fd, struct async_queue *queue ); extern obj_handle_t no_fd_read( struct fd *fd, const async_data_t *async, int blocking, file_pos_t pos ); @@ -177,7 +177,7 @@ extern struct object *create_serial( struct fd *fd ); extern struct async_queue *create_async_queue( struct fd *fd ); extern void free_async_queue( struct async_queue *queue ); extern struct async *create_async( struct thread *thread, struct async_queue *queue, - const async_data_t *data ); + const async_data_t *data, struct iosb *iosb ); extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ); extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total, client_ptr_t apc, client_ptr_t apc_arg ); diff --git a/server/mailslot.c b/server/mailslot.c index 3ddfab5..783b28b 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -332,7 +332,7 @@ static void mailslot_queue_async( struct fd *fd, const async_data_t *data, int t assert(mailslot->obj.ops == &mailslot_ops); - if ((async = fd_queue_async( fd, data, type ))) + if ((async = fd_queue_async( fd, data, NULL, type ))) { async_set_timeout( async, mailslot->read_timeout ? mailslot->read_timeout : -1, STATUS_IO_TIMEOUT ); diff --git a/server/named_pipe.c b/server/named_pipe.c index d93c40f..3245688 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -555,7 +555,7 @@ static obj_handle_t pipe_server_flush( struct fd *fd, const async_data_t *async_ if (!pipe_data_remaining( server )) return 0; - if ((async = fd_queue_async( server->fd, async_data, ASYNC_TYPE_WAIT ))) + if ((async = fd_queue_async( server->fd, async_data, NULL, ASYNC_TYPE_WAIT ))) { /* there's no unix way to be alerted when a pipe becomes empty, so resort to polling */ if (!server->flush_poll) @@ -602,7 +602,7 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const a { case ps_idle_server: case ps_wait_connect: - if ((async = fd_queue_async( server->ioctl_fd, async_data, ASYNC_TYPE_WAIT ))) + if ((async = fd_queue_async( server->ioctl_fd, async_data, NULL, ASYNC_TYPE_WAIT ))) { if (blocking) wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ); set_server_state( server, ps_wait_open ); @@ -855,7 +855,7 @@ static obj_handle_t named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, if (!pipe->waiters && !(pipe->waiters = create_async_queue( NULL ))) goto done; - if ((async = create_async( current, pipe->waiters, async_data ))) + if ((async = create_async( current, pipe->waiters, async_data, NULL ))) { timeout_t when = buffer->TimeoutSpecified ? buffer->Timeout.QuadPart : pipe->timeout; async_set_timeout( async, when, STATUS_IO_TIMEOUT ); diff --git a/server/serial.c b/server/serial.c index df462ea..6f9cc24 100644 --- a/server/serial.c +++ b/server/serial.c @@ -201,7 +201,7 @@ static void serial_queue_async( struct fd *fd, const async_data_t *data, int typ break; } - if ((async = fd_queue_async( fd, data, type ))) + if ((async = fd_queue_async( fd, data, NULL, type ))) { if (timeout) async_set_timeout( async, timeout * -10000, STATUS_TIMEOUT ); release_object( async ); diff --git a/server/sock.c b/server/sock.c index a3c88a0..f70a85d 100644 --- a/server/sock.c +++ b/server/sock.c @@ -552,7 +552,7 @@ obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *a return 0; } if (!(ifchange_q = sock_get_ifchange_q( sock ))) return 0; - if (!(async = create_async( current, ifchange_q, async_data ))) return 0; + if (!(async = create_async( current, ifchange_q, async_data, NULL ))) return 0; if (blocking) wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ); release_object( async ); set_error( STATUS_PENDING ); @@ -593,7 +593,7 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, return; } - if (!(async = create_async( current, queue, data ))) return; + if (!(async = create_async( current, queue, data, NULL ))) return; release_object( async ); sock_reselect( sock );
1
0
0
0
Jacek Caban : server: Introduced iosb struct for server-side IO_STATUS_BLOCK representation and use it in irp_call.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: d2b3c6c3f9e42cdb49225fbabc4db7e61f3c119b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2b3c6c3f9e42cdb49225fbab…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Dec 4 21:21:25 2016 +0100 server: Introduced iosb struct for server-side IO_STATUS_BLOCK representation and use it in irp_call. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ server/device.c | 58 +++++++++++++++++++++++------------------------------ server/file.h | 13 ++++++++++++ 3 files changed, 100 insertions(+), 33 deletions(-) diff --git a/server/async.c b/server/async.c index 70ebf95..568b440 100644 --- a/server/async.c +++ b/server/async.c @@ -389,6 +389,68 @@ void async_wake_up( struct async_queue *queue, unsigned int status ) } } +static void iosb_dump( struct object *obj, int verbose ); +static void iosb_destroy( struct object *obj ); + +static const struct object_ops iosb_ops = +{ + sizeof(struct iosb), /* size */ + iosb_dump, /* dump */ + no_get_type, /* get_type */ + no_add_queue, /* add_queue */ + NULL, /* remove_queue */ + NULL, /* signaled */ + NULL, /* satisfied */ + no_signal, /* signal */ + no_get_fd, /* get_fd */ + no_map_access, /* map_access */ + default_get_sd, /* get_sd */ + default_set_sd, /* set_sd */ + no_lookup_name, /* lookup_name */ + no_link_name, /* link_name */ + NULL, /* unlink_name */ + no_open_file, /* open_file */ + no_close_handle, /* close_handle */ + iosb_destroy /* destroy */ +}; + +static void iosb_dump( struct object *obj, int verbose ) +{ + assert( obj->ops == &iosb_ops ); + fprintf( stderr, "I/O status block\n" ); +} + +static void iosb_destroy( struct object *obj ) +{ + struct iosb *iosb = (struct iosb *)obj; + + free( iosb->in_data ); + free( iosb->out_data ); +} + +/* allocate iosb struct */ +struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size ) +{ + struct iosb *iosb; + + if (!(iosb = alloc_object( &iosb_ops ))) return NULL; + + iosb->status = STATUS_PENDING; + iosb->result = 0; + iosb->in_size = in_size; + iosb->in_data = NULL; + iosb->out_size = out_size; + iosb->out_data = NULL; + + if (in_size && !(iosb->in_data = memdup( in_data, in_size ))) + { + release_object( iosb ); + iosb = NULL; + } + + return iosb; +} + /* cancels all async I/O */ DECL_HANDLER(cancel_async) { diff --git a/server/device.c b/server/device.c index 2a34cfb..99d5204 100644 --- a/server/device.c +++ b/server/device.c @@ -50,13 +50,8 @@ struct irp_call struct thread *thread; /* thread that queued the irp */ client_ptr_t user_arg; /* user arg used to identify the request */ struct async *async; /* pending async op */ - unsigned int status; /* resulting status (or STATUS_PENDING) */ irp_params_t params; /* irp parameters */ - data_size_t result; /* size of result (input or output depending on the type) */ - data_size_t in_size; /* size of input data */ - void *in_data; /* input data */ - data_size_t out_size; /* size of output data */ - void *out_data; /* output data */ + struct iosb *iosb; /* I/O status block */ }; static void irp_call_dump( struct object *obj, int verbose ); @@ -241,13 +236,12 @@ static void irp_call_destroy( struct object *obj ) { struct irp_call *irp = (struct irp_call *)obj; - free( irp->in_data ); - free( irp->out_data ); if (irp->async) { async_terminate( irp->async, STATUS_CANCELLED ); release_object( irp->async ); } + if (irp->iosb) release_object( irp->iosb ); if (irp->file) release_object( irp->file ); if (irp->thread) release_object( irp->thread ); } @@ -269,14 +263,8 @@ static struct irp_call *create_irp( struct device_file *file, const irp_params_t irp->thread = NULL; irp->async = NULL; irp->params = *params; - irp->status = STATUS_PENDING; - irp->result = 0; - irp->in_size = in_size; - irp->in_data = NULL; - irp->out_size = out_size; - irp->out_data = NULL; - - if (irp->in_size && !(irp->in_data = memdup( in_data, in_size ))) + + if (!(irp->iosb = create_iosb( in_data, in_size, out_size ))) { release_object( irp ); irp = NULL; @@ -289,15 +277,16 @@ static void set_irp_result( struct irp_call *irp, unsigned int status, const void *out_data, data_size_t out_size, data_size_t result ) { struct device_file *file = irp->file; + struct iosb *iosb = irp->iosb; if (!file) return; /* already finished */ /* FIXME: handle the STATUS_PENDING case */ - irp->status = status; - irp->result = result; - irp->out_size = min( irp->out_size, out_size ); - if (irp->out_size && !(irp->out_data = memdup( out_data, irp->out_size ))) - irp->out_size = 0; + iosb->status = status; + iosb->result = result; + iosb->out_size = min( iosb->out_size, out_size ); + if (iosb->out_size && !(iosb->out_data = memdup( out_data, iosb->out_size ))) + iosb->out_size = 0; irp->file = NULL; if (irp->async) { @@ -761,6 +750,7 @@ DECL_HANDLER(get_next_device_request) struct irp_call *irp; struct device_manager *manager; struct list *ptr; + struct iosb *iosb; reply->params.major = IRP_MJ_MAXIMUM_FUNCTION + 1; @@ -788,14 +778,15 @@ DECL_HANDLER(get_next_device_request) reply->client_tid = get_thread_id( irp->thread ); } reply->params = irp->params; - reply->in_size = irp->in_size; - reply->out_size = irp->out_size; - if (irp->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW ); + iosb = irp->iosb; + reply->in_size = iosb->in_size; + reply->out_size = iosb->out_size; + if (iosb->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW ); else if ((reply->next = alloc_handle( current->process, irp, 0, 0 ))) { - set_reply_data_ptr( irp->in_data, irp->in_size ); - irp->in_data = NULL; - irp->in_size = 0; + set_reply_data_ptr( iosb->in_data, iosb->in_size ); + iosb->in_data = NULL; + iosb->in_size = 0; list_remove( &irp->mgr_entry ); list_init( &irp->mgr_entry ); } @@ -833,17 +824,18 @@ DECL_HANDLER(get_irp_result) if ((irp = find_irp_call( file, current, req->user_arg ))) { - if (irp->out_data) + struct iosb *iosb = irp->iosb; + if (iosb->out_data) { - data_size_t size = min( irp->out_size, get_reply_max_size() ); + data_size_t size = min( iosb->out_size, get_reply_max_size() ); if (size) { - set_reply_data_ptr( irp->out_data, size ); - irp->out_data = NULL; + set_reply_data_ptr( iosb->out_data, size ); + iosb->out_data = NULL; } } - reply->size = irp->result; - set_error( irp->status ); + reply->size = iosb->result; + set_error( iosb->status ); list_remove( &irp->dev_entry ); release_object( irp ); /* no longer on the device queue */ } diff --git a/server/file.h b/server/file.h index fb2e905..0a144ee 100644 --- a/server/file.h +++ b/server/file.h @@ -53,6 +53,18 @@ struct fd_ops void (*reselect_async)( struct fd *, struct async_queue *queue ); }; +/* server-side representation of I/O status block */ +struct iosb +{ + struct object obj; /* object header */ + unsigned int status; /* resulting status (or STATUS_PENDING) */ + data_size_t result; /* size of result (input or output depending on the type) */ + data_size_t in_size; /* size of input data */ + void *in_data; /* input data */ + data_size_t out_size; /* size of output data */ + void *out_data; /* output data */ +}; + /* file descriptor functions */ extern struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user, @@ -175,6 +187,7 @@ extern void async_terminate( struct async *async, unsigned int status ); extern void async_wake_up( struct async_queue *queue, unsigned int status ); extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key ); extern void fd_copy_completion( struct fd *src, struct fd *dst ); +extern struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size ); extern void cancel_process_asyncs( struct process *process ); /* access rights that require Unix read permission */
1
0
0
0
Akihiro Sagawa : quartz: Keep This/iface order in TRACEs for consistency.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 478feea23cb0c7ca122d72f12933d1b01f6dc0f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=478feea23cb0c7ca122d72f12…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Mon Dec 5 00:37:18 2016 +0900 quartz: Keep This/iface order in TRACEs for consistency. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filtergraph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index faf6e51..97c049d 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -766,7 +766,7 @@ static HRESULT WINAPI FilterGraph2_SetDefaultSyncSource(IFilterGraph2 *iface) HRESULT hr = S_OK; int i; - TRACE("(%p/%p)->() live sources not handled properly!\n", iface, This); + TRACE("(%p/%p)->() live sources not handled properly!\n", This, iface); EnterCriticalSection(&This->cs); @@ -5318,7 +5318,7 @@ static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceC HRESULT hr = S_OK; int i; - TRACE("(%p/%p)->(%p)\n", iface, This, pClock); + TRACE("(%p/%p)->(%p)\n", This, iface, pClock); EnterCriticalSection(&This->cs); { @@ -5366,7 +5366,7 @@ static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceC { IFilterGraphImpl *This = impl_from_IMediaFilter(iface); - TRACE("(%p/%p)->(%p)\n", iface, This, ppClock); + TRACE("(%p/%p)->(%p)\n", This, iface, ppClock); if (!ppClock) return E_POINTER;
1
0
0
0
Akihiro Sagawa : wineqtdecoder: Fix reference leaks.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 0eac876e3feb15eabe559249dd04d328e424dba8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0eac876e3feb15eabe559249d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Mon Dec 5 00:37:17 2016 +0900 wineqtdecoder: Fix reference leaks. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineqtdecoder/qtsplitter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 1d5b808..7db7a28 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -864,6 +864,9 @@ static ULONG WINAPI QTInPin_Release(IPin *iface) if (This->pAlloc) IMemAllocator_Release(This->pAlloc); This->pAlloc = NULL; + if (This->pReader) + IAsyncReader_Release(This->pReader); + This->pReader = NULL; This->pin.IPin_iface.lpVtbl = NULL; return 0; } @@ -1203,6 +1206,7 @@ static HRESULT WINAPI QTInPin_Disconnect(IPin *iface) { IMemAllocator_Decommit(This->pAlloc); IPin_Disconnect(This->pin.pConnectedTo); + IPin_Release(This->pin.pConnectedTo); This->pin.pConnectedTo = NULL; hr = QT_RemoveOutputPins(Parser); }
1
0
0
0
Akihiro Sagawa : winegstreamer: Fix reference leaks.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 38586dcf48bf38c136ea315fd9d83a1be56483b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=38586dcf48bf38c136ea315fd…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Mon Dec 5 00:37:14 2016 +0900 winegstreamer: Fix reference leaks. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 7 +++++++ dlls/winegstreamer/gstdemux.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 3077b38..9db1c72 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -366,6 +366,13 @@ static void test_render_run(const WCHAR *file) } releasefiltergraph(); + + if (h != INVALID_HANDLE_VALUE) { + /* check reference leaks */ + h = CreateFileW(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(h != INVALID_HANDLE_VALUE, "CreateFile failed: err=%d\n", GetLastError()); + CloseHandle(h); + } } static void test_graph_builder(void) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 03d8d5b..c33ed9e 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1951,6 +1951,9 @@ static ULONG WINAPI GSTInPin_Release(IPin *iface) if (This->pAlloc) IMemAllocator_Release(This->pAlloc); This->pAlloc = NULL; + if (This->pReader) + IAsyncReader_Release(This->pReader); + This->pReader = NULL; This->pin.IPin_iface.lpVtbl = NULL; return 0; } else @@ -2048,6 +2051,7 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface) if (SUCCEEDED(hr) && state == State_Stopped) { IMemAllocator_Decommit(This->pAlloc); IPin_Disconnect(This->pin.pConnectedTo); + IPin_Release(This->pin.pConnectedTo); This->pin.pConnectedTo = NULL; hr = GST_RemoveOutputPins(Parser); } else
1
0
0
0
Nikolay Sivov : dwrite: Improve face name returned by ConvertFontToLOGFONT ().
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 17586e308251fe96ce6304f1798142f1797c99ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17586e308251fe96ce6304f17…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Dec 4 19:22:16 2016 +0300 dwrite: Improve face name returned by ConvertFontToLOGFONT(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/font.c | 2 +- dlls/dwrite/gdiinterop.c | 14 -------------- dlls/dwrite/opentype.c | 26 ++++++++++++++++++++++++-- dlls/dwrite/tests/font.c | 29 ++++++++++++++++++++++++++++- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 77b6c4a..1e46498 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -224,7 +224,7 @@ extern void opentype_get_font_properties(struct file_stream_desc*,struct dwrite_ extern void opentype_get_font_metrics(struct file_stream_desc*,DWRITE_FONT_METRICS1*,DWRITE_CARET_METRICS*) DECLSPEC_HIDDEN; extern HRESULT opentype_get_font_info_strings(const void*,DWRITE_INFORMATIONAL_STRING_ID,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT opentype_get_font_familyname(struct file_stream_desc*,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; -extern HRESULT opentype_get_font_facename(struct file_stream_desc*,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; +extern HRESULT opentype_get_font_facename(struct file_stream_desc*,WCHAR*,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT opentype_get_typographic_features(IDWriteFontFace*,UINT32,UINT32,UINT32,UINT32*,DWRITE_FONT_FEATURE_TAG*) DECLSPEC_HIDDEN; extern BOOL opentype_get_vdmx_size(const void*,INT,UINT16*,UINT16*) DECLSPEC_HIDDEN; extern UINT32 opentype_get_cpal_palettecount(const void*) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 47ebd11..17bea89 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -3247,7 +3247,7 @@ static HRESULT init_font_data(const struct fontface_desc *desc, IDWriteLocalized stream_desc.face_index = desc->index; opentype_get_font_properties(&stream_desc, &props); opentype_get_font_metrics(&stream_desc, &data->metrics, NULL); - opentype_get_font_facename(&stream_desc, &data->names); + opentype_get_font_facename(&stream_desc, props.lf.lfFaceName, &data->names); /* get family name from font file */ hr = opentype_get_font_familyname(&stream_desc, family_name); diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 5034ad7..3675875 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -623,12 +623,8 @@ static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop1 *iface, IDWriteFont *font, LOGFONTW *logfont, BOOL *is_systemfont) { struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface); - static const WCHAR enusW[] = {'e','n','-','u','s',0}; IDWriteFontCollection *collection; - IDWriteLocalizedStrings *name; IDWriteFontFamily *family; - UINT32 index; - BOOL exists; HRESULT hr; TRACE("(%p)->(%p %p %p)\n", This, font, logfont, is_systemfont); @@ -655,17 +651,7 @@ static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop1 *iface, get_logfont_from_font(font, logfont); logfont->lfCharSet = DEFAULT_CHARSET; logfont->lfOutPrecision = OUT_OUTLINE_PRECIS; - logfont->lfFaceName[0] = 0; - - exists = FALSE; - hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &name, &exists); - if (FAILED(hr) || !exists) - return hr; - hr = IDWriteLocalizedStrings_FindLocaleName(name, enusW, &index, &exists); - if (hr == S_OK) - hr = IDWriteLocalizedStrings_GetString(name, index, logfont->lfFaceName, sizeof(logfont->lfFaceName)/sizeof(WCHAR)); - IDWriteLocalizedStrings_Release(name); return hr; } diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 7f6ccd1..4a6d62c 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -1612,10 +1612,11 @@ HRESULT opentype_get_font_familyname(struct file_stream_desc *stream_desc, IDWri /* FaceName locating order is WWS Face Name -> Preferred Face Name -> Face Name. If font claims to have 'Preferred Face Name' in WWS format, then WWS name is not used. */ -HRESULT opentype_get_font_facename(struct file_stream_desc *stream_desc, IDWriteLocalizedStrings **names) +HRESULT opentype_get_font_facename(struct file_stream_desc *stream_desc, WCHAR *lfname, IDWriteLocalizedStrings **names) { - const TT_OS2_V2 *tt_os2; + IDWriteLocalizedStrings *lfnames; void *os2_context, *name_context; + const TT_OS2_V2 *tt_os2; const void *name_table; HRESULT hr; @@ -1635,6 +1636,27 @@ HRESULT opentype_get_font_facename(struct file_stream_desc *stream_desc, IDWrite if (FAILED(hr)) hr = opentype_get_font_strings_from_id(name_table, OPENTYPE_STRING_SUBFAMILY_NAME, names); + /* User locale is preferred, with fallback to en-us. */ + *lfname = 0; + if (SUCCEEDED(opentype_get_font_strings_from_id(name_table, OPENTYPE_STRING_FAMILY_NAME, &lfnames))) { + static const WCHAR enusW[] = {'e','n','-','u','s',0}; + WCHAR localeW[LOCALE_NAME_MAX_LENGTH]; + UINT32 index; + BOOL exists; + + exists = FALSE; + if (GetUserDefaultLocaleName(localeW, sizeof(localeW)/sizeof(WCHAR))) + IDWriteLocalizedStrings_FindLocaleName(lfnames, localeW, &index, &exists); + + if (!exists) + IDWriteLocalizedStrings_FindLocaleName(lfnames, enusW, &index, &exists); + + if (exists) + IDWriteLocalizedStrings_GetString(lfnames, index, lfname, LF_FACESIZE); + + IDWriteLocalizedStrings_Release(lfnames); + } + if (tt_os2) IDWriteFontFileStream_ReleaseFileFragment(stream_desc->stream, os2_context); if (name_context) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index ca35324..987eac9 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -3459,6 +3459,7 @@ static void test_TryGetFontTable(void) static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) { void *os2_context, *head_context; + IDWriteLocalizedStrings *names; DWRITE_FONT_SIMULATIONS sim; IDWriteFontFace *fontface; const TT_OS2_V2 *tt_os2; @@ -3531,6 +3532,31 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) } } + /* lfFaceName */ + exists = FALSE; + logfont->lfFaceName[0] = 0; + hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &names, &exists); + if (SUCCEEDED(hr)) { + if (exists) { + static const WCHAR enusW[] = {'e','n','-','u','s',0}; + WCHAR localeW[LOCALE_NAME_MAX_LENGTH]; + UINT32 index; + + /* Fallback to en-us if there's no string for user locale. */ + exists = FALSE; + if (GetUserDefaultLocaleName(localeW, sizeof(localeW)/sizeof(WCHAR))) + IDWriteLocalizedStrings_FindLocaleName(names, localeW, &index, &exists); + + if (!exists) + IDWriteLocalizedStrings_FindLocaleName(names, enusW, &index, &exists); + + if (exists) + IDWriteLocalizedStrings_GetString(names, index, logfont->lfFaceName, sizeof(logfont->lfFaceName)/sizeof(WCHAR)); + } + + IDWriteLocalizedStrings_Release(names); + } + if (tt_os2) IDWriteFontFace_ReleaseFontTable(fontface, os2_context); if (tt_head) @@ -3631,6 +3657,8 @@ if (0) { /* crashes on native */ sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no"); ok(logfont.lfItalic == lf.lfItalic, "%s: unexpected italic flag %d, oblique simulation %s\n", wine_dbgstr_w(nameW), logfont.lfItalic, sim & DWRITE_FONT_SIMULATIONS_OBLIQUE ? "yes" : "no"); + ok(!lstrcmpW(logfont.lfFaceName, lf.lfFaceName), "%s: unexpected facename %s, expected %s\n", + wine_dbgstr_w(nameW), wine_dbgstr_w(logfont.lfFaceName), wine_dbgstr_w(lf.lfFaceName)); ok(logfont.lfOutPrecision == OUT_OUTLINE_PRECIS, "%s: unexpected output precision %d\n", wine_dbgstr_w(nameW), logfont.lfOutPrecision); @@ -3639,7 +3667,6 @@ if (0) { /* crashes on native */ ok(logfont.lfQuality == DEFAULT_QUALITY, "%s: unexpected quality %d\n", wine_dbgstr_w(nameW), logfont.lfQuality); ok(logfont.lfPitchAndFamily == DEFAULT_PITCH, "%s: unexpected pitch %d\n", wine_dbgstr_w(nameW), logfont.lfPitchAndFamily); - ok(logfont.lfFaceName[0] != 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName)); IDWriteFont_Release(font); }
1
0
0
0
Nikolay Sivov : dwrite/tests: Use defined symbols when testing LOGFONT fields values.
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: 3ffa9ee08284d7b4a43e5757001233bd967f9b4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ffa9ee08284d7b4a43e57570…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Dec 4 19:22:15 2016 +0300 dwrite/tests: Use defined symbols when testing LOGFONT fields values. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/font.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 738d100..ca35324 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -3632,10 +3632,13 @@ if (0) { /* crashes on native */ ok(logfont.lfItalic == lf.lfItalic, "%s: unexpected italic flag %d, oblique simulation %s\n", wine_dbgstr_w(nameW), logfont.lfItalic, sim & DWRITE_FONT_SIMULATIONS_OBLIQUE ? "yes" : "no"); - ok(logfont.lfOutPrecision == OUT_OUTLINE_PRECIS, "got %d\n", logfont.lfOutPrecision); - ok(logfont.lfClipPrecision == 0, "got %d\n", logfont.lfClipPrecision); - ok(logfont.lfQuality == 0, "got %d\n", logfont.lfQuality); - ok(logfont.lfPitchAndFamily == 0, "got %d\n", logfont.lfPitchAndFamily); + ok(logfont.lfOutPrecision == OUT_OUTLINE_PRECIS, "%s: unexpected output precision %d\n", wine_dbgstr_w(nameW), + logfont.lfOutPrecision); + ok(logfont.lfClipPrecision == CLIP_DEFAULT_PRECIS, "%s: unexpected clipping precision %d\n", wine_dbgstr_w(nameW), + logfont.lfClipPrecision); + ok(logfont.lfQuality == DEFAULT_QUALITY, "%s: unexpected quality %d\n", wine_dbgstr_w(nameW), logfont.lfQuality); + ok(logfont.lfPitchAndFamily == DEFAULT_PITCH, "%s: unexpected pitch %d\n", wine_dbgstr_w(nameW), + logfont.lfPitchAndFamily); ok(logfont.lfFaceName[0] != 0, "got face name %s\n", wine_dbgstr_w(logfont.lfFaceName)); IDWriteFont_Release(font);
1
0
0
0
Nikolay Sivov : dwrite: Improve lfWeight values returned by ConvertFontToLOGFONT().
by Alexandre Julliard
06 Dec '16
06 Dec '16
Module: wine Branch: master Commit: da11bee6c77729974520eca4fa1886997a41ec14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da11bee6c77729974520eca4f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Dec 4 19:22:14 2016 +0300 dwrite: Improve lfWeight values returned by ConvertFontToLOGFONT(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 1 + dlls/dwrite/gdiinterop.c | 1 - dlls/dwrite/opentype.c | 12 +++---- dlls/dwrite/tests/font.c | 81 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 62 insertions(+), 33 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 356000c..47ebd11 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -3401,6 +3401,7 @@ static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *fa if (init_font_data_from_font(family->fonts[heaviest], DWRITE_FONT_SIMULATIONS_BOLD, facenameW, &boldface) == S_OK) { boldface->bold_sim_tested = 1; + boldface->lf.lfWeight += (FW_BOLD - FW_REGULAR) / 2 + 1; fontfamily_add_font(family, boldface); } } diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index e4ef835..5034ad7 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -654,7 +654,6 @@ static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop1 *iface, get_logfont_from_font(font, logfont); logfont->lfCharSet = DEFAULT_CHARSET; - logfont->lfWeight = IDWriteFont_GetWeight(font); logfont->lfOutPrecision = OUT_OUTLINE_PRECIS; logfont->lfFaceName[0] = 0; diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index e16bf76..7f6ccd1 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -1307,10 +1307,9 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d if (version >= 4 && (fsSelection & OS2_FSSELECTION_OBLIQUE)) props->style = DWRITE_FONT_STYLE_OBLIQUE; - else if (fsSelection & OS2_FSSELECTION_ITALIC) { + else if (fsSelection & OS2_FSSELECTION_ITALIC) props->style = DWRITE_FONT_STYLE_ITALIC; - props->lf.lfItalic = 1; - } + memcpy(&props->panose, &tt_os2->panose, sizeof(props->panose)); } else if (tt_head) { @@ -1324,12 +1323,13 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d if (macStyle & TT_HEAD_MACSTYLE_BOLD) props->weight = DWRITE_FONT_WEIGHT_BOLD; - if (macStyle & TT_HEAD_MACSTYLE_ITALIC) { + if (macStyle & TT_HEAD_MACSTYLE_ITALIC) props->style = DWRITE_FONT_STYLE_ITALIC; - props->lf.lfItalic = 1; - } } + props->lf.lfWeight = props->weight; + props->lf.lfItalic = props->style == DWRITE_FONT_STYLE_ITALIC; + TRACE("stretch=%d, weight=%d, style %d\n", props->stretch, props->weight, props->style); if (tt_os2) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index d3c9d42..738d100 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -3458,7 +3458,16 @@ static void test_TryGetFontTable(void) static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) { + void *os2_context, *head_context; + DWRITE_FONT_SIMULATIONS sim; + IDWriteFontFace *fontface; + const TT_OS2_V2 *tt_os2; DWRITE_FONT_STYLE style; + const TT_HEAD *tt_head; + LONG weight; + UINT32 size; + BOOL exists; + HRESULT hr; /* These are rendering time properties. */ logfont->lfHeight = 0; @@ -3468,32 +3477,50 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) logfont->lfUnderline = 0; logfont->lfStrikeOut = 0; + logfont->lfWeight = 0; logfont->lfItalic = 0; - if (IDWriteFont_GetSimulations(font) & DWRITE_FONT_SIMULATIONS_OBLIQUE) - logfont->lfItalic = 1; + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "Failed to create font face, %#x\n", hr); - style = IDWriteFont_GetStyle(font); - if (!logfont->lfItalic && ((style == DWRITE_FONT_STYLE_ITALIC) || (style == DWRITE_FONT_STYLE_OBLIQUE))) { - void *os2_context, *head_context; - IDWriteFontFace *fontface; - const TT_OS2_V2 *tt_os2; - const TT_HEAD *tt_head; - UINT32 size; - BOOL exists; - HRESULT hr; + hr = IDWriteFontFace_TryGetFontTable(fontface, MS_0S2_TAG, (const void **)&tt_os2, &size, + &os2_context, &exists); + ok(hr == S_OK, "Failed to get OS/2 table, %#x\n", hr); - hr = IDWriteFont_CreateFontFace(font, &fontface); - ok(hr == S_OK, "Failed to create font face, %#x\n", hr); + hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void **)&tt_head, &size, + &head_context, &exists); + ok(hr == S_OK, "Failed to get head table, %#x\n", hr); + + sim = IDWriteFont_GetSimulations(font); - hr = IDWriteFontFace_TryGetFontTable(fontface, MS_0S2_TAG, (const void **)&tt_os2, &size, - &os2_context, &exists); - ok(hr == S_OK, "Failed to get OS/2 table, %#x\n", hr); + /* lfWeight */ + weight = FW_REGULAR; + if (tt_os2) { + USHORT usWeightClass = GET_BE_WORD(tt_os2->usWeightClass); - hr = IDWriteFontFace_TryGetFontTable(fontface, MS_HEAD_TAG, (const void **)&tt_head, &size, - &head_context, &exists); - ok(hr == S_OK, "Failed to get head table, %#x\n", hr); + if (usWeightClass >= 1 && usWeightClass <= 9) + usWeightClass *= 100; + if (usWeightClass > DWRITE_FONT_WEIGHT_ULTRA_BLACK) + weight = DWRITE_FONT_WEIGHT_ULTRA_BLACK; + else if (usWeightClass > 0) + weight = usWeightClass; + } + else if (tt_head) { + USHORT macStyle = GET_BE_WORD(tt_head->macStyle); + if (macStyle & TT_HEAD_MACSTYLE_BOLD) + weight = DWRITE_FONT_WEIGHT_BOLD; + } + if (sim & DWRITE_FONT_SIMULATIONS_BOLD) + weight += (FW_BOLD - FW_REGULAR) / 2 + 1; + logfont->lfWeight = weight; + + /* lfItalic */ + if (IDWriteFont_GetSimulations(font) & DWRITE_FONT_SIMULATIONS_OBLIQUE) + logfont->lfItalic = 1; + + style = IDWriteFont_GetStyle(font); + if (!logfont->lfItalic && ((style == DWRITE_FONT_STYLE_ITALIC) || (style == DWRITE_FONT_STYLE_OBLIQUE))) { if (tt_os2) { USHORT fsSelection = GET_BE_WORD(tt_os2->fsSelection); logfont->lfItalic = !!(fsSelection & OS2_FSSELECTION_ITALIC); @@ -3502,13 +3529,13 @@ static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont) USHORT macStyle = GET_BE_WORD(tt_head->macStyle); logfont->lfItalic = !!(macStyle & TT_HEAD_MACSTYLE_ITALIC); } - - if (tt_os2) - IDWriteFontFace_ReleaseFontTable(fontface, os2_context); - if (tt_head) - IDWriteFontFace_ReleaseFontTable(fontface, head_context); - IDWriteFontFace_Release(fontface); } + + if (tt_os2) + IDWriteFontFace_ReleaseFontTable(fontface, os2_context); + if (tt_head) + IDWriteFontFace_ReleaseFontTable(fontface, head_context); + IDWriteFontFace_Release(fontface); } static void test_ConvertFontToLOGFONT(void) @@ -3599,10 +3626,12 @@ if (0) { /* crashes on native */ sim = IDWriteFont_GetSimulations(font); get_logfont_from_font(font, &lf); + ok(logfont.lfWeight == lf.lfWeight, "%s: unexpected lfWeight %d, expected lfWeight %d, font weight %d, " + "bold simulation %s\n", wine_dbgstr_w(nameW), logfont.lfWeight, lf.lfWeight, IDWriteFont_GetWeight(font), + sim & DWRITE_FONT_SIMULATIONS_BOLD ? "yes" : "no"); ok(logfont.lfItalic == lf.lfItalic, "%s: unexpected italic flag %d, oblique simulation %s\n", wine_dbgstr_w(nameW), logfont.lfItalic, sim & DWRITE_FONT_SIMULATIONS_OBLIQUE ? "yes" : "no"); - ok(logfont.lfWeight > 0, "got %d\n", logfont.lfWeight); ok(logfont.lfOutPrecision == OUT_OUTLINE_PRECIS, "got %d\n", logfont.lfOutPrecision); ok(logfont.lfClipPrecision == 0, "got %d\n", logfont.lfClipPrecision); ok(logfont.lfQuality == 0, "got %d\n", logfont.lfQuality);
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
34
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200