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

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


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

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

kernel32: Implement registry mapping in GetPrivateProfileSectionNames().

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, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index abd5429c8d..6d8d64fc81 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -1807,11 +1807,26 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size,
 					     LPCWSTR filename)
 {
     DWORD ret = 0;
+    HKEY key;
+
+    if ((key = open_file_mapping_key( filename )))
+    {
+        WCHAR *section;
+        DWORD i;
+
+        for (i = 0; (section = enum_key( key, i )); ++i)
+        {
+            lstrcpynW( buffer + ret, section, size - ret - 1 );
+            ret = min( ret + strlenW( section ) + 1, size - 1 );
+        }
+
+        RegCloseKey( key );
+    }
 
     RtlEnterCriticalSection( &PROFILE_CritSect );
 
     if (PROFILE_Open( filename, FALSE ))
-        ret = PROFILE_GetSectionNames(buffer, size);
+        ret += PROFILE_GetSectionNames( buffer + ret, size - ret );
 
     RtlLeaveCriticalSection( &PROFILE_CritSect );
 




More information about the wine-cvs mailing list