> any solution to this ?
What are you trying to accomplish? By default they operate as a disk
device so you can use the disk DeviceIO messages.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
For example, DeviceIoControl(hVol, IOCTL_SFFDISK_DEVICE_COMMAND, structure of SFFDISK_DEVICE_COMMAND_DATA, ...)
Here comes the problem:
In SFFDISK_DEVICE_COMMAND_DATA structure in sffdisk.h, one field "Command" of enumeration type SFFDISK_DCMD indicate "the kind of action" to be performed.
This field could be
SFFDISK_DC_GET_VERSION,
SFFDISK_DC_LOCK_CHANNEL,
SFFDISK_DC_UNLOCK_CHANNEL,
SFFDISK_DC_DEVICE_COMMAND
For the three former cases, DeviceIoControl() works correctly, but for the later one, it always fails with errorce 5 (access denied)
This user-mode application is run under "Administrator" logon session.
I tried to clear DACL of this SD card such that everyone has fully access to this memory card.
But DeviceIoControl() still terminates with ERROR_ACCESS_DENIED.
Accroding to MSDN cc500400,
Handle to Logical and Physical disk drives might be different. I tried both cases but DeviceIoControl() still does not function.
Any one could help this ?
> But DeviceIoControl() still terminates with ERROR_ACCESS_DENIED.
>
> Accroding to MSDN cc500400,
> Handle to Logical and Physical disk drives might be different. I tried both cases but DeviceIoControl() still does not function.
How are you opening the device handle, as a drive letter or a volume?
You may get different results with:
CreateFile("\\.\PhysicalDrive2" ...
vs
CreateFile("\\.\X:" ...
Also you may have different results (due to different device permissions)
on Vista vs XP. I'm no expert on SD memory devices unfortunately.