Index: locale.c =================================================================== RCS file: /home/wine/wine/dlls/kernel/locale.c,v retrieving revision 1.27 diff -u -r1.27 locale.c --- locale.c 1 Dec 2003 22:46:19 -0000 1.27 +++ locale.c 13 Dec 2003 17:52:11 -0000 @@ -742,6 +742,7 @@ static INT get_registry_locale_info( UINT flags, LPCWSTR value, LPWSTR buffer, INT len ) { DWORD size; + DWORD resultSize; INT ret; HKEY hkey; NTSTATUS status; @@ -761,8 +762,9 @@ return 0; } - status = NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, info, size, &size ); + status = NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, info, size, &resultSize ); if (status == STATUS_BUFFER_OVERFLOW && !buffer) status = 0; + if (!(flags & LOCALE_RETURN_NUMBER)) size = info_size + resultSize; if (!status) { @@ -772,7 +774,8 @@ { if (ret < len || !buffer) { - ((WCHAR *)info->Data)[ret] = '\0'; + if (buffer) + ((WCHAR *)info->Data)[ret] = '\0'; ret++; } else