From c3a45b679dc4b0452eab260b8e573a8360be37aa Mon Sep 17 00:00:00 2001 From: Jose Carlos Jesus Date: Sat, 6 Jul 2024 16:55:06 -0400 Subject: [PATCH] Fix return value from GetObject gdi32_apitest (#7046) --- win32ss/gdi/gdi32/objects/gdiobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/win32ss/gdi/gdi32/objects/gdiobj.c b/win32ss/gdi/gdi32/objects/gdiobj.c index c1b6c2abe07..06c77174d2b 100644 --- a/win32ss/gdi/gdi32/objects/gdiobj.c +++ b/win32ss/gdi/gdi32/objects/gdiobj.c @@ -265,10 +265,11 @@ GetObjectW( (dwType == GDI_OBJECT_TYPE_BRUSH) || (dwType == GDI_OBJECT_TYPE_COLORSPACE) || ( (dwType == GDI_OBJECT_TYPE_EXTPEN) && - ( (cbSize >= sizeof(EXTLOGPEN)) || (cbSize == 0) ) ) || + ( (cbSize >= sizeof(EXTLOGPEN)))) || ( (dwType == GDI_OBJECT_TYPE_BITMAP) && (cbSize >= sizeof(BITMAP)) )) { - SetLastError(ERROR_NOACCESS); + if (cbSize) + SetLastError(ERROR_NOACCESS); } } }