> There's no need to use ntdll functions,

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:
http://www.winehq.org/pipermail/wine-devel/2008-April/064657.html

> last error doesn't matter on success, and if it does it should be set at the end of the function
anyway (with test cases showing that it's really supposed to).

The very last test in "test_profile_sections" (an existing test) requires GetPrivateProfileSectionA to return S_OK (ERROR_SUCCESS).  I originally submitted a patch that broke this test (plus exposed another problem, but we'll take one step at a time).  There was a complaint about this, but it was a really long time ago so it'd take me a while to find that email.  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).

Erich Hoover
ehoover@mines.edu

On Fri, Apr 11, 2008 at 4:02 AM, Alexandre Julliard <julliard@winehq.org> wrote:
"Erich Hoover" <ehoover@mines.edu> writes:

> Description:
>     Fixes incorrect file sharing mode in PROFILE_FlushFile and PROFILE_Open
> that result in WritePrivateProfileString failing under certain
> circumstances.  This problem is specifically evident in the "Thief: Deadly
> Shadows" installer (demo and full), which writes an empty config file that
> later causes the game to crash (Bug #5024). This version is functionally
> equivalent to Attempt 2; however, it uses NtCreateFile so there is no need
> to push and pop the error code.  This version also sets ERROR_SUCCESS, as
> opposed to S_OK, for Get* functions.  Conformance test included in part 2.

There's no need to use ntdll functions, last error doesn't matter on
success, and if it does it should be set at the end of the function
anyway (with test cases showing that it's really supposed to).

--
Alexandre Julliard
julliard@winehq.org