Too many directories returned by storage card detection functions

R

Roberto

Hi all,
I have a Windows CE device on which I'm trying to detect the storage card
directory path.
I know that a way to discover it is to use OpenNetCF functions, that check
for Directory and Temporary attribute.

The problem is that on that device there are also other 2 directories with
that attributes, but I know that they aren't storage card directories (they
are called 'Backup' and 'Network' directories, and they are integrated in
the device OS image).

All the functions that I tried to use (OpenNetCF, FindFirstFlashCard as
explained in http://msdn2.microsoft.com/En-US/library/aa458874.aspx) return
also these other 2 directories, so I can't programmatically recognize the
storage card....also SHGetAutoRunPath function, when a storage card is not
inserted, return a path starting by '\Network\...'.

Is there any way to get only the real storage card path?
From Control Panel, there is a section called 'Storage Manager', and inside
that I can see as store info the main store and the storage card (when
inserted), is there a standard function that recognize the storage card,
discarding the 'Network' and 'Backup' folders?
 
G

Guest

If you look in the registry, you can get the profiles for the storage
manager:

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles]

You may be able to use that info to determine the storage card's name and
then look for that folder, though this might be fairly device-specific. Not
sure if that will end up being any better than just hard-coding the name in.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
R

Roberto

Thanks, at the end I solved mixing the information from
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles] with the list of
directories with Directory and Temporary attributes, it seems to work in the
devices I tested (Windows CE 5 / Mobile 2003 & 5).

I've seen that Douglas Boiling, in his Programming Windows CE.Net book,
checks the directories with that attributes, and then tries to check if that
directory can be opened as a volume (creating a file Vol:), but also that
method doesn't work (it is correct for Network directory, but it doesn't
check correctly the Backup folder), so I have to use the info from the
registry.

If you look in the registry, you can get the profiles for the storage
manager:

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles]

You may be able to use that info to determine the storage card's name and
then look for that folder, though this might be fairly device-specific.
Not sure if that will end up being any better than just hard-coding the
name in.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


Roberto said:
Hi all,
I have a Windows CE device on which I'm trying to detect the storage card
directory path.
I know that a way to discover it is to use OpenNetCF functions, that
check for Directory and Temporary attribute.

The problem is that on that device there are also other 2 directories
with that attributes, but I know that they aren't storage card
directories (they are called 'Backup' and 'Network' directories, and they
are integrated in the device OS image).

All the functions that I tried to use (OpenNetCF, FindFirstFlashCard as
explained in http://msdn2.microsoft.com/En-US/library/aa458874.aspx)
return also these other 2 directories, so I can't programmatically
recognize the storage card....also SHGetAutoRunPath function, when a
storage card is not inserted, return a path starting by '\Network\...'.

Is there any way to get only the real storage card path?
From Control Panel, there is a section called 'Storage Manager', and
inside that I can see as store info the main store and the storage card
(when inserted), is there a standard function that recognize the storage
card, discarding the 'Network' and 'Backup' folders?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top