diff --git a/reactos/lib/gdi32/objects/dc.c b/reactos/lib/gdi32/objects/dc.c index 70ce7bb05a2..707cd1f1e16 100644 --- a/reactos/lib/gdi32/objects/dc.c +++ b/reactos/lib/gdi32/objects/dc.c @@ -249,6 +249,8 @@ GetObjectA(HGDIOBJ Handle, int Size, LPVOID Buffer) Type = NtGdiGetObjectType(Handle); if (0 == Type) { + /* From Wine: GetObject does not SetLastError() on a null object */ + SetLastError(0); return 0; } @@ -448,6 +450,8 @@ GetObjectType( break; } } - + else + /* From Wine: GetObjectType does SetLastError() on a null object */ + SetLastError(ERROR_INVALID_HANDLE); return Ret; }