Bruno Jesus : kernel32: Avoid ini cache if file does not exist anymore.

Alexandre Julliard julliard at winehq.org
Wed Mar 28 12:47:05 CDT 2012


Module: wine
Branch: master
Commit: 40f0145d002404ca75c3f998437df1556df45677
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=40f0145d002404ca75c3f998437df1556df45677

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Wed Mar 28 02:30:27 2012 -0300

kernel32: Avoid ini cache if file does not exist anymore.

---

 dlls/kernel32/profile.c       |    2 +-
 dlls/kernel32/tests/profile.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 89b96a1..3d00c29 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -817,10 +817,10 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
                     CurProfile->LastWriteTime = LastWriteTime;
                 }
                 CloseHandle(hFile);
+                return TRUE;
             }
             else TRACE("(%s): already opened, not yet created (mru=%d)\n",
                        debugstr_w(buffer), i);
-            return TRUE;
         }
     }
 
diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index 745f3b5..211d0c6 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -504,7 +504,7 @@ static void test_profile_refresh(void)
     /* Cache must be invalidated if file no longer exists and default must be returned */
     SetLastError(0xdeadbeef);
     res = GetPrivateProfileInt(SECTION, KEY, 421, testfile);
-    todo_wine ok( res == 421 ||
+    ok( res == 421 ||
         broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */
         "Got %d instead of 421\n", res);
 }




More information about the wine-cvs mailing list