Author: greatlrd
Date: Tue Jul 18 12:54:32 2006
New Revision: 23134
URL:
http://svn.reactos.org/svn/reactos?rev=23134&view=rev
Log:
adding NULL pointer check for ppdev, pHalInfo, pdwNumHeaps, pdwNumFourCCCodes
fill in more info for DDHALINFO it is not complete yet.
Modified:
trunk/reactos/drivers/video/displays/framebuf/ddenable.c
Modified: trunk/reactos/drivers/video/displays/framebuf/ddenable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebuf/ddenable.c (original)
+++ trunk/reactos/drivers/video/displays/framebuf/ddenable.c Tue Jul 18 12:54:32 2006
@@ -136,19 +136,41 @@
{
PPDEV ppdev = (PPDEV)dhpdev;
+ if (ppdev == NULL)
+ return FALSE;
+
+ /* check so pHalInfo, pdwNumHeaps, pdwNumFourCCCodes is not NULL
+ pdwFourCC and pvmList can be null
+ */
+
+ if (pHalInfo == NULL)
+ return FALSE;
+
+ if (pdwNumHeaps == NULL)
+ return FALSE;
+
+ if (pdwNumFourCCCodes == NULL)
+ return FALSE;
+
/* rest some data */
*pdwNumFourCCCodes = 0;
*pdwNumHeaps = 0;
-
-
/*
- check see if pvmList and pdwFourCC are second call
+ check see if pvmList and pdwFourCC are frist call
or frist. Secon call we fill in pHalInfo info
*/
if(!(pvmList && pdwFourCC))
- {
+ {
+ RtlZeroMemory(pHalInfo, sizeof(DDHALINFO));
+ pHalInfo->dwSize = sizeof(DDHALINFO);
+
+ pHalInfo->ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTQUEUE |
DDCAPS_BLTCOLORFILL | DDCAPS_READSCANLINE |
+ DDCAPS_BLTSTRETCH | DDCAPS_COLORKEY | DDCAPS_CANBLTSYSMEM;
+
+ pHalInfo->ddCaps.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP;
+
/* Calc how much memmory is left on the video cards memmory */
pHalInfo->ddCaps.dwVidMemTotal = (ppdev->MemHeight - ppdev->ScreenHeight) *
ppdev->ScreenDelta;
@@ -172,12 +194,7 @@
if ( ppdev->BitsPerPixel == 8 )
{
pHalInfo->vmiData.ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8;
- }
-
-
-
-
-
+ }
}
return TRUE;