RegSetValueExA/W: fixed REG_SZ string length handling for Win95.

oldstable
Alexandre Julliard 2001-04-10 21:30:24 +00:00
parent de962afa56
commit 918da64ae2
1 changed files with 10 additions and 2 deletions

View File

@ -640,7 +640,11 @@ DWORD WINAPI RegSetValueExW( HKEY hkey, LPCWSTR name, DWORD reserved,
{
UNICODE_STRING nameW;
if (count && is_string(type))
if (GetVersion() & 0x80000000) /* win95 */
{
if (type == REG_SZ) count = (strlenW( (WCHAR *)data ) + 1) * sizeof(WCHAR);
}
else if (count && is_string(type))
{
LPCWSTR str = (LPCWSTR)data;
/* if user forgot to count terminating null, add it (yes NT does this) */
@ -663,7 +667,11 @@ DWORD WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD type,
WCHAR *dataW = NULL;
NTSTATUS status;
if (count && is_string(type))
if (GetVersion() & 0x80000000) /* win95 */
{
if (type == REG_SZ) count = strlen(data) + 1;
}
else if (count && is_string(type))
{
/* if user forgot to count terminating null, add it (yes NT does this) */
if (data[count-1] && !data[count]) count++;