Exemplo n.º 1
0
    def parseFormatDataResponse(self, payload, msgFlags):
        isSuccessful = True if msgFlags & ClipboardMessageFlags.CB_RESPONSE_OK else False
        fid = self.req.requestedFormatId if self.req else None
        pdu = FormatDataResponsePDU(payload, isSuccessful, fid)

        if isSuccessful and fid in self.formats:
            fmt = str(self.formats[fid])

            if fmt == ClipboardFormatName.FILE_LIST.value:
                stream = BytesIO(payload)
                cItems = Uint32LE.unpack(stream)
                pdu.files = [FileDescriptor.parse(stream) for _ in range(cItems)]

        self.req = None
        return pdu
Exemplo n.º 2
0
 def parseFormatDataResponse(self, payload, msgFlags):
     isSuccessful = True if msgFlags & ClipboardMessageFlags.CB_RESPONSE_OK else False
     return FormatDataResponsePDU(payload, isSuccessful)