home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / rebootc.zip / REBOOT.C
C/C++ Source or Header  |  1993-03-28  |  514b  |  27 lines

  1. #define INCL_DOS
  2. #include <os2.h>
  3. #define DOSS          "\\DEV\\DOS$"
  4. #define CATEGORY_DOSSYS 0xD5 
  5. #define FUNCTION_REBOOT 0xAB
  6. main()
  7. {
  8. SHORT rc ;
  9. HFILE hDD ;
  10. USHORT usAction ;
  11. rc = DosOpen ( DOSS, &hDD, &usAction,
  12.                0L, FILE_NORMAL,
  13.                FILE_OPEN, OPEN_SHARE_DENYNONE |
  14.                OPEN_ACCESS_READWRITE, 0L );
  15. if (!rc)
  16.    {
  17.    DosDevIOCtl ( NULL,
  18.               NULL,
  19.               FUNCTION_REBOOT,
  20.               CATEGORY_DOSSYS,
  21.               hDD );
  22.  
  23.    DosClose ( hDD );
  24.    }
  25. return 0 ;
  26. }
  27.