Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shut Down

Status
Not open for further replies.

testers

Programmer
Oct 8, 2001
1
GB
Hi. I'm trying to work out some C++ code that will enable me to shut down a computer without going through the normal shut down procedure. The reason for wanting to do this is to simulate a power-cut/brown-out. We are trying to test the stability of our software with un-predicted power loss to the server.

Any ideas on some code for this?

Thanks

Andy
 
use ExitWindows Ion Filipski
1c.bmp


filipski@excite.com
 
I don't think that will help his situation - he's trying to simulate a BAD shutdown if I read his question right. Some inline assembly might work though:
mov AH, 17h;
mov AL, 00h;//Cold reboot - 01h gives warm reboot
int 14h;
(I found this on Ralf Brown's interrupt list - very good reference for dirty low-level coding!)
 
OK - ignore that last post please...was for some other BIOS. However, it appearst that int 19h will give you a warm reboot. Also, if the system supports APM, then int 15h with AX = 5307h, BX = 0001h, CX = 0003h is a system shut down (if the power supply supports that!).
 
Please read my answer on thread thread116-100864.
You will find there posibilities of using both an announced or unannounced reboot or power-off.
It uses ExitWindowEx API.

HTH, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top