print fastpath debug information if WITH_DEBUG_RDP is set
authorLysann Kessler <lysann.kessler@student.hpi.uni-potsdam.de>
Mon, 23 Jul 2012 21:01:23 +0000 (23:01 +0200)
committerLysann Kessler <lysann.kessler@student.hpi.uni-potsdam.de>
Mon, 23 Jul 2012 21:01:23 +0000 (23:01 +0200)
libfreerdp-core/fastpath.c

index a54330f..c777898 100644 (file)
 
 #define FASTPATH_MAX_PACKET_SIZE 0x3FFF
 
+#ifdef WITH_DEBUG_RDP
+static const char* const FASTPATH_UPDATETYPE_STRINGS[] =
+{
+       "Orders",                                                                       /* 0x0 */
+       "Bitmap",                                                                       /* 0x1 */
+       "Palette",                                                              /* 0x2 */
+       "Synchronize",                                          /* 0x3 */
+       "Surface Commands",                             /* 0x4 */
+       "System Pointer Hidden",        /* 0x5 */
+       "System Pointer Default",       /* 0x6 */
+       "???",                                                                          /* 0x7 */
+       "Pointer Position",                             /* 0x8 */
+       "Color Pointer",                                        /* 0x9 */
+       "Cached Pointer",                                       /* 0xA */
+       "New Pointer",                                          /* 0xB */
+};
+#endif
+
 /*
  * The fastpath header may be two or three bytes long.
  * This function assumes that at least two bytes are available in the stream
@@ -170,6 +188,11 @@ static boolean fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uin
        rdpContext* context = fastpath->rdp->update->context;
        rdpPointerUpdate* pointer = update->pointer;
 
+#ifdef WITH_DEBUG_RDP
+       DEBUG_RDP("recv Fast-Path %s Update (0x%X), length:%d",
+               updateCode < ARRAY_SIZE(FASTPATH_UPDATETYPE_STRINGS) ? FASTPATH_UPDATETYPE_STRINGS[updateCode] : "???", updateCode, size);
+#endif
+
        switch (updateCode)
        {
                case FASTPATH_UPDATETYPE_ORDERS: