RegSetValueExA/W: fixed REG_SZ string length handling for Win95.
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index c11af42..557da9b 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -640,7 +640,11 @@
{
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 @@
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++;