代码:info:=allocmem(32);
first_position:=(BpB.reserved_sector+BpB.num_of_fat*BpB.sector_per_fat) *BpB.bytes_per_sector;
FileSeek(hDeviceHandle,first_position,0);
if FileRead(hDeviceHandle,info[0],32)<>32 then
raise exception.Create('读数据错误');我想要实现的:从硬盘分区引导区的指定位置first_position开始,读取32个字节的内容到以info[0]起始的内存区域中。结果是:出现错误!经断点运行,发现FileRead的值为"inaccessible value",我很想知道出错原因,如何修正?
first_position:=(BpB.reserved_sector+BpB.num_of_fat*BpB.sector_per_fat) *BpB.bytes_per_sector;
FileSeek(hDeviceHandle,first_position,0);
if FileRead(hDeviceHandle,info[0],32)<>32 then
raise exception.Create('读数据错误');我想要实现的:从硬盘分区引导区的指定位置first_position开始,读取32个字节的内容到以info[0]起始的内存区域中。结果是:出现错误!经断点运行,发现FileRead的值为"inaccessible value",我很想知道出错原因,如何修正?
if FR<>32 then在查看FR的值试试。
参见:
http://blog.csdn.net/wendream/