Author: tkreuzer
Date: Fri Mar 14 20:10:53 2008
New Revision: 32689
URL:
http://svn.reactos.org/svn/reactos?rev=3D32689&view=3Drev
Log:
NtGdiExtGetObjectW has really nothing to do with dcs, move it to gdiobj.c
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win3=
2k/objects/dc.c?rev=3D32689&r1=3D32688&r2=3D32689&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Fri Mar 14 20:10:53 =
2008
@@ -1659,111 +1659,6 @@
return ret;
}
=
-INT
-FASTCALL
-IntGdiGetObject(IN HANDLE Handle,
- IN INT cbCount,
- IN LPVOID lpBuffer)
-{
- PVOID pGdiObject;
- INT Result =3D 0;
- DWORD dwObjectType;
-
- pGdiObject =3D GDIOBJ_LockObj(Handle, GDI_OBJECT_TYPE_DONTCARE);
- if (!pGdiObject)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return 0;
- }
-
- dwObjectType =3D GDIOBJ_GetObjectType(Handle);
- switch (dwObjectType)
- {
- case GDI_OBJECT_TYPE_PEN:
- case GDI_OBJECT_TYPE_EXTPEN:
- Result =3D PEN_GetObject((PGDIBRUSHOBJ) pGdiObject, cbCount, (PLOG=
PEN) lpBuffer); // IntGdiCreatePenIndirect
- break;
-
- case GDI_OBJECT_TYPE_BRUSH:
- Result =3D BRUSH_GetObject((PGDIBRUSHOBJ ) pGdiObject, cbCount, (L=
PLOGBRUSH)lpBuffer);
- break;
-
- case GDI_OBJECT_TYPE_BITMAP:
- Result =3D BITMAP_GetObject((BITMAPOBJ *) pGdiObject, cbCount, lpB=
uffer);
- break;
- case GDI_OBJECT_TYPE_FONT:
- Result =3D FontGetObject((PTEXTOBJ) pGdiObject, cbCount, lpBuffer);
-#if 0
- // Fix the LOGFONT structure for the stock fonts
- if (FIRST_STOCK_HANDLE <=3D Handle && Handle <=3D
LAST_STOCK_HANDL=
E)
- {
- FixStockFontSizeW(Handle, cbCount, lpBuffer);
- }
-#endif
- break;
-
- case GDI_OBJECT_TYPE_PALETTE:
- Result =3D PALETTE_GetObject((PPALGDI) pGdiObject, cbCount, lpBuff=
er);
- break;
-
- default:
- DPRINT1("GDI object type 0x%08x not implemented\n", dwObjectType);
- break;
- }
-
- GDIOBJ_UnlockObjByPtr(pGdiObject);
-
- return Result;
-}
-
-INT
-NTAPI
-NtGdiExtGetObjectW(IN HANDLE hGdiObj,
- IN INT cbCount,
- OUT LPVOID lpBuffer)
-{
- INT iRetCount =3D 0;
- INT cbCopyCount;
- union
- {
- BITMAP bitmap;
- DIBSECTION dibsection;
- LOGPEN logpen;
- LOGBRUSH logbrush;
- LOGFONTW logfontw;
- EXTLOGFONTW extlogfontw;
- ENUMLOGFONTEXDVW enumlogfontexdvw;
- } Object;
-
- // Normalize to the largest supported object size
- cbCount =3D min((UINT)cbCount, sizeof(Object));
-
- // Now do the actual call
- iRetCount =3D IntGdiGetObject(hGdiObj, cbCount, lpBuffer ? &Object : N=
ULL);
- cbCopyCount =3D min((UINT)cbCount, (UINT)iRetCount);
-
- // Make sure we have a buffer and a copy size
- if ((cbCopyCount) && (lpBuffer))
- {
- // Enter SEH for buffer transfer
- _SEH_TRY
- {
- // Probe the buffer and copy it
- ProbeForWrite(lpBuffer, cbCopyCount, sizeof(WORD));
- RtlCopyMemory(lpBuffer, &Object, cbCopyCount);
- }
- _SEH_HANDLE
- {
- // Clear the return value.
- // Do *NOT* set last error here!
- iRetCount =3D 0;
- }
- _SEH_END;
- }
- // Return the count
- return iRetCount;
-}
-
BOOL
APIENTRY
NtGdiResetDC(
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win3=
2k/objects/gdiobj.c?rev=3D32689&r1=3D32688&r2=3D32689&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Fri Mar 14 20:10=
:53 2008
@@ -1596,4 +1596,109 @@
return GDIOBJ_FreeObj(h, GDI_OBJECT_TYPE_CLIOBJ);
}
=
+INT
+FASTCALL
+IntGdiGetObject(IN HANDLE Handle,
+ IN INT cbCount,
+ IN LPVOID lpBuffer)
+{
+ PVOID pGdiObject;
+ INT Result =3D 0;
+ DWORD dwObjectType;
+
+ pGdiObject =3D GDIOBJ_LockObj(Handle, GDI_OBJECT_TYPE_DONTCARE);
+ if (!pGdiObject)
+ {
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return 0;
+ }
+
+ dwObjectType =3D GDIOBJ_GetObjectType(Handle);
+ switch (dwObjectType)
+ {
+ case GDI_OBJECT_TYPE_PEN:
+ case GDI_OBJECT_TYPE_EXTPEN:
+ Result =3D PEN_GetObject((PGDIBRUSHOBJ) pGdiObject, cbCount, (PLOG=
PEN) lpBuffer); // IntGdiCreatePenIndirect
+ break;
+
+ case GDI_OBJECT_TYPE_BRUSH:
+ Result =3D BRUSH_GetObject((PGDIBRUSHOBJ ) pGdiObject, cbCount, (L=
PLOGBRUSH)lpBuffer);
+ break;
+
+ case GDI_OBJECT_TYPE_BITMAP:
+ Result =3D BITMAP_GetObject((BITMAPOBJ *) pGdiObject, cbCount, lpB=
uffer);
+ break;
+ case GDI_OBJECT_TYPE_FONT:
+ Result =3D FontGetObject((PTEXTOBJ) pGdiObject, cbCount, lpBuffer);
+#if 0
+ // Fix the LOGFONT structure for the stock fonts
+ if (FIRST_STOCK_HANDLE <=3D Handle && Handle <=3D
LAST_STOCK_HANDL=
E)
+ {
+ FixStockFontSizeW(Handle, cbCount, lpBuffer);
+ }
+#endif
+ break;
+
+ case GDI_OBJECT_TYPE_PALETTE:
+ Result =3D PALETTE_GetObject((PPALGDI) pGdiObject, cbCount, lpBuff=
er);
+ break;
+
+ default:
+ DPRINT1("GDI object type 0x%08x not implemented\n", dwObjectType);
+ break;
+ }
+
+ GDIOBJ_UnlockObjByPtr(pGdiObject);
+
+ return Result;
+}
+
+INT
+NTAPI
+NtGdiExtGetObjectW(IN HANDLE hGdiObj,
+ IN INT cbCount,
+ OUT LPVOID lpBuffer)
+{
+ INT iRetCount =3D 0;
+ INT cbCopyCount;
+ union
+ {
+ BITMAP bitmap;
+ DIBSECTION dibsection;
+ LOGPEN logpen;
+ LOGBRUSH logbrush;
+ LOGFONTW logfontw;
+ EXTLOGFONTW extlogfontw;
+ ENUMLOGFONTEXDVW enumlogfontexdvw;
+ } Object;
+
+ // Normalize to the largest supported object size
+ cbCount =3D min((UINT)cbCount, sizeof(Object));
+
+ // Now do the actual call
+ iRetCount =3D IntGdiGetObject(hGdiObj, cbCount, lpBuffer ? &Object : N=
ULL);
+ cbCopyCount =3D min((UINT)cbCount, (UINT)iRetCount);
+
+ // Make sure we have a buffer and a copy size
+ if ((cbCopyCount) && (lpBuffer))
+ {
+ // Enter SEH for buffer transfer
+ _SEH_TRY
+ {
+ // Probe the buffer and copy it
+ ProbeForWrite(lpBuffer, cbCopyCount, sizeof(WORD));
+ RtlCopyMemory(lpBuffer, &Object, cbCopyCount);
+ }
+ _SEH_HANDLE
+ {
+ // Clear the return value.
+ // Do *NOT* set last error here!
+ iRetCount =3D 0;
+ }
+ _SEH_END;
+ }
+ // Return the count
+ return iRetCount;
+}
+
/* EOF */