Port changes in #171 to python2
Michael Teo
3 years ago
369 | 369 |
|
370 | 370 |
def prepare(self, message):
|
371 | 371 |
buf = self.filename.encode('UTF-16LE')
|
|
372 |
filename_len = len(buf)
|
372 | 373 |
if self.create_context_data:
|
373 | 374 |
n = SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE + len(buf)
|
374 | 375 |
if n % 8 != 0:
|
|
396 | 397 |
self.create_disp,
|
397 | 398 |
self.create_options,
|
398 | 399 |
SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # NameOffset
|
399 | |
len(self.filename)*2, # NameLength in bytes
|
|
400 |
filename_len, # Length of encoded filename in bytes
|
400 | 401 |
create_context_offset, # CreateContextOffset
|
401 | 402 |
len(self.create_context_data) # CreateContextLength
|
402 | 403 |
) + buf
|
369 | 369 |
|
370 | 370 |
def prepare(self, message):
|
371 | 371 |
buf = self.filename.encode('UTF-16LE')
|
372 | |
buf_len = len(buf)
|
|
372 |
filename_len = len(buf)
|
373 | 373 |
if self.create_context_data:
|
374 | 374 |
n = SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE + len(buf)
|
375 | 375 |
if n % 8 != 0:
|
|
397 | 397 |
self.create_disp,
|
398 | 398 |
self.create_options,
|
399 | 399 |
SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # NameOffset
|
400 | |
buf_len, # Length of encoded filename in bytes
|
|
400 |
filename_len, # Length of encoded filename in bytes
|
401 | 401 |
create_context_offset, # CreateContextOffset
|
402 | 402 |
len(self.create_context_data) # CreateContextLength
|
403 | 403 |
) + buf
|