Re: Организация мгновенного PowerOFF под Win2k (XP)
От: Alex Fedotov США  
Дата: 06.12.01 06:49
Оценка: 4 (1)
Здравствуйте FAngel, Вы писали:

FA>Не могу справится с задачей погашения питания под Windows2000 (XP).

FA>А необходимо это для аварийного погашения компа в случае останова кулера или перегрева камня...
FA>Обычный shutdown не устраивает абсолютно из-за своей тормознутости (15-60 сек.) и возможных зависонов.

Попробуй поиграть с ZwShutdownSystem:

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.
-- Alex Fedotov
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.