SEC_COMMIT usefulness in CreateFileMapping API



Hi All,

I am trying to understand importance of SEC_COMMIT section attibute when
using CreateFileMapping API to share mapped file between two processes.

I am using hFile as INVALID_HANDLE_VALUE. which means no file is created in
filesystem, so file will will be mapped into memory directly. How can I
prevent this file frombeing paged out of memory and in case it is paged out,
will the OS save this somewhere on filesystem ? How will this work if I have
not given a valid file handle (basically no file exist in filesystem) ?

please help me understand this. I truly appreciate your time ...

thanks !

HANDLE CreateFileMapping(
HANDLE hFile,
LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
DWORD flProtect,
DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow,
LPCTSTR lpName
);

.



Relevant Pages

  • Re: Get my process to use the mapped file
    ... automatically use the memory in the file. ... I am trying to get my process to use my mapped file. ... hFile = CreateFile( ... something like 'memcpy' to get the DIB into the mapped area, ...
    (microsoft.public.windowsce.app.development)
  • Re: Get my process to use the mapped file
    ... automatically use the memory in the file. ... I am trying to get my process to use my mapped file. ... hFile = CreateFile( ... something like 'memcpy' to get the DIB into the mapped area, ...
    (microsoft.public.windowsce.app.development)
  • Re: Get my process to use the mapped file
    ... You should be using CreateFileForMapping, ... I am trying to get my process to use my mapped file. ... hFile = CreateFile( ... something like 'memcpy' to get the DIB into the mapped area, ...
    (microsoft.public.windowsce.app.development)