|
|
@@ -199,6 +199,7 @@ var (
|
|
|
procSetPriorityClass = modkernel32.NewProc("SetPriorityClass")
|
|
|
procGetPriorityClass = modkernel32.NewProc("GetPriorityClass")
|
|
|
procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject")
|
|
|
+ procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent")
|
|
|
procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW")
|
|
|
procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW")
|
|
|
procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW")
|
|
|
@@ -2146,6 +2147,18 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) {
|
|
|
+ r1, _, e1 := syscall.Syscall(procGenerateConsoleCtrlEvent.Addr(), 2, uintptr(ctrlEvent), uintptr(processGroupID), 0)
|
|
|
+ if r1 == 0 {
|
|
|
+ if e1 != 0 {
|
|
|
+ err = errnoErr(e1)
|
|
|
+ } else {
|
|
|
+ err = syscall.EINVAL
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) {
|
|
|
r1, _, e1 := syscall.Syscall(procDefineDosDeviceW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)))
|
|
|
if r1 == 0 {
|