Ring3(User-Mode) 和Ring0(Kernel-Mode) 的关系使我们了解到为什么NT内核要稳定,少蓝屏.也使我们认识到Native API的强大作用. 使用Native API可以跳过而直接进入NTDLL并且非常Power,以下是代码. 可以实现秒关机,(记得它不会对打开的文件进行保存就会直接关机) Public Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal NewValue&, ByVal NewThread&, OldValue&) ' // Native API 关机 Public Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&) ' // ************* ' // API常数 ' // ************* ' // 关机权限 Public Const SE_SHUTDOWN_PRIVILEGE& = 19 ' // The Shutdown Actions Public Const SHUTDOWN& = 0 Public Const RESTART& = 1 Public Const POWEROFF& = 2 ' // 立即关机 Sub InstantlyShutDownPC() RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0 ' // 取得关机权限 NtShutdownSystem SHUTDOWN ' // 关机 End Sub VB版EXE文件.
04KOoMYg.zip
(3.65 KB, 下载次数: 39)
|