mirror of
https://github.com/reactos/reactos.git
synced 2025-05-15 07:17:23 +00:00
[WIN32K]
- Use shared locks for surfaces and palettes svn path=/trunk/; revision=51352
This commit is contained in:
parent
8357192be7
commit
197cf31913
5 changed files with 31 additions and 31 deletions
|
@ -743,7 +743,7 @@ DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set)
|
|||
if (pDC)
|
||||
{
|
||||
if (SetType == 1)
|
||||
{
|
||||
{
|
||||
if ( Set )
|
||||
pDC->fs |= DC_FLAG_FULLSCREEN;
|
||||
else
|
||||
|
|
|
@ -934,24 +934,24 @@ NtUserSetCursorContents(
|
|||
/* Copy new IconInfo field */
|
||||
CurIcon->IconInfo = IconInfo;
|
||||
|
||||
psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor);
|
||||
psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmColor);
|
||||
if (psurfBmp)
|
||||
{
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
SURFACE_ShareUnlockSurface(psurfBmp);
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask);
|
||||
psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmMask);
|
||||
if (!psurfBmp)
|
||||
goto done;
|
||||
|
||||
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy / 2;
|
||||
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
SURFACE_ShareUnlockSurface(psurfBmp);
|
||||
}
|
||||
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ GreCreateBitmapEx(
|
|||
}
|
||||
DecompressBitmap(sizl, pvCompressedBits, pvBits, lDelta, iFormat);
|
||||
fjBitmap |= BMF_RLE_HACK;
|
||||
|
||||
|
||||
iFormat = iFormat == BMF_4RLE ? BMF_4BPP : BMF_8BPP;
|
||||
psurf->SurfObj.iBitmapFormat = iFormat;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ NtGdiCreateBitmap(
|
|||
|
||||
if (pUnsafeBits && hbmp)
|
||||
{
|
||||
PSURFACE psurf = SURFACE_LockSurface(hbmp);
|
||||
PSURFACE psurf = SURFACE_ShareLockSurface(hbmp);
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForRead(pUnsafeBits, cjSize, 1);
|
||||
|
@ -215,7 +215,7 @@ NtGdiCreateBitmap(
|
|||
}
|
||||
_SEH2_END
|
||||
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
SURFACE_ShareUnlockSurface(psurf);
|
||||
}
|
||||
|
||||
return hbmp;
|
||||
|
|
|
@ -514,7 +514,7 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
}
|
||||
|
||||
/* Lock the DIB palette */
|
||||
ppalDIB = PALETTE_LockPalette(hpalDIB);
|
||||
ppalDIB = PALETTE_ShareLockPalette(hpalDIB);
|
||||
if (!ppalDIB)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -555,7 +555,7 @@ Exit:
|
|||
ret = ScanLines;
|
||||
}
|
||||
|
||||
if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);
|
||||
if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
|
||||
|
||||
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
|
||||
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
|
||||
|
@ -1590,7 +1590,7 @@ DIB_CreateDIBSection(
|
|||
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
||||
goto cleanup;
|
||||
}
|
||||
bmp = SURFACE_LockSurface(res);
|
||||
bmp = SURFACE_ShareLockSurface(res); // HACK
|
||||
if (NULL == bmp)
|
||||
{
|
||||
DPRINT1("SURFACE_LockSurface failed\n");
|
||||
|
@ -1646,7 +1646,7 @@ cleanup:
|
|||
|
||||
if (bmp)
|
||||
{
|
||||
SURFACE_UnlockSurface(bmp);
|
||||
SURFACE_ShareUnlockSurface(bmp);
|
||||
}
|
||||
|
||||
// Return BITMAP handle and storage location
|
||||
|
|
|
@ -469,11 +469,11 @@ NtGdiCreatePaletteInternal ( IN LPLOGPALETTE pLogPal, IN UINT cEntries )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PalGDI = (PPALETTE) PALETTE_LockPalette(NewPalette);
|
||||
PalGDI = (PPALETTE) PALETTE_ShareLockPalette(NewPalette);
|
||||
if (PalGDI != NULL)
|
||||
{
|
||||
PALETTE_ValidateFlags(PalGDI->IndexedColors, PalGDI->NumColors);
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
PALETTE_ShareUnlockPalette(PalGDI);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -664,7 +664,7 @@ COLORREF APIENTRY NtGdiGetNearestColor(HDC hDC, COLORREF Color)
|
|||
if (NULL != dc)
|
||||
{
|
||||
HPALETTE hpal = dc->dclevel.hpal;
|
||||
palGDI = (PPALETTE) PALETTE_LockPalette(hpal);
|
||||
palGDI = PALETTE_ShareLockPalette(hpal);
|
||||
if (!palGDI)
|
||||
{
|
||||
DC_UnlockDc(dc);
|
||||
|
@ -691,7 +691,7 @@ COLORREF APIENTRY NtGdiGetNearestColor(HDC hDC, COLORREF Color)
|
|||
(GetGValue(Color) >> GBits) << GBits,
|
||||
(GetBValue(Color) >> BBits) << BBits);
|
||||
}
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
DC_UnlockDc(dc);
|
||||
}
|
||||
|
||||
|
@ -704,7 +704,7 @@ NtGdiGetNearestPaletteIndex(
|
|||
HPALETTE hpal,
|
||||
COLORREF crColor)
|
||||
{
|
||||
PPALETTE ppal = (PPALETTE) PALETTE_LockPalette(hpal);
|
||||
PPALETTE ppal = PALETTE_ShareLockPalette(hpal);
|
||||
UINT index = 0;
|
||||
|
||||
if (ppal)
|
||||
|
@ -715,7 +715,7 @@ NtGdiGetNearestPaletteIndex(
|
|||
index = PALETTE_ulGetNearestPaletteIndex(ppal, crColor);
|
||||
}
|
||||
// else SetLastError ?
|
||||
PALETTE_UnlockPalette(ppal);
|
||||
PALETTE_ShareUnlockPalette(ppal);
|
||||
}
|
||||
|
||||
return index;
|
||||
|
@ -777,13 +777,13 @@ IntAnimatePalette(HPALETTE hPal,
|
|||
PWND Wnd;
|
||||
const PALETTEENTRY *pptr = PaletteColors;
|
||||
|
||||
palPtr = (PPALETTE)PALETTE_LockPalette(hPal);
|
||||
palPtr = PALETTE_ShareLockPalette(hPal);
|
||||
if (!palPtr) return FALSE;
|
||||
|
||||
pal_entries = palPtr->NumColors;
|
||||
if (StartIndex >= pal_entries)
|
||||
{
|
||||
PALETTE_UnlockPalette(palPtr);
|
||||
PALETTE_ShareUnlockPalette(palPtr);
|
||||
return FALSE;
|
||||
}
|
||||
if (StartIndex+NumEntries > pal_entries) NumEntries = pal_entries - StartIndex;
|
||||
|
@ -800,7 +800,7 @@ IntAnimatePalette(HPALETTE hPal,
|
|||
}
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(palPtr);
|
||||
PALETTE_ShareUnlockPalette(palPtr);
|
||||
|
||||
/* Immediately apply the new palette if current window uses it */
|
||||
Wnd = UserGetDesktopWindow();
|
||||
|
@ -831,7 +831,7 @@ IntGetPaletteEntries(
|
|||
PPALETTE palGDI;
|
||||
UINT numEntries;
|
||||
|
||||
palGDI = (PPALETTE) PALETTE_LockPalette(hpal);
|
||||
palGDI = (PPALETTE) PALETTE_ShareLockPalette(hpal);
|
||||
if (NULL == palGDI)
|
||||
{
|
||||
return 0;
|
||||
|
@ -846,7 +846,7 @@ IntGetPaletteEntries(
|
|||
}
|
||||
if (numEntries <= StartIndex)
|
||||
{
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
return 0;
|
||||
}
|
||||
memcpy(pe, palGDI->IndexedColors + StartIndex, Entries * sizeof(PALETTEENTRY));
|
||||
|
@ -856,7 +856,7 @@ IntGetPaletteEntries(
|
|||
Entries = numEntries;
|
||||
}
|
||||
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
return Entries;
|
||||
}
|
||||
|
||||
|
@ -894,7 +894,7 @@ IntGetSystemPaletteEntries(HDC hDC,
|
|||
return 0;
|
||||
}
|
||||
|
||||
palGDI = PALETTE_LockPalette(dc->dclevel.hpal);
|
||||
palGDI = PALETTE_ShareLockPalette(dc->dclevel.hpal);
|
||||
if (palGDI != NULL)
|
||||
{
|
||||
if (pe != NULL)
|
||||
|
@ -917,7 +917,7 @@ IntGetSystemPaletteEntries(HDC hDC,
|
|||
}
|
||||
|
||||
if (palGDI != NULL)
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
|
||||
if (dc != NULL)
|
||||
DC_UnlockDc(dc);
|
||||
|
@ -941,13 +941,13 @@ IntSetPaletteEntries(
|
|||
return 0;
|
||||
}
|
||||
|
||||
palGDI = PALETTE_LockPalette(hpal);
|
||||
palGDI = PALETTE_ShareLockPalette(hpal);
|
||||
if (!palGDI) return 0;
|
||||
|
||||
numEntries = palGDI->NumColors;
|
||||
if (Start >= numEntries)
|
||||
{
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
return 0;
|
||||
}
|
||||
if (numEntries < Start + Entries)
|
||||
|
@ -955,7 +955,7 @@ IntSetPaletteEntries(
|
|||
Entries = numEntries - Start;
|
||||
}
|
||||
memcpy(palGDI->IndexedColors + Start, pe, Entries * sizeof(PALETTEENTRY));
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
|
||||
return Entries;
|
||||
}
|
||||
|
@ -1138,7 +1138,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj)
|
|||
!GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) )
|
||||
return Ret;
|
||||
|
||||
palGDI = PALETTE_LockPalette(hgdiobj);
|
||||
palGDI = PALETTE_ShareLockPalette(hgdiobj);
|
||||
if (!palGDI) return FALSE;
|
||||
|
||||
// FIXME!!
|
||||
|
@ -1146,7 +1146,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj)
|
|||
// Zero out Current and Old Translated pointers?
|
||||
//
|
||||
Ret = TRUE;
|
||||
PALETTE_UnlockPalette(palGDI);
|
||||
PALETTE_ShareUnlockPalette(palGDI);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue