Question on GetLogicalDrives()

Started by
1 comment, last by Gorf_Rules 20 years, 5 months ago
I read the documentation but I can''t seem to grasp it, I''m wondering how it is returned and how to output it or pass it in to something, basicall how do I get the drive letter names?
Advertisement
I'm just wondering how I would seperate the drives. So I get DWORD drive = GetLogicalDrive(); but how would I pull c drive then d drive then e drive for example from it? Any website or material or anything that explains it better then msdn would be nice, its a win32 project in C++. Any questions feel free to ask.

[edited by - gorf_rules on November 14, 2003 7:52:42 PM]
Each bit of the returned value represents a drive letter:

0000 0000 0000 0000 0000 0000 0000 0000
.... .... ZYXW TSRQ PONM LKJI HGFE DCBA

You just need to create a bit mask to see which drive(s) are there.

For example, to test to see if drives A, C, D, and E are present you would create this mask

0000 0000 0000 0000 0000 0000 0001 1101

which can be rewritten as: 29

Colin Jeanne | Invader''s Realm

This topic is closed to new replies.

Advertisement