Correct error returns for GetObject and GetObjectType based on Wine
tests.
Modified: trunk/reactos/lib/gdi32/objects/dc.c
_____
Modified: trunk/reactos/lib/gdi32/objects/dc.c
--- trunk/reactos/lib/gdi32/objects/dc.c 2006-01-24 05:03:00 UTC
(rev 21006)
+++ trunk/reactos/lib/gdi32/objects/dc.c 2006-01-24 05:23:52 UTC
(rev 21007)
@@ -249,6 +249,8 @@
Type = NtGdiGetObjectType(Handle);
if (0 == Type)
{
+ /* From Wine: GetObject does not SetLastError() on a null object
*/
+ SetLastError(0);
return 0;
}
@@ -448,6 +450,8 @@
break;
}
}
-
+ else
+ /* From Wine: GetObjectType does SetLastError() on a null object */
+ SetLastError(ERROR_INVALID_HANDLE);
return Ret;
}
Show replies by date