I've browsed through the CreateFile documentation... still wondering how should I use P/Invoke to call CreateFile and to read the boot sector, to display out the .MBR?
Any reference code for this portion? Thank you in advance!
I've browsed through the CreateFile documentation... still wondering how should I use P/Invoke to call CreateFile and to read the boot sector, to display out the .MBR?
Any reference code for this portion? Thank you in advance!
To expand on Baget's answer, you can call CreateFile
like this:
hFile = CreateFile("\\\\.\\physicaldrive0",
GENERIC_READ | FILE_SHARE_READ,
0,
OPEN_EXISTING,
0,
0);