Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get SD card/IPSM name ??

82 views
Skip to first unread message

Rahul P. Shukla

unread,
Apr 3, 2008, 6:31:00 AM4/3/08
to
Hi,
In my application I have to detect programmatically SD card (if inserted)
and IPSM (if available in the device). I am using FindFirstStore,
GetStoreInfo, FindNextStore APIs but not getting the names of SD card and
IPSM.
Is there any other way to detect and get the name of inserted SD card and
IPSM ???

Thanks a lot …

JochenD

unread,
Apr 3, 2008, 8:21:00 AM4/3/08
to
Hi Rahul,

under Windows CE, normally the names of the SD Card / MMC card / USB
stick... folders are stored in the registry under the key:
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\...]

eg:
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory]
"Folder"="Storage Card SD"
...

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC]
"Folder"="Storage Card MMC"
...

It might be a possibility for you to retreive these names using the registry
API and then do a FindFirstFile() or something along these lines. For further
information about the registry key or the registry API you can consult the
Platform Builder help.

Best regards
-Jochen

Rahul P. Shukla

unread,
Apr 3, 2008, 8:44:01 AM4/3/08
to
Hello Jochen ...
I checked the device registry as u told ..but registry setting are
unaffected whether SD card is inserted or not. So I wont be able to know if
card is inserted or IPSM is present.

Well .... my problem is still there .. :)
Thanks for ur reply ....

- rahul

JochenD

unread,
Apr 3, 2008, 9:36:02 AM4/3/08
to
Hi Rahul,

the registry key ([HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\...])
doesn't tell you if a card is present or not, it does tell you however what
the name of the folder should be if a card is present. So once you find out
the name of the folder from that registy key, you can then do a search in the
root directory (e.g. FindFirstFile() API) to see if the card is present or
not. Again, this registry key is just a way of finding out what the name of
the folder must be if a storage card is pesent.

best regards

Rahul P. Shukla

unread,
Apr 3, 2008, 10:21:00 AM4/3/08
to
Yes you are right ....
with the help of this registry I could know about the name of SD card.
I am having some 3-4 types of devices and getting the common registry as
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMMC] to get the name of
SD crad.
Now I have to search for the location in registry which can give me the name
of IPSM.

I am still looking for some more way to know the SD card/IPSM name.

Thanks,
Rahul :)

Paul G. Tobey [eMVP]

unread,
Apr 3, 2008, 11:28:01 AM4/3/08
to
That's going to depend on the version of PSM. Maybe you should take a step
back and tell us *why* you want to do this. Why is it important to know
whether PSM is there or not?

Paul T.

"Rahul P. Shukla" <RahulP...@discussions.microsoft.com> wrote in message
news:4FC5FD1A-69AE-43CF...@microsoft.com...

>> > > > Thanks a lot .
>> > > >


BobZ

unread,
Apr 3, 2008, 6:00:37 PM4/3/08
to

I use FindFirstFile and relatives to look for the name of the root
folder, but that can vary. So I check for names that begin with
"IPSM", "Storage_", "Storage", "CF Card", "SD Card", and "Memory
Card". I don't check the whole string because the name can accumulate
a number (e.g., CF Card 2) if one card replaces another, or even if
one card is removed and reinserted.

For at least some, newer, platforms, FindFirstFlashCard will find
storage cards, but I don't use it. And I wonder whether it will find
IPSM.

>
>Thanks a lot …

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Rahul P. Shukla

unread,
Apr 4, 2008, 1:09:00 AM4/4/08
to
Hi Robert,
Acctually I was using the same way to detect SD card and I got the success
too .. :) This is a tricy way to find out SD cards ...... this formula may
fail some where ....I dont know where ....
So I was looking for some solid way to detect SD card and getting its name ...
Same way I am find the name of IPSM .. I am looking for any directry whish
hase TEMPORARY attribute .... And then filtering with the name of Flash File
Store, PSM, or any string containing FFS ... So here are chances too that my
code may fail on some specific hand held device which have IPSM with another
name ....

Thanks for the reply :)

- Rahul

Rahul P. Shukla

unread,
Apr 4, 2008, 1:13:01 AM4/4/08
to
Yes .. Sure I will tell ...
I have to perform some operations over IPSM of teh device ... Even I can say
that I have to test the IPSM for some file read/write and some file
execution...
So first I have to find out whether the device have IPSM or not, if yes then
what is the name of device ... As I replied to Robert, I am getting the name
of SD card and IPSM with some tricky way .. that may fail in some specific
devices ... So I was seeking for some "Solid" way ... :)

Paul G. Tobey [eMVP]

unread,
Apr 4, 2008, 11:32:39 AM4/4/08
to
Your code would fail on our devices in two different ways: 1. Some devices
mount PSM as the root of the filesystem, so you'd have to check "\", 2. The
other devices don't use PSM in the name of the filesystem folder (because
our users don't care what "PSM" is).

Paul T.

"Rahul P. Shukla" <RahulP...@discussions.microsoft.com> wrote in message
news:FC92AEA3-2A9C-4F03...@microsoft.com...

>> >Thanks a lot .

Paul G. Tobey [eMVP]

unread,
Apr 4, 2008, 11:31:12 AM4/4/08
to
So, let me rephrase what you're saying and see if I understand correctly.
"I am working in the test division of a company that ships several devices,
some of which use PSM for flash-based storage and some of which do not. I
need to run a test on the PSM filesystem, if it exists, but I need a way to
decide if it does exist" Yes? No? I still think that you're telling us
*how* you're trying to do things, rather than why. If you are a test guy
working on various devices, it seems to me that running the correct test for
the device you're testing is all you need. I suppose that you could do a
search in the registry for references to psmfsd.dll to decide yes/no on PSM
being present and then scan the registry near where you found that psmfsd
reference for possible names. I'm thinking that maybe the quick and simple
answer here is "Ask the user what folder he wants to have scanned."

Paul T.

"Rahul P. Shukla" <RahulP...@discussions.microsoft.com> wrote in message

news:A3F14B93-CDFB-4694...@microsoft.com...

Michel Verhagen (eMVP)

unread,
Apr 8, 2008, 2:43:33 PM4/8/08
to
You should have a look at FindFirstStore/NextStore.

Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
http://GuruCE.com
Consultancy, training and development services.


Paul G. Tobey [eMVP] wrote:

Rahul P. Shukla

unread,
Apr 21, 2008, 8:46:01 AM4/21/08
to
Yes, I did check FindFirstStore/NextStore. But I was not able to recognize
which one is SD card (with the name displayed by device) and which one is FFS.
I checked all the variables of STOREINFO structure, but couldn't get the
name and type of the storage. evertime API was saying the same DeviceType for
everthing found.

- Rahul

Paul G. Tobey [eMVP]

unread,
Apr 21, 2008, 11:51:13 AM4/21/08
to
Yes, that's a limitation. If you can't figure it out from the registry,
possibly in combination with the results of FindFirstStore/FindNextStore,
then you can't do it. There's no way that Windows CE enforces drivers to
indicate whether they are based on PSM or not! Windows CE knows nothing
about PSM, anyway; it's just another mass storage driver to it.

Paul T.

"Rahul P. Shukla" <RahulP...@discussions.microsoft.com> wrote in message

news:A7083696-98F2-4B1E...@microsoft.com...

0 new messages