home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 24 / CDACTUAL24.iso / SHARE / os2 / edm2 / common / snippets / reboot.txt < prev    next >
Encoding:
Text File  |  1998-05-02  |  743 b   |  31 lines

  1.   #define SYSFUNC               0xD5
  2.   #define REBOOT                0xAB
  3.   #define REBOOTDEV             "\\DEV\\DOS$
  4.  
  5.   HFILE  hREBOOT;
  6.   ULONG  ulAction;
  7.  
  8.   rc = DosOpen(REBOOTDEV,
  9.                &hREBOOT,
  10.                &ulAction,
  11.                0L,
  12.                FILE_NORMAL,
  13.                FILE_OPEN,
  14.                OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
  15.                0L);
  16.   if (rc == 0)
  17.   {
  18.      DosDevIOCtl(hREBOOT,
  19.                  SYSFUNC,
  20.                  REBOOT,
  21.                  NULL,
  22.                  0L,
  23.                  NULL,
  24.                  NULL,
  25.                  0L,
  26.                  NULL);
  27.      DosClose(hDD);
  28.   }
  29.  
  30. Make sure that the functions DosOpen and DosDevIOCtl are prototyped.
  31.