Re: writeable file mapping
- From: "William DePalo [MVP VC++]" <willd.no.spam@xxxxxxxx>
- Date: Fri, 12 May 2006 13:48:15 -0400
"Henry Townsend" <henry.townsend@xxxxxxxx> wrote in message
news:vZidnfEUectVXvnZRVn-jg@xxxxxxxxxxxxxx
I'm trying to do something which should be basic but doesn't seem to be
documented. I need to map a file into memory and be able to modify the
mapping while being sure I don't modify the file itself. On Unix this is
done by setting mmap flags = MAP_PRIVATE. On Windows there seems no
documented way to do it. ...I probably won't have write access to the
files and I certainly don't want to risk modifying them even if I do.
There are at least two possibilities.
The first is that you don't specify a file. If you use INVALID_HANDLE_VALUE
the section will be backed by the paging file. Then read your file into the
mapped section. Of course, there'd be a small window between its creation
and the time when the section has good data.
The second is that you copy the file to another one first.
Regards,
Will
.
- Follow-Ups:
- Re: writeable file mapping
- From: Ben Voigt
- Re: writeable file mapping
- Prev by Date: Re: CreateProcess parameter interception at NtCreateSection
- Next by Date: Re: GetCurrentProcessorNumber() for XP?
- Previous by thread: Re: DLL Loading Question
- Next by thread: Re: writeable file mapping
- Index(es):
Relevant Pages
|