locked
How to read SD Card CID on Windows Mobile 5.0? RRS feed

  • Question

  • Hi! I have found several ways to read CID register, but all of them are suposed to work on Windows CE. I need to develop an application that works on Windows Mobile 5.0. Here is what I have found and what problems I have encountered:

     - Send CMD2 / CMD10 to SD card via IOCTL_SFFDISK_DEVICE_COMMAND of DeviceIoControl - it does compile, but I get error 87 (wrong parameter). Possibly I am doing something wrong, but it would be a shame to use such low level utility, don't you think?

     - Use IOCTL_DISK_GET_STORAGEID of DeviceIoControl (supposed to work for WindowsCE 3.0 or later) - my Windows Mobile 5.0 SDK lacks Diskio.h file

    EDIT: I managed to get around the lack of Diskio.h file. The thing is this command does not return CID but something called "serial number" which can be some kind of hashed CID, but can also be partitions serial, or file system's number. This is not what I need.

     - Use SDCardInfoQuery (supposed to work for WindowsCE 5.0 or later) - the most curios case. I have the header file that declares the function (<Sdcardddk.h>), but library that defines it (Sdcardlib.lib) is nowhere to be found! So it is present, but only partialy!

    I'm using Visual C++ 2008. Can anyone help me please with this?

    Monday, January 3, 2011 8:58 AM

Answers

  • Hi,

    I don't think this is achievable with windows Mobile 5. Pocket PC has no SD-specific APIs. So you'd have to talk to the driver
    directly which is different on every Pocket PC. Contact the manufacturer
    of your Pocket PC to see if they expose a way to do this.

    Also Check the thread bellow you might find something useful:

    http://forum.xda-developers.com/showthread.php?t=383884

    Thanks

    Binze


    Binze Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Bin-ze Zhao Thursday, January 6, 2011 5:39 AM
    Wednesday, January 5, 2011 7:12 AM