&gt; There&#39;s no need to use ntdll functions,<br><br>I submitted prior patches that did not use ntdll, there was a complaint about that approach since it had to push and pop the last error:<br><a href="http://www.winehq.org/pipermail/wine-devel/2008-April/064657.html">http://www.winehq.org/pipermail/wine-devel/2008-April/064657.html</a><br>
<br>&gt; last error doesn&#39;t matter on success, and if it does it should be set at the end of the function<br>
anyway (with test cases showing that it&#39;s really supposed to).<br>
<font color="#888888"><br></font>The very last test in &quot;test_profile_sections&quot; (an existing test) requires GetPrivateProfileSectionA to return S_OK (ERROR_SUCCESS).&nbsp; I originally submitted a patch that broke this test (plus exposed another problem, but we&#39;ll take one step at a time).&nbsp; There was a complaint about this, but it was a really long time ago so it&#39;d take me a while to find that email.&nbsp; Essentially, the write functions need to return the last error from before they were called (part 2/2 is a conformance test for this) and the get functions need to set the last error to ERROR_SUCCESS (as shown by an existing test, though it actually tests against the value-equivalent S_OK).<br>
<br>Erich Hoover<br><a href="mailto:ehoover@mines.edu">ehoover@mines.edu</a><br><br><div class="gmail_quote">On Fri, Apr 11, 2008 at 4:02 AM, Alexandre Julliard &lt;<a href="mailto:julliard@winehq.org">julliard@winehq.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">&quot;Erich Hoover&quot; &lt;<a href="mailto:ehoover@mines.edu">ehoover@mines.edu</a>&gt; writes:<br>

<br>
&gt; Description:<br>
&gt; &nbsp; &nbsp; Fixes incorrect file sharing mode in PROFILE_FlushFile and PROFILE_Open<br>
&gt; that result in WritePrivateProfileString failing under certain<br>
&gt; circumstances. &nbsp;This problem is specifically evident in the &quot;Thief: Deadly<br>
&gt; Shadows&quot; installer (demo and full), which writes an empty config file that<br>
&gt; later causes the game to crash (Bug #5024). This version is functionally<br>
&gt; equivalent to Attempt 2; however, it uses NtCreateFile so there is no need<br>
&gt; to push and pop the error code. &nbsp;This version also sets ERROR_SUCCESS, as<br>
&gt; opposed to S_OK, for Get* functions. &nbsp;Conformance test included in part 2.<br>
<br>
</div>There&#39;s no need to use ntdll functions, last error doesn&#39;t matter on<br>
success, and if it does it should be set at the end of the function<br>
anyway (with test cases showing that it&#39;s really supposed to).<br>
<font color="#888888"><br>
--<br>
Alexandre Julliard<br>
<a href="mailto:julliard@winehq.org">julliard@winehq.org</a><br>
</font></blockquote></div><br>