[gnome-remote-desktop] rdp-graphics-pipeline: Print unknown cap set versions to the output



commit 36d568c4e633ee6f20e1115b70f20de282dd7858
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sat Aug 6 12:39:19 2022 +0200

    rdp-graphics-pipeline: Print unknown cap set versions to the output
    
    The graphics pipeline is an integral part of the modern remote desktop
    in the RDP protocol.
    When adding new features, Microsoft adds new capability sets as part of
    the capability negotiation.
    These new capability sets may not be documented instantly or only on
    request, and so it is beneficial to print unknown capability versions
    to the output to get notified of them.
    
    So, print any unknown capability set versions to the output in order to
    become attentive about new functionality.

 src/grd-rdp-graphics-pipeline.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
---
diff --git a/src/grd-rdp-graphics-pipeline.c b/src/grd-rdp-graphics-pipeline.c
index 58bbc088..283084b1 100644
--- a/src/grd-rdp-graphics-pipeline.c
+++ b/src/grd-rdp-graphics-pipeline.c
@@ -1157,6 +1157,30 @@ static uint32_t cap_list[] =
   RDPGFX_CAPVERSION_8,   /* [MS-RDPEGFX] 2.2.3.1 */
 };
 
+static void
+search_and_list_unknown_cap_sets_versions (RDPGFX_CAPSET *cap_sets,
+                                           uint16_t       n_cap_sets)
+{
+  uint16_t i;
+  size_t j;
+
+  for (i = 0; i < n_cap_sets; ++i)
+    {
+      gboolean cap_found = FALSE;
+
+      for (j = 0; j < G_N_ELEMENTS (cap_list) && !cap_found; ++j)
+        {
+          if (cap_sets[i].version == cap_list[j])
+            cap_found = TRUE;
+        }
+      if (!cap_found)
+        {
+          g_debug ("[RDP.RDPGFX] Received unknown capability set with "
+                   "version 0x%08X", cap_sets[i].version);
+        }
+    }
+}
+
 static gboolean
 cap_sets_contains_supported_version (RDPGFX_CAPSET *cap_sets,
                                      uint16_t       n_cap_sets)
@@ -1233,6 +1257,8 @@ rdpgfx_caps_advertise (RdpgfxServerContext             *rdpgfx_context,
   GrdSessionRdp *session_rdp = graphics_pipeline->session_rdp;
 
   g_debug ("[RDP.RDPGFX] Received a CapsAdvertise PDU");
+  search_and_list_unknown_cap_sets_versions (caps_advertise->capsSets,
+                                             caps_advertise->capsSetCount);
 
   if (graphics_pipeline->initialized &&
       graphics_pipeline->initial_version < RDPGFX_CAPVERSION_103)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]