Skip to content

Commit

Permalink
fix: find process panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 committed Nov 8, 2024
1 parent 215bf09 commit 792f162
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions component/process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func newSearcher(isV4, isTCP bool) *searcher {
func getTransportTable(fn uintptr, family int, class int) ([]byte, error) {
for size, buf := uint32(8), make([]byte, 8); ; {
ptr := unsafe.Pointer(&buf[0])
err, _, _ := syscall.Syscall6(fn, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0, 0)
err, _, _ := syscall.Syscall6(fn, 6, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0)

switch err {
case 0:
Expand Down Expand Up @@ -216,15 +216,12 @@ func getExecPathFromPID(pid uint32) (string, error) {
buf := make([]uint16, syscall.MAX_LONG_PATH)
size := uint32(len(buf))
r1, _, err := syscall.Syscall6(
queryProcName,
queryProcName, 4,
uintptr(h),
uintptr(0),
uintptr(unsafe.Pointer(&buf[0])),
uintptr(unsafe.Pointer(&size)),
0,
0,
0,
)
0, 0)
if r1 == 0 {
return "", err
}
Expand Down

0 comments on commit 792f162

Please sign in to comment.