Jacek Caban : wineconsole: Use IOCTL_CONDRV_GET_RENDERER_EVENTS to fetch events.

Alexandre Julliard julliard at winehq.org
Wed Jul 8 15:34:36 CDT 2020


Module: wine
Branch: master
Commit: a0d325333fb0cba6028a15b924dd115cbbdc0586
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a0d325333fb0cba6028a15b924dd115cbbdc0586

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jul  8 16:29:49 2020 +0200

wineconsole: Use IOCTL_CONDRV_GET_RENDERER_EVENTS to fetch events.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/wineconsole/wineconsole.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index e94af41d2b..2820657a70 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -243,20 +243,20 @@ static void WINECON_SetColors(struct inner_data *data, const struct config_data*
 void	WINECON_GrabChanges(struct inner_data* data)
 {
     struct console_renderer_event	evts[256];
-    int	i, num, ev_found;
+    int i, ev_found;
+    DWORD num;
     HANDLE h;
 
     if (data->in_grab_changes) return;
 
-    SERVER_START_REQ( get_console_renderer_events )
+    if (!DeviceIoControl( data->hSynchro, IOCTL_CONDRV_GET_RENDERER_EVENTS, NULL, 0, evts,
+                          sizeof(evts), &num, NULL ) || !num)
     {
-        wine_server_set_reply( req, evts, sizeof(evts) );
-        req->handle = wine_server_obj_handle( data->hSynchro );
-        if (!wine_server_call_err( req )) num = wine_server_reply_size(reply) / sizeof(evts[0]);
-        else num = 0;
+        ERR( "failed to get renderer events: %u\n", GetLastError() );
+        data->dying = TRUE;
+        return;
     }
-    SERVER_END_REQ;
-    if (!num) {WINE_WARN("hmm renderer signaled but no events available\n"); return;}
+    num /= sizeof(*evts);
     WINE_TRACE( "got %u events\n", num );
 
     /* FIXME: should do some event compression here (cursor pos, update) */




More information about the wine-cvs mailing list