https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb504d7b0c85f69a9f215…
commit cb504d7b0c85f69a9f2152427eca4b9b18fbeefe
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Apr 24 17:27:55 2022 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Mon Apr 25 22:18:41 2022 +0200
[WIN32SS] Fix crash if releasing a PDEVOBJ before switching to graphic mode
- do not try to remove ppdev from gppdevList if gppdevList is NULL
- do not check (and maybe change) gpmdev, as it should be done only in
MDEVOBJ_vDestroy
---
win32ss/gdi/eng/pdevobj.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c
index e1f9da54c69..77dce0b0bfa 100644
--- a/win32ss/gdi/eng/pdevobj.c
+++ b/win32ss/gdi/eng/pdevobj.c
@@ -139,7 +139,7 @@ PDEVOBJ_vRelease(
{
gppdevList = ppdev->ppdevNext;
}
- else
+ else if (gppdevList)
{
PPDEVOBJ ppdevCurrent = gppdevList;
BOOL found = FALSE;
@@ -154,10 +154,6 @@ PDEVOBJ_vRelease(
ppdevCurrent->ppdevNext = ppdev->ppdevNext;
}
- /* Is this the primary one ? */
- if (ppdev == gpmdev->ppdevGlobal)
- gpmdev->ppdevGlobal = NULL;
-
/* Unload display driver */
EngUnloadImage(ppdev->pldev);