Lazarus
Installation => PDAs and Smartphones => Topic started by: AndieSphinx on April 18, 2007, 04:35:11 pm
-
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)
-
I've tried to port it to freepascal, but I'm stucked at IOCTL_DISK_GET_STORAGEID. I couldn't find such routine.
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
-
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 ?
-
which unit uses this inc ?
Windows.pas
-
Sure. But its included, and GetVolumeInformation still undefined :(
-
GetVolumeInformation is a function declared on C:\lazarus\fpc\2.0.4\source\fcl\netware\nwnit.pp.
-
The netware directory isn´t for windows operating system AFAIK
To see who includes redef.inc and defines.inc do another search, this time for {$include defines.inc} or similar
-
I have this links in my favorite but not tested yet.
http://www.pocketpcdn.com/articles/serial_number2002.html
http://www.pocketpcdn.com/articles/serial_number.html
-
sekel: I've found the {$i defines.inc} line in the ...\units\arm-wince\windows.pp, \rtl\windows.o, .ppu files. I tought, that this unit (windows) will recognize the GetVolumeInformation, but unfortunately, it doesn't. I even can't find such function in the windows unit. :( I don't know, how could I proceed further.
zaher: Thanx for the sources, my only problem, that these must be ported to FP, and I'm a bit weak in C, so I think, I will need an already pascalized code :(
-
Good afternoon. Please help. How to get the ID SD Card?