"Dmitry Timoshkov" dmitry@sloboda.ru writes:
From http://msdn.microsoft.com/library/psdk/winbase/filemap_79wn.htm
--- cut --- "To fully close a file-mapping object, an application must unmap all mapped views of the file-mapping object by calling UnmapViewOfFile, and close the file-mapping object handle by calling CloseHandle. The order in which these functions are called ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ does not matter. The call to UnmapViewOfFile is necessary because mapped views of ^^^^^^^^^^^^^^^ a file-mapping object maintain internal open handles to the object, and a file-mapping object will not close until all open handles to it are closed." --- cut ---
My patch is WRONG. MSDN says that until both CloseHandle and UnmapViewOfFile are called the file-mapping object still exists. This is wrong for NT but true for Win9x.
Why do you say it's wrong for NT? It seems perfectly correct: the mapping object exists as long as you have a handle to it, or some view of it is mapped (which keeps a handle internally, just like we do under Wine).
Do not confuse the file mapping object with mapped views; the doc only talks about the mapping object. Specific views of the object are unmapped by UnmapViewOfFile (at least under NT), even if this may not cause the mapping object to be deleted. This doesn't contradict the doc at all.