Alexandre Julliard : winecrt0: Preserve last error when loading debug functions.
Alexandre Julliard
julliard at winehq.org
Fri Dec 20 14:07:24 CST 2019
Module: wine
Branch: master
Commit: a812374a529f553da0f4c0b9c2d67b9178f644ff
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a812374a529f553da0f4c0b9c2d67b9178f644ff
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Dec 20 10:34:07 2019 +0100
winecrt0: Preserve last error when loading debug functions.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winecrt0/debug.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/winecrt0/debug.c b/dlls/winecrt0/debug.c
index 01bfd4c3e1..cb07c7835d 100644
--- a/dlls/winecrt0/debug.c
+++ b/dlls/winecrt0/debug.c
@@ -50,9 +50,11 @@ static void load_func( void **func, const char *name, void *def )
{
if (!*func)
{
+ DWORD err = GetLastError();
HMODULE module = GetModuleHandleA( "ntdll.dll" );
void *proc = GetProcAddress( module, name );
InterlockedExchangePointer( func, proc ? proc : def );
+ SetLastError( err );
}
}
#define LOAD_FUNC(name) load_func( (void **)&p ## name, #name, fallback ## name )
More information about the wine-cvs
mailing list