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];
Author: tkreuzer
Date: Fri Oct 24 07:16:44 2014
New Revision: 64947
URL: http://svn.reactos.org/svn/reactos?rev=64947&view=rev
Log:
[NTOSKRNL]
Do not try to dereference Irp->UserIosb if it is NULL, to avoid unnecessary exceptions (inside SEH).
Modified:
trunk/reactos/ntoskrnl/io/iomgr/irp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Fri Oct 24 07:16:44 2014
@@ -324,17 +324,21 @@
Key = FileObject->CompletionContext->Key;
}
- /* Use SEH to make sure we don't write somewhere invalid */
- _SEH2_TRY
- {
- /* Save the IOSB Information */
- *Irp->UserIosb = Irp->IoStatus;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- /* Ignore any error */
- }
- _SEH2_END;
+ /* Check for UserIos */
+ if (Irp->UserIosb != NULL)
+ {
+ /* Use SEH to make sure we don't write somewhere invalid */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
+ }
/* Check if we have an event or a file object */
if (Irp->UserEvent)