#include <OS2.h>
#include <Stdio.h>
#include <String.h>

#define Run int main
#define Say printf

#define const struct /*cs-data-types*/
#define set enum class /*cs-values*/

/* * */

set SCANNER
{
  MAX_DRIVES       = 32,
  SHIFT_TO_DRIVE_A = 65
};

/* * */

Run ()
{
  ULONG Current_drive = 0; ULONG Drive_map = 0; 
  DosQueryCurrentDisk (&Current_drive, &Drive_map);

  ULONG Drives[SCANNER::MAX_DRIVES] = {0};

  {
    for (INT Drive_number = 0; Drive_number < SCANNER::MAX_DRIVES; Drive_number ++)
    {
      ULONG Drive_bit = 1 << Drive_number;

      if (Drive_map & Drive_bit) Drives[Drive_number] = 1;
    }
  }

  {
    for (INT Drive_number = 0; Drive_number < SCANNER::MAX_DRIVES; Drive_number ++)
    {
      if (Drives[Drive_number]) 
      {
        BYTE Drive_letter[] = { Drive_number + SCANNER::SHIFT_TO_DRIVE_A, 0 };

        Say ("Found: %s:" "\r\n", Drive_letter);
      }
    }
  }

  return 0;
}