26 Jul
2006
26 Jul
'06
2:39 p.m.
"Benjamin Arai" <me(a)benjaminarai.com> writes:
+ str = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*size); + if (!str) + return E_OUTOFMEMORY; + size = GetLocaleInfoW(LOCALE_USER_DEFAULT,localeValue, str, size); + if (!size) { + ERR("GetLocaleInfo of 0x%lx failed in 2nd stage?!\n", localeValue); + HeapFree(GetProcessHeap(),0,str); + return HRESULT_FROM_WIN32(GetLastError()); + } + *pbstrOut = SysAllocString(str);
You should do the GetLocaleInfoW directly into the destination string instead of allocating another buffer. -- Alexandre Julliard julliard(a)winehq.org