diff --git a/util_windows.go b/util_windows.go index 5cfdf8f..61312ae 100644 --- a/util_windows.go +++ b/util_windows.go @@ -94,8 +94,7 @@ func ReadPassword(fd int) ([]byte, error) { defer windows.SetConsoleMode(windows.Handle(fd), old) var h windows.Handle - p, _ := windows.GetCurrentProcess() - if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { + if err := windows.DuplicateHandle(windows.GetCurrentProcess(), windows.Handle(fd), windows.GetCurrentProcess(), &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { return nil, err }