diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 03:58:43 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 08:05:02 +0100 |
commit | 2c40b69ae2bda312e2c2afb596a30c440405c90a (patch) | |
tree | fe870bd30b6990d87e1d1ce01e109f3975f676c3 /main.go | |
parent | README: backports are missing 1.12 for now (diff) | |
download | wireguard-windows-2c40b69ae2bda312e2c2afb596a30c440405c90a.tar.xz wireguard-windows-2c40b69ae2bda312e2c2afb596a30c440405c90a.zip |
ipc: implement event system with pipes
Also use Go 1.12's Sysconn
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -25,7 +25,7 @@ var flags = [...]string{ "/managerservice", "/tunnelservice CONFIG_PATH", "/tunneldebug CONFIG_PATH", - "/ui CMD_READ_HANDLE CMD_WRITE_HANDLE", + "/ui CMD_READ_HANDLE CMD_WRITE_HANDLE CMD_EVENT_HANDLE", } //sys messageBoxEx(hwnd windows.Handle, text *uint16, title *uint16, typ uint, languageId uint16) = user32.MessageBoxExW @@ -146,7 +146,7 @@ func main() { } return case "/ui": - if len(os.Args) != 4 { + if len(os.Args) != 5 { usage() } readPipe, err := pipeFromHandleArgument(os.Args[2]) @@ -157,7 +157,11 @@ func main() { if err != nil { fatal(err) } - service.InitializeIPCClient(readPipe, writePipe) + eventPipe, err := pipeFromHandleArgument(os.Args[4]) + if err != nil { + fatal(err) + } + service.InitializeIPCClient(readPipe, writePipe, eventPipe) ui.RunUI() return } |