kernel32: Implement registry mapping in WritePrivateProfileStringW().

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:08 -05:00 committed by Alexandre Julliard
parent 7c4f2d5342
commit 73fc0a18a6
1 changed files with 17 additions and 0 deletions

View File

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