Ejemplo n.º 1
0
Archivo: layer.py Proyecto: zha0/rdpy
 def recvFastPath(self, secFlag, fastPathS):
     """
     @summary: Implement IFastPathListener interface
     Fast path is needed by RDP 8.0
     @param fastPathS: {Stream} that contain fast path data
     @param secFlag: {SecFlags}
     """
     fastPathPDU = data.FastPathUpdatePDU()
     fastPathS.readType(fastPathPDU)
     if fastPathPDU.updateHeader.value == data.FastPathUpdateType.FASTPATH_UPDATETYPE_BITMAP:
         self._listener.onUpdate(fastPathPDU.updateData.rectangles._array)
Ejemplo n.º 2
0
    def sendBitmapUpdatePDU(self, bitmapDatas):
        """
        @summary: Send bitmap update data
        @param bitmapDatas: List of data.BitmapData
        """
        #check bitmap header for client that want it (very old client)
        if self._clientCapabilities[
                caps.CapsType.
                CAPSTYPE_GENERAL].capability.extraFlags.value & caps.GeneralExtraFlag.NO_BITMAP_COMPRESSION_HDR:
            for bitmapData in bitmapDatas:
                if bitmapData.flags.value & data.BitmapFlag.BITMAP_COMPRESSION:
                    bitmapData.flags.value |= data.BitmapFlag.NO_BITMAP_COMPRESSION_HDR

        if self._clientFastPathSupported and not self._fastPathSender is None:
            #fast path case
            fastPathUpdateDataPDU = data.FastPathBitmapUpdateDataPDU()
            fastPathUpdateDataPDU.rectangles._array = bitmapDatas
            self._fastPathSender.sendFastPath(
                0, data.FastPathUpdatePDU(fastPathUpdateDataPDU))
        else:
            #slow path case
            updateDataPDU = data.BitmapUpdateDataPDU()
            updateDataPDU.rectangles._array = bitmapDatas
            self.sendDataPDU(data.UpdateDataPDU(updateDataPDU))