阅读:1908回复:15
如何在driver中完成关闭或重启系统的操作
本人需要在driver中完成关闭系统(shutdown)或重启(restart)系统的操作,但查了很多资料没有结果,哪位高手给予指点一下,谢了
|
|
沙发#
发布于:2004-07-15 09:54
HalReturnToFirmware( );
|
|
板凳#
发布于:2004-07-15 12:04
能否说的具体些,最好加上code,谢了
|
|
地板#
发布于:2004-07-15 12:23
编译时提示这个函数没有定义
|
|
地下室#
发布于:2004-07-15 13:36
extern
NTHALAPI VOID HalReturnToFirmware ( IN FIRMWARE_REENTRY Routine ); FIRMWARE_REENTRY 是一个enum类型; |
|
5楼#
发布于:2004-07-15 14:12
这个函数是非正常关机的,每次系统重启的时候需要自检,这样
不符合程序的要求,能否帮助讲述一下zwshutdownsystem这个函数 |
|
6楼#
发布于:2004-07-15 14:21
FIRMWARE_REENTRY 的定义能否给出
|
|
7楼#
发布于:2004-07-15 14:39
这个函数是非正常关机的,每次系统重启的时候需要自检,这样 ZwShutdownSystem shuts down the system. NTSYSAPI NTSTATUS NTAPI ZwShutdownSystem( IN SHUTDOWN_ACTION Action ); Parameters Action The action to be performed after shutdown. Permitted values are drawn from the enumeration SHUTDOWN_ACTION. typedef enum _SHUTDOWN_ACTION { ShutdownNoReboot, ShutdownReboot, ShutdownPowerOff } SHUTDOWN_ACTION; Return Value Returns STATUS_SUCCESS or an error status, such as STATUS_PRIVILEGE_NOT_HELD. Related Win32 Functions ExitWindows(Ex), InitiateSystemShutdown. Remarks SeShutdownPrivilege is required to shut down the system. User-mode applications and services are not informed of the shutdown (drivers of devices that have registered for shutdown notification by calling IoRegisterShutdownNotification are informed). The system must have hardware support for power-off if the power-off action is to be used successfully. |
|
|
8楼#
发布于:2004-07-15 15:02
我按照你写的方法执行了ZwShutdownSystem,但系统没有反映,没有执行关闭或重启操作,不知为什么,是否需要设置权限什么的。
|
|
9楼#
发布于:2004-07-15 16:00
ZwShutdownSystem关机一样很粗鲁,每次也需要自检。
[编辑 - 7/15/04 by wwwllg] |
|
10楼#
发布于:2004-07-15 16:05
最粗鲁的,int 19h
|
|
11楼#
发布于:2004-07-15 16:18
尽管zwshutdownsystem也很粗鲁,但我仍然想知道怎么用它,请给予指点吧
|
|
12楼#
发布于:2004-07-15 16:19
尤其是为什么执行了zwshutdownsystem没有起作用
|
|
13楼#
发布于:2004-07-15 16:22
找到入口点执行就可以了。
|
|
14楼#
发布于:2004-07-15 16:47
麻烦说的具体点,怎么找啊
|
|
15楼#
发布于:2004-07-16 09:12
typedef enum _FIRMWARE_REENTRY {
HalHaltRoutine, HalPowerDownRoutine, HalRestartRoutine, HalRebootRoutine, HalInteractiveModeRoutine, HalMaximumRoutine } FIRMWARE_REENTRY, *PFIRMWARE_REENTRY; extern NTHALAPI VOID HalReturnToFirmware ( IN FIRMWARE_REENTRY Routine ); |
|