Re: writeable file mapping

Tech-Archive recommends: Fix windows errors by optimizing your registry



"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


.



Relevant Pages

  • Re: Any way to capture stdcout output to memory?
    ... If I was able to modify the source I'd have it write to a memory buffer in ... clear that the platforms is Windows, not Unix, right? ... the stdout buffer (pointed to by one of the elements in the FILE ...
    (comp.lang.c)
  • Re: User Logon Request Is Rejected
    ... Wondering if the Load Hive method can be used to modify the HKLM part? ... Final option, consider repairing XP: http://www.webtree.ca/windowsxp/repair_xp.htm ... Windows XP Shell/User ... "ET Sherman" wrote in message ...
    (microsoft.public.windowsxp.general)
  • Re: Copying a kernel routine
    ... OH, lets see, you are going to modify the page table, but not the internal ... If you need a kernel like routine, design your own, but of course as I said ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: CHKDSK Ran on restart now I cant view files!
    ... I havent used or modified the drive (maybe windows has) I read that if I ... modify the contents the worst it will be to recover! ... The more you use the drive or modify data ... Windows will now check the disk. ...
    (microsoft.public.windowsxp.general)
  • [vim] Syntax Highlighting Takes a Holiday
    ... On the job I use RCS for version control under Windows. ... Quite often I begin to modify a file only to be warned it is read only. ... The problem I'm writing about is after the "edit" command, all the foreground colors change to either white or black, depending on the background, dark or light. ... endif endfunction. ...
    (comp.editors)