aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-23 12:34:50 +0100
committermarha <marha@users.sourceforge.net>2012-02-23 12:34:50 +0100
commit50cb30a8b13f3218a1dc933a4584466f4d616438 (patch)
tree4b1180e588d443ad00145d5e7662d5a45dcc76c1 /xorg-server/hw/xwin
parent3be08ad7b814a6a371bfc8114a9aa7a8cb8bd48c (diff)
downloadvcxsrv-50cb30a8b13f3218a1dc933a4584466f4d616438.tar.gz
vcxsrv-50cb30a8b13f3218a1dc933a4584466f4d616438.tar.bz2
vcxsrv-50cb30a8b13f3218a1dc933a4584466f4d616438.zip
Return error when bitsperpixel is less then 24
Diffstat (limited to 'xorg-server/hw/xwin')
-rw-r--r--xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
index 4633d4867..c5b799079 100644
--- a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
+++ b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c
@@ -49,6 +49,7 @@ struct __DRIdrawableRec
HBITMAP hBitmap;
int winWidth;
int winHeight;
+ int bitsPerPixel;
VOID *bits;
void *driverPrivate;
@@ -290,6 +291,7 @@ void setupDIB(__DRIdrawable * pdp)
bmiSize = sizeof(*bmInfo);
bitsPerPixel = GetDeviceCaps(pdp->hDC, BITSPIXEL);
+ pdp->bitsPerPixel=bitsPerPixel;
switch (bitsPerPixel) {
case 8:
@@ -915,6 +917,15 @@ static __DRIscreen *driCreateNewScreen(int scrn, const __DRIextension **extensio
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
+ HDC hDc = GetDC(NULL);
+ int bitsPerPixel= GetDeviceCaps(hDc, BITSPIXEL);
+ ReleaseDC(NULL, hDc);
+ if (bitsPerPixel<24)
+ {
+ PRINTF(__FUNCTION__": bitsPerPixel not supported %d\n", bitsPerPixel);
+ return NULL;
+ }
+
psp = calloc(sizeof(struct __DRIscreenRec),1);
if (!psp)
return NULL;