home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / RB3731.ZIP / BOOTA.C next >
Text File  |  1992-04-17  |  2KB  |  56 lines

  1. /*
  2.  *  BOOTA:  A simple program to start a DOS Boot session under OS/2 2.0.
  3.  *          This program can be run from an OS/2 command prompt and it
  4.  *          then start to Boot DOS from the A: drive.
  5.  *
  6.  *  Last Modfied: 04/02/92
  7.  *
  8.  *  Author: Stacey Barnes
  9.  *  Modified: Jeff Muir
  10.  */
  11.  
  12. #define INCL_DOSSESMGR
  13. #define INCL_DOSMISC
  14. #include <os2.h>
  15.  
  16. /* messages used by BOOTA */
  17. PSZ pBootAMsg = "BOOTA: Booting DOS from A: Drive.\r\n";
  18. PSZ pBootSuccess = "Session started.\r\n";
  19. PSZ pBootFailure = "Session could not be started.\r\n";
  20.  
  21. STARTDATA startd;                  /* Session start information */
  22. USHORT    SessionID, ProcessID;    /* Session and Process ID for new session*/
  23.  
  24. void main(void)
  25. {
  26.   USHORT       rc;
  27.  
  28.   /* Print header message */
  29.   DosPutMessage(1,strlen(pBootAMsg),pBootAMsg);
  30.  
  31.   /* Init fields to Boot from A: drive */
  32.   startd.Length                   = sizeof(STARTDATA);
  33.   startd.Related                  = SSF_RELATED_INDEPENDENT;
  34.   startd.FgBg                     = SSF_FGBG_FORE;
  35.   startd.TraceOpt                 = SSF_TRACEOPT_NONE;
  36.   startd.PgmTitle                 = "Boot A: Drive";
  37.   startd.PgmName                  = NULL;
  38.   startd.PgmInputs                = NULL;
  39.   startd.TermQ                    = NULL;
  40.   startd.Environment              = "DOS_STARTUP_DRIVE=A:\0";
  41.   startd.InheritOpt               = SSF_INHERTOPT_PARENT;
  42.   startd.SessionType              = SSF_TYPE_VDM;
  43.  
  44.   /* Start the DOS Boot Session */
  45.   rc = DosStartSession( &startd, &SessionID, &ProcessID );
  46.  
  47.   /* Print out either Success or Failure message */
  48.   if(rc)
  49.     DosPutMessage(1,strlen(pBootFailure),pBootFailure);
  50.   else
  51.     DosPutMessage(1,strlen(pBootSuccess),pBootSuccess);
  52.  
  53. return;
  54. }
  55.  
  56.