mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
- 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. svn path=/trunk/; revision=30133
This commit is contained in:
parent
9fb45686cb
commit
49f59088cf
6 changed files with 48 additions and 16 deletions
|
@ -276,30 +276,59 @@ DeleteDC(HDC hDC)
|
|||
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;
|
||||
}
|
||||
{ // 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;
|
||||
|
||||
/* 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);
|
||||
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
|
||||
GetArcDirection( HDC hdc )
|
||||
|
|
|
@ -152,9 +152,6 @@ NtGdiDeleteEnhMetaFile (
|
|||
HENHMETAFILE emf
|
||||
);
|
||||
|
||||
/* Should be done in user-mode. */
|
||||
BOOL STDCALL NtGdiDeleteObject(HGDIOBJ hObject);
|
||||
|
||||
/* Meta are user-mode. */
|
||||
BOOL
|
||||
STDCALL
|
||||
|
|
|
@ -93,4 +93,6 @@ PVOID INTERNAL_CALL GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCES
|
|||
#define GDIOBJFLAG_IGNOREPID (0x1)
|
||||
#define GDIOBJFLAG_IGNORELOCK (0x2)
|
||||
|
||||
BOOL FASTCALL NtGdiDeleteObject(HGDIOBJ hObject);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1023,11 +1023,15 @@ NtGdiOpenDCW( PUNICODE_STRING Device,
|
|||
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
|
|
|
@ -663,7 +663,8 @@ LockHandle:
|
|||
* \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);
|
||||
|
|
|
@ -738,7 +738,6 @@ NtGdiCreateDIBitmap 6
|
|||
NtGdiCreateEnhMetaFile 4
|
||||
NtGdiCreateScalableFontResource 4
|
||||
NtGdiDeleteEnhMetaFile 1
|
||||
NtGdiDeleteObject 1
|
||||
NtGdiEnumEnhMetaFile 5
|
||||
NtGdiEnumFonts 4
|
||||
NtGdiEnumICMProfiles 3
|
||||
|
|
Loading…
Reference in a new issue