Contains information about the SMB2_COM_CREATE response from the server. If the message has no errors, each instance contains the following attributes: - oplock (integer): one of SMB2_OPLOCK_LEVEL_xxx constants - create_action (integer): one of SMB2_FILE_xxx constants - allocat
| 404 | ) + buf |
| 405 | |
| 406 | class SMB2CreateResponse(Structure): |
| 407 | """ |
| 408 | Contains information about the SMB2_COM_CREATE response from the server. |
| 409 | |
| 410 | If the message has no errors, each instance contains the following attributes: |
| 411 | - oplock (integer): one of SMB2_OPLOCK_LEVEL_xxx constants |
| 412 | - create_action (integer): one of SMB2_FILE_xxx constants |
| 413 | - allocation_size (long) |
| 414 | - file_size (long) |
| 415 | - file_attributes (integer) |
| 416 | - fid (16-bytes string) |
| 417 | - create_time, lastaccess_time, lastwrite_time, change_time (float) |
| 418 | |
| 419 | References: |
| 420 | =========== |
| 421 | - [MS-SMB2]: 2.2.14 |
| 422 | """ |
| 423 | |
| 424 | STRUCTURE_FORMAT = "<HBBIQQQQQQII16sII" |
| 425 | STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT) |
| 426 | |
| 427 | def decode(self, message): |
| 428 | assert message.command == SMB2_COM_CREATE |
| 429 | |
| 430 | if message.status == 0: |
| 431 | struct_size, self.oplock, _, self.create_action, \ |
| 432 | create_time, lastaccess_time, lastwrite_time, change_time, \ |
| 433 | self.allocation_size, self.file_size, self.file_attributes, \ |
| 434 | _, self.fid, _, _ = struct.unpack(self.STRUCTURE_FORMAT, message.raw_data[SMB2Message.HEADER_SIZE:SMB2Message.HEADER_SIZE+self.STRUCTURE_SIZE]) |
| 435 | |
| 436 | self.create_time = convertFILETIMEtoEpoch(create_time) |
| 437 | self.lastaccess_time = convertFILETIMEtoEpoch(lastaccess_time) |
| 438 | self.lastwrite_time = convertFILETIMEtoEpoch(lastwrite_time) |
| 439 | self.change_time = convertFILETIMEtoEpoch(change_time) |
| 440 | |
| 441 | |
| 442 | class SMB2WriteRequest(Structure): |