Example #1
0
func setStdHandle(ph *syscall.Proc, stdhandle int32, handle syscall.Handle) error {
	r0, _, e1 := syscall.Syscall(ph.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0)
	if r0 == 0 {
		if e1 != 0 {
			return error(e1)
		}
		return syscall.EINVAL
	}
	return nil
}