Nikolay Sivov : user32: Avoid touching last error on successful path of GetClassInfo().
Module: wine Branch: master Commit: c4fd1099dd34e6a26af64da5f0fd672dcad1ad59 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c4fd1099dd34e6a26af64da5f... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 8 10:54:40 2018 +0300 user32: Avoid touching last error on successful path of GetClassInfo(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/class.c | 5 ++++- dlls/user32/tests/class.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/user32/class.c b/dlls/user32/class.c index d4e7951..ce2830f 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -333,6 +333,7 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, B ULONG module_offset; } *wndclass; const WCHAR *module, *ret; + UNICODE_STRING name_us; HMODULE hmod; if (basename_offset) @@ -345,7 +346,9 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, B return name; data.cbSize = sizeof(data); - if (!FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data)) + RtlInitUnicodeString(&name_us, name); + if (RtlFindActivationContextSectionString(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, + &name_us, &data)) return name; wndclass = (struct wndclass_redirect_data *)data.lpData; diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index a9eee41..92b9ad9 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -998,6 +998,7 @@ if (0) { /* crashes under XP */ SetLastError(0xdeadbeef); ret = GetClassInfoExA(0, "static", &wcx); ok(ret, "GetClassInfoExA() error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Unexpected error code %d\n", GetLastError()); ok(wcx.cbSize == 0, "expected 0, got %u\n", wcx.cbSize); ok(wcx.lpfnWndProc != NULL, "got null proc\n");
participants (1)
-
Alexandre Julliard