[PATCH 1/2] localspl: Clear LastError on success in AddMonitor

Detlef Riekenberg wine.dev at web.de
Mon Jan 30 12:43:34 CST 2017


This is ugly, but there are printmonitor installers,
which depend on GetLastError() even on success of AddMonitor

The old example monitor code from Microsoft has the broken code
and many monitors used the Mircosoft example as start,
so we need to duplicate this behavior...

redmon is an example.
The test in the Dialog after the successful installation
has the message for the code from GetLastError() appended,
which is not shown on windows.

https://bugs.winehq.org/show_bug.cgi?id=3864#c22

--
bye bye ... Detlef

Signed-off-by: Detlef Riekenberg <wine.dev at web.de>
---
 dlls/localspl/provider.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
index f359b73..f370b9f 100644
--- a/dlls/localspl/provider.c
+++ b/dlls/localspl/provider.c
@@ -1541,6 +1541,9 @@ static BOOL WINAPI fpAddMonitor(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
         RegCloseKey(hentry);
     }
 
+    if (res)
+        SetLastError(ERROR_SUCCESS); /* Monitor installer depend on this */
+
     RegCloseKey(hroot);
     return (res);
 }
-- 
2.7.4




More information about the wine-patches mailing list