Home > Back-end >  Why read the logical disk sector, the last about eight sectors cannot read out data
Why read the logical disk sector, the last about eight sectors cannot read out data

Time:04-08

Code roughly the following
Var
HDev: THandle;
Buf: an array of byte [0.. 511];
Dr: DWORD;
Lp: int64;
B: Boolean;
The begin
HDev:=CreateFile (' \ \ \ C: 'GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ or FILE_SHARE_WRITE, nil,
OPEN_EXISTING, 0, 0);
Lp:=$18 fffff000;
FileSeek (hDev, lp, FILE_BEGIN);
FillChar (buf, sizeof (buf), $AA);
B:=ReadFile (hDev, buf, 512, Dr, nil);
Dr:=GetLastError;
The CloseHandle (hDev);
FHexMemo. SetBuffer (Self, 0);
EnabledDebugPrivilege (false);
I C plate starts at 0 x18fffff000 out data, which is the last eight sector read out data, later found that other dish, too, is roughly the last eight sector read out data,
The diagram below, spectacular watershed, a large AA AA AA AA,,,, is can't read data, before the show 0 can be read, who know how to solve?

CodePudding user response:

Mend WinHEX, 0 x18fffff000 behind is data,

WinHEX under fill again at the end of the data, the end is 0 x18ffffffff, there are data,

Is 0 at the end of my program is x18ffffffff, but couldn't read the data, all is the initial value AAAAAAA...
  • Related