From 254445ecc44d5dbfe93aa34bba152d27dcaddb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 1 Jan 2008 16:35:21 +0000 Subject: [PATCH] Bugcheck if no miniport driver is available See issue #2899 for more details. svn path=/trunk/; revision=31534 --- reactos/subsystems/win32/win32k/objects/dc.c | 33 ++++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index b59130c0171..38635b95974 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -16,29 +16,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id$ - * +/* * DC.C - Device context functions * */ #include +#include #define NDEBUG #include -/* ROS Internal. Please deprecate */ -NTHALAPI -BOOLEAN -NTAPI -HalQueryDisplayOwnership( - VOID -); - -#ifndef OBJ_COLORSPACE -#define OBJ_COLORSPACE (14) -#endif - static GDIDEVICE PrimarySurface; static KEVENT VideoDriverNeedsPreparation; static KEVENT VideoDriverPrepared; @@ -740,8 +728,15 @@ IntGdiCreateDC(PUNICODE_STRING Driver, { if (! IntPrepareDriverIfNeeded()) { - DPRINT1("Unable to prepare graphics driver, returning NULL ic\n"); - return NULL; + /* Here, we have two possibilities: + * a) return NULL, and hope that the caller + * won't call us in a loop + * b) bugcheck, but caller is unable to + * react on the problem + */ + /*DPRINT1("Unable to prepare graphics driver, returning NULL ic\n"); + return NULL;*/ + KeBugCheck(VIDEO_DRIVER_INIT_FAILURE); } } else @@ -2846,7 +2841,11 @@ IntEnumDisplaySettings( return FALSE; } - IntPrepareDriverIfNeeded(); + if (!IntPrepareDriverIfNeeded()) + { + DPRINT1("IntPrepareDriverIfNeeded failed\n"); + return FALSE; + } /* * DriverFileNames may be a list of drivers in REG_SZ_MULTI format,