https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b57be0a746fd9b42fed0e9ac5cf88eaf222ce11d
commit b57be0a746fd9b42fed0e9ac5cf88eaf222ce11d Author: Victor Martinez Calvo <[email protected]> AuthorDate: Tue May 3 16:00:21 2022 +0200 Commit: GitHub <[email protected]> CommitDate: Tue May 3 16:00:21 2022 +0200 [GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394) This fixes the last GetObjectW apitest case: ok_long(GetObjectA(hBrush, 0, &TestStruct), 0); - When "cbSize" is "0", GetObjectW shouldn't return "sizeof(LOGBRUSH)" but 0. - Rely in BRUSH::cjGetObject behavior which returns 0 when cjSize is 0. Co-authored-by: Víctor Martínez Calvo <[email protected]> --- win32ss/gdi/gdi32/objects/gdiobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32ss/gdi/gdi32/objects/gdiobj.c b/win32ss/gdi/gdi32/objects/gdiobj.c index 96617881fc4..5f8d8e1f6c3 100644 --- a/win32ss/gdi/gdi32/objects/gdiobj.c +++ b/win32ss/gdi/gdi32/objects/gdiobj.c @@ -206,7 +206,7 @@ GetObjectW( break; case GDI_OBJECT_TYPE_BRUSH: - if (!lpBuffer || !cbSize) return sizeof(LOGBRUSH); + if (!lpBuffer) return sizeof(LOGBRUSH); break; case GDI_OBJECT_TYPE_BITMAP:
