I like to be able to modify the content of "pBuf" without modifying the content of the file. what would be the options, if that would be possible at all?.
pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
highDWordVal,
lowDWordVal,
BUF_SIZE1); //BUF_SIZE);

Recommended Answers

All 2 Replies

You need to create a 'copy on write' view.

Open the file for read access: CreateFile( ...., GENERIC_READ, .... ) ; Create the FileMapping for read access: CreateFileMapping( ....., PAGE_READONLY, ..... ) ; Create a copy-on-write view: MapViewOfFile( ......, [b]FILE_MAP_COPY[/b], ..... ) ; Unix: mmap( ...., PROT_READ|PROT_WRITE, [b]MAP_PRIVATE[/b], .... ) ;

hi,
Now , i need , to modify the content of buffer (pBuf) and the content of the mapped file. mapped file has to take and save the changes done to the buffr (pBuf). What would be the flags?.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.