【VB声明】
Private Declare Function SetThreadPriority Lib "kernel32" Alias "SetThreadPriority" (ByVal hThread As Long, ByVal nPriority As Long) As Long
【说明】
设定线程的优先级别
【返回值】
Long,非零表示成功,零表示失败。会设置GetLastError
【备注】
线程的优先级同进程的优先级类组合在一起就决定了线程的实际优先级
【参数表】
hThread -------- Long,线程句柄
nPriority ------ Long,返回带有THREAD_PRIORITY_???前缀的某个函数,它定义了线程的优级。
实例:
Const THREAD_BASE_PRIORITY_IDLE = -15
Const THREAD_BASE_PRIORITY_LOWRT = 15
Const THREAD_BASE_PRIORITY_MIN = -2
Const THREAD_BASE_PRIORITY_MAX = 2
Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
Const THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1)
Const THREAD_PRIORITY_ABOVE_NORMAL = (THREAD_PRIORITY_HIGHEST - 1)
Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
Const THREAD_PRIORITY_NORMAL = 0
Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
Const HIGH_PRIORITY_CLASS = &H80
Const IDLE_PRIORITY_CLASS = &H40
Const NORMAL_PRIORITY_CLASS = &H20
Const REALTIME_PRIORITY_CLASS = &H100
Private Declare Function SetThreadPriority Lib "kernel32" (ByVal hThread As Long, ByVal nPriority As Long) As Long
Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Private Declare Function GetThreadPriority Lib "kernel32" (ByVal hThread As Long) As Long
Private Declare Function GetPriorityClass Lib "kernel32" (ByVal hProcess As Long) As Long
Private Declare Function GetCurrentThread Lib "kernel32" () As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Sub Form_Load()
Dim hThread As Long, hProcess As Long
'retrieve the current thread and process
hThread = GetCurrentThread
hProcess = GetCurrentProcess
'set the new thread priority to "lowest"
SetThreadPriority hThread, THREAD_PRIORITY_LOWEST
'set the new priority class to "idle"
SetPriorityClass hProcess, IDLE_PRIORITY_CLASS
'print some results
Me.AutoRedraw = True
Me.Print "Current Thread Priority:" + Str$(GetThreadPriority(hThread))
Me.Print "Current Priority Class:" + Str$(GetPriorityClass(hProcess))
End Sub
GetCurrentThread:
【VB声明】
Private Declare Function GetCurrentThread Lib "kernel32" Alias "GetCurrentThread" () As Long
Private Declare Function GetCurrentThread Lib "kernel32" () As Long
Private Declare Sub ExitThread Lib "kernel32" (ByVal dwExitCode As Long)
Private Declare Function GetExitCodeThread Lib "kernel32" (ByVal hThread As Long, lpExitCode As Long) As Long
Private Sub Form_Load()
'Exit this thread
ExitThread GetExitCodeThread(GetCurrentThread, 0)
End Sub
试试吧,如果不行的话,最好自己研究研究DDK,很明显这已经超出了vb的范围,或者联系一下变速齿轮的作者,问问他,是怎么利用系统漏洞,获取系统0层权限的。