TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Rinat Sadretdinow
date: 1996-10-28 13:25:10
subject: reboot

Hello Paul!

 PE> Can someone please send me code that will do a reboot().

    HFILE  hf;
    ULONG  foo;

    /* make sure \OS2\BOOT\DOS.SYS is loaded in your CONFIG.SYS */
    APIRET rc = DosOpen("DOS$", &hf, &foo, 0L,
FILE_NORMAL, FILE_OPEN,
                        OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYNONE |
                        OPEN_FLAGS_FAIL_ON_ERROR, NULL);

    /* reset IFS cache and perform shutdown */
    rc = DosShutdown(0L);

    /* reboot the system */
    DosDevIOCtl(hf, 0xD5, 0xAB, NULL, 0, NULL, NULL, 0, NULL);

    /* close DOS$ just for good housekeeping, actualy not required */
    DosClose(hf);

Bye!
Rinat Sadretdinow                                              [Team OS/2]

---
* Origin: -= Thunder Bird =- +7 095 947 1209 10:00pm-08:00am (2:5020/620)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 5020/620 509 443 79 5100/8 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.