MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / sendFindNext

Method sendFindNext

pager_lib/smb/base.py:2288–2309  ·  view source on GitHub ↗
(tid, sid, resume_key, resume_file, support_dfs)

Source from the content-addressed store, hash-verified

2286 errback(OperationFailure('Failed to list %s on %s: Unable to retrieve file list' % ( path, service_name ), messages_history))
2287
2288 def sendFindNext(tid, sid, resume_key, resume_file, support_dfs):
2289 setup_bytes = struct.pack('<H', 0x0002) # TRANS2_FIND_NEXT2 sub-command. See [MS-CIFS]: 2.2.6.3.1
2290 params_bytes = \
2291 struct.pack('<HHHIH',
2292 sid, # SID
2293 100, # SearchCount
2294 0x0104, # InfoLevel: SMB_FIND_FILE_BOTH_DIRECTORY_INFO
2295 resume_key, # ResumeKey
2296 0x0006) # Flags: SMB_FIND_RETURN_RESUME_KEYS | SMB_FIND_CLOSE_AT_EOS
2297 params_bytes += (resume_file+'\0').encode('UTF-16LE')
2298
2299 m = SMBMessage(ComTransaction2Request(max_params_count = 10,
2300 max_data_count = 16644,
2301 max_setup_count = 0,
2302 params_bytes = params_bytes,
2303 setup_bytes = setup_bytes))
2304 m.tid = tid
2305 if support_dfs:
2306 m.flags2 |= SMB_FLAGS2_DFS
2307 self._sendSMBMessage(m)
2308 self.pending_requests[m.mid] = _PendingRequest(m.mid, expiry_time, findNextCB, errback, sid = sid, support_dfs = support_dfs)
2309 self._pushToArray(messages_history, m)
2310
2311 def findNextCB(find_message, **kwargs):
2312 self._pushToArray(messages_history, find_message)

Callers

nothing calls this directly

Calls 5

_pushToArrayMethod · 0.95
SMBMessageClass · 0.85
_PendingRequestClass · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected