mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:15:41 +00:00
- Unlock GDI objects by pointer, not by handle.
- Fix a few invalid lock cases. - Add support for shared GDI object locks and use it for locking surfaces. svn path=/trunk/; revision=15830
This commit is contained in:
parent
e7f345e0a2
commit
4619446ed0
41 changed files with 772 additions and 819 deletions
|
@ -29,8 +29,9 @@ typedef struct _BITMAPOBJ
|
|||
((HBITMAP) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BITMAP))
|
||||
#define BITMAPOBJ_FreeBitmap(hBMObj) \
|
||||
GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
|
||||
#define BITMAPOBJ_LockBitmap(hBMObj) GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)
|
||||
#define BITMAPOBJ_UnlockBitmap(hBMObj) GDIOBJ_UnlockObj((HGDIOBJ) hBMObj)
|
||||
/* NOTE: Use shared locks! */
|
||||
#define BITMAPOBJ_LockBitmap(hBMObj) (PBITMAPOBJ)EngLockSurface((HSURF)hBMObj)
|
||||
#define BITMAPOBJ_UnlockBitmap(pBMObj) EngUnlockSurface(&pBMObj->SurfObj)
|
||||
BOOL INTERNAL_CALL BITMAP_Cleanup(PVOID ObjectBody);
|
||||
|
||||
INT FASTCALL BITMAPOBJ_GetWidthBytes (INT bmWidth, INT bpp);
|
||||
|
|
|
@ -71,7 +71,7 @@ typedef struct
|
|||
#define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BRUSH))
|
||||
#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)
|
||||
#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
|
||||
#define BRUSHOBJ_UnlockBrush(hBrush) GDIOBJ_UnlockObj((HGDIOBJ)hBrush)
|
||||
#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr(pBrush)
|
||||
BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody);
|
||||
|
||||
#ifdef __USE_W32API
|
||||
|
|
|
@ -151,8 +151,8 @@ typedef struct
|
|||
|
||||
#define DC_LockDc(hDC) \
|
||||
((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC))
|
||||
#define DC_UnlockDc(hDC) \
|
||||
GDIOBJ_UnlockObj ((HGDIOBJ) hDC)
|
||||
#define DC_UnlockDc(pDC) \
|
||||
GDIOBJ_UnlockObjByPtr (pDC)
|
||||
|
||||
HDC FASTCALL RetrieveDisplayHDC(VOID);
|
||||
HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
|
||||
|
|
|
@ -81,6 +81,7 @@ BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle);
|
|||
void INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner);
|
||||
void INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo);
|
||||
BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj);
|
||||
VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(PGDIOBJ Object);
|
||||
|
||||
#define GDIOBJ_GetObjectType(Handle) \
|
||||
GDI_HANDLE_GET_TYPE(Handle)
|
||||
|
@ -91,19 +92,18 @@ BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj);
|
|||
#define GDIOBJ_AllocObj(ty) GDIOBJ_AllocObjDbg(__FILE__,__LINE__,ty)
|
||||
#define GDIOBJ_FreeObj(obj,ty) GDIOBJ_FreeObjDbg(__FILE__,__LINE__,obj,ty)
|
||||
#define GDIOBJ_LockObj(obj,ty) GDIOBJ_LockObjDbg(__FILE__,__LINE__,obj,ty)
|
||||
#define GDIOBJ_UnlockObj(obj) GDIOBJ_UnlockObjDbg(__FILE__,__LINE__,obj)
|
||||
#define GDIOBJ_ShareLockObj(obj,ty) GDIOBJ_ShareLockObjDbg(__FILE__,__LINE__,obj,ty)
|
||||
|
||||
HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObjDbg(const char* file, int line, ULONG ObjectType);
|
||||
BOOL INTERNAL_CALL GDIOBJ_FreeObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
|
||||
PGDIOBJ INTERNAL_CALL GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
|
||||
BOOL INTERNAL_CALL GDIOBJ_UnlockObjDbg (const char* file, int line, HGDIOBJ hObj);
|
||||
PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType);
|
||||
|
||||
#else /* !GDI_DEBUG */
|
||||
|
||||
HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType);
|
||||
BOOL INTERNAL_CALL GDIOBJ_FreeObj (HGDIOBJ hObj, DWORD ObjectType);
|
||||
PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType);
|
||||
BOOL INTERNAL_CALL GDIOBJ_UnlockObj (HGDIOBJ hObj);
|
||||
PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType);
|
||||
|
||||
#endif /* GDI_DEBUG */
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PEN))
|
||||
#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)
|
||||
#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN))
|
||||
#define PENOBJ_UnlockPen(hBMObj) GDIOBJ_UnlockObj((HGDIOBJ) hBMObj)
|
||||
#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr(pPenObj)
|
||||
|
||||
HPEN STDCALL
|
||||
NtGdiCreatePen(
|
||||
|
|
|
@ -13,7 +13,7 @@ typedef struct _ROSRGNDATA {
|
|||
|
||||
#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)
|
||||
#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION))
|
||||
#define RGNDATA_UnlockRgn(hRgn) GDIOBJ_UnlockObj((HGDIOBJ)hRgn)
|
||||
#define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr(pRgn)
|
||||
HRGN FASTCALL RGNDATA_AllocRgn(INT n);
|
||||
BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct
|
|||
((HFONT) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_FONT))
|
||||
#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)
|
||||
#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT))
|
||||
#define TEXTOBJ_UnlockText(hBMObj) GDIOBJ_UnlockObj ((HGDIOBJ) hBMObj)
|
||||
#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr (pBMObj)
|
||||
|
||||
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle);
|
||||
NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont);
|
||||
|
|
|
@ -89,7 +89,6 @@ BltMask(SURFOBJ* Dest,
|
|||
static BYTE maskbit[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHINST GdiBrush = NULL;
|
||||
HBITMAP PatternSurface = NULL;
|
||||
SURFOBJ *PatternObj = NULL;
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
|
||||
|
@ -109,7 +108,6 @@ BltMask(SURFOBJ* Dest,
|
|||
GDIBRUSHINST,
|
||||
BrushObject);
|
||||
|
||||
PatternSurface = GdiBrush->GdiBrushObject->hbmPattern;
|
||||
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern);
|
||||
if(PatternBitmap != NULL)
|
||||
{
|
||||
|
@ -157,7 +155,7 @@ BltMask(SURFOBJ* Dest,
|
|||
}
|
||||
|
||||
if (PatternBitmap != NULL)
|
||||
BITMAPOBJ_UnlockBitmap(PatternSurface);
|
||||
BITMAPOBJ_UnlockBitmap(PatternBitmap);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -245,7 +243,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
/* Pattern brush */
|
||||
if (bmPattern != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(BltInfo.PatternSurface->hsurf);
|
||||
BITMAPOBJ_UnlockBitmap(bmPattern);
|
||||
}
|
||||
|
||||
return Result;
|
||||
|
|
|
@ -106,6 +106,7 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
|||
{
|
||||
EngDeleteClip(EnterLeave->TrivialClipObj);
|
||||
EngFreeMem((*OutputObj)->pvBits);
|
||||
EngUnlockSurface(*OutputObj);
|
||||
EngDeleteSurface((HSURF)EnterLeave->OutputBitmap);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
}
|
||||
if (SurfObj->pvBits == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(NewBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BITMAPOBJ_FreeBitmap(NewBitmap);
|
||||
return 0;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
BitmapObj->dimension.cy = 0;
|
||||
BitmapObj->dib = NULL;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(NewBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return NewBitmap;
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ EngCreateDeviceSurface(IN DHSURF dhsurf,
|
|||
|
||||
BitmapObj->flHooks = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(NewSurface);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return NewSurface;
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ EngAssociateSurface(IN HSURF Surface,
|
|||
/* Hook up specified functions */
|
||||
BitmapObj->flHooks = Hooks;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(Surface);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -481,19 +481,21 @@ EngEraseSurface(SURFOBJ *Surface,
|
|||
return FillSolid(Surface, Rect, iColor);
|
||||
}
|
||||
|
||||
#define GDIBdyToHdr(body) \
|
||||
((PGDIOBJHDR)(body) - 1)
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
SURFOBJ * STDCALL
|
||||
EngLockSurface(IN HSURF Surface)
|
||||
{
|
||||
BITMAPOBJ *bmp = (BITMAPOBJ*)BITMAPOBJ_LockBitmap(Surface);
|
||||
if(bmp != NULL)
|
||||
{
|
||||
return &bmp->SurfObj;
|
||||
}
|
||||
BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(Surface, GDI_OBJECT_TYPE_BITMAP);
|
||||
|
||||
return NULL;
|
||||
if (bmp != NULL)
|
||||
return &bmp->SurfObj;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -502,7 +504,7 @@ EngLockSurface(IN HSURF Surface)
|
|||
VOID STDCALL
|
||||
EngUnlockSurface(IN SURFOBJ *Surface)
|
||||
{
|
||||
ASSERT (Surface);
|
||||
BITMAPOBJ_UnlockBitmap (Surface->hsurf);
|
||||
if (Surface != NULL)
|
||||
GDIOBJ_UnlockObjByPtr(Surface);
|
||||
}
|
||||
/* EOF */
|
||||
|
|
|
@ -104,7 +104,7 @@ IntEngWndUpdateClipObj(
|
|||
}
|
||||
}
|
||||
}
|
||||
RGNDATA_UnlockRgn(hVisRgn);
|
||||
RGNDATA_UnlockRgn(visRgn);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -272,9 +272,9 @@ IntEngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
|
|||
|
||||
end:
|
||||
if (PaletteSource != NULL)
|
||||
PALETTE_UnlockPalette(PaletteSource);
|
||||
PALETTE_UnlockPalette(SourcePalGDI);
|
||||
if (PaletteDest != NULL && PaletteDest != PaletteSource)
|
||||
PALETTE_UnlockPalette(PaletteDest);
|
||||
PALETTE_UnlockPalette(DestPalGDI);
|
||||
return XlateObj;
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ IntEngCreateMonoXlate(
|
|||
break;
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(PaletteSource);
|
||||
PALETTE_UnlockPalette(SourcePalGDI);
|
||||
|
||||
return XlateObj;
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
|
|||
XlateGDI = EngAllocMem(0, sizeof(XLATEGDI), TAG_XLATEOBJ);
|
||||
if (XlateGDI == NULL)
|
||||
{
|
||||
PALETTE_UnlockPalette(PaletteDest);
|
||||
PALETTE_UnlockPalette(DestPalGDI);
|
||||
DPRINT1("Failed to allocate memory for a XLATE structure!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
|
|||
XlateGDI->translationTable = EngAllocMem(0, sizeof(ULONG) * 2, 0);
|
||||
if (XlateGDI->translationTable == NULL)
|
||||
{
|
||||
PALETTE_UnlockPalette(PaletteDest);
|
||||
PALETTE_UnlockPalette(DestPalGDI);
|
||||
EngFreeMem(XlateGDI);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
|
|||
DestPalGDI->NumColors);
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(PaletteDest);
|
||||
PALETTE_UnlockPalette(DestPalGDI);
|
||||
|
||||
return XlateObj;
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color)
|
|||
{
|
||||
/* Return closest match for the given color. */
|
||||
Closest = ClosestColorMatch(XlateGDI, (LPPALETTEENTRY)&Color, PalGDI->IndexedColors, PalGDI->NumColors);
|
||||
PALETTE_UnlockPalette(XlateGDI->DestPal);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
return Closest;
|
||||
}
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj, ULONG PalOutType, ULONG cPal,
|
|||
*OutPal = *InPal;
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(hPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
|
||||
return cPal;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct tagDCE
|
|||
((HDCE) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_DCE))
|
||||
#define DCEOBJ_FreeDCE(hDCE) GDIOBJ_FreeObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE)
|
||||
#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE))
|
||||
#define DCEOBJ_UnlockDCE(hDCE) GDIOBJ_UnlockObj((HGDIOBJ)hDCE)
|
||||
#define DCEOBJ_UnlockDCE(pDCE) GDIOBJ_UnlockObjByPtr(pDCE)
|
||||
BOOL INTERNAL_CALL DCE_Cleanup(PVOID ObjectBody);
|
||||
|
||||
PDCE FASTCALL DceAllocDCE(HWND hWnd, DCE_TYPE Type);
|
||||
|
|
|
@ -37,7 +37,7 @@ HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
|||
CONST RGBQUAD *Colors);
|
||||
#define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)
|
||||
#define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE))
|
||||
#define PALETTE_UnlockPalette(hPalette) GDIOBJ_UnlockObj((HGDIOBJ)hPalette)
|
||||
#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(pPalette)
|
||||
BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody);
|
||||
|
||||
HPALETTE FASTCALL PALETTE_Init (VOID);
|
||||
|
|
|
@ -51,7 +51,7 @@ HANDLE STDCALL NtGdiDdCreateDirectDrawObject(
|
|||
if (!pDC->DriverFunctions.EnableDirectDraw)
|
||||
{
|
||||
// Driver doesn't support DirectDraw
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ HANDLE STDCALL NtGdiDdCreateDirectDrawObject(
|
|||
if (!success)
|
||||
{
|
||||
// DirectDraw creation failed
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(pDC);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,8 @@ HANDLE STDCALL NtGdiDdCreateDirectDrawObject(
|
|||
if (palette_callbacks.dwFlags & DDHAL_PALCB32_SETENTRIES)
|
||||
pDirectDraw->DdSetEntries = palette_callbacks.SetEntries;
|
||||
|
||||
GDIOBJ_UnlockObj(hDirectDraw);
|
||||
DC_UnlockDc(hdc);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
return hDirectDraw;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ BOOL STDCALL NtGdiDdQueryDirectDrawObject(
|
|||
|
||||
if (!success)
|
||||
{
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ BOOL STDCALL NtGdiDdQueryDirectDrawObject(
|
|||
}
|
||||
|
||||
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -235,8 +235,8 @@ HANDLE STDCALL NtGdiDdCreateSurfaceObject(
|
|||
// FIXME: figure out how to use this
|
||||
pSurface->bComplete = bComplete;
|
||||
|
||||
GDIOBJ_UnlockObj(hSurface);
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pSurface);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return hSurface;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ BOOL STDCALL NtGdiDdAttachSurface(
|
|||
PDD_SURFACE pSurfaceTo = GDIOBJ_LockObj(hSurfaceTo, GDI_OBJECT_TYPE_DD_SURFACE);
|
||||
if (!pSurfaceTo)
|
||||
{
|
||||
GDIOBJ_UnlockObj(hSurfaceFrom);
|
||||
GDIOBJ_UnlockObjByPtr(pSurfaceFrom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -269,8 +269,8 @@ BOOL STDCALL NtGdiDdAttachSurface(
|
|||
pSurfaceFrom->Local.lpAttachListFrom = pSurfaceFrom->AttachListFrom;
|
||||
}
|
||||
|
||||
GDIOBJ_UnlockObj(hSurfaceFrom);
|
||||
GDIOBJ_UnlockObj(hSurfaceTo);
|
||||
GDIOBJ_UnlockObjByPtr(pSurfaceFrom);
|
||||
GDIOBJ_UnlockObjByPtr(pSurfaceTo);
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
@ -295,7 +295,7 @@ DWORD STDCALL NtGdiDdGetDriverInfo(
|
|||
pDirectDraw->Global.dhpdev,(PDD_HALINFO) puGetDriverInfoData,
|
||||
&pdwNumHeaps, pvmList, &pdwNumFourCC, pdwFourCC);
|
||||
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return ddRVal;
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank(
|
|||
|
||||
ddRVal = pDirectDraw->DdWaitForVerticalBlank(puWaitForVerticalBlankData);
|
||||
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return ddRVal;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ DWORD STDCALL NtGdiDdCanCreateSurface(
|
|||
|
||||
ddRVal = pDirectDraw->DdCanCreateSurface(puCanCreateSurfaceData);
|
||||
|
||||
GDIOBJ_UnlockObj(hDirectDrawLocal);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return ddRVal;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ DWORD STDCALL NtGdiDdBlt(
|
|||
|
||||
ddRVal = pDirectDraw->DdBlt(puBltData);
|
||||
|
||||
GDIOBJ_UnlockObj(hSurfaceDest);
|
||||
GDIOBJ_UnlockObjByPtr(pDirectDraw);
|
||||
|
||||
return ddRVal;
|
||||
}
|
||||
|
|
|
@ -50,9 +50,7 @@ IntGetCursorLocation(PWINSTATION_OBJECT WinStaObject, POINT *loc)
|
|||
{
|
||||
HDC hDC;
|
||||
PDC dc;
|
||||
HBITMAP hBitmap;
|
||||
BITMAPOBJ *BitmapObj;
|
||||
SURFOBJ *SurfObj;
|
||||
GDIDEVICE *GDIDevice;
|
||||
|
||||
#if 1
|
||||
/* FIXME - get the screen dc from the window station or desktop */
|
||||
|
@ -62,17 +60,12 @@ IntGetCursorLocation(PWINSTATION_OBJECT WinStaObject, POINT *loc)
|
|||
|
||||
if (!(dc = DC_LockDc(hDC)))
|
||||
return FALSE;
|
||||
GDIDevice = (GDIDEVICE *)dc->GDIDevice;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
hBitmap = dc->w.hBitmap;
|
||||
DC_UnlockDc(hDC);
|
||||
if (!(BitmapObj = BITMAPOBJ_LockBitmap(hBitmap)))
|
||||
return FALSE;
|
||||
loc->x = GDIDevice->Pointer.Pos.x;
|
||||
loc->y = GDIDevice->Pointer.Pos.y;
|
||||
|
||||
SurfObj = &BitmapObj->SurfObj;
|
||||
loc->x = GDIDEV(SurfObj)->Pointer.Pos.x;
|
||||
loc->y = GDIDEV(SurfObj)->Pointer.Pos.y;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -135,7 +128,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
|||
}
|
||||
dcbmp = dc->w.hBitmap;
|
||||
DevInfo = dc->DevInfo;
|
||||
DC_UnlockDc(Screen);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dcbmp);
|
||||
if ( !BitmapObj )
|
||||
|
@ -159,13 +152,13 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
|||
|
||||
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
|
||||
CurInfo->ShowingCursor = 0;
|
||||
BITMAPOBJ_UnlockBitmap(dcbmp);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
if (!NewCursor)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(dcbmp);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -176,11 +169,11 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
|||
if (MaskBmpObj)
|
||||
{
|
||||
const int maskBpp = BitsPerFormat(MaskBmpObj->SurfObj.iBitmapFormat);
|
||||
BITMAPOBJ_UnlockBitmap(NewCursor->IconInfo.hbmMask);
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
if (maskBpp != 1)
|
||||
{
|
||||
DPRINT1("SetCursor: The Mask bitmap must have 1BPP!\n");
|
||||
BITMAPOBJ_UnlockBitmap(dcbmp);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -224,14 +217,14 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
|||
NULL);
|
||||
if ( !hMask )
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(NewCursor->IconInfo.hbmMask);
|
||||
BITMAPOBJ_UnlockBitmap(dcbmp);
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
return (HCURSOR)0;
|
||||
}
|
||||
soMask = EngLockSurface((HSURF)hMask);
|
||||
EngCopyBits(soMask, &MaskBmpObj->SurfObj, NULL, NULL,
|
||||
&DestRect, &SourcePoint);
|
||||
BITMAPOBJ_UnlockBitmap(NewCursor->IconInfo.hbmMask);
|
||||
BITMAPOBJ_UnlockBitmap(MaskBmpObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +273,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
|||
GDIDEV(SurfObj)->Pointer.MovePointer = GDIDEVFUNCS(SurfObj).MovePointer;
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dcbmp);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if(hMask)
|
||||
{
|
||||
EngUnlockSurface(soMask);
|
||||
|
@ -617,7 +610,7 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo, BOOL Indirect)
|
|||
{
|
||||
CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmColor);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmColor, NULL);
|
||||
}
|
||||
if(CurIconObject->IconInfo.hbmMask &&
|
||||
|
@ -628,7 +621,7 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo, BOOL Indirect)
|
|||
CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmMask);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmMask, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -749,7 +742,7 @@ NtUserGetCursorIconSize(
|
|||
else
|
||||
SetLastNtError(Status);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmColor);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
|
||||
done:
|
||||
IntReleaseCurIconObject(CurIconObject);
|
||||
|
@ -1109,7 +1102,7 @@ NtUserSetCursorIconContents(
|
|||
{
|
||||
CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmColor);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmColor, NULL);
|
||||
}
|
||||
else
|
||||
|
@ -1121,7 +1114,7 @@ NtUserSetCursorIconContents(
|
|||
CurIconObject->Size.cx = bmp->SurfObj.sizlBitmap.cx;
|
||||
CurIconObject->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(CurIconObject->IconInfo.hbmMask);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
GDIOBJ_SetOwnership(CurIconObject->IconInfo.hbmMask, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -349,9 +349,9 @@ IntGetDesktopWorkArea(PDESKTOP_OBJECT Desktop, PRECT Rect)
|
|||
{
|
||||
Ret->right = BitmapObj->SurfObj.sizlBitmap.cx;
|
||||
Ret->bottom = BitmapObj->SurfObj.sizlBitmap.cy;
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
}
|
||||
DC_UnlockDc(ScreenDeviceContext);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
if(Rect)
|
||||
|
|
|
@ -952,7 +952,7 @@ IntMouseInput(MOUSEINPUT *mi)
|
|||
if (dc)
|
||||
{
|
||||
hBitmap = dc->w.hBitmap;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
if (BitmapObj)
|
||||
|
@ -970,7 +970,7 @@ IntMouseInput(MOUSEINPUT *mi)
|
|||
GDIDEV(SurfObj)->Pointer.Pos.x = MousePos.x;
|
||||
GDIDEV(SurfObj)->Pointer.Pos.y = MousePos.y;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ NtUserGetSystemMetrics(ULONG Index)
|
|||
{
|
||||
Width = ScreenDC->GDIInfo->ulHorzRes;
|
||||
Height = ScreenDC->GDIInfo->ulVertRes;
|
||||
DC_UnlockDc(ScreenDCHandle);
|
||||
DC_UnlockDc(ScreenDC);
|
||||
}
|
||||
NtGdiDeleteDC(ScreenDCHandle);
|
||||
}
|
||||
|
|
|
@ -841,7 +841,7 @@ IntSystemParametersInfo(
|
|||
WinStaObject->cxWallpaper = bmp->SurfObj.sizlBitmap.cx;
|
||||
WinStaObject->cyWallpaper = bmp->SurfObj.sizlBitmap.cy;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hNewBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
|
||||
/* change the bitmap's ownership */
|
||||
GDIOBJ_SetOwnership(hNewBitmap, NULL);
|
||||
|
|
|
@ -506,7 +506,7 @@ NtUserEnumDisplayMonitors(
|
|||
return -1;
|
||||
}
|
||||
dcVisRgn = dc->w.hVisRgn;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
regionType = NtGdiGetRgnBox(dcVisRgn, &dcRect);
|
||||
if (regionType == 0)
|
||||
|
|
|
@ -743,7 +743,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
|
|||
if (NULL != Rgn)
|
||||
{
|
||||
UnsafeIntGetRgnBox(Rgn, &Ps.rcPaint);
|
||||
RGNDATA_UnlockRgn(Window->UpdateRegion);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
IntGdiOffsetRect(&Ps.rcPaint,
|
||||
Window->WindowRect.left - Window->ClientRect.left,
|
||||
Window->WindowRect.top - Window->ClientRect.top);
|
||||
|
@ -933,7 +933,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
|
|||
ASSERT(RgnData != NULL);
|
||||
RegionType = UnsafeIntGetRgnBox(RgnData, &Rect);
|
||||
ASSERT(RegionType != ERROR);
|
||||
RGNDATA_UnlockRgn(Window->UpdateRegion);
|
||||
RGNDATA_UnlockRgn(RgnData);
|
||||
}
|
||||
AlwaysPaint = (Window->Flags & WINDOWOBJECT_NEED_NCPAINT) ||
|
||||
(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT);
|
||||
|
@ -1062,7 +1062,7 @@ NtUserScrollDC(HDC hDC, INT dx, INT dy, const RECT *lprcScroll,
|
|||
IntGdiOffsetRect(&rSrc_lp, offset.left - offset.right, offset.top - offset.bottom);
|
||||
IntDPtoLP(DC, (LPPOINT)&rDst_lp, 2);
|
||||
IntDPtoLP(DC, (LPPOINT)&rSrc_lp, 2);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(DC);
|
||||
|
||||
if (!NtGdiBitBlt(hDC, rDst_lp.left, rDst_lp.top, rDst_lp.right - rDst_lp.left,
|
||||
rDst_lp.bottom - rDst_lp.top, hDC, rSrc_lp.left, rSrc_lp.top,
|
||||
|
@ -1071,7 +1071,7 @@ NtUserScrollDC(HDC hDC, INT dx, INT dy, const RECT *lprcScroll,
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(DC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -130,7 +130,7 @@ DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
|||
|
||||
Dce = DCEOBJ_LockDCE(DceHandle);
|
||||
/* No real locking, just get the pointer */
|
||||
DCEOBJ_UnlockDCE(DceHandle);
|
||||
DCEOBJ_UnlockDCE(Dce);
|
||||
Dce->Self = DceHandle;
|
||||
Dce->hDC = IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
|
||||
if (NULL == defaultDCstate)
|
||||
|
@ -200,7 +200,7 @@ DceSetDrawable(PWINDOW_OBJECT WindowObject, HDC hDC, ULONG Flags,
|
|||
dc->w.DCOrgY = WindowObject->ClientRect.top;
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -855,7 +855,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
|
|||
NtGdiOffsetRgn(pDCE->hClipRgn, DeltaX, DeltaY);
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(pDCE->hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
|
||||
|
||||
|
|
|
@ -3918,7 +3918,7 @@ IntGetWindowRgn(HWND hWnd, HRGN hRgn)
|
|||
if((pRgn = RGNDATA_LockRgn(hRgn)))
|
||||
{
|
||||
Ret = pRgn->rdh.iType;
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(pRgn);
|
||||
}
|
||||
else
|
||||
Ret = ERROR;
|
||||
|
@ -3959,7 +3959,7 @@ IntGetWindowRgnBox(HWND hWnd, RECT *Rect)
|
|||
{
|
||||
Ret = pRgn->rdh.iType;
|
||||
*Rect = pRgn->rdh.rcBound;
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
RGNDATA_UnlockRgn(pRgn);
|
||||
}
|
||||
else
|
||||
Ret = ERROR;
|
||||
|
|
|
@ -853,13 +853,13 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
if (VisBefore != NULL && (VisRgn = (PROSRGNDATA)RGNDATA_LockRgn(VisBefore)) &&
|
||||
UnsafeIntGetRgnBox(VisRgn, &TempRect) == NULLREGION)
|
||||
{
|
||||
RGNDATA_UnlockRgn(VisBefore);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
NtGdiDeleteObject(VisBefore);
|
||||
VisBefore = NULL;
|
||||
}
|
||||
else if(VisRgn)
|
||||
{
|
||||
RGNDATA_UnlockRgn(VisBefore);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -988,13 +988,13 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
if (VisAfter != NULL && (VisRgn = (PROSRGNDATA)RGNDATA_LockRgn(VisAfter)) &&
|
||||
UnsafeIntGetRgnBox(VisRgn, &TempRect) == NULLREGION)
|
||||
{
|
||||
RGNDATA_UnlockRgn(VisAfter);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
NtGdiDeleteObject(VisAfter);
|
||||
VisAfter = NULL;
|
||||
}
|
||||
else if(VisRgn)
|
||||
{
|
||||
RGNDATA_UnlockRgn(VisAfter);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1048,7 +1048,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
UnsafeIntGetRgnBox(VisRgn, &CopyRect) == NULLREGION)
|
||||
{
|
||||
/* Nothing to copy, clean up */
|
||||
RGNDATA_UnlockRgn(CopyRgn);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
NtGdiDeleteObject(CopyRgn);
|
||||
CopyRgn = NULL;
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
{
|
||||
if(VisRgn)
|
||||
{
|
||||
RGNDATA_UnlockRgn(CopyRgn);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
}
|
||||
/*
|
||||
* Small trick here: there is no function to bitblt a region. So
|
||||
|
@ -1083,7 +1083,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
}
|
||||
else if(VisRgn)
|
||||
{
|
||||
RGNDATA_UnlockRgn(CopyRgn);
|
||||
RGNDATA_UnlockRgn(VisRgn);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -61,7 +61,7 @@ NtGdiBitBlt(
|
|||
}
|
||||
if (DCDest->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -73,15 +73,15 @@ NtGdiBitBlt(
|
|||
DCSrc = DC_LockDc(hDCSrc);
|
||||
if (NULL == DCSrc)
|
||||
{
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
DPRINT1("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -137,17 +137,17 @@ NtGdiBitBlt(
|
|||
{
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
if(BitmapDest != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
}
|
||||
if(BitmapSrc != NULL && BitmapSrc != BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -191,20 +191,20 @@ NtGdiBitBlt(
|
|||
{
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
if(BitmapDest != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
}
|
||||
if(BitmapSrc != NULL && BitmapSrc != BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
}
|
||||
if(BrushObj != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||
}
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return FALSE;
|
||||
|
@ -222,21 +222,21 @@ NtGdiBitBlt(
|
|||
|
||||
if(BitmapDest != NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
}
|
||||
if (UsesSource && BitmapSrc != BitmapDest)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
}
|
||||
if (BrushObj != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||
}
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -273,14 +273,14 @@ NtGdiTransparentBlt(
|
|||
}
|
||||
if (DCDest->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hdcDst);
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if((hdcDst != hdcSrc) && !(DCSrc = DC_LockDc(hdcSrc)))
|
||||
{
|
||||
DC_UnlockDc(hdcDst);
|
||||
DC_UnlockDc(DCDest);
|
||||
DPRINT1("Invalid source dc handle (0x%08x) passed to NtGdiTransparentBlt\n", hdcSrc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
|
@ -291,10 +291,10 @@ NtGdiTransparentBlt(
|
|||
}
|
||||
if (DCSrc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hdcSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
if(hdcDst != hdcSrc)
|
||||
{
|
||||
DC_UnlockDc(hdcDst);
|
||||
DC_UnlockDc(DCDest);
|
||||
}
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
|
@ -314,16 +314,16 @@ NtGdiTransparentBlt(
|
|||
|
||||
if(!(PalSourceGDI = PALETTE_LockPalette(SourcePalette)))
|
||||
{
|
||||
DC_UnlockDc(hdcSrc);
|
||||
DC_UnlockDc(hdcDst);
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if((DestPalette != SourcePalette) && !(PalDestGDI = PALETTE_LockPalette(DestPalette)))
|
||||
{
|
||||
PALETTE_UnlockPalette(SourcePalette);
|
||||
DC_UnlockDc(hdcSrc);
|
||||
DC_UnlockDc(hdcDst);
|
||||
PALETTE_UnlockPalette(PalSourceGDI);
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -331,13 +331,13 @@ NtGdiTransparentBlt(
|
|||
{
|
||||
PalDestMode = PalDestGDI->Mode;
|
||||
PalSrcMode = PalSourceGDI->Mode;
|
||||
PALETTE_UnlockPalette(DestPalette);
|
||||
PALETTE_UnlockPalette(PalDestGDI);
|
||||
}
|
||||
else
|
||||
{
|
||||
PalDestMode = PalSrcMode = PalSourceGDI->Mode;
|
||||
}
|
||||
PALETTE_UnlockPalette(SourcePalette);
|
||||
PALETTE_UnlockPalette(PalSourceGDI);
|
||||
|
||||
/* Translate Transparent (RGB) Color to the source palette */
|
||||
if((XlateObj = (XLATEOBJ*)IntEngCreateXlate(PalSrcMode, PAL_RGB, SourcePalette, NULL)))
|
||||
|
@ -375,12 +375,12 @@ NtGdiTransparentBlt(
|
|||
TransparentColor, 0);
|
||||
|
||||
done:
|
||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
|
||||
DC_UnlockDc(hdcSrc);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
if(hdcDst != hdcSrc)
|
||||
{
|
||||
DC_UnlockDc(hdcDst);
|
||||
DC_UnlockDc(DCDest);
|
||||
}
|
||||
if(XlateObj)
|
||||
{
|
||||
|
@ -432,7 +432,7 @@ NtGdiCreateBitmap(
|
|||
bmp = BITMAPOBJ_LockBitmap( hBitmap );
|
||||
/* FIXME - bmp can be NULL!!!!!! */
|
||||
bmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
|
||||
BITMAPOBJ_UnlockBitmap( hBitmap );
|
||||
BITMAPOBJ_UnlockBitmap( bmp );
|
||||
|
||||
/*
|
||||
* NOTE: It's ugly practice, but we are using the object even
|
||||
|
@ -524,7 +524,7 @@ NtGdiCreateCompatibleBitmap(
|
|||
Bmp = IntCreateCompatibleBitmap(Dc, Width, Height);
|
||||
|
||||
DPRINT ("\t\t%04x\n", Bmp);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
return Bmp;
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ NtGdiGetBitmapDimensionEx(
|
|||
|
||||
*Dimension = bmp->dimension;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return Result;
|
||||
}
|
||||
XPos += dc->w.DCOrgX;
|
||||
|
@ -639,10 +639,10 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
}
|
||||
EngDeleteXlate(XlateObj);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObject);
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
// if Result is still CLR_INVALID, then the "quick" method above didn't work
|
||||
if ( bInRect && Result == CLR_INVALID )
|
||||
|
@ -671,7 +671,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
|||
if ( bmpobj )
|
||||
{
|
||||
Result = *(COLORREF*)bmpobj->SurfObj.pvScan0;
|
||||
BITMAPOBJ_UnlockBitmap ( hBmpTmp );
|
||||
BITMAPOBJ_UnlockBitmap ( bmpobj );
|
||||
}
|
||||
}
|
||||
NtGdiDeleteObject ( hBmpTmp );
|
||||
|
@ -970,7 +970,7 @@ NtGdiSetBitmapBits(
|
|||
ret = Bytes;
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -997,7 +997,7 @@ NtGdiSetBitmapDimensionEx(
|
|||
bmp->dimension.cx = Width;
|
||||
bmp->dimension.cy = Height;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap (hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1081,7 +1081,7 @@ NtGdiStretchBlt(
|
|||
}
|
||||
if (DCDest->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1093,15 +1093,15 @@ NtGdiStretchBlt(
|
|||
DCSrc = DC_LockDc(hDCSrc);
|
||||
if (NULL == DCSrc)
|
||||
{
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
DPRINT1("Invalid source dc handle (0x%08x) passed to NtGdiStretchBlt\n", hDCSrc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (DCSrc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCSrc);
|
||||
DC_UnlockDc(DCDest);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1210,9 +1210,9 @@ NtGdiStretchBlt(
|
|||
{
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1237,9 +1237,9 @@ NtGdiStretchBlt(
|
|||
{
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1253,19 +1253,19 @@ NtGdiStretchBlt(
|
|||
EngDeleteXlate(XlateObj);
|
||||
if (UsesPattern)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||
}
|
||||
failed:
|
||||
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapSrc);
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapDest);
|
||||
if (UsesSource && hDCSrc != hDCDest)
|
||||
{
|
||||
DC_UnlockDc(hDCSrc);
|
||||
DC_UnlockDc(DCSrc);
|
||||
}
|
||||
DC_UnlockDc(hDCDest);
|
||||
DC_UnlockDc(DCDest);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -1336,7 +1336,7 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap)
|
|||
ExFreePool (buf);
|
||||
}
|
||||
|
||||
GDIOBJ_UnlockObj(hBitmap);
|
||||
GDIOBJ_UnlockObjByPtr(Bitmap);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
|
|||
Result = IntEngCreateXlate(0, 0, Dc->w.hPalette, Pattern->hDIBPalette);
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BrushObj->hbmPattern);
|
||||
BITMAPOBJ_UnlockBitmap(Pattern);
|
||||
*Failed = FALSE;
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ IntGdiCreateDIBBrush(
|
|||
BitmapObject = BITMAPOBJ_LockBitmap(hPattern);
|
||||
ASSERT(BitmapObject != NULL);
|
||||
BitmapObject->hDIBPalette = BuildDIBPalette(BitmapInfo, &PaletteType);
|
||||
BITMAPOBJ_UnlockBitmap(hPattern);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObject);
|
||||
|
||||
hBrush = BRUSHOBJ_AllocBrush();
|
||||
if (hBrush == NULL)
|
||||
|
@ -295,7 +295,7 @@ IntGdiCreateDIBBrush(
|
|||
|
||||
GDIOBJ_SetOwnership(hPattern, NULL);
|
||||
|
||||
BRUSHOBJ_UnlockBrush(hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
|
||||
return hBrush;
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ IntGdiCreateHatchBrush(
|
|||
|
||||
GDIOBJ_SetOwnership(hPattern, NULL);
|
||||
|
||||
BRUSHOBJ_UnlockBrush(hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
|
||||
return hBrush;
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ IntGdiCreatePatternBrush(
|
|||
|
||||
GDIOBJ_SetOwnership(hPattern, NULL);
|
||||
|
||||
BRUSHOBJ_UnlockBrush(hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
|
||||
return hBrush;
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ IntGdiCreateSolidBrush(
|
|||
BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF;
|
||||
/* FIXME: Fill in the rest of fields!!! */
|
||||
|
||||
BRUSHOBJ_UnlockBrush(hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
|
||||
return hBrush;
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ IntGdiCreateNullBrush(VOID)
|
|||
BrushObject = BRUSHOBJ_LockBrush(hBrush);
|
||||
ASSERT(BrushObject != NULL);
|
||||
BrushObject->flAttrs |= GDIBRUSH_IS_NULL;
|
||||
BRUSHOBJ_UnlockBrush(hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObject);
|
||||
|
||||
return hBrush;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ IntPatBlt(
|
|||
ROP3_TO_ROP4(ROP));
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ IntGdiPolyPatBlt(
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -539,12 +539,12 @@ IntGdiPolyPatBlt(
|
|||
r->r.bottom,
|
||||
dwRop,
|
||||
BrushObj);
|
||||
BRUSHOBJ_UnlockBrush(r->hBrush);
|
||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||
}
|
||||
r++;
|
||||
}
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ NtGdiSetBrushOrgEx(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
|||
Status = MmCopyToCaller(Point, &SafePoint, sizeof(POINT));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ NtGdiSetBrushOrgEx(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
|||
|
||||
dc->w.brushOrgX = XOrg;
|
||||
dc->w.brushOrgY = YOrg;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ NtGdiPatBlt(
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ NtGdiPatBlt(
|
|||
if (BrushObj == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -727,8 +727,8 @@ NtGdiPatBlt(
|
|||
ROP,
|
||||
BrushObj);
|
||||
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(BrushObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
|||
(PRECTL)CombinedRegion->Buffer,
|
||||
(PRECTL)&CombinedRegion->rdh.rcBound);
|
||||
|
||||
RGNDATA_UnlockRgn(Dc->w.hGCClipRgn);
|
||||
RGNDATA_UnlockRgn(CombinedRegion);
|
||||
}
|
||||
|
||||
if ( NULL == Dc->CombinedClip )
|
||||
|
@ -55,31 +55,6 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
|||
return NtGdiOffsetRgn(Dc->w.hGCClipRgn, -Dc->w.DCOrgX, -Dc->w.DCOrgY);
|
||||
}
|
||||
|
||||
HRGN WINAPI SaveVisRgn(HDC hdc)
|
||||
{
|
||||
HRGN copy;
|
||||
PROSRGNDATA obj;/*, copyObj;*/
|
||||
PDC dc = DC_LockDc(hdc);
|
||||
|
||||
if (!dc) return 0;
|
||||
|
||||
obj = RGNDATA_LockRgn(dc->w.hVisRgn);
|
||||
/* FIXME - Handle obj == NULL!!! */
|
||||
|
||||
if(!(copy = NtGdiCreateRectRgn(0, 0, 0, 0)))
|
||||
{
|
||||
RGNDATA_UnlockRgn(dc->w.hVisRgn);
|
||||
DC_UnlockDc(hdc);
|
||||
return 0;
|
||||
}
|
||||
NtGdiCombineRgn(copy, dc->w.hVisRgn, 0, RGN_COPY);
|
||||
/* copyObj = RGNDATA_LockRgn(copy); */
|
||||
/* copyObj->header.hNext = obj->header.hNext;
|
||||
header.hNext = copy; */
|
||||
DC_UnlockDc(hdc);
|
||||
return copy;
|
||||
}
|
||||
|
||||
INT STDCALL
|
||||
NtGdiSelectVisRgn(HDC hdc, HRGN hrgn)
|
||||
{
|
||||
|
@ -108,7 +83,7 @@ NtGdiSelectVisRgn(HDC hdc, HRGN hrgn)
|
|||
retval = NtGdiCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
|
||||
if ( retval != ERROR )
|
||||
CLIPPING_UpdateGCRegion(dc);
|
||||
DC_UnlockDc( hdc );
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -141,7 +116,7 @@ int STDCALL NtGdiExtSelectClipRgn(HDC hDC,
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return ERROR;
|
||||
}
|
||||
|
@ -155,7 +130,7 @@ int STDCALL NtGdiExtSelectClipRgn(HDC hDC,
|
|||
if((Rgn = RGNDATA_LockRgn(dc->w.hVisRgn)))
|
||||
{
|
||||
UnsafeIntGetRgnBox(Rgn, &rect);
|
||||
RGNDATA_UnlockRgn(dc->w.hVisRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
dc->w.hClipRgn = UnsafeIntCreateRectRgnIndirect(&rect);
|
||||
}
|
||||
else
|
||||
|
@ -172,7 +147,7 @@ int STDCALL NtGdiExtSelectClipRgn(HDC hDC,
|
|||
}
|
||||
|
||||
retval = CLIPPING_UpdateGCRegion(dc);
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -192,14 +167,14 @@ IntGdiGetClipBox(HDC hDC, LPRECT rc)
|
|||
|
||||
if (!(Rgn = RGNDATA_LockRgn(dc->w.hGCClipRgn)))
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return ERROR;
|
||||
}
|
||||
retval = UnsafeIntGetRgnBox(Rgn, rc);
|
||||
RGNDATA_UnlockRgn(dc->w.hGCClipRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
IntDPtoLP(dc, (LPPOINT)rc, 2);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -277,7 +252,7 @@ int STDCALL NtGdiExcludeClipRect(HDC hDC,
|
|||
if (Result != ERROR)
|
||||
CLIPPING_UpdateGCRegion(dc);
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -327,7 +302,7 @@ int STDCALL NtGdiIntersectClipRect(HDC hDC,
|
|||
if (Result != ERROR)
|
||||
CLIPPING_UpdateGCRegion(dc);
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -354,7 +329,7 @@ BOOL STDCALL NtGdiPtVisible(HDC hDC,
|
|||
}
|
||||
|
||||
rgn = dc->w.hGCClipRgn;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return (rgn ? NtGdiPtInRegion(rgn, X, Y) : FALSE);
|
||||
}
|
||||
|
@ -377,7 +352,7 @@ BOOL STDCALL NtGdiRectVisible(HDC hDC,
|
|||
Status = MmCopyFromCaller(&Rect, UnsafeRect, sizeof(RECT));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -387,10 +362,10 @@ BOOL STDCALL NtGdiRectVisible(HDC hDC,
|
|||
{
|
||||
IntLPtoDP(dc, (LPPOINT)&Rect, 2);
|
||||
Result = UnsafeIntRectInRegion(Rgn, &Rect);
|
||||
RGNDATA_UnlockRgn(dc->w.hGCClipRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ BOOL STDCALL NtGdiAnimatePalette(HPALETTE hPal, UINT StartIndex,
|
|||
pal_entries = palPtr->NumColors;
|
||||
if (StartIndex >= pal_entries)
|
||||
{
|
||||
PALETTE_UnlockPalette(hPal);
|
||||
PALETTE_UnlockPalette(palPtr);
|
||||
return FALSE;
|
||||
}
|
||||
if (StartIndex+NumEntries > pal_entries) NumEntries = pal_entries - StartIndex;
|
||||
|
@ -102,7 +102,7 @@ BOOL STDCALL NtGdiAnimatePalette(HPALETTE hPal, UINT StartIndex,
|
|||
}
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(hPal);
|
||||
PALETTE_UnlockPalette(palPtr);
|
||||
|
||||
/* Immediately apply the new palette if current window uses it */
|
||||
hHwd = NtUserGetDesktopWindow();
|
||||
|
@ -112,11 +112,11 @@ BOOL STDCALL NtGdiAnimatePalette(HPALETTE hPal, UINT StartIndex,
|
|||
{
|
||||
if (dc->w.hPalette == hPal)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
NtGdiRealizePalette(hDC);
|
||||
}
|
||||
else
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
NtUserReleaseDC(hHwd,hDC);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ HPALETTE STDCALL NtGdiCreatePalette(CONST PLOGPALETTE palette)
|
|||
PALETTE_ValidateFlags(PalGDI->IndexedColors, PalGDI->NumColors);
|
||||
PalGDI->logicalToSystem = NULL;
|
||||
|
||||
PALETTE_UnlockPalette(NewPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
|
||||
return NewPalette;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ COLORREF STDCALL NtGdiGetNearestColor(HDC hDC, COLORREF Color)
|
|||
palGDI = (PPALGDI) PALETTE_LockPalette(hpal);
|
||||
if (!palGDI)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return nearest;
|
||||
}
|
||||
|
||||
|
@ -234,8 +234,8 @@ COLORREF STDCALL NtGdiGetNearestColor(HDC hDC, COLORREF Color)
|
|||
(GetBValue(Color) >> BBits) << BBits);
|
||||
break;
|
||||
}
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
DC_UnlockDc(hDC);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
return nearest;
|
||||
|
@ -251,7 +251,7 @@ UINT STDCALL NtGdiGetNearestPaletteIndex(HPALETTE hpal,
|
|||
{
|
||||
/* Return closest match for the given RGB color */
|
||||
index = COLOR_PaletteLookupPixel(palGDI->IndexedColors, palGDI->NumColors, NULL, Color, FALSE);
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
}
|
||||
|
||||
return index;
|
||||
|
@ -280,7 +280,7 @@ UINT STDCALL NtGdiGetPaletteEntries(HPALETTE hpal,
|
|||
{
|
||||
if (numEntries <= StartIndex)
|
||||
{
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
return 0;
|
||||
}
|
||||
memcpy(pe, palGDI->IndexedColors + StartIndex, Entries * sizeof(PALETTEENTRY));
|
||||
|
@ -293,7 +293,7 @@ UINT STDCALL NtGdiGetPaletteEntries(HPALETTE hpal,
|
|||
}
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
return Entries;
|
||||
}
|
||||
|
||||
|
@ -411,8 +411,8 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC)
|
|||
// need to pass this to IntEngCreateXlate with palettes unlocked
|
||||
sysMode = sysGDI->Mode;
|
||||
palMode = palGDI->Mode;
|
||||
PALETTE_UnlockPalette(systemPalette);
|
||||
PALETTE_UnlockPalette(dc->w.hPalette);
|
||||
PALETTE_UnlockPalette(sysGDI);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
|
||||
// Step 3: Create the XLATEOBJ for device managed DCs
|
||||
if(dc->w.flags != DC_MEMORY)
|
||||
|
@ -421,7 +421,7 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC)
|
|||
palGDI->logicalToSystem = IntEngCreateXlate(sysMode, palMode, systemPalette, dc->w.hPalette);
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return realized;
|
||||
}
|
||||
|
@ -501,13 +501,13 @@ HPALETTE STDCALL NtGdiSelectPalette(HDC hDC,
|
|||
if ((dc->w.bitsPerPixel <= 8 && PAL_INDEXED == PalGDI->Mode)
|
||||
|| (8 < dc->w.bitsPerPixel && PAL_INDEXED != PalGDI->Mode))
|
||||
{
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
oldPal = dc->w.hPalette;
|
||||
dc->w.hPalette = hpal;
|
||||
}
|
||||
else
|
||||
{
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
oldPal = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ HPALETTE STDCALL NtGdiSelectPalette(HDC hDC,
|
|||
{
|
||||
oldPal = NULL;
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
return oldPal;
|
||||
|
@ -542,7 +542,7 @@ UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal,
|
|||
numEntries = palGDI->NumColors;
|
||||
if (Start >= numEntries)
|
||||
{
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
return 0;
|
||||
}
|
||||
if (numEntries < Start + Entries)
|
||||
|
@ -553,7 +553,7 @@ UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal,
|
|||
PALETTE_ValidateFlags(palGDI->IndexedColors, palGDI->NumColors);
|
||||
ExFreePool(palGDI->logicalToSystem);
|
||||
palGDI->logicalToSystem = NULL;
|
||||
PALETTE_UnlockPalette(hpal);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
|
||||
return Entries;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ NtGdiDPtoLP(HDC hDC,
|
|||
|
||||
if (!UnsafePoints || Count <= 0)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ NtGdiDPtoLP(HDC hDC,
|
|||
Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD);
|
||||
if(!Points)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ NtGdiDPtoLP(HDC hDC,
|
|||
Status = MmCopyFromCaller(Points, UnsafePoints, Size);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -169,13 +169,13 @@ NtGdiDPtoLP(HDC hDC,
|
|||
Status = MmCopyToCaller(UnsafePoints, Points, Size);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ NtGdiGetGraphicsMode ( HDC hDC )
|
|||
|
||||
GraphicsMode = dc->w.GraphicsMode;
|
||||
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return GraphicsMode;
|
||||
}
|
||||
|
||||
|
@ -224,14 +224,14 @@ NtGdiGetWorldTransform(HDC hDC,
|
|||
}
|
||||
if (!XForm)
|
||||
{
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = MmCopyToCaller(XForm, &dc->w.xformWorld2Wnd, sizeof(XFORM));
|
||||
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return NT_SUCCESS(Status);
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
|
|||
|
||||
if (!UnsafePoints || Count <= 0)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
|
|||
Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD);
|
||||
if(!Points)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
|
|||
Status = MmCopyFromCaller(Points, UnsafePoints, Size);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -318,13 +318,13 @@ NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
|
|||
Status = MmCopyToCaller(UnsafePoints, Points, Size);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Points);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ NtGdiModifyWorldTransform(HDC hDC,
|
|||
|
||||
if (!UnsafeXForm)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ NtGdiModifyWorldTransform(HDC hDC,
|
|||
Status = MmCopyFromCaller(&SafeXForm, UnsafeXForm, sizeof(XFORM));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -381,13 +381,13 @@ NtGdiModifyWorldTransform(HDC hDC,
|
|||
break;
|
||||
|
||||
default:
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,7 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
|||
if ( !NT_SUCCESS(Status) )
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
|||
dc->vportOrgY += YOffset;
|
||||
DC_UpdateXforms(dc);
|
||||
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,7 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
|||
dc->wndOrgY += YOffset;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -521,14 +521,14 @@ NtGdiSetGraphicsMode(HDC hDC,
|
|||
|
||||
if ((Mode != GM_COMPATIBLE) && (Mode != GM_ADVANCED))
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = dc->w.GraphicsMode;
|
||||
dc->w.GraphicsMode = Mode;
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -550,7 +550,7 @@ NtGdiSetMapMode(HDC hDC,
|
|||
PrevMapMode = dc->w.MapMode;
|
||||
dc->w.MapMode = MapMode;
|
||||
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return PrevMapMode;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ NtGdiSetViewportExtEx(HDC hDC,
|
|||
case MM_LOMETRIC:
|
||||
case MM_TEXT:
|
||||
case MM_TWIPS:
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
|
||||
case MM_ISOTROPIC:
|
||||
|
@ -600,7 +600,7 @@ NtGdiSetViewportExtEx(HDC hDC,
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ NtGdiSetViewportExtEx(HDC hDC,
|
|||
dc->vportExtY = YExtent;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
|||
dc->vportOrgY = Y;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ NtGdiSetWindowExtEx(HDC hDC,
|
|||
case MM_LOMETRIC:
|
||||
case MM_TEXT:
|
||||
case MM_TWIPS:
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ NtGdiSetWindowExtEx(HDC hDC,
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ NtGdiSetWindowExtEx(HDC hDC,
|
|||
dc->wndExtY = YExtent;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -738,7 +738,7 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -747,7 +747,7 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
|||
dc->wndOrgY = Y;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -769,7 +769,7 @@ NtGdiSetWorldTransform(HDC hDC,
|
|||
|
||||
if (!XForm)
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
/* Win doesn't set LastError */
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -777,19 +777,19 @@ NtGdiSetWorldTransform(HDC hDC,
|
|||
/* Check that graphics mode is GM_ADVANCED */
|
||||
if ( dc->w.GraphicsMode != GM_ADVANCED )
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = MmCopyFromCaller(&dc->w.xformWorld2Wnd, XForm, sizeof(XFORM));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DC_UpdateXforms (dc);
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ func_type STDCALL func_name( HDC hdc ) \
|
|||
return 0; \
|
||||
} \
|
||||
ft = dc->dc_field; \
|
||||
DC_UnlockDc( hdc ); \
|
||||
DC_UnlockDc(dc); \
|
||||
return ft; \
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ BOOL STDCALL NtGdi##FuncName ( HDC hdc, LP##type pt ) \
|
|||
return FALSE; \
|
||||
} \
|
||||
Int##FuncName( dc, &Safept); \
|
||||
DC_UnlockDc(hdc); \
|
||||
DC_UnlockDc(dc); \
|
||||
Status = MmCopyToCaller(pt, &Safept, sizeof( type )); \
|
||||
if(!NT_SUCCESS(Status)) \
|
||||
{ \
|
||||
|
@ -107,7 +107,7 @@ INT STDCALL func_name( HDC hdc, INT mode ) \
|
|||
} \
|
||||
prevMode = dc->dc_field; \
|
||||
dc->dc_field = mode; \
|
||||
DC_UnlockDc ( hdc ); \
|
||||
DC_UnlockDc ( dc ); \
|
||||
return prevMode; \
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ NtGdiCreateCompatableDC(HDC hDC)
|
|||
|
||||
if (NULL == hNewDC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(OrigDC);
|
||||
if (NULL != DisplayDC)
|
||||
{
|
||||
NtGdiDeleteDC(DisplayDC);
|
||||
|
@ -193,8 +193,8 @@ NtGdiCreateCompatableDC(HDC hDC)
|
|||
/* Create default bitmap */
|
||||
if (!(hBitmap = NtGdiCreateBitmap( 1, 1, 1, NewDC->w.bitsPerPixel, NULL )))
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( hNewDC );
|
||||
DC_UnlockDc( OrigDC );
|
||||
DC_UnlockDc( NewDC );
|
||||
DC_FreeDC( hNewDC );
|
||||
if (NULL != DisplayDC)
|
||||
{
|
||||
|
@ -213,12 +213,12 @@ NtGdiCreateCompatableDC(HDC hDC)
|
|||
NewDC->w.backgroundColor = OrigDC->w.backgroundColor;
|
||||
NewDC->w.backgroundMode = OrigDC->w.backgroundMode;
|
||||
NewDC->w.ROPmode = OrigDC->w.ROPmode;
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(NewDC);
|
||||
DC_UnlockDc(OrigDC);
|
||||
if (NULL != DisplayDC)
|
||||
{
|
||||
NtGdiDeleteDC(DisplayDC);
|
||||
}
|
||||
DC_UnlockDc(hNewDC);
|
||||
|
||||
hVisRgn = NtGdiCreateRectRgn(0, 0, 1, 1);
|
||||
NtGdiSelectVisRgn(hNewDC, hVisRgn);
|
||||
|
@ -795,7 +795,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
|||
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
|
||||
NewDC->w.ROPmode = R2_COPYPEN;
|
||||
|
||||
DC_UnlockDc( hNewDC );
|
||||
DC_UnlockDc( NewDC );
|
||||
|
||||
hVisRgn = NtGdiCreateRectRgn(0, 0, NewDC->GDIInfo->ulHorzRes,
|
||||
NewDC->GDIInfo->ulVertRes);
|
||||
|
@ -811,7 +811,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc( hNewDC );
|
||||
DC_UnlockDc( NewDC );
|
||||
}
|
||||
|
||||
return hNewDC;
|
||||
|
@ -940,7 +940,7 @@ NtGdiDeleteDC(HDC DCHandle)
|
|||
}
|
||||
DC_SetNextDC (DCToDelete, DC_GetNextDC (savedDC));
|
||||
DCToDelete->saveLevel--;
|
||||
DC_UnlockDc( savedHDC );
|
||||
DC_UnlockDc( savedDC );
|
||||
NtGdiDeleteDC (savedHDC);
|
||||
}
|
||||
|
||||
|
@ -980,7 +980,7 @@ NtGdiDeleteDC(HDC DCHandle)
|
|||
#if 0 /* FIXME */
|
||||
PATH_DestroyGdiPath (&DCToDelete->w.path);
|
||||
#endif
|
||||
DC_UnlockDc( DCHandle );
|
||||
DC_UnlockDc( DCToDelete );
|
||||
DC_FreeDC ( DCHandle );
|
||||
|
||||
return TRUE;
|
||||
|
@ -1051,7 +1051,7 @@ NtGdiGetCurrentObject(HDC hDC, UINT ObjectType)
|
|||
break;
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return SelObject;
|
||||
}
|
||||
|
||||
|
@ -1093,11 +1093,11 @@ NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point)
|
|||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -1117,7 +1117,7 @@ NtGdiSetBkColor(HDC hDC, COLORREF color)
|
|||
oldColor = dc->w.backgroundColor;
|
||||
dc->w.backgroundColor = color;
|
||||
hBrush = dc->w.hBrush;
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
NtGdiSelectObject(hDC, hBrush);
|
||||
return oldColor;
|
||||
}
|
||||
|
@ -1138,7 +1138,7 @@ NtGdiGetDCState(HDC hDC)
|
|||
hnewdc = DC_AllocDC(NULL);
|
||||
if (hnewdc == NULL)
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return 0;
|
||||
}
|
||||
newdc = DC_LockDc( hnewdc );
|
||||
|
@ -1211,8 +1211,8 @@ NtGdiGetDCState(HDC hDC)
|
|||
newdc->w.hClipRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
|
||||
NtGdiCombineRgn( newdc->w.hClipRgn, dc->w.hClipRgn, 0, RGN_COPY );
|
||||
}
|
||||
DC_UnlockDc( hnewdc );
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( newdc );
|
||||
DC_UnlockDc( dc );
|
||||
return hnewdc;
|
||||
}
|
||||
|
||||
|
@ -1308,9 +1308,9 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
|
|||
res = CLIPPING_UpdateGCRegion( dc );
|
||||
ASSERT ( res != ERROR );
|
||||
}
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
#else
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn);
|
||||
#endif
|
||||
|
||||
|
@ -1327,11 +1327,11 @@ NtGdiSetDCState ( HDC hDC, HDC hDCSave )
|
|||
GDISelectPalette16( hDC, dcs->w.hPalette, FALSE );
|
||||
#endif
|
||||
} else {
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
DC_UnlockDc ( hDCSave );
|
||||
DC_UnlockDc ( dcs );
|
||||
} else {
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
}
|
||||
|
@ -1552,7 +1552,7 @@ NtGdiGetDeviceCaps(HDC hDC,
|
|||
|
||||
DPRINT("(%04x,%d): returning %d\n", hDC, Index, ret);
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1607,7 +1607,7 @@ IntGdiGetObject(HANDLE Handle, INT Count, LPVOID Buffer)
|
|||
break;
|
||||
}
|
||||
|
||||
GDIOBJ_UnlockObj(Handle);
|
||||
GDIOBJ_UnlockObjByPtr(GdiObject);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -1706,7 +1706,7 @@ NtGdiGetObjectType(HANDLE handle)
|
|||
result = 0;
|
||||
break;
|
||||
}
|
||||
GDIOBJ_UnlockObj(handle);
|
||||
GDIOBJ_UnlockObjByPtr(ptr);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1747,7 +1747,7 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel)
|
|||
|
||||
if ((SaveLevel < 1) || (SaveLevel > dc->saveLevel))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1759,14 +1759,14 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel)
|
|||
dcs = DC_LockDc (hdcs);
|
||||
if (dcs == NULL)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
DC_SetNextDC (dcs, DC_GetNextDC (dcs));
|
||||
if (--dc->saveLevel < SaveLevel)
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( hdcs );
|
||||
DC_UnlockDc( dc );
|
||||
DC_UnlockDc( dcs );
|
||||
NtGdiSetDCState(hDC, hdcs);
|
||||
#if 0
|
||||
if (!PATH_AssignGdiPath( &dc->w.path, &dcs->w.path ))
|
||||
|
@ -1784,11 +1784,11 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel)
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc( hdcs );
|
||||
DC_UnlockDc( dcs );
|
||||
}
|
||||
NtGdiDeleteDC (hdcs);
|
||||
}
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return success;
|
||||
}
|
||||
|
||||
|
@ -1815,7 +1815,7 @@ NtGdiSaveDC(HDC hDC)
|
|||
dc = DC_LockDc (hDC);
|
||||
if (dc == NULL)
|
||||
{
|
||||
DC_UnlockDc(hdcs);
|
||||
DC_UnlockDc(dcs);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1837,8 +1837,8 @@ NtGdiSaveDC(HDC hDC)
|
|||
DC_SetNextDC (dcs, DC_GetNextDC (dc));
|
||||
DC_SetNextDC (dc, hdcs);
|
||||
ret = ++dc->saveLevel;
|
||||
DC_UnlockDc( hdcs );
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dcs );
|
||||
DC_UnlockDc( dc );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1879,7 +1879,7 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(dc, pen, &Failed);
|
||||
PENOBJ_UnlockPen(hGDIObj);
|
||||
PENOBJ_UnlockPen(pen);
|
||||
if (Failed)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
|
@ -1902,7 +1902,7 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
}
|
||||
|
||||
XlateObj = IntGdiCreateBrushXlate(dc, brush, &Failed);
|
||||
BRUSHOBJ_UnlockBrush(hGDIObj);
|
||||
BRUSHOBJ_UnlockBrush(brush);
|
||||
if (Failed)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
|
@ -1928,14 +1928,14 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
// must be memory dc to select bitmap
|
||||
if (!(dc->w.flags & DC_MEMORY))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return NULL;
|
||||
}
|
||||
pb = BITMAPOBJ_LockBitmap(hGDIObj);
|
||||
if (NULL == pb)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return NULL;
|
||||
}
|
||||
objOrg = (HGDIOBJ)dc->w.hBitmap;
|
||||
|
@ -1959,16 +1959,16 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
NtGdiSelectObject ( hDC, dc->w.hBrush );
|
||||
NtGdiSelectObject ( hDC, dc->w.hPen );
|
||||
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
hVisRgn = NtGdiCreateRectRgn ( 0, 0, pb->SurfObj.sizlBitmap.cx, pb->SurfObj.sizlBitmap.cy );
|
||||
BITMAPOBJ_UnlockBitmap( hGDIObj );
|
||||
BITMAPOBJ_UnlockBitmap( pb );
|
||||
NtGdiSelectVisRgn ( hDC, hVisRgn );
|
||||
NtGdiDeleteObject ( hVisRgn );
|
||||
|
||||
return objOrg;
|
||||
|
||||
case GDI_OBJECT_TYPE_REGION:
|
||||
DC_UnlockDc (hDC);
|
||||
DC_UnlockDc (dc);
|
||||
/*
|
||||
* The return value is one of the following values:
|
||||
* SIMPLEREGION
|
||||
|
@ -1980,7 +1980,7 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return objOrg;
|
||||
}
|
||||
|
||||
|
@ -2012,7 +2012,7 @@ NtGdiSetHookFlags(HDC hDC, WORD Flags)
|
|||
dc->w.flags &= ~DC_DIRTY;
|
||||
}
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return wRet;
|
||||
}
|
||||
|
@ -2083,7 +2083,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
|||
|
||||
NewDC->w.hPalette = NtGdiGetStockObject(DEFAULT_PALETTE);
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(NewDC);
|
||||
|
||||
return hDC;
|
||||
}
|
||||
|
@ -2210,7 +2210,7 @@ DC_SetOwnership(HDC hDC, PEPROCESS Owner)
|
|||
{
|
||||
GDIOBJ_CopyOwnership(hDC, DC->w.hGCClipRgn);
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(DC);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,22 +32,22 @@ NtGdiSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Col
|
|||
if (!(dc = DC_LockDc(hDC))) return 0;
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
DC_UnlockDc(hDC);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
@ -75,13 +75,13 @@ NtGdiSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Col
|
|||
Entries = 0;
|
||||
}
|
||||
_SEH_END
|
||||
PALETTE_UnlockPalette(BitmapObj->hDIBPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
}
|
||||
else
|
||||
Entries = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
DC_UnlockDc(hDC);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Entries;
|
||||
}
|
||||
|
@ -97,22 +97,22 @@ NtGdiGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
|||
if (!(dc = DC_LockDc(hDC))) return 0;
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (BitmapObj == NULL)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BitmapObj->dib == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
DC_UnlockDc(hDC);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
@ -140,13 +140,13 @@ NtGdiGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
|
|||
Entries = 0;
|
||||
}
|
||||
_SEH_END
|
||||
PALETTE_UnlockPalette(BitmapObj->hDIBPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
}
|
||||
else
|
||||
Entries = 0;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
DC_UnlockDc(hDC);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Entries;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ IntSetDIBits(
|
|||
(PVOID) Bits);
|
||||
if (0 == SourceBitmap)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -213,8 +213,8 @@ IntSetDIBits(
|
|||
SourceSurf = EngLockSurface((HSURF)SourceBitmap);
|
||||
if (NULL == SourceSurf)
|
||||
{
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -225,13 +225,13 @@ IntSetDIBits(
|
|||
{
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
DDB_Palette_Type = hDCPalette->Mode;
|
||||
DDB_Palette = DC->DevInfo->hpalDefault;
|
||||
PALETTE_UnlockPalette(DC->DevInfo->hpalDefault);
|
||||
PALETTE_UnlockPalette(hDCPalette);
|
||||
|
||||
// Source palette obtained from the BITMAPINFO
|
||||
DIB_Palette = BuildDIBPalette ( (PBITMAPINFO)bmi, (PINT)&DIB_Palette_Type );
|
||||
|
@ -239,7 +239,7 @@ IntSetDIBits(
|
|||
{
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ IntSetDIBits(
|
|||
PALETTE_FreePalette(DIB_Palette);
|
||||
EngUnlockSurface(SourceSurf);
|
||||
EngDeleteSurface((HSURF)SourceBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return 0;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ IntSetDIBits(
|
|||
// if (ColorUse == DIB_PAL_COLORS)
|
||||
// WinFree((LPSTR)lpRGB);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -310,13 +310,13 @@ NtGdiSetDIBits(
|
|||
}
|
||||
if (Dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Ret = IntSetDIBits(Dc, hBitmap, StartScan, ScanLines, Bits, bmi, ColorUse);
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -376,13 +376,13 @@ NtGdiGetDIBits(HDC hDC,
|
|||
}
|
||||
if (Dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
return 0;
|
||||
}
|
||||
hSourcePalette = Dc->w.hPalette;
|
||||
/* FIXME: This is incorrect. hDestPalette should be something other. */
|
||||
hDestPalette = Dc->DevInfo->hpalDefault;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
/* Get pointer to the source bitmap object. */
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hBitmap);
|
||||
|
@ -456,7 +456,7 @@ NtGdiGetDIBits(HDC hDC,
|
|||
/* FIXME - SourcePalette can be NULL!!! Don't assert here! */
|
||||
ASSERT(SourcePalette);
|
||||
SourcePaletteType = SourcePalette->Mode;
|
||||
PALETTE_UnlockPalette(hSourcePalette);
|
||||
PALETTE_UnlockPalette(SourcePalette);
|
||||
|
||||
DestPalette = PALETTE_LockPalette(hDestPalette);
|
||||
/* FIXME - DestPalette can be NULL!!!! Don't assert here!!! */
|
||||
|
@ -488,7 +488,7 @@ NtGdiGetDIBits(HDC hDC,
|
|||
}
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(hDestPalette);
|
||||
PALETTE_UnlockPalette(DestPalette);
|
||||
|
||||
XlateObj = IntEngCreateXlate(
|
||||
DestPaletteType, SourcePaletteType, hDestPalette, hSourcePalette);
|
||||
|
@ -513,7 +513,7 @@ NtGdiGetDIBits(HDC hDC,
|
|||
}
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ LONG STDCALL NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
if (Bits == NULL)
|
||||
{
|
||||
ret = bmp->SurfObj.cjBits;
|
||||
BITMAPOBJ_UnlockBitmap (hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ LONG STDCALL NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
if (Count == 0)
|
||||
{
|
||||
DPRINT("Less then one entire line requested\n");
|
||||
BITMAPOBJ_UnlockBitmap (hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@ LONG STDCALL NtGdiGetBitmapBits(HBITMAP hBitmap,
|
|||
ret = Count;
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap (hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap (bmp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -750,7 +750,7 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header,
|
|||
|
||||
Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
|
||||
|
||||
DC_UnlockDc(hDc);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
return Bmp;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ HBITMAP STDCALL NtGdiCreateDIBSection(HDC hDC,
|
|||
{
|
||||
hbitmap = DIB_CreateDIBSection ( dc, (BITMAPINFO*)bmi, Usage, Bits,
|
||||
hSection, dwOffset, 0);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -945,7 +945,7 @@ DIB_CreateDIBSection(
|
|||
|
||||
if (bmp)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(res);
|
||||
BITMAPOBJ_UnlockBitmap(bmp);
|
||||
}
|
||||
|
||||
// Return BITMAP handle and storage location
|
||||
|
@ -1111,7 +1111,7 @@ DIB_MapPaletteColors(PDC dc, CONST BITMAPINFO* lpbmi)
|
|||
lpIndex++;
|
||||
}
|
||||
// RELEASEDCINFO(hDC);
|
||||
PALETTE_UnlockPalette(dc->w.hPalette);
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
|
||||
return lpRGB;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ IntGdiPolygon(PDC dc,
|
|||
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
|
||||
ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->w.ROPmode), UnsafePoints, Count, DestRect );
|
||||
}
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
|
||||
/* get BRUSHOBJ from current pen. */
|
||||
PenBrushObj = PENOBJ_LockPen(dc->w.hPen);
|
||||
|
@ -127,10 +127,10 @@ IntGdiPolygon(PDC dc,
|
|||
ROP2_TO_MIX(dc->w.ROPmode)); /* MIX */
|
||||
}
|
||||
}
|
||||
PENOBJ_UnlockPen( dc->w.hPen );
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ NtGdiEllipse(
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ NtGdiEllipse(
|
|||
FillBrush = BRUSHOBJ_LockBrush(dc->w.hBrush);
|
||||
if (NULL == FillBrush)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INTERNAL_ERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -255,8 +255,8 @@ NtGdiEllipse(
|
|||
PenBrush = PENOBJ_LockPen(dc->w.hPen);
|
||||
if (NULL == PenBrush)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(FillBrush);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INTERNAL_ERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -264,9 +264,9 @@ NtGdiEllipse(
|
|||
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
|
||||
if (NULL == BitmapObj)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(FillBrush);
|
||||
PENOBJ_UnlockPen(PenBrush);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INTERNAL_ERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -391,10 +391,10 @@ NtGdiEllipse(
|
|||
}
|
||||
} while (B > A);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
PENOBJ_UnlockPen(dc->w.hPen);
|
||||
DC_UnlockDc(hDC);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BRUSHOBJ_UnlockBrush(FillBrush);
|
||||
PENOBJ_UnlockPen(PenBrush);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ NtGdiPie(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ NtGdiPie(HDC hDC,
|
|||
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush);
|
||||
if (NULL == FillBrushObj)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INTERNAL_ERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -708,8 +708,8 @@ NtGdiPie(HDC hDC,
|
|||
ShapePoints = ExAllocatePoolWithTag(PagedPool, 8 * (Right - Left + 1) / 2 * sizeof(SHAPEPOINT), TAG_SHAPE);
|
||||
if (NULL == ShapePoints)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
|
@ -718,8 +718,8 @@ NtGdiPie(HDC hDC,
|
|||
if (Left == Right)
|
||||
{
|
||||
PUTPIXEL(Left, Top, &PenBrushObj);
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -804,8 +804,8 @@ NtGdiPie(HDC hDC,
|
|||
}
|
||||
|
||||
ExFreePool(ShapePoints);
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
DC_UnlockDc(hDC);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return ret;
|
||||
#else
|
||||
|
@ -858,7 +858,7 @@ NtGdiPolygon(HDC hDC,
|
|||
{
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ NtGdiPolygon(HDC hDC,
|
|||
|
||||
ExFreePool(Safept);
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
return Ret;
|
||||
|
@ -903,7 +903,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, (sizeof(POINT) + sizeof(INT)) * Count, TAG_SHAPE);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -923,7 +923,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, Points, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Safept);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -931,7 +931,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
Status = MmCopyFromCaller(SafePolyPoints, PolyCounts, sizeof(INT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Safept);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -939,7 +939,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -947,7 +947,7 @@ NtGdiPolyPolygon(HDC hDC,
|
|||
Ret = IntGdiPolyPolygon(dc, Safept, SafePolyPoints, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -1008,14 +1008,14 @@ IntRectangle(PDC dc,
|
|||
}
|
||||
}
|
||||
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
|
||||
/* get BRUSHOBJ from current pen. */
|
||||
PenBrushObj = PENOBJ_LockPen(dc->w.hPen);
|
||||
if (PenBrushObj == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1057,10 +1057,10 @@ IntRectangle(PDC dc,
|
|||
Mix);
|
||||
}
|
||||
|
||||
PENOBJ_UnlockPen(dc->w.hPen);
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
/* Move current position in DC?
|
||||
MSDN: The current position is neither used nor updated by Rectangle. */
|
||||
|
@ -1087,13 +1087,13 @@ NtGdiRectangle(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ret = IntRectangle ( dc, LeftRect, TopRect, RightRect, BottomRect );
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1147,7 +1147,6 @@ IntRoundRect(
|
|||
if (!BitmapObj)
|
||||
{
|
||||
/* Nothing to do, as we don't have a bitmap */
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
SetLastWin32Error(ERROR_INTERNAL_ERROR);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1158,7 +1157,7 @@ IntRoundRect(
|
|||
if (FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)
|
||||
{
|
||||
/* make null brush check simpler... */
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
FillBrushObj = NULL;
|
||||
}
|
||||
else
|
||||
|
@ -1173,7 +1172,7 @@ IntRoundRect(
|
|||
if (PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)
|
||||
{
|
||||
/* make null pen check simpler... */
|
||||
PENOBJ_UnlockPen(dc->w.hPen);
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
PenBrushObj = NULL;
|
||||
}
|
||||
else
|
||||
|
@ -1359,11 +1358,11 @@ IntRoundRect(
|
|||
PUTLINE ( left, y2, left, y1, PenBrushInst );
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if(PenBrushObj != NULL)
|
||||
PENOBJ_UnlockPen(dc->w.hPen);
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
if(FillBrushObj != NULL)
|
||||
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
|
||||
BRUSHOBJ_UnlockBrush(FillBrushObj);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1390,14 +1389,14 @@ NtGdiRoundRect(
|
|||
}
|
||||
else if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = IntRoundRect ( dc, LeftRect, TopRect, RightRect, BottomRect, Width, Height );
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -1481,7 +1480,7 @@ IntGdiGradientFill(
|
|||
/* FIXME - PalDestGDI can be NULL!!! Don't assert but handle this case gracefully! */
|
||||
ASSERT(PalDestGDI);
|
||||
Mode = PalDestGDI->Mode;
|
||||
PALETTE_UnlockPalette(dc->w.hPalette);
|
||||
PALETTE_UnlockPalette(PalDestGDI);
|
||||
|
||||
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||
ASSERT(XlateObj);
|
||||
|
@ -1497,7 +1496,7 @@ IntGdiGradientFill(
|
|||
&DitherOrg,
|
||||
ulMode);
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
EngDeleteXlate(XlateObj);
|
||||
|
||||
return Ret;
|
||||
|
@ -1528,13 +1527,13 @@ NtGdiGradientFill(
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
if(!pVertex || !uVertex || !pMesh || !uMesh)
|
||||
{
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1549,21 +1548,21 @@ NtGdiGradientFill(
|
|||
SizeMesh = uMesh * sizeof(TRIVERTEX);
|
||||
break;
|
||||
default:
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!(SafeVertex = ExAllocatePoolWithTag(PagedPool, (uVertex * sizeof(TRIVERTEX)) + SizeMesh, TAG_SHAPE)))
|
||||
{
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
Status = MmCopyFromCaller(SafeVertex, pVertex, uVertex * sizeof(TRIVERTEX));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(SafeVertex);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -1572,7 +1571,7 @@ NtGdiGradientFill(
|
|||
Status = MmCopyFromCaller(SafeMesh, pMesh, SizeMesh);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(SafeVertex);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -1580,7 +1579,7 @@ NtGdiGradientFill(
|
|||
|
||||
Ret = IntGdiGradientFill(dc, SafeVertex, uVertex, SafeMesh, uMesh, ulMode);
|
||||
|
||||
DC_UnlockDc(hdc);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(SafeVertex);
|
||||
return Ret;
|
||||
}
|
||||
|
|
|
@ -306,7 +306,7 @@ done:
|
|||
for ( j = 0; j < GDI_STACK_LEVELS; j++ )
|
||||
{
|
||||
ULONG Addr = GDIHandleAllocator[h[i].idx][j];
|
||||
if ( !KeRosPrintAddress ( (PVOID)Addr ) )
|
||||
if ( !KiRosPrintAddress ( (PVOID)Addr ) )
|
||||
DbgPrint ( "<%X>", Addr );
|
||||
}
|
||||
DbgPrint ( "\n" );
|
||||
|
@ -519,7 +519,7 @@ LockHandle:
|
|||
|
||||
GdiHdr = GDIBdyToHdr(Entry->KernelData);
|
||||
|
||||
if(GdiHdr->LockingThread == NULL)
|
||||
if(GdiHdr->Locks == 0)
|
||||
{
|
||||
BOOL Ret;
|
||||
PW32PROCESS W32Process = PsGetWin32Process();
|
||||
|
@ -555,16 +555,11 @@ LockHandle:
|
|||
}
|
||||
else
|
||||
{
|
||||
/* the object is currently locked. just clear the type field so when the
|
||||
object gets unlocked it will be finally deleted from the table. Also
|
||||
incrment the reuse counter! */
|
||||
Entry->Type = ((Entry->Type >> GDI_HANDLE_REUSECNT_SHIFT) + 1) << GDI_HANDLE_REUSECNT_SHIFT;
|
||||
|
||||
/* unlock the handle slot */
|
||||
InterlockedExchangePointer(&Entry->ProcessId, NULL);
|
||||
|
||||
/* report a successful deletion as the object is actually removed from the table */
|
||||
return TRUE;
|
||||
/*
|
||||
* The object is currently locked, so freeing is forbidden!
|
||||
*/
|
||||
DPRINT1("GdiHdr->Locks: %d\n", GdiHdr->Locks);
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -722,134 +717,263 @@ GDIOBJ_LockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType)
|
|||
GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType)
|
||||
#endif /* GDI_DEBUG */
|
||||
{
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PETHREAD Thread;
|
||||
HANDLE ProcessId, LockedProcessId, PrevProcId;
|
||||
LONG ExpectedType;
|
||||
#ifdef GDI_DEBUG
|
||||
ULONG Attempts = 0;
|
||||
#endif
|
||||
USHORT HandleIndex;
|
||||
PGDI_TABLE_ENTRY HandleEntry;
|
||||
HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId;
|
||||
PGDIOBJ Object = NULL;
|
||||
|
||||
DPRINT("GDIOBJ_LockObj: hObj: 0x%08x\n", hObj);
|
||||
HandleIndex = GDI_HANDLE_GET_INDEX(hObj);
|
||||
|
||||
Thread = PsGetCurrentThread();
|
||||
/* Check that the handle index is valid. */
|
||||
if (HandleIndex >= GDI_HANDLE_COUNT)
|
||||
return NULL;
|
||||
|
||||
ProcessId = PsGetCurrentProcessId();
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1);
|
||||
HandleEntry = &HandleTable->Entries[HandleIndex];
|
||||
|
||||
ExpectedType = ((ObjectType != GDI_OBJECT_TYPE_DONTCARE) ? ObjectType : 0);
|
||||
ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1);
|
||||
HandleProcessId = (HANDLE)((ULONG_PTR)HandleEntry->ProcessId & ~1);
|
||||
|
||||
/* Check for invalid owner. */
|
||||
if (ProcessId != HandleProcessId && HandleProcessId != NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent the thread from being terminated during the locking process.
|
||||
* It would result in undesired effects and inconsistency of the global
|
||||
* handle table.
|
||||
*/
|
||||
|
||||
Entry = GDI_HANDLE_GET_ENTRY(HandleTable, hObj);
|
||||
KeEnterCriticalRegion();
|
||||
|
||||
LockHandle:
|
||||
/* lock the object, we must not delete stock objects, so don't check!!! */
|
||||
PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, LockedProcessId, ProcessId);
|
||||
if(PrevProcId == ProcessId)
|
||||
{
|
||||
LONG EntryType = Entry->Type << 16;
|
||||
/*
|
||||
* Loop until we either successfully lock the handle entry & object or
|
||||
* fail some of the check.
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* Lock the handle table entry. */
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1);
|
||||
PrevProcId = InterlockedCompareExchangePointer(&HandleEntry->ProcessId,
|
||||
LockedProcessId,
|
||||
HandleProcessId);
|
||||
|
||||
/* we're locking an object that belongs to our process or it's a global
|
||||
object if ProcessId == 0 here. ProcessId can only be 0 here if it previously
|
||||
failed to lock the object and it turned out to be a global object. */
|
||||
if(EntryType != 0 && Entry->KernelData != NULL &&
|
||||
(ExpectedType == 0 || (EntryType == ExpectedType)))
|
||||
{
|
||||
PETHREAD PrevThread;
|
||||
PGDIOBJHDR GdiHdr;
|
||||
|
||||
GdiHdr = GDIBdyToHdr(Entry->KernelData);
|
||||
|
||||
/* save the pointer to the calling thread so we know it was this thread
|
||||
that locked the object. There's no need to do this atomically as we're
|
||||
holding the lock of the handle slot, but this way it's easier ;) */
|
||||
PrevThread = InterlockedCompareExchangePointer(&GdiHdr->LockingThread, Thread, NULL);
|
||||
|
||||
if(PrevThread == NULL || PrevThread == Thread)
|
||||
if (PrevProcId == HandleProcessId)
|
||||
{
|
||||
if(++GdiHdr->Locks == 1)
|
||||
{
|
||||
LONG HandleType = HandleEntry->Type << 16;
|
||||
|
||||
/*
|
||||
* We're locking an object that belongs to our process or it's a
|
||||
* global object if HandleProcessId is 0 here.
|
||||
*/
|
||||
|
||||
/* FIXME: Check the upper 16-bits of handle number! */
|
||||
if (HandleType != 0 && HandleEntry->KernelData != NULL &&
|
||||
(ObjectType == GDI_OBJECT_TYPE_DONTCARE ||
|
||||
HandleType == ObjectType))
|
||||
{
|
||||
PGDIOBJHDR GdiHdr = GDIBdyToHdr(HandleEntry->KernelData);
|
||||
PETHREAD Thread = PsGetCurrentThread();
|
||||
|
||||
if (GdiHdr->Locks == 0)
|
||||
{
|
||||
GdiHdr->LockingThread = Thread;
|
||||
GdiHdr->Locks = 1;
|
||||
Object = HandleEntry->KernelData;
|
||||
}
|
||||
else
|
||||
{
|
||||
InterlockedIncrement(&GdiHdr->Locks);
|
||||
if (GdiHdr->LockingThread != Thread)
|
||||
{
|
||||
InterlockedDecrement(&GdiHdr->Locks);
|
||||
|
||||
/* Unlock the handle table entry. */
|
||||
InterlockedExchangePointer(&HandleEntry->ProcessId, PrevProcId);
|
||||
|
||||
DelayExecution();
|
||||
continue;
|
||||
}
|
||||
Object = HandleEntry->KernelData;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Debugging code. Report attempts to lock deleted handles and
|
||||
* locking type mismatches.
|
||||
*/
|
||||
|
||||
if ((HandleType & ~GDI_HANDLE_REUSE_MASK) == 0)
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x that is deleted!\n", hObj);
|
||||
#ifdef GDI_DEBUG
|
||||
GdiHdr->lockfile = file;
|
||||
GdiHdr->lockline = line;
|
||||
KeRosDumpStackFrames(NULL, 20);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x, type mismatch (0x%x : 0x%x)\n",
|
||||
hObj, HandleType & ~GDI_HANDLE_REUSE_MASK, ObjectType & ~GDI_HANDLE_REUSE_MASK);
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames(NULL, 20);
|
||||
#endif
|
||||
}
|
||||
#ifdef GDI_DEBUG
|
||||
DPRINT1("-> called from %s:%i\n", file, line);
|
||||
#endif
|
||||
}
|
||||
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
/* Unlock the handle table entry. */
|
||||
InterlockedExchangePointer(&HandleEntry->ProcessId, PrevProcId);
|
||||
|
||||
/* we're done, return the object body */
|
||||
return GDIHdrToBdy(GdiHdr);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
/*
|
||||
* The handle is currently locked, wait some time and try again.
|
||||
*/
|
||||
|
||||
#ifdef GDI_DEBUG
|
||||
if(++Attempts > 20)
|
||||
{
|
||||
DPRINT1("[%d]Waiting at %s:%i as 0x%x on 0x%x\n", Attempts, file, line, Thread, PrevThread);
|
||||
}
|
||||
#endif
|
||||
|
||||
DelayExecution();
|
||||
goto LockHandle;
|
||||
DelayExecution();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
}
|
||||
|
||||
if((EntryType & ~GDI_HANDLE_REUSE_MASK) == 0)
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x that is deleted!\n", hObj);
|
||||
KeLeaveCriticalRegion();
|
||||
|
||||
return Object;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Return pointer to the object by handle (and allow sharing of the handle
|
||||
* across threads).
|
||||
*
|
||||
* \param hObj Object handle
|
||||
* \return Pointer to the object.
|
||||
*
|
||||
* \note Process can only get pointer to the objects it created or global objects.
|
||||
*
|
||||
* \todo Get rid of the ObjectType parameter!
|
||||
*/
|
||||
PGDIOBJ INTERNAL_CALL
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames ( NULL, 20 );
|
||||
GDIOBJ_ShareLockObjDbg (const char* file, int line, HGDIOBJ hObj, DWORD ObjectType)
|
||||
#else /* !GDI_DEBUG */
|
||||
GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType)
|
||||
#endif /* GDI_DEBUG */
|
||||
{
|
||||
USHORT HandleIndex;
|
||||
PGDI_TABLE_ENTRY HandleEntry;
|
||||
HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId;
|
||||
PGDIOBJ Object = NULL;
|
||||
|
||||
HandleIndex = GDI_HANDLE_GET_INDEX(hObj);
|
||||
|
||||
/* Check that the handle index is valid. */
|
||||
if (HandleIndex >= GDI_HANDLE_COUNT)
|
||||
return NULL;
|
||||
|
||||
HandleEntry = &HandleTable->Entries[HandleIndex];
|
||||
|
||||
ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1);
|
||||
HandleProcessId = (HANDLE)((ULONG_PTR)HandleEntry->ProcessId & ~1);
|
||||
|
||||
/* Check for invalid owner. */
|
||||
if (ProcessId != HandleProcessId && HandleProcessId != NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent the thread from being terminated during the locking process.
|
||||
* It would result in undesired effects and inconsistency of the global
|
||||
* handle table.
|
||||
*/
|
||||
|
||||
KeEnterCriticalRegion();
|
||||
|
||||
/*
|
||||
* Loop until we either successfully lock the handle entry & object or
|
||||
* fail some of the check.
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* Lock the handle table entry. */
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1);
|
||||
PrevProcId = InterlockedCompareExchangePointer(&HandleEntry->ProcessId,
|
||||
LockedProcessId,
|
||||
HandleProcessId);
|
||||
|
||||
if (PrevProcId == HandleProcessId)
|
||||
{
|
||||
LONG HandleType = HandleEntry->Type << 16;
|
||||
|
||||
/*
|
||||
* We're locking an object that belongs to our process or it's a
|
||||
* global object if HandleProcessId is 0 here.
|
||||
*/
|
||||
|
||||
/* FIXME: Check the upper 16-bits of handle number! */
|
||||
if (HandleType != 0 && HandleEntry->KernelData != NULL &&
|
||||
(ObjectType == GDI_OBJECT_TYPE_DONTCARE ||
|
||||
HandleType == ObjectType))
|
||||
{
|
||||
PGDIOBJHDR GdiHdr = GDIBdyToHdr(HandleEntry->KernelData);
|
||||
|
||||
InterlockedIncrement(&GdiHdr->Locks);
|
||||
Object = HandleEntry->KernelData;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Debugging code. Report attempts to lock deleted handles and
|
||||
* locking type mismatches.
|
||||
*/
|
||||
|
||||
if ((HandleType & ~GDI_HANDLE_REUSE_MASK) == 0)
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x that is deleted!\n", hObj);
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames(NULL, 20);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x, type mismatch (0x%x : 0x%x)\n",
|
||||
hObj, HandleType & ~GDI_HANDLE_REUSE_MASK, ObjectType & ~GDI_HANDLE_REUSE_MASK);
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames(NULL, 20);
|
||||
#endif
|
||||
}
|
||||
#ifdef GDI_DEBUG
|
||||
DPRINT1("-> called from %s:%i\n", file, line);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Unlock the handle table entry. */
|
||||
InterlockedExchangePointer(&HandleEntry->ProcessId, PrevProcId);
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Attempted to lock object 0x%x, type mismatch (0x%x : 0x%x)\n",
|
||||
hObj, EntryType & ~GDI_HANDLE_REUSE_MASK, ExpectedType & ~GDI_HANDLE_REUSE_MASK);
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames ( NULL, 20 );
|
||||
#endif
|
||||
/*
|
||||
* The handle is currently locked, wait some time and try again.
|
||||
*/
|
||||
|
||||
DelayExecution();
|
||||
continue;
|
||||
}
|
||||
#ifdef GDI_DEBUG
|
||||
DPRINT1("-> called from %s:%i\n", file, line);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if(PrevProcId == LockedProcessId)
|
||||
{
|
||||
#ifdef GDI_DEBUG
|
||||
if(++Attempts > 20)
|
||||
{
|
||||
DPRINT1("[%d]Waiting from %s:%i on 0x%x\n", Attempts, file, line, hObj);
|
||||
}
|
||||
#endif
|
||||
/* the handle is currently locked, wait some time and try again.
|
||||
FIXME - we shouldn't loop forever! Give up after some time! */
|
||||
DelayExecution();
|
||||
/* try again */
|
||||
goto LockHandle;
|
||||
}
|
||||
else if(((ULONG_PTR)PrevProcId & ~0x1) == 0)
|
||||
{
|
||||
/* we're trying to lock a global object, change the ProcessId to 0 and try again */
|
||||
ProcessId = NULL;
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1);
|
||||
}
|
||||
|
||||
goto LockHandle;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Attempted to lock foreign handle: 0x%x, Owner: 0x%x locked: 0x%x Caller: 0x%x, stockobj: 0x%x\n", hObj, (ULONG_PTR)PrevProcId & ~0x1, (ULONG_PTR)PrevProcId & 0x1, PsGetCurrentProcessId(), GDI_HANDLE_IS_STOCKOBJ(hObj));
|
||||
#ifdef GDI_DEBUG
|
||||
KeRosDumpStackFrames ( NULL, 20 );
|
||||
DPRINT1("-> called from %s:%i\n", file, line);
|
||||
#endif
|
||||
}
|
||||
KeLeaveCriticalRegion();
|
||||
|
||||
return NULL;
|
||||
return Object;
|
||||
}
|
||||
|
||||
|
||||
|
@ -857,162 +981,24 @@ LockHandle:
|
|||
* Release GDI object. Every object locked by GDIOBJ_LockObj() must be unlocked. You should unlock the object
|
||||
* as soon as you don't need to have access to it's data.
|
||||
|
||||
* \param hObj Object handle
|
||||
*
|
||||
* \note This function performs delayed cleanup. If the object is locked when GDI_FreeObj() is called
|
||||
* then \em this function frees the object when reference count is zero.
|
||||
*/
|
||||
BOOL INTERNAL_CALL
|
||||
#ifdef GDI_DEBUG
|
||||
GDIOBJ_UnlockObjDbg (const char* file, int line, HGDIOBJ hObj)
|
||||
#else /* !GDI_DEBUG */
|
||||
GDIOBJ_UnlockObj (HGDIOBJ hObj)
|
||||
#endif /* GDI_DEBUG */
|
||||
* \param Object Object pointer (as returned by GDIOBJ_LockObj).
|
||||
*/
|
||||
VOID INTERNAL_CALL
|
||||
GDIOBJ_UnlockObjByPtr(PGDIOBJ Object)
|
||||
{
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PETHREAD Thread;
|
||||
HANDLE ProcessId, LockedProcessId, PrevProcId;
|
||||
PGDIOBJHDR GdiHdr = GDIBdyToHdr(Object);
|
||||
#ifdef GDI_DEBUG
|
||||
ULONG Attempts = 0;
|
||||
if (InterlockedDecrement(&GdiHdr->Locks) == 0)
|
||||
{
|
||||
GdiHdr->lockfile = NULL;
|
||||
GdiHdr->lockline = 0;
|
||||
}
|
||||
#else
|
||||
InterlockedDecrement(&GdiHdr->Locks);
|
||||
#endif
|
||||
|
||||
DPRINT("GDIOBJ_UnlockObj: hObj: 0x%08x\n", hObj);
|
||||
Thread = PsGetCurrentThread();
|
||||
|
||||
ProcessId = PsGetCurrentProcessId();
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1);
|
||||
|
||||
Entry = GDI_HANDLE_GET_ENTRY(HandleTable, hObj);
|
||||
|
||||
LockHandle:
|
||||
/* lock the handle, we must not delete stock objects, so don't check!!! */
|
||||
PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, LockedProcessId, ProcessId);
|
||||
if(PrevProcId == ProcessId)
|
||||
{
|
||||
/* we're unlocking an object that belongs to our process or it's a global
|
||||
object if ProcessId == 0 here. ProcessId can only be 0 here if it previously
|
||||
failed to lock the object and it turned out to be a global object. */
|
||||
if(Entry->KernelData != NULL)
|
||||
{
|
||||
PETHREAD PrevThread;
|
||||
PGDIOBJHDR GdiHdr;
|
||||
|
||||
GdiHdr = GDIBdyToHdr(Entry->KernelData);
|
||||
|
||||
PrevThread = GdiHdr->LockingThread;
|
||||
if(PrevThread == Thread)
|
||||
{
|
||||
BOOL Ret;
|
||||
|
||||
if(--GdiHdr->Locks == 0)
|
||||
{
|
||||
GdiHdr->LockingThread = NULL;
|
||||
|
||||
#ifdef GDI_DEBUG
|
||||
GdiHdr->lockfile = NULL;
|
||||
GdiHdr->lockline = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
if((Entry->Type & ~GDI_HANDLE_REUSE_MASK) == 0 && GdiHdr->Locks == 0)
|
||||
{
|
||||
PPAGED_LOOKASIDE_LIST LookasideList;
|
||||
PW32PROCESS W32Process = PsGetWin32Process();
|
||||
DWORD Type = GDI_HANDLE_GET_TYPE(hObj);
|
||||
|
||||
ASSERT(ProcessId != 0); /* must not delete a global handle!!!! */
|
||||
|
||||
/* we should delete the handle */
|
||||
Entry->KernelData = NULL;
|
||||
InterlockedExchangePointer(&Entry->ProcessId, 0);
|
||||
|
||||
InterlockedPushEntrySList(&HandleTable->FreeEntriesHead,
|
||||
&HandleTable->FreeEntries[GDI_ENTRY_TO_INDEX(HandleTable, Entry)]);
|
||||
|
||||
if(W32Process != NULL)
|
||||
{
|
||||
InterlockedDecrement(&W32Process->GDIObjects);
|
||||
}
|
||||
|
||||
/* call the cleanup routine. */
|
||||
Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type);
|
||||
|
||||
/* Now it's time to free the memory */
|
||||
LookasideList = FindLookasideList(Type);
|
||||
if(LookasideList != NULL)
|
||||
{
|
||||
ExFreeToPagedLookasideList(LookasideList, GdiHdr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remove the handle slot lock */
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
Ret = TRUE;
|
||||
}
|
||||
|
||||
/* we're done*/
|
||||
return Ret;
|
||||
}
|
||||
#ifdef GDI_DEBUG
|
||||
else if(PrevThread != NULL)
|
||||
{
|
||||
DPRINT1("Attempted to unlock object 0x%x, previously locked by other thread (0x%x) from %s:%i (called from %s:%i)\n",
|
||||
hObj, PrevThread, GdiHdr->lockfile, GdiHdr->lockline, file, line);
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
#ifdef GDI_DEBUG
|
||||
if(++Attempts > 20)
|
||||
{
|
||||
DPRINT1("[%d]Waiting at %s:%i as 0x%x on 0x%x\n", Attempts, file, line, Thread, PrevThread);
|
||||
}
|
||||
#endif
|
||||
/* FIXME - we should give up after some time unless we want to wait forever! */
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
|
||||
DelayExecution();
|
||||
goto LockHandle;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InterlockedExchangePointer(&Entry->ProcessId, PrevProcId);
|
||||
DPRINT1("Attempted to unlock object 0x%x that is deleted!\n", hObj);
|
||||
}
|
||||
}
|
||||
else if(PrevProcId == LockedProcessId)
|
||||
{
|
||||
#ifdef GDI_DEBUG
|
||||
if(++Attempts > 20)
|
||||
{
|
||||
DPRINT1("[%d]Waiting from %s:%i on 0x%x\n", Attempts, file, line, hObj);
|
||||
}
|
||||
#endif
|
||||
/* the handle is currently locked, wait some time and try again.
|
||||
FIXME - we shouldn't loop forever! Give up after some time! */
|
||||
DelayExecution();
|
||||
/* try again */
|
||||
goto LockHandle;
|
||||
}
|
||||
else if(((ULONG_PTR)PrevProcId & ~0x1) == 0)
|
||||
{
|
||||
/* we're trying to unlock a global object, change the ProcessId to 0 and try again */
|
||||
ProcessId = NULL;
|
||||
LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1);
|
||||
|
||||
goto LockHandle;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Attempted to unlock foreign handle: 0x%x, Owner: 0x%x locked: 0x%x Caller: 0x%x, stockobj: 0x%x\n", hObj, (ULONG_PTR)PrevProcId & ~0x1, (ULONG_PTR)PrevProcId & 0x1, PsGetCurrentProcessId(), GDI_HANDLE_IS_STOCKOBJ(hObj));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle)
|
||||
{
|
||||
|
@ -1097,7 +1083,7 @@ LockHandle:
|
|||
GdiHdr = GDIBdyToHdr(Entry->KernelData);
|
||||
|
||||
PrevThread = GdiHdr->LockingThread;
|
||||
if(PrevThread == NULL || PrevThread == Thread)
|
||||
if(GdiHdr->Locks == 0 || PrevThread == Thread)
|
||||
{
|
||||
/* dereference the process' object counter */
|
||||
if(PrevProcId != GDI_GLOBAL_PROCESS)
|
||||
|
@ -1208,7 +1194,7 @@ LockHandle:
|
|||
PGDIOBJHDR GdiHdr = GDIBdyToHdr(Entry->KernelData);
|
||||
|
||||
PrevThread = GdiHdr->LockingThread;
|
||||
if(PrevThread == NULL || PrevThread == Thread)
|
||||
if(GdiHdr->Locks == 0 || PrevThread == Thread)
|
||||
{
|
||||
PEPROCESS OldProcess;
|
||||
PW32PROCESS W32Process;
|
||||
|
@ -1346,7 +1332,7 @@ LockHandleFrom:
|
|||
/* save the pointer to the calling thread so we know it was this thread
|
||||
that locked the object */
|
||||
PrevThread = GdiHdr->LockingThread;
|
||||
if(PrevThread == NULL || PrevThread == Thread)
|
||||
if(GdiHdr->Locks == 0 || PrevThread == Thread)
|
||||
{
|
||||
/* now let's change the ownership of the target object */
|
||||
|
||||
|
|
|
@ -113,8 +113,8 @@ IntGdiLineTo(DC *dc,
|
|||
ROP2_TO_MIX(dc->w.ROPmode));
|
||||
}
|
||||
|
||||
BITMAPOBJ_UnlockBitmap ( dc->w.hBitmap );
|
||||
PENOBJ_UnlockPen( dc->w.hPen );
|
||||
BITMAPOBJ_UnlockBitmap ( BitmapObj );
|
||||
PENOBJ_UnlockPen( PenBrushObj );
|
||||
}
|
||||
|
||||
if (Ret)
|
||||
|
@ -230,7 +230,7 @@ IntGdiPolyline(DC *dc,
|
|||
&PenBrushInst.BrushObject, Points, Count,
|
||||
ROP2_TO_MIX(dc->w.ROPmode));
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
EngFreeMem(Points);
|
||||
}
|
||||
else
|
||||
|
@ -239,7 +239,7 @@ IntGdiPolyline(DC *dc,
|
|||
}
|
||||
}
|
||||
|
||||
PENOBJ_UnlockPen(dc->w.hPen);
|
||||
PENOBJ_UnlockPen(PenBrushObj);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ NtGdiArc(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ NtGdiArc(HDC hDC,
|
|||
XEndArc,
|
||||
YEndArc);
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -412,7 +412,7 @@ NtGdiArcTo(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ NtGdiArcTo(HDC hDC,
|
|||
// Line from current position to starting point of arc
|
||||
if ( !IntGdiLineTo(dc, XRadial1, YRadial1) )
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -432,13 +432,13 @@ NtGdiArcTo(HDC hDC,
|
|||
result = IntGdiArc(dc, LeftRect, TopRect, RightRect, BottomRect,
|
||||
XRadial1, YRadial1, XRadial2, YRadial2);
|
||||
|
||||
//DC_UnlockDc( hDC );
|
||||
//DC_UnlockDc(dc);
|
||||
|
||||
// If no error occured, the current position is moved to the ending point of the arc.
|
||||
if(result)
|
||||
IntGdiMoveToEx(dc, XRadial2, YRadial2, NULL);
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ NtGdiGetArcDirection(HDC hDC)
|
|||
if ( dc )
|
||||
{
|
||||
ret = IntGdiGetArcDirection ( dc );
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -480,14 +480,14 @@ NtGdiLineTo(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Ret = IntGdiLineTo(dc, XEnd, YEnd);
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ NtGdiMoveToEx(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ NtGdiMoveToEx(HDC hDC,
|
|||
Status = MmCopyFromCaller(&SafePoint, Point, sizeof(POINT));
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ NtGdiMoveToEx(HDC hDC,
|
|||
|
||||
Ret = IntGdiMoveToEx(dc, X, Y, (Point ? &SafePoint : NULL));
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ NtGdiPolyBezier(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ NtGdiPolyBezier(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * Count, TAG_BEZIER);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -570,14 +570,14 @@ NtGdiPolyBezier(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, pt, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ NtGdiPolyBezier(HDC hDC,
|
|||
Ret = IntGdiPolyBezier(dc, Safept, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ NtGdiPolyBezierTo(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ NtGdiPolyBezierTo(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * Count, TAG_BEZIER);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -627,14 +627,14 @@ NtGdiPolyBezierTo(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, pt, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ NtGdiPolyBezierTo(HDC hDC,
|
|||
Ret = IntGdiPolyBezierTo(dc, Safept, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ NtGdiPolyline(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ NtGdiPolyline(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * Count, TAG_SHAPE);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -695,14 +695,14 @@ NtGdiPolyline(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, pt, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ NtGdiPolyline(HDC hDC,
|
|||
Ret = IntGdiPolyline(dc, Safept, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -734,7 +734,7 @@ NtGdiPolylineTo(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ NtGdiPolylineTo(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * Count, TAG_SHAPE);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -752,14 +752,14 @@ NtGdiPolylineTo(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, pt, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ NtGdiPolylineTo(HDC hDC,
|
|||
Ret = IntGdiPolylineTo(dc, Safept, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -793,7 +793,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
Safept = ExAllocatePoolWithTag(PagedPool, (sizeof(POINT) + sizeof(DWORD)) * Count, TAG_SHAPE);
|
||||
if(!Safept)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -813,7 +813,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
Status = MmCopyFromCaller(Safept, pt, sizeof(POINT) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Safept);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -821,7 +821,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
Status = MmCopyFromCaller(SafePolyPoints, PolyPoints, sizeof(DWORD) * Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
ExFreePool(Safept);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
|
@ -829,7 +829,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
}
|
||||
else
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ NtGdiPolyPolyline(HDC hDC,
|
|||
Ret = IntGdiPolyPolyline(dc, Safept, SafePolyPoints, Count);
|
||||
|
||||
ExFreePool(Safept);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ NtGdiSetArcDirection(HDC hDC,
|
|||
dc->w.ArcDirection = ArcDirection;
|
||||
}
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return nOldDirection;
|
||||
}
|
||||
/* EOF */
|
||||
|
|
|
@ -77,7 +77,7 @@ PALETTE_AllocPalette(ULONG Mode,
|
|||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
||||
if (NULL == PalGDI->IndexedColors)
|
||||
{
|
||||
PALETTE_UnlockPalette(NewPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
PALETTE_FreePalette(NewPalette);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ PALETTE_AllocPalette(ULONG Mode,
|
|||
PalGDI->BlueMask = Blue;
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(NewPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
|
||||
return NewPalette;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
|||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
||||
if (NULL == PalGDI->IndexedColors)
|
||||
{
|
||||
PALETTE_UnlockPalette(NewPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
PALETTE_FreePalette(NewPalette);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
|||
|
||||
PalGDI->NumColors = NumColors;
|
||||
|
||||
PALETTE_UnlockPalette(NewPalette);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
|
||||
return NewPalette;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ HPALETTE FASTCALL PALETTE_Init(VOID)
|
|||
DbgPrint("Win32k: Can not create palette mapping -- out of memory!");
|
||||
return FALSE;
|
||||
}
|
||||
PALETTE_UnlockPalette(hpalette);
|
||||
PALETTE_UnlockPalette(palObj);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -233,7 +233,7 @@ INT STDCALL PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapO
|
|||
/* FIXME - handle pSysPal == NULL!!!!!!! */
|
||||
|
||||
COLOR_sysPal = pSysPal->IndexedColors;
|
||||
PALETTE_UnlockPalette(hSysPal); // FIXME: Is this a right way to obtain pointer to the system palette?
|
||||
PALETTE_UnlockPalette(pSysPal); // FIXME: Is this a right way to obtain pointer to the system palette?
|
||||
|
||||
|
||||
// reset dynamic system palette entries
|
||||
|
|
|
@ -72,7 +72,7 @@ NtGdiCloseFigure ( HDC hDC )
|
|||
if ( dc )
|
||||
{
|
||||
ret = IntCloseFigure ( dc );
|
||||
DC_UnlockDc ( hDC );
|
||||
DC_UnlockDc ( dc );
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -66,7 +66,7 @@ IntGdiCreatePenIndirect(PLOGPEN LogPen)
|
|||
DPRINT1("FIXME: IntGdiCreatePenIndirect is UNIMPLEMENTED\n");
|
||||
}
|
||||
|
||||
PENOBJ_UnlockPen(hPen);
|
||||
PENOBJ_UnlockPen(PenObject);
|
||||
|
||||
return hPen;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ NtGdiEscape(HDC hDC,
|
|||
/* TODO FIXME - don't pass umode buffer to an Int function */
|
||||
ret = IntGdiEscape(dc, Escape, InSize, InData, OutData);
|
||||
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ IntGdiExtEscape(
|
|||
OutSize,
|
||||
(PVOID)OutData );
|
||||
}
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ NtGdiExtEscape(
|
|||
}
|
||||
if ( pDC->IsIC )
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(pDC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ NtGdiExtEscape(
|
|||
SafeInData = ExAllocatePoolWithTag ( PagedPool, InSize, TAG_PRINT );
|
||||
if ( !SafeInData )
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(pDC);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return -1;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ NtGdiExtEscape(
|
|||
if ( !NT_SUCCESS(Status) )
|
||||
{
|
||||
ExFreePool ( SafeInData );
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(pDC);
|
||||
SetLastNtError(Status);
|
||||
return -1;
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ NtGdiExtEscape(
|
|||
{
|
||||
if ( SafeInData )
|
||||
ExFreePool ( SafeInData );
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(pDC);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return -1;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ NtGdiExtEscape(
|
|||
|
||||
Result = IntGdiExtEscape ( pDC, Escape, InSize, SafeInData, OutSize, SafeOutData );
|
||||
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
if ( SafeInData )
|
||||
ExFreePool ( SafeInData );
|
||||
|
|
|
@ -461,7 +461,7 @@ IntDumpRegion(HRGN hRgn)
|
|||
Data->rdh.rcBound.bottom,
|
||||
Data->rdh.iType);
|
||||
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Data);
|
||||
}
|
||||
#endif /* NDEBUG */
|
||||
|
||||
|
@ -727,7 +727,7 @@ HRGN FASTCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lp
|
|||
objSrc = RGNDATA_LockRgn(hSrc);
|
||||
if(objSrc == NULL)
|
||||
{
|
||||
RGNDATA_UnlockRgn(hDst);
|
||||
RGNDATA_UnlockRgn(rgnDst);
|
||||
return NULL;
|
||||
}
|
||||
if(!lpPt)
|
||||
|
@ -741,8 +741,8 @@ HRGN FASTCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lp
|
|||
hRet = hDst;
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hSrc);
|
||||
RGNDATA_UnlockRgn(hDst);
|
||||
RGNDATA_UnlockRgn(objSrc);
|
||||
RGNDATA_UnlockRgn(rgnDst);
|
||||
|
||||
return hRet;
|
||||
}
|
||||
|
@ -1717,7 +1717,7 @@ static void FASTCALL REGION_XorRegion(ROSRGNDATA *dr, ROSRGNDATA *sra,
|
|||
|
||||
trb = RGNDATA_LockRgn( htrb );
|
||||
if( !trb ){
|
||||
RGNDATA_UnlockRgn( htra );
|
||||
RGNDATA_UnlockRgn( tra );
|
||||
NtGdiDeleteObject( htra );
|
||||
NtGdiDeleteObject( htrb );
|
||||
return;
|
||||
|
@ -1726,8 +1726,8 @@ static void FASTCALL REGION_XorRegion(ROSRGNDATA *dr, ROSRGNDATA *sra,
|
|||
REGION_SubtractRegion(tra,sra,srb);
|
||||
REGION_SubtractRegion(trb,srb,sra);
|
||||
REGION_UnionRegion(dr,tra,trb);
|
||||
RGNDATA_UnlockRgn( htra );
|
||||
RGNDATA_UnlockRgn( htrb );
|
||||
RGNDATA_UnlockRgn( tra );
|
||||
RGNDATA_UnlockRgn( trb );
|
||||
|
||||
NtGdiDeleteObject( htra );
|
||||
NtGdiDeleteObject( htrb );
|
||||
|
@ -1761,20 +1761,20 @@ BOOL FASTCALL REGION_CreateFrameRgn(HRGN hDest, HRGN hSrc, INT x, INT y)
|
|||
}
|
||||
if (!REGION_NOT_EMPTY(srcObj))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hSrc);
|
||||
RGNDATA_UnlockRgn(srcObj);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(destObj = (PROSRGNDATA)RGNDATA_LockRgn(hDest)))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hSrc);
|
||||
RGNDATA_UnlockRgn(srcObj);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
EMPTY_REGION(destObj);
|
||||
if (!REGION_CopyRegion(destObj, srcObj))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hDest);
|
||||
RGNDATA_UnlockRgn(hSrc);
|
||||
RGNDATA_UnlockRgn(destObj);
|
||||
RGNDATA_UnlockRgn(srcObj);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1830,8 +1830,8 @@ BOOL FASTCALL REGION_CreateFrameRgn(HRGN hDest, HRGN hSrc, INT x, INT y)
|
|||
}
|
||||
REGION_SubtractRegion(destObj, srcObj, destObj);
|
||||
|
||||
RGNDATA_UnlockRgn(hDest);
|
||||
RGNDATA_UnlockRgn(hSrc);
|
||||
RGNDATA_UnlockRgn(destObj);
|
||||
RGNDATA_UnlockRgn(srcObj);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1863,7 +1863,7 @@ BOOL FASTCALL REGION_LPTODP(HDC hdc, HRGN hDest, HRGN hSrc)
|
|||
goto done;
|
||||
if(!( destObj = (PROSRGNDATA) RGNDATA_LockRgn( hDest ) ))
|
||||
{
|
||||
RGNDATA_UnlockRgn( hSrc );
|
||||
RGNDATA_UnlockRgn( srcObj );
|
||||
goto done;
|
||||
}
|
||||
EMPTY_REGION(destObj);
|
||||
|
@ -1886,11 +1886,11 @@ BOOL FASTCALL REGION_LPTODP(HDC hdc, HRGN hDest, HRGN hSrc)
|
|||
}
|
||||
ret = TRUE;
|
||||
|
||||
RGNDATA_UnlockRgn( hSrc );
|
||||
RGNDATA_UnlockRgn( hDest );
|
||||
RGNDATA_UnlockRgn( srcObj );
|
||||
RGNDATA_UnlockRgn( destObj );
|
||||
|
||||
done:
|
||||
DC_UnlockDc( hdc );
|
||||
DC_UnlockDc( dc );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1898,7 +1898,6 @@ HRGN FASTCALL RGNDATA_AllocRgn(INT n)
|
|||
{
|
||||
HRGN hReg;
|
||||
PROSRGNDATA pReg;
|
||||
BOOL bRet;
|
||||
|
||||
if ((hReg = (HRGN) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_REGION)))
|
||||
{
|
||||
|
@ -1922,8 +1921,7 @@ HRGN FASTCALL RGNDATA_AllocRgn(INT n)
|
|||
pReg->rdh.nCount = n;
|
||||
pReg->rdh.nRgnSize = n*sizeof(RECT);
|
||||
|
||||
bRet = RGNDATA_UnlockRgn(hReg);
|
||||
ASSERT(bRet);
|
||||
RGNDATA_UnlockRgn(pReg);
|
||||
|
||||
return hReg;
|
||||
}
|
||||
|
@ -1989,7 +1987,7 @@ NtGdiCombineRgn(HRGN hDest,
|
|||
REGION_SubtractRegion(destRgn, src1Rgn, src2Rgn);
|
||||
break;
|
||||
}
|
||||
RGNDATA_UnlockRgn(hSrc2);
|
||||
RGNDATA_UnlockRgn(src2Rgn);
|
||||
result = destRgn->rdh.iType;
|
||||
}
|
||||
else if(hSrc2 == NULL)
|
||||
|
@ -1998,10 +1996,10 @@ NtGdiCombineRgn(HRGN hDest,
|
|||
}
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hSrc1);
|
||||
RGNDATA_UnlockRgn(src1Rgn);
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hDest);
|
||||
RGNDATA_UnlockRgn(destRgn);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2169,7 +2167,7 @@ NtGdiCreateRoundRectRgn(INT left, INT top, INT right, INT bottom,
|
|||
rect.bottom = bottom;
|
||||
UnsafeIntUnionRectWithRgn( obj, &rect );
|
||||
}
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( obj );
|
||||
return hrgn;
|
||||
}
|
||||
|
||||
|
@ -2187,7 +2185,7 @@ NtGdiEqualRgn(HRGN hSrcRgn1,
|
|||
return ERROR;
|
||||
|
||||
if( !(rgn2 = RGNDATA_LockRgn(hSrcRgn2))){
|
||||
RGNDATA_UnlockRgn( hSrcRgn1 );
|
||||
RGNDATA_UnlockRgn( rgn1 );
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
@ -2216,8 +2214,8 @@ NtGdiEqualRgn(HRGN hSrcRgn1,
|
|||
bRet = TRUE;
|
||||
|
||||
exit:
|
||||
RGNDATA_UnlockRgn( hSrcRgn1 );
|
||||
RGNDATA_UnlockRgn( hSrcRgn2 );
|
||||
RGNDATA_UnlockRgn( rgn1 );
|
||||
RGNDATA_UnlockRgn( rgn2 );
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
@ -2266,12 +2264,12 @@ NtGdiExtCreateRegion(CONST XFORM *Xform,
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Region);
|
||||
NtGdiDeleteObject(hRgn);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Region);
|
||||
|
||||
return hRgn;
|
||||
}
|
||||
|
@ -2291,7 +2289,7 @@ NtGdiFillRgn(HDC hDC, HRGN hRgn, HBRUSH hBrush)
|
|||
|
||||
if (NULL == (oldhBrush = NtGdiSelectObject(hDC, hBrush)))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(rgn);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -2300,7 +2298,7 @@ NtGdiFillRgn(HDC hDC, HRGN hRgn, HBRUSH hBrush)
|
|||
NtGdiPatBlt(hDC, r->left, r->top, r->right - r->left, r->bottom - r->top, PATCOPY);
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn( hRgn );
|
||||
RGNDATA_UnlockRgn( rgn );
|
||||
NtGdiSelectObject(hDC, oldhBrush);
|
||||
|
||||
return TRUE;
|
||||
|
@ -2360,7 +2358,7 @@ NtGdiGetRgnBox(HRGN hRgn,
|
|||
}
|
||||
|
||||
ret = UnsafeIntGetRgnBox(Rgn, &SafeRect);
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
if (ERROR == ret)
|
||||
{
|
||||
return ret;
|
||||
|
@ -2395,13 +2393,13 @@ NtGdiInvertRgn(HDC hDC,
|
|||
|
||||
if(!NtGdiPatBlt(hDC, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, DSTINVERT))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(RgnData);
|
||||
return FALSE;
|
||||
}
|
||||
rc++;
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(RgnData);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2443,7 +2441,7 @@ NtGdiOffsetRgn(HRGN hRgn,
|
|||
}
|
||||
}
|
||||
ret = rgn->rdh.iType;
|
||||
RGNDATA_UnlockRgn( hRgn );
|
||||
RGNDATA_UnlockRgn( rgn );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2467,7 +2465,7 @@ NtGdiPaintRgn(HDC hDC,
|
|||
return FALSE;
|
||||
|
||||
if(!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))){
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -2475,7 +2473,7 @@ NtGdiPaintRgn(HDC hDC,
|
|||
// Transform region into device co-ords
|
||||
if(!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->w.DCOrgX, dc->w.DCOrgY) == ERROR) {
|
||||
NtGdiDeleteObject( tmpVisRgn );
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
|
@ -2487,7 +2485,7 @@ NtGdiPaintRgn(HDC hDC,
|
|||
visrgn = RGNDATA_LockRgn(hRgn);
|
||||
if (visrgn == NULL)
|
||||
{
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -2509,11 +2507,11 @@ NtGdiPaintRgn(HDC hDC,
|
|||
&BrushOrigin,
|
||||
0xFFFF);//FIXME:don't know what to put here
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
RGNDATA_UnlockRgn( hRgn );
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
RGNDATA_UnlockRgn( visrgn );
|
||||
|
||||
// Fill the region
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2534,13 +2532,13 @@ NtGdiPtInRegion(HRGN hRgn,
|
|||
r = (PRECT) rgn->Buffer;
|
||||
for(i = 0; i < rgn->rdh.nCount; i++) {
|
||||
if(INRECT(*r, X, Y)){
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(rgn);
|
||||
return TRUE;
|
||||
}
|
||||
r++;
|
||||
}
|
||||
}
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(rgn);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -2583,13 +2581,13 @@ NtGdiRectInRegion(HRGN hRgn,
|
|||
|
||||
if (!NT_SUCCESS(MmCopyFromCaller(&rc, unsaferc, sizeof(RECT))))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
DPRINT1("NtGdiRectInRegion: bogus rc\n");
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
Ret = UnsafeIntRectInRegion(Rgn, &rc);
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -2625,7 +2623,7 @@ NtGdiSetRectRgn(HRGN hRgn,
|
|||
} else
|
||||
EMPTY_REGION(rgn);
|
||||
|
||||
RGNDATA_UnlockRgn( hRgn );
|
||||
RGNDATA_UnlockRgn( rgn );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2643,13 +2641,13 @@ NtGdiUnionRectWithRgn(HRGN hDest, CONST PRECT UnsafeRect)
|
|||
|
||||
if (! NT_SUCCESS(MmCopyFromCaller(&SafeRect, UnsafeRect, sizeof(RECT))))
|
||||
{
|
||||
RGNDATA_UnlockRgn(hDest);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UnsafeIntUnionRectWithRgn(Rgn, &SafeRect);
|
||||
RGNDATA_UnlockRgn(hDest);
|
||||
RGNDATA_UnlockRgn(Rgn);
|
||||
return hDest;
|
||||
}
|
||||
|
||||
|
@ -2674,7 +2672,7 @@ DWORD STDCALL NtGdiGetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
|
|||
size = obj->rdh.nCount * sizeof(RECT);
|
||||
if(count < (size + sizeof(RGNDATAHEADER)) || rgndata == NULL)
|
||||
{
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( obj );
|
||||
if (rgndata) /* buffer is too small, signal it by return 0 */
|
||||
return 0;
|
||||
else /* user requested buffer size with rgndata NULL */
|
||||
|
@ -2683,15 +2681,15 @@ DWORD STDCALL NtGdiGetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata)
|
|||
|
||||
//first we copy the header then we copy buffer
|
||||
if( !NT_SUCCESS( MmCopyToCaller( rgndata, obj, sizeof( RGNDATAHEADER )))){
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( obj );
|
||||
return 0;
|
||||
}
|
||||
if( !NT_SUCCESS( MmCopyToCaller( (char*)rgndata+sizeof( RGNDATAHEADER ), obj->Buffer, size ))){
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( obj );
|
||||
return 0;
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( obj );
|
||||
return size + sizeof(RGNDATAHEADER);
|
||||
}
|
||||
|
||||
|
@ -3146,7 +3144,7 @@ IntCreatePolyPolgonRgn(POINT *Pts,
|
|||
(Pts[2].x == Pts[3].x) &&
|
||||
(Pts[3].y == Pts[0].y))))
|
||||
{
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( region );
|
||||
NtGdiSetRectRgn( hrgn, min(Pts[0].x, Pts[2].x), min(Pts[0].y, Pts[2].y),
|
||||
max(Pts[0].x, Pts[2].x), max(Pts[0].y, Pts[2].y) );
|
||||
return hrgn;
|
||||
|
@ -3279,7 +3277,7 @@ IntCreatePolyPolgonRgn(POINT *Pts,
|
|||
curPtBlock = tmpPtBlock;
|
||||
}
|
||||
ExFreePool( pETEs );
|
||||
RGNDATA_UnlockRgn( hrgn );
|
||||
RGNDATA_UnlockRgn( region );
|
||||
return hrgn;
|
||||
}
|
||||
|
||||
|
@ -3325,7 +3323,7 @@ NtGdiCreatePolygonRgn(CONST PPOINT pt,
|
|||
|
||||
EMPTY_REGION(rgn);
|
||||
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
RGNDATA_UnlockRgn(rgn);
|
||||
return hRgn;
|
||||
}
|
||||
|
||||
|
|
|
@ -501,7 +501,7 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont)
|
|||
/* this should really depend on whether GM_ADVANCED is set */
|
||||
TextObj->logfont.lfOrientation = TextObj->logfont.lfEscapement;
|
||||
}
|
||||
TEXTOBJ_UnlockText(*NewFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1536,7 +1536,7 @@ NtGdiExtTextOut(
|
|||
}
|
||||
if (dc->IsIC)
|
||||
{
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
/* Yes, Windows really returns TRUE in this case */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1576,7 +1576,7 @@ NtGdiExtTextOut(
|
|||
else
|
||||
{
|
||||
Mode = PalDestGDI->Mode;
|
||||
PALETTE_UnlockPalette(dc->w.hPalette);
|
||||
PALETTE_UnlockPalette(PalDestGDI);
|
||||
}
|
||||
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||
if ( !XlateObj )
|
||||
|
@ -1941,21 +1941,21 @@ NtGdiExtTextOut(
|
|||
|
||||
EngDeleteXlate(XlateObj);
|
||||
EngDeleteXlate(XlateObj2);
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if(TextObj != NULL)
|
||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
if (hBrushBg != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(hBrushBg);
|
||||
BRUSHOBJ_UnlockBrush(BrushBg);
|
||||
NtGdiDeleteObject(hBrushBg);
|
||||
}
|
||||
BRUSHOBJ_UnlockBrush(hBrushFg);
|
||||
BRUSHOBJ_UnlockBrush(BrushFg);
|
||||
NtGdiDeleteObject(hBrushFg);
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePool(Dx);
|
||||
}
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -1965,23 +1965,23 @@ fail:
|
|||
if ( XlateObj != NULL )
|
||||
EngDeleteXlate(XlateObj);
|
||||
if(TextObj != NULL)
|
||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
if (hBrushBg != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(hBrushBg);
|
||||
BRUSHOBJ_UnlockBrush(BrushBg);
|
||||
NtGdiDeleteObject(hBrushBg);
|
||||
}
|
||||
if (hBrushFg != NULL)
|
||||
{
|
||||
BRUSHOBJ_UnlockBrush(hBrushFg);
|
||||
BRUSHOBJ_UnlockBrush(BrushFg);
|
||||
NtGdiDeleteObject(hBrushFg);
|
||||
}
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePool(Dx);
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2069,7 +2069,7 @@ NtGdiGetCharWidth32(HDC hDC,
|
|||
}
|
||||
hFont = dc->w.hFont;
|
||||
TextObj = TEXTOBJ_LockText(hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
if (TextObj == NULL)
|
||||
{
|
||||
|
@ -2121,7 +2121,7 @@ NtGdiGetCharWidth32(HDC hDC,
|
|||
SafeBuffer[i - FirstChar] = (face->glyph->advance.x + 32) >> 6;
|
||||
}
|
||||
IntUnLockFreeType;
|
||||
TEXTOBJ_UnlockText(hFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
MmCopyToCaller(Buffer, SafeBuffer, BufferSize);
|
||||
ExFreePool(SafeBuffer);
|
||||
return TRUE;
|
||||
|
@ -2414,8 +2414,8 @@ NtGdiGetTextExtentExPoint(HDC hDC,
|
|||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
ExFreePool(String);
|
||||
if (! Result)
|
||||
|
@ -2538,11 +2538,11 @@ NtGdiGetTextExtentPoint32(HDC hDC,
|
|||
{
|
||||
Result = TextIntGetTextExtentPoint (
|
||||
dc, TextObj, String, Count, 0, NULL, NULL, &Size);
|
||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
ExFreePool(String);
|
||||
if (! Result)
|
||||
|
@ -2574,7 +2574,7 @@ NtGdiGetTextFace(HDC hDC, INT Count, LPWSTR FaceName)
|
|||
return FALSE;
|
||||
}
|
||||
TextObj = TEXTOBJ_LockText(Dc->w.hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
Count = min(Count, wcslen(TextObj->logfont.lfFaceName));
|
||||
Status = MmCopyToCaller(FaceName, TextObj->logfont.lfFaceName, Count * sizeof(WCHAR));
|
||||
|
@ -2661,13 +2661,13 @@ NtGdiGetTextMetrics(HDC hDC,
|
|||
Status = MmCopyToCaller(tm, &SafeTm, sizeof(TEXTMETRICW));
|
||||
}
|
||||
}
|
||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = STATUS_INVALID_HANDLE;
|
||||
}
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -2721,7 +2721,7 @@ NtGdiSetTextAlign(HDC hDC,
|
|||
}
|
||||
prevAlign = dc->w.textAlign;
|
||||
dc->w.textAlign = Mode;
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
return prevAlign;
|
||||
}
|
||||
|
||||
|
@ -2743,7 +2743,7 @@ NtGdiSetTextColor(HDC hDC,
|
|||
oldColor = dc->w.textColor;
|
||||
dc->w.textColor = color;
|
||||
hBrush = dc->w.hBrush;
|
||||
DC_UnlockDc( hDC );
|
||||
DC_UnlockDc( dc );
|
||||
NtGdiSelectObject(hDC, hBrush);
|
||||
return oldColor;
|
||||
}
|
||||
|
@ -2791,7 +2791,7 @@ NtGdiGetFontData(
|
|||
}
|
||||
hFont = Dc->w.hFont;
|
||||
TextObj = TEXTOBJ_LockText(hFont);
|
||||
DC_UnlockDc(hDC);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
if (TextObj == NULL)
|
||||
{
|
||||
|
@ -2818,7 +2818,7 @@ NtGdiGetFontData(
|
|||
|
||||
IntUnLockFreeType;
|
||||
|
||||
TEXTOBJ_UnlockText(hFont);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -2973,13 +2973,13 @@ TextIntRealizeFont(HFONT FontHandle)
|
|||
|
||||
if (TextObj->Initialized)
|
||||
{
|
||||
TEXTOBJ_UnlockText(FontHandle);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (! RtlCreateUnicodeString(&FaceName, TextObj->logfont.lfFaceName))
|
||||
{
|
||||
TEXTOBJ_UnlockText(FontHandle);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
SubstituteFontFamily(&FaceName, 0);
|
||||
|
@ -3014,7 +3014,7 @@ TextIntRealizeFont(HFONT FontHandle)
|
|||
}
|
||||
|
||||
RtlFreeUnicodeString(&FaceName);
|
||||
TEXTOBJ_UnlockText(FontHandle);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
|
||||
ASSERT((NT_SUCCESS(Status) ^ (NULL == TextObj->Font)) != 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue