Use GetLogicalDrives, which returns a DWORD that's a bitmask telling which drive letters are assigned. Bit 0 is drive A, bit 1 is drive B, and so on.