Signed-off-by: Zebediah Figura z.figura12@gmail.com --- 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 6525028bb4a..c051c91f5e5 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -1806,11 +1806,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 );