如何实现在硬盘上任何一个位置开始读取数据?偏移貌似有大小限制。
代码如下所示int main()
{
unsigned char buf[512]={0};
OVERLAPPED overlap;
long int i;
HANDLE hFile = CreateFile("\\\\.\\PhysicalDrive0",//\\\\.\\PhysicalDrive0..D://123.txt
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
0,//FILE_FLAG_OVERLAPPED,
NULL);
DWORD RSize=0;
overlap.Offset = i*512;
ReadFile(hFile, buf, 512, &RSize, &overlap);
//可将buf显示在某区域或写入另一个文件来检查读出是否正确
CloseHandle(hFile);
ReadMBR(buf,0,511);
}
overlap.Offset = i*512;这里是读取文件开始位置的偏移,但是貌似有大小限制,超过4个G左右就无法在正确的读取数据了,求教各位有什么办法可以解决?