Zebediah Figura : kernel32: Implement registry mapping in WritePrivateProfileStringW().

Alexandre Julliard julliard at winehq.org
Wed Jul 15 16:44:46 CDT 2020


Module: wine
Branch: master
Commit: 73fc0a18a693c179d676d38fe8cf0df8f7679ea9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=73fc0a18a693c179d676d38fe8cf0df8f7679ea9

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun Jul 12 20:32:08 2020 -0500

kernel32: Implement registry mapping in WritePrivateProfileStringW().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/profile.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 3e06543a66..27057e62f7 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -1473,6 +1473,9 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
 					LPCWSTR string, LPCWSTR filename )
 {
     BOOL ret = FALSE;
+    HKEY key;
+
+    TRACE("(%s, %s, %s, %s)\n", debugstr_w(section), debugstr_w(entry), debugstr_w(string), debugstr_w(filename));
 
     if (!section && !entry && !string) /* documented "file flush" case */
     {
@@ -1486,6 +1489,20 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
     }
     if (!entry) return PROFILE_DeleteSection( filename, section );
 
+    if (get_mapped_section_key( filename, section, entry, TRUE, &key ))
+    {
+        LSTATUS res;
+
+        if (string)
+            res = RegSetValueExW( key, entry, 0, REG_SZ, (const BYTE *)string,
+                                  (strlenW( string ) + 1) * sizeof(WCHAR) );
+        else
+            res = RegDeleteValueW( key, entry );
+        RegCloseKey( key );
+        if (res) SetLastError( res );
+        return !res;
+    }
+
     EnterCriticalSection( &PROFILE_CritSect );
 
     if (PROFILE_Open( filename, TRUE ))




More information about the wine-cvs mailing list