[Spice-devel] [win32/vd_agent v2 1/3] construct WDDMMonitorConfigEscape also with NULL DisplayMode

Yuri Benditovich yuri.benditovich at daynix.com
Fri Mar 8 09:15:49 UTC 2019


Adding possibility to construct WDDMMonitorConfigEscape object
with NULL parameter of DisplayMode. In this case all the fields
depending on DisplayMode are set to zero.

Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
 vdagent/display_configuration.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index cdbbe23..bb2fb80 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -242,10 +242,10 @@ struct WDDMMonitorConfigEscape {
     {
         _ioctl = QXL_ESCAPE_MONITOR_CONFIG;
         _head.id = _head.surface_id = 0;
-        _head.x = mode->get_pos_x();
-        _head.y = mode->get_pos_y();
-        _head.width = mode->get_width();
-        _head.height = mode->get_height();
+        _head.x = mode ? mode->get_pos_x() : 0;
+        _head.y = mode ? mode->get_pos_y() : 0;
+        _head.width = mode ? mode->get_width() : 0;
+        _head.height = mode ? mode->get_height() : 0;
     }
     uint32_t    _ioctl;
     QXLHead     _head;
-- 
2.16.1.windows.4



More information about the Spice-devel mailing list