http://bugs.winehq.org/show_bug.cgi?id=5024
--- Comment #27 from Erich Hoover ehoover@mines.edu 2007-10-18 02:03:13 --- Created an attachment (id=8640) --> (http://bugs.winehq.org/attachment.cgi?id=8640) Testing the operation of CreateFile
However, that patch was not accepted, i don't remember exactly why.
Probably because CreateFile performs exactly the same under Wine as on Windows. The attached test sequence is a rather extensive test of opening the same file twice with different permissions. Success/Failure was established by running the test cases on Windows XP and this matches exactly with the results on Linux. I think a more exhaustive version of your profile test should be made and the same method should be applied in order to make sure everything works properly in all cases (by making your test more exhaustive it should be possible to deduce the permissions requested by WritePrivateProfileString).