<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - CreateFile fails with ERROR_SHARING_VIOLATION"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=69597">69597</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CreateFile fails with ERROR_SHARING_VIOLATION
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Thomas.Freitag@alfa.de
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=86175" name="attach_86175" title="CreateFile with FILE_SHARE_READ | FILE_SHARE_WRITE">attachment 86175</a> <a href="attachment.cgi?id=86175&action=edit" title="CreateFile with FILE_SHARE_READ | FILE_SHARE_WRITE">[details]</a></span>
CreateFile with FILE_SHARE_READ | FILE_SHARE_WRITE

On Windows 64 bit the CreateFile function fails with ERROR_SHARING_VIOLATION if
only opened with FILE_SHARE_READ, see i.e.
<a href="http://us.generation-nt.com/createfile-returning-error-sharing-violation-help-28503972.html">http://us.generation-nt.com/createfile-returning-error-sharing-violation-help-28503972.html</a>,
This can happen even if noone else has opened the file. Even if we don't want
to write, we need to open it with FILE_SHARE_READ | FILE_SHARE_WRITE. The
attached patch solves it.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>