I googled a lot and I couldn't find any answer to this problem...
I have a C++ console application that reads a 1GB SD card that fixes improperly closed files and writes the FAT table accordingly. The SD card is written at the beginning by a firmware in a custom made device. It worked OK up to Xp and stopped working in Win Vista/seven. I tried elevating privileges: within an administrator account type, I launched a cmd window using the "run as administrator" method but no luck. I also tried with a manifest asking for highestAvailable privileges but no luck.
I read in some post that “Windows Vista doesn't allow you to access the disks from user-mode processes at all. Does anybody know about any way of bypassing this behavior?
I’m working in a workaround however I would like to know if this is impossible or not
Edit:
This is my first post here so I don't quite understand about the linking issue... But I'm not reated to any spam at all... just asking in a comunity driven site :)
The code looks like
hDevice = CreateFile(buffer,GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_EXISTING,0,NULL);
I then read the BTB information from the SD and look for and improperly closed file.
Finally when trying to write to the SD
WriteFile(hDevice,buffer,SD_SECTOR_SIZE, &temp, 0)
I get an Access denied (error #5)
The string on CreateFile() is \.\g: as the g letter correspond to the SD card on my machine. All that works ok and as I said before it woks on XP. I also tried using: DeviceIoControl with FSCTL_LOCK_VOLUME but that gives a mem fault error.
Hope this helps to understand and thanks for any help