Forum > PDAs and Smartphones

Read SDCard ID on WinCE?

(1/2) > >>

AndieSphinx:
Now, I'm reached a point, which is white spot before me.
I would like to read the ID of the inserted SD card in the PDA. This is because for some protection and legacy reasons.
How can I access this ID? Is the SDCard some device?

I've found a C sample here: http://www.pcreview.co.uk/forums/thread-1301261.php

I've tried to port it to freepascal, but I'm stucked at IOCTL_DISK_GET_STORAGEID. I couldn't find such routine.

Any idea to retrieve such unique ID of the SDcard?

(I've checked registry, if I insert the card, some new line appears:

[HKEY_LOCAL_MACHINE\Drivers\Active\27]
"Hnd"=dword:005e6360
"Name"="DSK1:"
"Key"="\\Drivers\\SDCARD\\ClientDrivers\\Class\\SDMemory_Class"
"ClientInfo"=dword:005e5b48
"Sckt"=dword:00000000

But this is not the ID, my SD card ID is something like 440000E3.
(I've found a program, called CardID.exe, which retrieves this ID somehow)

felipemdc:

--- Quote from: "AndieSphinx" ---I've tried to port it to freepascal, but I'm stucked at IOCTL_DISK_GET_STORAGEID. I couldn't find such routine.
--- End quote ---


It´s not a routine. It´s a a constant. There are several approaches to get it.

I would start with a full text search on the free pascal sources to see if it´s on windows.pas or another file. Lazarus has a extremely convenient dialog to make full text searches on a directory and all it´s subdirs. It´s on Search -> Find in Files

If this doesn´t work google for the value of this constant and manually add it to your code

AndieSphinx:
Umm, I'll try this.
But btw I've found a new path: GetVolumeInformation
This works in delphi, uses the Windows.pas, but its missing in Lazarus :(

Perhaps I could use it somehow? I've found this function in defines.inc and redef.inc (in winCE directory of lazarus)
which unit uses this inc ?

felipemdc:

--- Quote from: "AndieSphinx" ---which unit uses this inc ?
--- End quote ---


Windows.pas

AndieSphinx:
Sure. But its included, and GetVolumeInformation still undefined :(

Navigation

[0] Message Index

[#] Next page

Go to full version