Is there a way to read the bytes directly from the harddrive? I mean the FS, dirt, "deleted" stuff and everything.
Is there a way to read the bytes directly from the harddrive? I mean the FS, dirt, "deleted" stuff and everything.
This looks promising:
http://support.microsoft.com/kb/100027
gg
GetLastError after a failed call to DeviceIoControl returns 5 (access denied).
How do I get permission to access the harddrive?
I am running the program under an admin account.
Last edited by Yarin; 03-27-2008 at 12:33 PM.
You must also not have mounted the drive. So if you are trying to access a drive that you can "see" in Windows, it's not going to allow you access.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
>> Are you on Vista, where "administrator" isn't really "administrator" anymore?
No, XP. But tell more about this.
>> You must also not have mounted the drive. So if you are trying to access a drive that you can "see" in Windows, it's not going to allow you access.
Okay, that's probably it, I'll try doing that first.
>> And what IOCTL are you attempting?
DISK_GET_DRIVE_LAYOUT
You know about UAC, right?
It means then unless the application asks for admin privileges, you don't have them. This is true for administrator accounts, too.
So running your app with UAC enabled on Vista would guarantee failure because you would be running it as a limited user unless you specified in the manifest to run it as admin or disabled UAC.
Access it through a system service, they run in session 0 if installed form the admin acount. Don't use vista, they broke a lot of the security stuff in an effort to make it harder to write applications that perform useful work.
I found another way to enumerate the partitions, but now when I use CreateFile on "\\.\C:", ReadFile failed. It seems I can't do it like that. When I said read raw from the hd, I literally meant read EVERYTHING, like a disk defragmentor.