to SupermanTm:如下函数返回指向文件内容缓冲区开始处的指针(对大文件尤为试用)
function MapFile(FileName: string): Pointer;
var
hFile, hMap: THandle;
FileSize: Integer;
os: OFSTRUCT;
begin
hFile := OpenFile(PChar(FileName), os, OF_READWRITE);
FileSize := GetFileSize(hFile, nil);
hMap := CreateFileMapping(hFile, nil, PAGE_READWRITE or SEC_COMMIT,
0, FileSize, PChar(FileName));
Result := MapViewOfFile(hMap, FILE_MAP_WRITE, 0, 0, FileSize);
CloseHandle(hFile);
end;