home *** CD-ROM | disk | FTP | other *** search
- /* ____________________________________________________________________
-
- GetBootDrive - REXX
- Copyright (C) 1993 Bruce E. Högman. All Rights Reserved.
- This program is dedicated to the Public Domain by the author.
-
- Function: GetBootDrive returns the letter of the drive used to
- boot the system. It uses DosQuerySysInfo to return the boot drive
- number from OS/2.
- ____________________________________________________________________
- */
- #define INCL_DOSFILEMGR
- #define INCL_RXFUNC
- #include <rexxsaa.h>
- #include <os2.h>
- static unsigned long const DataBufLen=16;
- static unsigned char const DriveLtr[28]="0ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- RexxFunctionHandler GetBootDrive;
- ULONG GetBootDrive(
- PUCHAR Name, /* name of the function */
- ULONG Argc, /* number of arguments */
- RXSTRING Argv[], /* list of argument strings */
- PSZ Queuename, /* current queue name */
- PRXSTRING Retstr) /* returned result string */
- { ULONG rc; /* Return code of function */
- CHAR DataBuf[16]=""; ULONG *pBoot=(ULONG *) DataBuf;
- rc = DosQuerySysInfo( 5,5, DataBuf, DataBufLen);
- Retstr->strlength=1;
- *(Retstr->strptr)=DriveLtr[*pBoot];
- return 0; /* successful completion */
- }