From 42fa951ba7ff81572e6ab7d3f1bc0947901d8f7b Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 2 Dec 2007 17:31:12 +0000 Subject: [PATCH] Fix two smaller bugs in DxDdStartupDxGraphics ------------------------------------------------ fix : use full path to dxg.sys when we trying load it fix : only try unload dxg.sys if it really been load and got a fail status code. svn path=/trunk/; revision=30963 --- reactos/subsystems/win32/win32k/ntddraw/ddraw.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c index 808d8b728bd..4160b81daf4 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c +++ b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c @@ -50,10 +50,12 @@ DxDdStartupDxGraphics( ULONG ulc1, // DxApiGetVersion() /* Loading the kernel interface of directx for win32k */ - ghDxGraphics = EngLoadImage(L"drivers\\dxg.sys"); - if (!ghDxGraphics) + + ghDxGraphics = EngLoadImage(L"\\SystemRoot\\System32\\drivers\\dxg.sys"); + + if (ghDxGraphics == NULL) { - DPRINT1("Warning: dxg.sys not found\n"); + DPRINT1("Warning: dxg.sys not found\n"); Status = STATUS_DLL_NOT_FOUND; } else @@ -83,8 +85,11 @@ DxDdStartupDxGraphics( ULONG ulc1, { gpfnStartupDxGraphics = NULL; gpfnCleanupDxGraphics = NULL; - EngUnloadImage( ghDxGraphics); - ghDxGraphics = NULL; + if (ghDxGraphics != NULL) + { + EngUnloadImage( ghDxGraphics); + ghDxGraphics = NULL; + } DPRINT1("Warning: DirectX graphics interface can not be initialized\n"); } else