home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / reboot1.lzh / REBOOT.C < prev    next >
C/C++ Source or Header  |  1990-01-16  |  988b  |  33 lines

  1. #define INCL_BASE
  2. #define INCL_NOPM
  3. #include <os2.h>
  4.  
  5. #include <stdio.h>
  6.  
  7.  
  8. void main(void)
  9. {
  10.    HFILE hf;
  11.    USHORT usAction,retcode;
  12.  
  13.    retcode = DosOpen("BOOT$",                /* open reboot device  */
  14.        &hf,                                    /* address of device handle */
  15.        &usAction,                              /* action taken */
  16.        0L,                                     /* size of new file */
  17.        0,                                      /* normal file attribute */
  18.        1,                                      /* open existing file */
  19.        0x0011,                                 /* write-only, exclusive */
  20.        0L);                                    /* reserved */
  21.  
  22.    if (!retcode){
  23.       DosShutdown(0L);
  24.       DosDevIOCtl(0L,0L,0,0x80,hf);
  25.       puts("BOOT$ not functioning");
  26.    }
  27.    else{
  28.       puts("Failed to open BOOT$");
  29.       puts("Please make sure that BOOT.SYS is installed in your CONFIG.SYS");
  30.     }
  31. }
  32.  
  33.