mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 18:59:21 +02:00
FpDebug: Windows, implement alternative "normal" file reading (via stream). On 32bit mapping an entire file into memory can fail, if not enough continuous memory is available.
This commit is contained in:
parent
5b84fae03d
commit
dc46e8ce2e
@ -338,6 +338,14 @@ begin
|
|||||||
FModulePtr := MapViewOfFile(FMapHandle, FILE_MAP_READ, 0, 0, 0);
|
FModulePtr := MapViewOfFile(FMapHandle, FILE_MAP_READ, 0, 0, 0);
|
||||||
if FModulePtr = nil
|
if FModulePtr = nil
|
||||||
then begin
|
then begin
|
||||||
|
if GetLastError = 8 then begin // not enough memory, use a stream instead
|
||||||
|
CloseHandle(FMapHandle);
|
||||||
|
FMapHandle := 0;
|
||||||
|
FList := TList.Create;
|
||||||
|
FStream := THandleStream.Create(AFileHandle);
|
||||||
|
inherited Create;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
raise Exception.Create('Could not map view: ' + IntToStr(GetLastOSError));
|
raise Exception.Create('Could not map view: ' + IntToStr(GetLastOSError));
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user