News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MapViewOfFile fails on large file

Started by Ghirai, April 02, 2006, 01:51:36 PM

Previous topic - Next topic

Ghirai

Hello,

This code:
invoke MapViewOfFile,eax,FILE_MAP_READ,0,0,0

fails on a ~10GiB file.

Any indea how to make it work?

Thanks.
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

asmfan

let win32.hlp be with you:)
just make a view of not entire file but definite size chunk...
Russia is a weird place

Ghirai

Yeah, i know ,i was hoping there's another way.

Thanks.

MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

asmfan

MMF is a great mechanism. but it has its advantages while file stays in RAM. if this chunk size is more than available free mem all advantages disparear - file goes to swapfile. i'd suggest you to check free memory status and then choose the MMF chunk size.(e.g 2/3 of free RAM)
Russia is a weird place

Evenbit

Quote from: Ghirai on April 02, 2006, 01:51:36 PM
Hello,

This code:
invoke MapViewOfFile,eax,FILE_MAP_READ,0,0,0

fails on a ~10GiB file.

Any indea how to make it work?

Thanks.


Take a look at the example that I posted here:

http://www.masmforum.com/simple/index.php?topic=3486.0;topicseen

It is written in HLA but should be clear enough for you to translate for other assemblers.

Nathan.