"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).