Merge pull request #1221 from shirou/feature/process_win_fix_dup_handle

[process][windows] fix release handle
pull/1223/head
shirou 3 years ago committed by GitHub
commit a3ae4bc40d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -703,6 +703,9 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er
0, true, windows.DUPLICATE_SAME_ACCESS) != nil {
continue
}
// release the new handle
defer windows.CloseHandle(windows.Handle(file))
fileType, _ := windows.GetFileType(windows.Handle(file))
if fileType != windows.FILE_TYPE_DISK {
continue

Loading…
Cancel
Save