本帖最后由 深山红叶__ 于 2014-8-5 16:49 编辑
- Private Declare Function RtlAdjustPrivilege Lib "ntdll.dll" (ByVal Privilege As Long, ByVal Enable As Long, ByVal CurrentThread As Long, Enabled As Long) As Long
- Private Declare Function NtSetInformationProcess Lib "NTDLL.DLL" (ByVal ProcessHandle As Long, ByVal ProcessInformationClass As Long, ByRef ProcessInformation As Any, ByVal lProcessInformationLength As Long) As Long
- Const ProcessBreakOnTermination = 29
- Private Sub Form_Load()
- Call RtlAdjustPrivilege(&H14, 1, 0, 0)'获取14号权限令牌
- Call NtSetInformationProcess (-1, ProcessBreakOnTermination, 1&, 4)'提升进程为关键进程
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Call NtSetInformationProcess (-1, ProcessBreakOnTermination, 0&, 4)'降低进程为普通进程
- End Sub
复制代码 |