Commit 6111ee61 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

Return the size of the needed resource when buffer is NULL for LoadString().

parent 56ab55d3
......@@ -877,9 +877,8 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
TRACE_(resource)("strlen = %d\n", (int)*p );
if (buffer == NULL) return *p;
i = MIN(buflen - 1, *p);
if (buffer == NULL)
return i;
if (i > 0) {
memcpy(buffer, p + 1, i);
buffer[i] = '\0';
......@@ -928,9 +927,8 @@ INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id,
TRACE_(resource)("strlen = %d\n", (int)*p );
if (buffer == NULL) return *p;
i = MIN(buflen - 1, *p);
if (buffer == NULL)
return i;
if (i > 0) {
memcpy(buffer, p + 1, i * sizeof (WCHAR));
buffer[i] = (WCHAR) 0;
......@@ -1038,7 +1036,7 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
TRACE_(resource)(" - strlen=%d\n",slen);
i = MIN(buflen - 1, slen);
if (buffer == NULL)
return slen; /* different to LoadString */
return slen;
if (i>0) {
lstrcpynA(buffer,(char*)mre->Text,i);
buffer[i]=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment