From 031aef852e2e88c0a97c67d6da927831030bfc7f Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 3 Jun 2021 18:44:48 +0200 Subject: [PATCH] user32: Debugstr_format() should not modify the last error. Signed-off-by: Francois Gouget Signed-off-by: Alexandre Julliard --- dlls/user32/clipboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 3d17b658e45..e8de7d9bdf6 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -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)