|
|
@@ -196,6 +196,8 @@ var (
|
|
|
procTerminateJobObject = modkernel32.NewProc("TerminateJobObject")
|
|
|
procSetErrorMode = modkernel32.NewProc("SetErrorMode")
|
|
|
procResumeThread = modkernel32.NewProc("ResumeThread")
|
|
|
+ procSetPriorityClass = modkernel32.NewProc("SetPriorityClass")
|
|
|
+ procGetPriorityClass = modkernel32.NewProc("GetPriorityClass")
|
|
|
procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW")
|
|
|
procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW")
|
|
|
procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW")
|
|
|
@@ -2105,6 +2107,31 @@ func ResumeThread(thread Handle) (ret uint32, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func SetPriorityClass(process Handle, priorityClass uint32) (err error) {
|
|
|
+ r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0)
|
|
|
+ if r1 == 0 {
|
|
|
+ if e1 != 0 {
|
|
|
+ err = errnoErr(e1)
|
|
|
+ } else {
|
|
|
+ err = syscall.EINVAL
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetPriorityClass(process Handle) (ret uint32, err error) {
|
|
|
+ r0, _, e1 := syscall.Syscall(procGetPriorityClass.Addr(), 1, uintptr(process), 0, 0)
|
|
|
+ ret = uint32(r0)
|
|
|
+ if ret == 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 {
|