Search code examples
windows-cesd-cardioctl

IOCTL_DISK_GET_STORAGEID WinCE vs Linux difference?


I'm trying to match a function from a WinCE program in Linux.

The function uses a WinCE call zu output the SD cards identifier.

but the problem is that the WINCE function outputs

0280XXXXXX as as serial number - whereas I get the same number on linux in /sys/block/mmcblk0/device/serial but the first byte (02) is missing (output is 80XXXXXX)

Does anyone that knows wince good know where the IOCTL_DISK_GET_STORAGEID function takes the first byte from?


Solution

  • The WinCE output does look a bit odd for an SD card.

    Assuming your WinCE device is using the standard Microsoft SD card driver, the serial number is taken from the card's CID (i.e. it is only 32 bits), and is formatted as %08X when the STORAGE_IDENTIFICATION struct is generated by the driver.

    So unless there's an error in the program you're using to obtain the serial number, my guess would be that the WinCE device uses a custom SD card driver (e.g. one that combines the manufacturer ID and serial number, or one that simply has a bug).