-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdefines.go
executable file
·80 lines (64 loc) · 2.46 KB
/
defines.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package winpty
import (
"path/filepath"
"syscall"
)
const (
WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN = 1
WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION = 0x8
)
var (
modWinPTY *syscall.LazyDLL
// Error handling...
winpty_error_code *syscall.LazyProc
winpty_error_msg *syscall.LazyProc
winpty_error_free *syscall.LazyProc
// Configuration of a new agent.
winpty_config_new *syscall.LazyProc
winpty_config_free *syscall.LazyProc
winpty_config_set_initial_size *syscall.LazyProc
winpty_config_set_mouse_mode *syscall.LazyProc
winpty_config_set_agent_timeout *syscall.LazyProc
// Start the agent.
winpty_open *syscall.LazyProc
winpty_agent_process *syscall.LazyProc
// I/O Pipes
winpty_conin_name *syscall.LazyProc
winpty_conout_name *syscall.LazyProc
winpty_conerr_name *syscall.LazyProc
// Agent RPC Calls
winpty_spawn_config_new *syscall.LazyProc
winpty_spawn_config_free *syscall.LazyProc
winpty_spawn *syscall.LazyProc
winpty_set_size *syscall.LazyProc
winpty_free *syscall.LazyProc
)
func setupDefines(dllPrefix string) {
if modWinPTY != nil {
return
}
modWinPTY = syscall.NewLazyDLL(filepath.Join(dllPrefix, `winpty.dll`))
// Error handling...
winpty_error_code = modWinPTY.NewProc("winpty_error_code")
winpty_error_msg = modWinPTY.NewProc("winpty_error_msg")
winpty_error_free = modWinPTY.NewProc("winpty_error_free")
// Configuration of a new agent.
winpty_config_new = modWinPTY.NewProc("winpty_config_new")
winpty_config_free = modWinPTY.NewProc("winpty_config_free")
winpty_config_set_initial_size = modWinPTY.NewProc("winpty_config_set_initial_size")
winpty_config_set_mouse_mode = modWinPTY.NewProc("winpty_config_set_mouse_mode")
winpty_config_set_agent_timeout = modWinPTY.NewProc("winpty_config_set_agent_timeout")
// Start the agent.
winpty_open = modWinPTY.NewProc("winpty_open")
winpty_agent_process = modWinPTY.NewProc("winpty_agent_process")
// I/O Pipes
winpty_conin_name = modWinPTY.NewProc("winpty_conin_name")
winpty_conout_name = modWinPTY.NewProc("winpty_conout_name")
winpty_conerr_name = modWinPTY.NewProc("winpty_conerr_name")
// Agent RPC Calls
winpty_spawn_config_new = modWinPTY.NewProc("winpty_spawn_config_new")
winpty_spawn_config_free = modWinPTY.NewProc("winpty_spawn_config_free")
winpty_spawn = modWinPTY.NewProc("winpty_spawn")
winpty_set_size = modWinPTY.NewProc("winpty_set_size")
winpty_free = modWinPTY.NewProc("winpty_free")
}