user32: Debugstr_format() should not modify the last error.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-06-03 18:44:48 +02:00 committed by Alexandre Julliard
parent bbe2eaecc9
commit 031aef852e
1 changed files with 4 additions and 1 deletions

View File

@ -81,8 +81,11 @@ struct metafile_pict
static const char *debugstr_format( UINT id )
{
WCHAR buffer[256];
DWORD le = GetLastError();
BOOL r = GetClipboardFormatNameW( id, buffer, 256 );
SetLastError(le);
if (GetClipboardFormatNameW( id, buffer, 256 ))
if (r)
return wine_dbg_sprintf( "%04x %s", id, debugstr_w(buffer) );
switch (id)