Some work on supporting Windows

This commit is contained in:
AlexSSD7 2023-08-28 11:35:57 +02:00
commit 2f1d4ae60d
9 changed files with 109 additions and 19 deletions

View file

@ -0,0 +1,19 @@
// go:build windows
package vm
import (
"fmt"
"os/exec"
"syscall"
)
func prepareVMCmd(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
}
}
func terminateProcess(pid int) error {
return exec.Command("TASKKILL", "/T", "/F", "/PID", fmt.Sprint(pid)).Run()
}