title: System Error 0x5: CreateFileMapping()
body: <p>I wish to implement <strong>IPC using Named Shared Memory.</strong> </p>
  
  <p>To do this, one of the steps is getting a handle to a <strong>Mapping Memory Object</strong>, using <em>CreateFileMapping().</em> </p>
  
  <p>I do it exactly as MSDN website reccommends: <a href="http://msdn.microsoft.com/en-us/library/aa366551(v=VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa366551(v=VS.85).aspx</a>:</p>
  
  <pre><code>hFileMappingHandle = CreateFileMapping
      (
          INVALID_HANDLE_VALUE,      // use paging file
          NULL,                      // default security 
          PAGE_READWRITE,            // read/write access
          0,            // maximum object size (high-order DWORD) 
          256,            // maximum object size (low-order DWORD)  
          "Global\\MyFileMappingObject"          // name of mapping object
      ); 
  DWORD dwError = GetLastError();
  </code></pre>
  
  <p>However, the handle returned is always <strong>0x0</strong>, and the <em>System Error Code</em> returned is: <strong>0x5 (Access Denied.)</strong></p>
  
  <ul>
  <li>Only <strong>Named Memory Sharing</strong> desired (not file sharing).</li>
  <li><strong>Windows 7 x64</strong> bit OS</li>
  <li><strong>Administrator's</strong> user rights available</li>
  <li>Developed Application: 64bit Plug-In application <strong>(.dll)</strong></li>
  </ul>
  
  <p>Does anybody have the same experience, and a way to fix it, please? I use MSDN site as my reference, so I to not think, there is problem in the code.</p>