From: chrkon on
Hello everybody,
our software (c# on .CF) must handle different sd cards. So I need a SD card
specific information to identify a SD card.

My first idea was to use "IOCTL_STORAGE_GET_DEVICEID" via P/Invoke
(DeviceIoControl).
This works fine on a Windows Mobile 5 Hardware (Archer, Juniper Systems).
Unfortunatedly our customers have still older handheld hardware (Panasonic
CF-P1 with Pocket PC 2002). On these devices calling the DeviceIoControl
funktion with the "... _GET_DEVICEID" parameter fails with SD cards (Error
0x57 - wrong parameter). On the same system the function will work with
CF-Cards. So I assume, that this is an issue of the device. But I have no
chance to get a patch from Panasonic for this (old device).

So I have to find an other way to identify the different SD cards.
(I don't want to create additional files, because it would be possible to
exchange these files manually between the cards.)

My second idea was to use the Volume ID of the SD Card. Most SD Cards use
the FAT Filesystem. And this filesystem has an ID. You can see it if you call
the "dir" command on the comand shell. This information will be changed if
the SD card is formatted, but for our needs it is OK.
On the desktop PC there is the API call "GetVolumeInformation" which deliver
this information. But I have not found something like this for mobile
systems.

Does anybody know how I can read this ID?
A different way to get a "SD card specific ID" would fine, too.

Kind regards,
Christof Konstantinopoulos

(Dortmund, Germany)


From: davidknechtges on
On Jun 23, 9:28 pm, chrkon <chr...(a)discussions.microsoft.com> wrote:
> Hello everybody,
> our software (c# on .CF) must handle different sd cards. So I need a SD card
> specific information to identify a SD card.
>
> My first idea was to use "IOCTL_STORAGE_GET_DEVICEID" via P/Invoke
> (DeviceIoControl).
> This works fine on a Windows Mobile 5 Hardware (Archer, Juniper Systems).
> Unfortunatedly our customers have still older handheld hardware (Panasonic
> CF-P1 with Pocket PC 2002). On these devices calling the DeviceIoControl
> funktion with the "... _GET_DEVICEID" parameter fails with SD cards (Error
> 0x57 - wrong parameter). On the same system the function will work with
> CF-Cards. So I assume, that this is an issue of the device. But I have no
> chance to get a patch from Panasonic for this (old device).
>
> So I have to find an other way to identify the different SD cards.
> (I don't want to create additional files, because it would be possible to
> exchange these files manually between the cards.)
>
> My second idea was to use the Volume ID of the SD Card. Most SD Cards use
> the FAT Filesystem. And this filesystem has an ID. You can see it if you call
> the "dir" command on the comand shell. This information will be changed if
> the SD card is formatted, but for our needs it is OK.
> On the desktop PC there is the API call "GetVolumeInformation" which deliver
> this information. But I have not found something like this for mobile
> systems.
>
> Does anybody know how I can read this ID?
> A different way to get a "SD card specific ID" would fine, too.
>
> Kind regards,
> Christof Konstantinopoulos
>
> (Dortmund, Germany)

How about the API GetStoreInfo? You can get the device name and store
name from that.

Would that work?

David
From: chrkon on
Hello David,

many thanks for your reply.
I didn't know anything about the GetStore API before. So I have take a look
to the MSDN description. Unfortunatedly you only get the Names. I assume,
that both informations are equal if you use two SD Cards from one vendor.

But I have not tested it. To use P/Invoke I have to implement the signature
of this function, but I don't know in which .dll I will find this GetStore /
OpenStore function.

Kind regards,

Christof



"davidknechtges" wrote:

> On Jun 23, 9:28 pm, chrkon <chr...(a)discussions.microsoft.com> wrote:
> > Hello everybody,
> > our software (c# on .CF) must handle different sd cards. So I need a SD card
> > specific information to identify a SD card.
> >
> > [... removed by chrkon (repost should be short) ...]
> >
> > Does anybody know how I can read this ID?
> > A different way to get a "SD card specific ID" would fine, too.
> >
> > Kind regards,
> > Christof Konstantinopoulos
> >
> > (Dortmund, Germany)
>
> How about the API GetStoreInfo? You can get the device name and store
> name from that.
>
> Would that work?
>
> David
>

From: chrkon on
Hello David,

many thanks for your reply. Until now I have not heard anything about this
GetStoreInfo API. So I take a look into the MSDN.
As you wrote, you get back the device name and the store name, but I assume,
that I will receive equal values if I use two different SD cards from the
same vendor. So this way is no solution for me.

I have not tested this function, because I don't know in which .dll I will
find it. To use P/Invoke I have to know this.

Kind regards,
Christof

"davidknechtges" wrote:

> On Jun 23, 9:28 pm, chrkon <chr...(a)discussions.microsoft.com> wrote:
> > Hello everybody,
> > our software (c# on .CF) must handle different sd cards. So I need a SD card
> > specific information to identify a SD card.

[... some parts removed by chrkon, reply should be small :-) ... ]

> > Does anybody know how I can read this ID?
> > A different way to get a "SD card specific ID" would fine, too.
> >
> > Kind regards,
> > Christof Konstantinopoulos
> >
> > (Dortmund, Germany)
>
> How about the API GetStoreInfo? You can get the device name and store
> name from that.
>
> Would that work?
>
> David
>
From: Simon Hart [MVP] on
see if this helps:
http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/thread/9a8219032ec9a876/8934f9549c5d7e63?lnk=st&q=sd+card+id+pocket+pc&rnum=6#8934f9549c5d7e63

--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"chrkon" wrote:

> Hello everybody,
> our software (c# on .CF) must handle different sd cards. So I need a SD card
> specific information to identify a SD card.
>
> My first idea was to use "IOCTL_STORAGE_GET_DEVICEID" via P/Invoke
> (DeviceIoControl).
> This works fine on a Windows Mobile 5 Hardware (Archer, Juniper Systems).
> Unfortunatedly our customers have still older handheld hardware (Panasonic
> CF-P1 with Pocket PC 2002). On these devices calling the DeviceIoControl
> funktion with the "... _GET_DEVICEID" parameter fails with SD cards (Error
> 0x57 - wrong parameter). On the same system the function will work with
> CF-Cards. So I assume, that this is an issue of the device. But I have no
> chance to get a patch from Panasonic for this (old device).
>
> So I have to find an other way to identify the different SD cards.
> (I don't want to create additional files, because it would be possible to
> exchange these files manually between the cards.)
>
> My second idea was to use the Volume ID of the SD Card. Most SD Cards use
> the FAT Filesystem. And this filesystem has an ID. You can see it if you call
> the "dir" command on the comand shell. This information will be changed if
> the SD card is formatted, but for our needs it is OK.
> On the desktop PC there is the API call "GetVolumeInformation" which deliver
> this information. But I have not found something like this for mobile
> systems.
>
> Does anybody know how I can read this ID?
> A different way to get a "SD card specific ID" would fine, too.
>
> Kind regards,
> Christof Konstantinopoulos
>
> (Dortmund, Germany)
>
>