Commit 14a39fcf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Introduce NtGdiExtGetObjectW.

parent 5d9586a6
...@@ -1060,9 +1060,9 @@ INT WINAPI GetObjectA( HGDIOBJ handle, INT count, LPVOID buffer ) ...@@ -1060,9 +1060,9 @@ INT WINAPI GetObjectA( HGDIOBJ handle, INT count, LPVOID buffer )
} }
/*********************************************************************** /***********************************************************************
* GetObjectW (GDI32.@) * NtGdiExtGetObjectW (win32u.@)
*/ */
INT WINAPI GetObjectW( HGDIOBJ handle, INT count, LPVOID buffer ) INT WINAPI NtGdiExtGetObjectW( HGDIOBJ handle, INT count, void *buffer )
{ {
GDI_HANDLE_ENTRY *entry; GDI_HANDLE_ENTRY *entry;
const struct gdi_obj_funcs *funcs = NULL; const struct gdi_obj_funcs *funcs = NULL;
...@@ -1078,11 +1078,9 @@ INT WINAPI GetObjectW( HGDIOBJ handle, INT count, LPVOID buffer ) ...@@ -1078,11 +1078,9 @@ INT WINAPI GetObjectW( HGDIOBJ handle, INT count, LPVOID buffer )
} }
LeaveCriticalSection( &gdi_section ); LeaveCriticalSection( &gdi_section );
if (funcs) if (funcs && funcs->pGetObjectW)
{ {
if (!funcs->pGetObjectW) if (buffer && ((ULONG_PTR)buffer >> 16) == 0) /* catch apps getting argument order wrong */
SetLastError( ERROR_INVALID_HANDLE );
else if (buffer && ((ULONG_PTR)buffer >> 16) == 0) /* catch apps getting argument order wrong */
SetLastError( ERROR_NOACCESS ); SetLastError( ERROR_NOACCESS );
else else
result = funcs->pGetObjectW( handle, count, buffer ); result = funcs->pGetObjectW( handle, count, buffer );
......
...@@ -111,3 +111,32 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ obj ) ...@@ -111,3 +111,32 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ obj )
if (!ret) SetLastError( ERROR_INVALID_HANDLE ); if (!ret) SetLastError( ERROR_INVALID_HANDLE );
return ret; return ret;
} }
/***********************************************************************
* GetObjectW (GDI32.@)
*/
INT WINAPI GetObjectW( HGDIOBJ handle, INT count, void *buffer )
{
int result;
TRACE( "%p %d %p\n", handle, count, buffer );
result = NtGdiExtGetObjectW( handle, count, buffer );
if (!result && count)
{
switch(get_object_type( handle ))
{
case 0:
case OBJ_BITMAP:
case OBJ_BRUSH:
case OBJ_FONT:
case OBJ_PAL:
case OBJ_PEN:
case OBJ_EXTPEN:
break;
default:
SetLastError( ERROR_INVALID_HANDLE );
}
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment