From 4dfba73e5cd015f610ba6864546426e72db605a2 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Thu, 14 Apr 2022 23:27:49 +0800 Subject: [PATCH] Fix: SyscallN should not use nargs --- component/process/process_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/component/process/process_windows.go b/component/process/process_windows.go index c51a36f..26a389a 100644 --- a/component/process/process_windows.go +++ b/component/process/process_windows.go @@ -174,7 +174,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.SyscallN(fn, 6, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0) + err, _, _ := syscall.SyscallN(fn, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0) switch err { case 0: @@ -210,12 +210,12 @@ func getExecPathFromPID(pid uint32) (string, error) { buf := make([]uint16, syscall.MAX_LONG_PATH) size := uint32(len(buf)) r1, _, err := syscall.SyscallN( - queryProcName, 4, + queryProcName, uintptr(h), uintptr(1), uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&size)), - 0, 0) + ) if r1 == 0 { return "", err }