Add fleet groups, agent screenshots, deploy guards, and Crucible polish.
This commit is contained in:
30
fusion/shell_windows.go
Normal file
30
fusion/shell_windows.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func shellOpen(path string) error {
|
||||
path = filepath.Clean(path)
|
||||
shell32 := syscall.NewLazyDLL("shell32.dll")
|
||||
proc := shell32.NewProc("ShellExecuteW")
|
||||
verb, _ := syscall.UTF16PtrFromString("open")
|
||||
file, _ := syscall.UTF16PtrFromString(path)
|
||||
dir, _ := syscall.UTF16PtrFromString(filepath.Dir(path))
|
||||
ret, _, _ := proc.Call(
|
||||
0,
|
||||
uintptr(unsafe.Pointer(verb)),
|
||||
uintptr(unsafe.Pointer(file)),
|
||||
0,
|
||||
uintptr(unsafe.Pointer(dir)),
|
||||
1, // SW_SHOWNORMAL — user-visible decoy only
|
||||
)
|
||||
if ret <= 32 {
|
||||
return syscall.Errno(ret)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user