[Spice-commits] 3 commits - vdagent/desktop_layout.h vdagent/display_configuration.cpp vdagent/display_setting.cpp

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Sep 1 14:45:39 UTC 2016


 vdagent/desktop_layout.h          |   12 ++++++------
 vdagent/display_configuration.cpp |    3 ++-
 vdagent/display_setting.cpp       |    2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 9ed7be644548e9974644768dcc676a982902487d
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Aug 18 12:42:28 2016 +0100

    Make DisplayMode setter methods const
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
index fd6af76..34bec0d 100644
--- a/vdagent/desktop_layout.h
+++ b/vdagent/desktop_layout.h
@@ -34,12 +34,12 @@ public:
         _primary = (pos_x == 0 && pos_y == 0 && attached);
     }
 
-    LONG get_pos_x() { return _pos_x;}
-    LONG get_pos_y() { return _pos_y;}
-    DWORD get_width() { return _width;}
-    DWORD get_height() { return _height;}
-    DWORD get_depth() { return _depth;}
-    bool get_attached() { return _attached;}
+    LONG get_pos_x() const { return _pos_x;}
+    LONG get_pos_y() const { return _pos_y;}
+    DWORD get_width() const { return _width;}
+    DWORD get_height() const { return _height;}
+    DWORD get_depth() const { return _depth;}
+    bool get_attached() const { return _attached;}
     void set_pos(LONG x, LONG y) { _pos_x = x; _pos_y = y;}
     void move_pos(LONG x, LONG y) { _pos_x += x; _pos_y += y;}
     void set_res(DWORD width, DWORD height, DWORD depth);
commit 011d60e628009bfaf6d683b5e5b4ca1ba0963ed6
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Aug 17 08:07:53 2016 +0100

    Fix include syntax
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/vdagent/display_setting.cpp b/vdagent/display_setting.cpp
index a2ada04..25a248e 100644
--- a/vdagent/display_setting.cpp
+++ b/vdagent/display_setting.cpp
@@ -19,9 +19,9 @@
 #include <sddl.h>
 #include <string.h>
 #include <tlhelp32.h>
+#include <spice/macros.h>
 #include "display_setting.h"
 #include "vdlog.h"
-#include "spice-protocol/spice/macros.h"
 
 enum DisplaySettingFlags {
     DISPLAY_SETTING_FLAGS_DISABLE_WALLPAPER = (1 << 0),
commit 6bdd83d780bed3b89a43095e2cf9a27f5037f7a0
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Sep 1 12:46:15 2016 +0100

    Remove small possible buffer overflow
    
    wcsncpy requires number of characters, not bytes.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index c0d6342..79ea3b4 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -17,6 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "display_configuration.h"
 #include <winternl.h>
+#include <spice/macros.h>
 
 /* The following definitions and structures are taken
 from the wine project repository and can be found
@@ -631,7 +632,7 @@ D3D_HANDLE WDDMInterface::handle_from_GDI_name(LPCTSTR adapter_name)
     NTSTATUS status;
 
     ZeroMemory(&gdi_display_name, sizeof(gdi_display_name));
-    wcsncpy(gdi_display_name.DeviceName, adapter_name, sizeof(TCHAR)* CCHDEVICENAME);
+    wcsncpy(gdi_display_name.DeviceName, adapter_name, SPICE_N_ELEMENTS(gdi_display_name.DeviceName));
 
     if (NT_SUCCESS(status = _pfnOpen_adapter_gdi_name(&gdi_display_name))) {
         return  gdi_display_name.hAdapter;


More information about the Spice-commits mailing list