[PATCH 2/2] kernel32/profile: Interpret NULL filename argument as "win.ini".

Carlos Rivera carlos at superkaos.org
Fri Sep 4 15:42:46 CDT 2020


When trying to access the filename mapping from IniFileMapping,
if NULL is given as a filename, try to find the mapping of "win.ini".
Just as PROFILE_Open looks for "win.ini" when looking for
a NULL filename.

Signed-off-by: Carlos Rivera <carlos at superkaos.org>
---
 dlls/kernel32/profile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 43b303fa25..c987c3f6b9 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -1028,6 +1028,9 @@ static HKEY open_file_mapping_key( const WCHAR *filename )
     static HKEY mapping_key;
     HKEY key;
 
+    if (!filename)
+        filename = wininiW;
+
     EnterCriticalSection( &PROFILE_CritSect );
 
     if (!mapping_key && RegOpenKeyExW( HKEY_LOCAL_MACHINE, mapping_pathW, 0, KEY_WOW64_64KEY, &mapping_key ))
-- 
2.28.0




More information about the wine-devel mailing list