kernel32: Consistify allocation behavior with FormatMessageA/W.
This commit is contained in:
parent
8e20322578
commit
fcdd0d3040
@ -752,8 +752,7 @@ DWORD WINAPI FormatMessageW(
|
|||||||
TRACE("-- %s\n",debugstr_w(target));
|
TRACE("-- %s\n",debugstr_w(target));
|
||||||
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
|
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
|
||||||
/* nSize is the MINIMUM size */
|
/* nSize is the MINIMUM size */
|
||||||
DWORD len = strlenW(target) + 1;
|
*((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT, max(nSize, talloced)*sizeof(WCHAR));
|
||||||
*((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,len*sizeof(WCHAR));
|
|
||||||
strcpyW(*(LPWSTR*)lpBuffer, target);
|
strcpyW(*(LPWSTR*)lpBuffer, target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user