I googled a lot and did not find an answer to this problem ...
I have a C ++ console application that reads a 1 GB SD card that fixes improperly closed files and writes a FAT table accordingly. The SD card is initially recorded by firmware in a custom device. It worked fine until Xp and stopped working in Win Vista / seven. I tried to elevate privileges: in the administrator account type, I launched the cmd window using the "run as administrator" method, but no luck. I also tried with a manifest asking for highAvailable privileges, but no luck.
In some article, I read that โWindows Vista does not allow you to access disks from user-mode processes at all. Does anyone know of any way around this behavior?
Im 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 the problem of linking ... But I am not attached to any spam at all ... just asking on a site related to the community :)
The code looks like
hDevice = CreateFile(buffer,GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_EXISTING,0,NULL);
Then I read BTB information from SD and searched and closed the file incorrectly.
Finally, when trying to write to SD
WriteFile(hDevice,buffer,SD_SECTOR_SIZE, &temp, 0)
I get access denied (error # 5)
The line in CreateFile () is \. \ G: since the letter g corresponds to the SD card on my machine. Everything that works fine, and, as I said, this happens on XP. I also tried using: DeviceIoControl with FSCTL_LOCK_VOLUME, but this gives a memory error error.
Hope this helps to understand and thank for any help.