home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cidsam.zip / GETBOOTD.C < prev    next >
C/C++ Source or Header  |  1993-06-28  |  1KB  |  34 lines

  1.                   /*********************************/
  2.                   /*              NOTE             */
  3.                   /*                               */
  4.                   /* This sample code has been     */
  5.                   /* provided by IBM.  It is not   */
  6.                   /* warranted for any particular  */
  7.                   /* use or purpose.               */
  8.                   /*                               */
  9.                   /* IBM releases this code into   */
  10.                   /* the public domain.  You may   */
  11.                   /* use it, modify it, or         */
  12.                   /* incorporate it into other     */
  13.                   /* products without restriction. */
  14.                   /*********************************/
  15. /* Returns an integer in the range 1 - 32 indicating the drive from which */
  16. /* the system was booted.  A: = 1, B: = 2, C: = 3, etc.                   */
  17.  
  18. #define INCL_DOSFILEMGR
  19. #define INCL_DOSMISC
  20. #include <os2.h>
  21.  
  22. int main()
  23. {
  24.    UINT buf, rc;
  25.  
  26.  
  27.    rc = DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, 
  28.                         (PVOID)&buf, sizeof(UINT));
  29.    if (rc)
  30.      buf = 0;
  31.  
  32.    return (buf);
  33. }
  34.