kernel32: Implement registry mapping in GetPrivateProfileSectionNames().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-07-12 20:32:10 -05:00 committed by Alexandre Julliard
parent 9ed6d24ed8
commit 3c1ebfdf82
1 changed files with 16 additions and 1 deletions

View File

@ -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 );