https://git.reactos.org/?p=reactos.git;a=commitdiff;h=34085be22d56684b16810…
commit 34085be22d56684b16810bc210a2453ef6368fe6
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Jan 9 11:26:59 2022 +0100
Commit: hpoussin <32227662+hpoussin(a)users.noreply.github.com>
CommitDate: Fri Apr 15 23:09:16 2022 +0200
[WIN32SS] Rename PDEVOBJ_vSwitchPdev to PDEVOBJ_bDynamicModeChange
Even if it currently always succeeds, let it return a boolean for later.
---
win32ss/gdi/eng/pdevobj.c | 13 ++++++++++---
win32ss/gdi/eng/pdevobj.h | 6 ++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c
index 9c7337698e2..1bf060dbec2 100644
--- a/win32ss/gdi/eng/pdevobj.c
+++ b/win32ss/gdi/eng/pdevobj.c
@@ -430,9 +430,9 @@ SwitchPointer(
*ppvPointer2 = pvTemp;
}
-VOID
+BOOL
NTAPI
-PDEVOBJ_vSwitchPdev(
+PDEVOBJ_bDynamicModeChange(
PPDEVOBJ ppdev,
PPDEVOBJ ppdev2)
{
@@ -481,6 +481,8 @@ PDEVOBJ_vSwitchPdev(
/* Notify each driver instance of its new HDEV association */
ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
ppdev2->pfn.CompletePDEV(ppdev2->dhpdev, (HDEV)ppdev2);
+
+ return TRUE;
}
@@ -536,7 +538,12 @@ PDEVOBJ_bSwitchMode(
/* 6. Copy old PDEV state to new PDEV instance */
/* 7. Switch the PDEVs */
- PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
+ if (!PDEVOBJ_bDynamicModeChange(ppdev, ppdevTmp))
+ {
+ DPRINT1("PDEVOBJ_bDynamicModeChange() failed\n");
+ PDEVOBJ_vRelease(ppdevTmp);
+ goto leave2;
+ }
/* 8. Disable DirectDraw */
diff --git a/win32ss/gdi/eng/pdevobj.h b/win32ss/gdi/eng/pdevobj.h
index af4973b60f6..4943c994d29 100644
--- a/win32ss/gdi/eng/pdevobj.h
+++ b/win32ss/gdi/eng/pdevobj.h
@@ -213,4 +213,10 @@ PDEVOBJ_bSwitchMode(
PPDEVOBJ ppdev,
PDEVMODEW pdm);
+BOOL
+NTAPI
+PDEVOBJ_bDynamicModeChange(
+ _Inout_ PPDEVOBJ ppdev,
+ _Inout_ PPDEVOBJ ppdev2);
+
#endif /* !__WIN32K_PDEVOBJ_H */