home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9303 / asmtrick / ws.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-03  |  1.0 KB  |  33 lines

  1. /*========================================================*/
  2. /*                          WS.C                          */
  3. /*           (C) 1993 Tilo Batsch & DMV-Verlag            */
  4. /*         Auslösen eines Warmstarts unter OS/2           */
  5. /*========================================================*/
  6. #define INCL_NOCOMMON
  7. #define INCL_DOS
  8. #include <os2.h>
  9. #include <stdio.h>
  10.  
  11. int main (void)
  12. {
  13.   USHORT rc;
  14.   USHORT usAction;
  15.   HFILE hFile;
  16.  
  17.   /*     Nummer von \dev\dos$ für DosDevIOCtl holen       */
  18.   if (rc = DosOpen ("\\DEV\\DOS$", &hFile, &usAction,
  19.       0, 4, 1, 0x40, 0L))
  20.      printf("DosOpen: %u", rc);
  21.   else 
  22.   {
  23.     /*               Dateisystem herunterfahren           */
  24.     DosShutdown (0L);
  25.     /*     undokumentiert(!): Warmstart über /dev/dos$    */
  26.     if (rc = DosDevIOCtl (NULL, NULL, 0xAB, 0xD5, hFile))
  27.       printf("DosDevIOCtl: %u", rc);
  28.   }
  29. }
  30.  
  31. /*========================================================*/
  32. /*                      Ende von WS.C                     */
  33.