Merge remote branch 'matthortman/MBH' into raster
[libguac-client-rdp.git] / src / rdp_gdi.c
old mode 100644 (file)
new mode 100755 (executable)
index 52f1966..a9ca292
@@ -97,11 +97,23 @@ void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
     guac_socket* socket = client->socket;
     guac_rdp_bitmap* bitmap = (guac_rdp_bitmap*) memblt->bitmap;
 
+       guac_composite_mode cmode = GUAC_COMP_OVER;
+
+       if (memblt->bRop == 204) cmode = GUAC_COMP_OVER;
+       else if (memblt->bRop == 238) cmode = GUAC_COMP_OR;
+       else if (memblt->bRop == 136) cmode = GUAC_COMP_AND;
+       else if (memblt->bRop == 102) cmode = GUAC_COMP_XOR2;
+       else if (memblt->bRop == 187) cmode = GUAC_COMP_NOR;
+       else
+       {
+               guac_client_log_info (client, "guac_rdp_gdi_memblt: UNSUPPORTED opcode = %d (0x%02X)", memblt->bRop, memblt->bRop);
+       }
+
     if (bitmap->layer != NULL)
         guac_protocol_send_copy(socket,
                 bitmap->layer,
                 memblt->nXSrc, memblt->nYSrc, memblt->nWidth, memblt->nHeight,
-                GUAC_COMP_OVER,
+                cmode,
                 current_layer, memblt->nLeftRect, memblt->nTopRect);
 
 }