Author: jimtabor
Date: Mon Nov 5 01:10:59 2007
New Revision: 30133
URL:
http://svn.reactos.org/svn/reactos?rev=30133&view=rev
Log:
- Removed NtGdiDeleteObject from w32ksvc.db and ntgdibad.h.
- Moved the define export to gdiobj.h and made it a FASTCALL internal to win32k.
- I did not rename it to IntXXXX.
- Implemented a functional DeleteObject for gdi.
Modified:
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/include/gdiobj.h
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Mon Nov 5 01:10:59 2007
@@ -276,29 +276,58 @@
return Ret;
}
-
-/*
-
+/*
* @implemented
*/
BOOL
STDCALL
DeleteObject(HGDIOBJ hObject)
{
+ UINT Type = 0;
+
/* From Wine: DeleteObject does not SetLastError() on a null object */
if(!hObject) return FALSE;
if (0 != ((DWORD) hObject & GDI_HANDLE_STOCK_MASK))
- {
- DPRINT1("Trying to delete system object 0x%x\n", hObject);
- return TRUE;
- }
-
- /* deleting a handle that doesn't belong to the caller should be rather rarely
- so for the sake of speed just try to delete it without checking validity */
- return NtGdiDeleteObject(hObject);
-}
-
+ { // Relax! This is a normal return!
+ DPRINT("Trying to delete system object 0x%x\n", hObject);
+ return TRUE;
+ }
+ // If you dont own it?! Get OUT!
+ if(!GdiIsHandleValid(hObject)) return FALSE;
+
+ Type = GDI_HANDLE_GET_TYPE(hObject);
+
+ if ((Type == GDI_OBJECT_TYPE_METAFILE) ||
+ (Type == GDI_OBJECT_TYPE_ENHMETAFILE))
+ return FALSE;
+
+ switch (Type)
+ {
+ case GDI_OBJECT_TYPE_DC:
+ return DeleteDC((HDC) hObject);
+ case GDI_OBJECT_TYPE_COLORSPACE:
+ return NtGdiDeleteColorSpace((HCOLORSPACE) hObject);
+#if 0
+ case GDI_OBJECT_TYPE_METADC:
+ return MFDRV_DeleteObject( hObject );
+ case GDI_OBJECT_TYPE_EMF:
+ {
+ PLDC pLDC = GdiGetLDC(hObject);
+ if ( !pLDC ) return FALSE;
+ return EMFDRV_DeleteObject( hObject );
+ }
+#endif
+ case GDI_OBJECT_TYPE_REGION:
+ case GDI_OBJECT_TYPE_BRUSH:
+ case GDI_OBJECT_TYPE_EXTPEN:
+ case GDI_OBJECT_TYPE_PEN:
+ case GDI_OBJECT_TYPE_FONT:
+ case GDI_OBJECT_TYPE_BITMAP:
+ break;
+ }
+ return NtGdiDeleteObjectApp(hObject);
+}
INT
STDCALL
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Mon Nov 5 01:10:59 2007
@@ -152,9 +152,6 @@
HENHMETAFILE emf
);
-/* Should be done in user-mode. */
-BOOL STDCALL NtGdiDeleteObject(HGDIOBJ hObject);
-
/* Meta are user-mode. */
BOOL
STDCALL
Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h Mon Nov 5 01:10:59 2007
@@ -93,4 +93,6 @@
#define GDIOBJFLAG_IGNOREPID (0x1)
#define GDIOBJFLAG_IGNORELOCK (0x2)
+BOOL FASTCALL NtGdiDeleteObject(HGDIOBJ hObject);
+
#endif
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Mon Nov 5 01:10:59 2007
@@ -1023,10 +1023,14 @@
}
-BOOL STDCALL
+BOOL
+STDCALL
NtGdiDeleteObjectApp(HANDLE DCHandle)
{
PDC DCToDelete;
+
+ if (GDI_HANDLE_GET_TYPE(DCHandle) != GDI_OBJECT_TYPE_DC)
+ return NtGdiDeleteObject((HGDIOBJ) DCHandle);
if (!GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, DCHandle))
{
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Mon Nov 5 01:10:59 2007
@@ -663,7 +663,8 @@
* \param hObject object handle
* \return if the function fails the returned value is FALSE.
*/
-BOOL STDCALL
+BOOL
+FASTCALL
NtGdiDeleteObject(HGDIOBJ hObject)
{
DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject);
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Mon Nov 5 01:10:59 2007
@@ -738,7 +738,6 @@
NtGdiCreateEnhMetaFile 4
NtGdiCreateScalableFontResource 4
NtGdiDeleteEnhMetaFile 1
-NtGdiDeleteObject 1
NtGdiEnumEnhMetaFile 5
NtGdiEnumFonts 4
NtGdiEnumICMProfiles 3