From ae1c71085cc781dfc74da11438ed0f8d1dd81dbf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 28 Apr 2015 09:23:48 -0700 Subject: [PATCH] helper/passsword: fix windows compilation --- helper/password/password_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helper/password/password_windows.go b/helper/password/password_windows.go index 51703feaf4..3fb8a94aa7 100644 --- a/helper/password/password_windows.go +++ b/helper/password/password_windows.go @@ -9,7 +9,7 @@ import ( var ( kernel32 = syscall.MustLoadDLL("kernel32.dll") - setConsoleModeProc = kernel.MustFindProc("SetConsoleMod") + setConsoleModeProc = kernel32.MustFindProc("SetConsoleMod") ) // Magic constant from MSDN to control whether charactesr read are @@ -30,7 +30,7 @@ func read(f *os.File) (string, error) { defer setConsoleMode(handle, oldMode) // The new mode is the old mode WITHOUT the echo input flag set. - var newMode uint32 = oldMode & ^ENABLE_ECHO_INPUT + var newMode uint32 = uint32(int(oldMode) & ^ENABLE_ECHO_INPUT) if err := setConsoleMode(handle, newMode); err != nil { return "", err } @@ -39,7 +39,7 @@ func read(f *os.File) (string, error) { } func setConsoleMode(console syscall.Handle, mode uint32) error { - r, _, err := stConsoleModeProc.Call(uintptr(console), uintptr(mode)) + r, _, err := setConsoleModeProc.Call(uintptr(console), uintptr(mode)) if r == 0 { return err }