Alexandre Julliard : regedit: FormatMessage() now reports ERROR_NO_WORK_DONE error for empty string.

Alexandre Julliard julliard at winehq.org
Wed May 13 16:29:54 CDT 2020


Module: wine
Branch: master
Commit: d9884c930f0ce9ca3a1cb103c700b94cfc555011
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d9884c930f0ce9ca3a1cb103c700b94cfc555011

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 13 22:06:58 2020 +0200

regedit: FormatMessage() now reports ERROR_NO_WORK_DONE error for empty string.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regedit/regedit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c
index 4b555f4ef5..e25de19b52 100644
--- a/programs/regedit/regedit.c
+++ b/programs/regedit/regedit.c
@@ -55,10 +55,9 @@ static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
     WCHAR *str;
     DWORD len;
 
-    SetLastError(NO_ERROR);
     len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER,
                          fmt, 0, 0, (WCHAR *)&str, 0, &va_args);
-    if (len == 0 && GetLastError() != NO_ERROR)
+    if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE)
     {
         WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
         return;




More information about the wine-cvs mailing list