File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def find_name(root, findname):
1515 while TODO :
1616 try :
1717 for name , obj in TODO .pop ().items ():
18- if findname in name :
18+ if findname in name or findname in obj . type :
1919 print ("* {0}" .format (obj_with_link (obj )))
2020 if obj .type == "Directory" :
2121 TODO .append (obj )
Original file line number Diff line number Diff line change @@ -20,7 +20,14 @@ def query_link(linkpath):
2020 x = winproxy .NtOpenSymbolicLinkObject (res , gdef .DIRECTORY_QUERY | gdef .READ_CONTROL , obj_attr )
2121 v = gdef .LSA_UNICODE_STRING .from_size (1000 )
2222 s = gdef .ULONG ()
23- winproxy .NtQuerySymbolicLinkObject (res , v , s ) # Handle Buffer-too-small ?
23+ try :
24+ winproxy .NtQuerySymbolicLinkObject (res , v , s )
25+ except WindowsError as e :
26+ if not (e .winerror & 0xffffffff ) == gdef .STATUS_BUFFER_TOO_SMALL :
27+ raise
28+ # If our initial 1000 buffer is not enought (improbable) retry with correct size
29+ v = gdef .LSA_UNICODE_STRING .from_size (s .value )
30+ winproxy .NtQuerySymbolicLinkObject (res , v , s )
2431 return v .str
2532
2633
You can’t perform that action at this time.
0 commit comments