return 0;
}
- PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr);
+ PalGDI = psurf->ppal;
for (Index = StartIndex;
Index < StartIndex + Entries && Index < PalGDI->NumColors;
PalGDI->IndexedColors[Index].peGreen = Colors[Index - StartIndex].rgbGreen;
PalGDI->IndexedColors[Index].peBlue = Colors[Index - StartIndex].rgbBlue;
}
- PALETTE_UnlockPalette(PalGDI);
}
else
Entries = 0;
bmi->bmiHeader.biHeight,
bmi->bmiHeader.biBitCount));
- psurfDst = SURFACE_LockSurface(hBitmap);
- psurfSrc = SURFACE_LockSurface(SourceBitmap);
+ psurfDst = SURFACE_ShareLockSurface(hBitmap);
+ psurfSrc = SURFACE_ShareLockSurface(SourceBitmap);
if(!(psurfSrc && psurfDst))
{
cleanup:
if(psurfSrc)
{
- SURFACE_UnlockSurface(psurfSrc);
+ SURFACE_ShareUnlockSurface(psurfSrc);
}
if(psurfDst)
{
- SURFACE_UnlockSurface(psurfDst);
+ SURFACE_ShareUnlockSurface(psurfDst);
}
GreDeleteObject(SourceBitmap);
}
/* Lock the DIB palette */
- ppalDIB = PALETTE_LockPalette(hpalDIB);
+ ppalDIB = PALETTE_ShareLockPalette(hpalDIB);
if (!ppalDIB)
{
EngSetLastError(ERROR_INVALID_HANDLE);
ret = ScanLines;
}
- if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);
+ if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
- if (hpalDIB) PALETTE_FreePaletteByHandle(hpalDIB);
+ if (hpalDIB) GreDeleteObject(hpalDIB);
DC_UnlockDc(pDC);
return ret;
/* For color DDBs in native depth (mono DDBs always have
a black/white palette):
Generate the color map from the selected palette */
- PPALETTE pDcPal = PALETTE_LockPalette(pDC->dclevel.hpal);
+ PPALETTE pDcPal = PALETTE_ShareLockPalette(pDC->dclevel.hpal);
if(!pDcPal)
{
ScanLines = 0 ;
rgbQuads[i].rgbBlue = pDcPal->IndexedColors[i].peBlue;
rgbQuads[i].rgbReserved = 0;
}
- PALETTE_UnlockPalette(pDcPal);
+ PALETTE_ShareUnlockPalette(pDcPal);
}
else
{
{
if(dc)
{
- PPALETTE pdcPal ;
- pdcPal = PALETTE_LockPalette(dc->dclevel.hpal);
- hpal = DIB_MapPaletteColors(pdcPal, bmi);
- PALETTE_UnlockPalette(pdcPal);
+ PPALETTE ppalDc;
+ ppalDc = PALETTE_ShareLockPalette(dc->dclevel.hpal);
+ hpal = DIB_MapPaletteColors(ppalDc, bmi);
+ PALETTE_ShareUnlockPalette(ppalDc);
}
else
{
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
goto cleanup;
}
- bmp = SURFACE_LockSurface(res);
+ bmp = SURFACE_ShareLockSurface(res); // HACK
if (NULL == bmp)
{
DPRINT1("SURFACE_LockSurface failed\n");
if (res)
{
- SURFACE_FreeSurfaceByHandle(res);
+ GreDeleteObject(res);
res = 0;
}
}
if (bmp)
{
- SURFACE_UnlockSurface(bmp);
+ SURFACE_ShareUnlockSurface(bmp);
}
// Return BITMAP handle and storage location