github.com/getong/docker@v1.13.1/integration-cli/daemon_windows.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "strconv" 6 "syscall" 7 "unsafe" 8 9 "github.com/go-check/check" 10 "golang.org/x/sys/windows" 11 ) 12 13 func openEvent(desiredAccess uint32, inheritHandle bool, name string, proc *windows.LazyProc) (handle syscall.Handle, err error) { 14 namep, _ := syscall.UTF16PtrFromString(name) 15 var _p2 uint32 16 if inheritHandle { 17 _p2 = 1 18 } 19 r0, _, e1 := proc.Call(uintptr(desiredAccess), uintptr(_p2), uintptr(unsafe.Pointer(namep))) 20 handle = syscall.Handle(r0) 21 if handle == syscall.InvalidHandle { 22 err = e1 23 } 24 return 25 } 26 27 func pulseEvent(handle syscall.Handle, proc *windows.LazyProc) (err error) { 28 r0, _, _ := proc.Call(uintptr(handle)) 29 if r0 != 0 { 30 err = syscall.Errno(r0) 31 } 32 return 33 } 34 35 func signalDaemonDump(pid int) { 36 modkernel32 := windows.NewLazySystemDLL("kernel32.dll") 37 procOpenEvent := modkernel32.NewProc("OpenEventW") 38 procPulseEvent := modkernel32.NewProc("PulseEvent") 39 40 ev := "Global\\docker-daemon-" + strconv.Itoa(pid) 41 h2, _ := openEvent(0x0002, false, ev, procOpenEvent) 42 if h2 == 0 { 43 return 44 } 45 pulseEvent(h2, procPulseEvent) 46 } 47 48 func signalDaemonReload(pid int) error { 49 return fmt.Errorf("daemon reload not supported") 50 } 51 52 func cleanupExecRoot(c *check.C, execRoot string) { 53 }