[ros-dev] [ros-diffs] [tkreuzer] 26564: GetNonFontObject: - OBJECTTYPE_META_DC does not SetLastError() - beautify the code a little

Timo Kreuzer timo.kreuzer at web.de
Sun Apr 29 02:21:46 CEST 2007


MSDN is not a good reference for this function. It's description is 
incomplete and wrong in some cases.
And I don't see the problem. NtGdiExtGetObjectW is not called for 
GDI_OBJECT_TYPE_DC. It is only called for valid types.


James Tabor schrieb:
> Hi!
>     switch(dwType)
>     {
> +    case GDI_OBJECT_TYPE_PEN: //Check the structures and see if A & W are the same.
> +    case GDI_OBJECT_TYPE_EXTPEN:
> +    case GDI_OBJECT_TYPE_BRUSH: // Mixing Apples and Oranges?
> +    case GDI_OBJECT_TYPE_BITMAP:
> +    case GDI_OBJECT_TYPE_PALETTE:
> +      return NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer);
> +
>       case GDI_OBJECT_TYPE_DC:
>       case GDI_OBJECT_TYPE_REGION:
>       case GDI_OBJECT_TYPE_METAFILE:
>       case GDI_OBJECT_TYPE_ENHMETAFILE:
>       case GDI_OBJECT_TYPE_EMF:
> -    case GDI_OBJECT_TYPE_METADC:
>         SetLastError(ERROR_INVALID_HANDLE);
> -      return 0;
>
> This is wrong,,, you can not call NtGdiExtGetObjectW first before faulting on GDI_OBJECT_TYPE_DC.
>
> http://msdn2.microsoft.com/en-us/library/ms533268.aspx
>
> Normal DC's do not pass to kernel space. Please RTFM.
>
> Thanks,
> James
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
>
>   



More information about the Ros-dev mailing list