Author: jgardou
Date: Fri Oct 24 11:35:07 2014
New Revision: 64955
URL: http://svn.reactos.org/svn/reactos?rev=64955&view=rev
Log:
[WIN32K]
- Keep track of the PDEV which we create a compatible bitmap for.
- Allow attaching a DDB to a DC if they are from the same PDEV
Fixes various problems after mode switching, including the infamous "Where is desk.cpl palette bitmap"
Modified:
trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitmaps.…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] Fri Oct 24 11:35:07 2014
@@ -249,6 +249,7 @@
/* Set flags */
psurf->flags = API_BITMAP;
psurf->hdc = NULL; // FIXME:
+ psurf->SurfObj.hdev = (HDEV)Dc->ppdev;
SURFACE_ShareUnlockSurface(psurf);
}
else
@@ -277,6 +278,7 @@
/* Set flags */
psurfBmp->flags = API_BITMAP;
psurfBmp->hdc = NULL; // FIXME:
+ psurf->SurfObj.hdev = (HDEV)Dc->ppdev;
SURFACE_ShareUnlockSurface(psurfBmp);
}
else if (Count == sizeof(DIBSECTION))
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Fri Oct 24 11:35:07 2014
@@ -329,6 +329,10 @@
/* DIB sections are always compatible */
if (psurf->hSecure != NULL) return TRUE;
+
+ /* See if this is the same PDEV */
+ if (psurf->SurfObj.hdev == (HDEV)pdc->ppdev)
+ return TRUE;
/* Get the bit depth of the bitmap */
cBitsPixel = gajBitsPerFormat[psurf->SurfObj.iBitmapFormat];