https://git.reactos.org/?p=reactos.git;a=commitdiff;h=185f2dac855b55d328fd5…
commit 185f2dac855b55d328fd547ef4faaa0f3df7a42b
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun May 8 21:51:10 2022 +0200
Commit: hpoussin <32227662+hpoussin(a)users.noreply.github.com>
CommitDate: Sat May 14 21:29:12 2022 +0200
[WIN32SS] Copy function table earlier, and use it in all PDEVOBJ operations
---
win32ss/gdi/eng/pdevobj.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c
index 65469cfce76..c16fd43bf4b 100644
--- a/win32ss/gdi/eng/pdevobj.c
+++ b/win32ss/gdi/eng/pdevobj.c
@@ -176,7 +176,7 @@ PDEVOBJ_bEnablePDEV(
ULONG i;
/* Get the DrvEnablePDEV function */
- pfnEnablePDEV = ppdev->pldev->pfn.EnablePDEV;
+ pfnEnablePDEV = ppdev->pfn.EnablePDEV;
/* Call the drivers DrvEnablePDEV function */
TRACE("DrvEnablePDEV(pdevmode %p (%dx%dx%d %d Hz) hdev %p (%S))\n",
@@ -243,7 +243,7 @@ PDEVOBJ_vCompletePDEV(
{
/* Call the drivers DrvCompletePDEV function */
TRACE("DrvCompletePDEV(dhpdev %p hdev %p)\n", ppdev->dhpdev, ppdev);
- ppdev->pldev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
+ ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
}
static
@@ -314,7 +314,7 @@ PDEVOBJ_pSurface(
{
/* Call the drivers DrvEnableSurface */
TRACE("DrvEnableSurface(dhpdev %p)\n", ppdev->dhpdev);
- hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
+ hsurf = ppdev->pfn.EnableSurface(ppdev->dhpdev);
TRACE("DrvEnableSurface(dhpdev %p) => hsurf %p\n", ppdev->dhpdev,
hsurf);
if (hsurf== NULL)
{
@@ -502,6 +502,9 @@ PDEVOBJ_Create(
ppdev->pldev = pldev;
ppdev->dwAccelerationLevel = dwAccelerationLevel;
+ /* Copy the function table */
+ ppdev->pfn = ppdev->pldev->pfn;
+
/* Call the driver to enable the PDEV */
if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
{
@@ -511,9 +514,6 @@ PDEVOBJ_Create(
return NULL;
}
- /* Copy the function table */
- ppdev->pfn = ppdev->pldev->pfn;
-
/* Tell the driver that the PDEV is ready */
PDEVOBJ_vCompletePDEV(ppdev);