Archived

This topic is now archived and is closed to further replies.

Gorf_Rules

Question on GetLogicalDrives()

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites