References: =========== - [MS-SMB2]: 2.2.39
| 784 | |
| 785 | |
| 786 | class SMB2SetInfoRequest(Structure): |
| 787 | """ |
| 788 | References: |
| 789 | =========== |
| 790 | - [MS-SMB2]: 2.2.39 |
| 791 | """ |
| 792 | |
| 793 | STRUCTURE_FORMAT = "<HBBIHHI16s" |
| 794 | STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT) |
| 795 | |
| 796 | def __init__(self, fid, additional_info, info_type, file_info_class, data): |
| 797 | self.fid = fid |
| 798 | self.additional_info = additional_info |
| 799 | self.info_type = info_type |
| 800 | self.file_info_class = file_info_class |
| 801 | self.data = data or b'' |
| 802 | |
| 803 | def initMessage(self, message): |
| 804 | Structure.initMessage(self, message) |
| 805 | message.command = SMB2_COM_SET_INFO |
| 806 | |
| 807 | def prepare(self, message): |
| 808 | message.data = struct.pack(self.STRUCTURE_FORMAT, |
| 809 | 33, # StructureSize. Must be 33 as mandated by [MS-SMB2] 2.2.39 |
| 810 | self.info_type, # InfoType |
| 811 | self.file_info_class, # FileInfoClass |
| 812 | len(self.data), # BufferLength |
| 813 | SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # BufferOffset |
| 814 | 0, # Reserved |
| 815 | self.additional_info, # AdditionalInformation |
| 816 | self.fid # FileId |
| 817 | ) + self.data |
| 818 | |
| 819 | class SMB2SetInfoResponse(Structure): |
| 820 | """ |
no outgoing calls
no test coverage detected