mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 09:01:13 +00:00
Fixing smaller bugs in dx after some analyzing how vmware drv works.
1. vmware drv do not implement DrvGetDirectDrawInfo that show windows 2000/XP/2003 that mean u are not force to implement this api in the drv, only INDEX_DrvEnableDirectDraw and INDEX_DrvDisableDirectDraw are req to be implement in the driver. svn path=/trunk/; revision=26164
This commit is contained in:
parent
3907b65ae1
commit
34713168d4
|
@ -85,38 +85,40 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw)
|
||||||
* but we get back how many pvmList it whant we should alloc, same
|
* but we get back how many pvmList it whant we should alloc, same
|
||||||
* with pdwFourCC.
|
* with pdwFourCC.
|
||||||
*/
|
*/
|
||||||
success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev,
|
if (pDirectDraw->DrvGetDirectDrawInfo)
|
||||||
&HalInfo,
|
|
||||||
&pDirectDraw->dwNumHeaps,
|
|
||||||
NULL,
|
|
||||||
&pDirectDraw->dwNumFourCC,
|
|
||||||
NULL);
|
|
||||||
if (!success)
|
|
||||||
{
|
{
|
||||||
DPRINT1("DrvGetDirectDrawInfo frist call fail\n");
|
DPRINT1("if u are using vmware driver and see this msg, please repot this\n");
|
||||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev,
|
||||||
return FALSE;
|
&HalInfo,
|
||||||
}
|
&pDirectDraw->dwNumHeaps,
|
||||||
|
NULL,
|
||||||
|
&pDirectDraw->dwNumFourCC,
|
||||||
|
NULL);
|
||||||
/* The driver are not respnose to alloc the memory for pvmList
|
if (!success)
|
||||||
* but it is win32k responsible todo, Windows 9x it is gdi32.dll
|
|
||||||
*/
|
|
||||||
if (pDirectDraw->dwNumHeaps != 0)
|
|
||||||
{
|
|
||||||
pDirectDraw->pvmList = (PVIDEOMEMORY) ExAllocatePoolWithTag(PagedPool, pDirectDraw->dwNumHeaps * sizeof(VIDEOMEMORY), TAG_DXPVMLIST);
|
|
||||||
if (pDirectDraw->pvmList == NULL)
|
|
||||||
{
|
{
|
||||||
|
DPRINT1("DrvGetDirectDrawInfo frist call fail\n");
|
||||||
|
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* The driver are not respnose to alloc the memory for pdwFourCC
|
|
||||||
* but it is win32k responsible todo, Windows 9x it is gdi32.dll
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (pDirectDraw->dwNumFourCC != 0)
|
/* The driver are not respnose to alloc the memory for pvmList
|
||||||
|
* but it is win32k responsible todo, Windows 9x it is gdi32.dll
|
||||||
|
*/
|
||||||
|
if (pDirectDraw->dwNumHeaps != 0)
|
||||||
|
{
|
||||||
|
pDirectDraw->pvmList = (PVIDEOMEMORY) ExAllocatePoolWithTag(PagedPool, pDirectDraw->dwNumHeaps * sizeof(VIDEOMEMORY), TAG_DXPVMLIST);
|
||||||
|
if (pDirectDraw->pvmList == NULL)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The driver are not respnose to alloc the memory for pdwFourCC
|
||||||
|
* but it is win32k responsible todo, Windows 9x it is gdi32.dll
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (pDirectDraw->dwNumFourCC != 0)
|
||||||
{
|
{
|
||||||
pDirectDraw->pdwFourCC = (LPDWORD) ExAllocatePoolWithTag(PagedPool, pDirectDraw->dwNumFourCC * sizeof(DWORD), TAG_DXFOURCC);
|
pDirectDraw->pdwFourCC = (LPDWORD) ExAllocatePoolWithTag(PagedPool, pDirectDraw->dwNumFourCC * sizeof(DWORD), TAG_DXFOURCC);
|
||||||
|
|
||||||
|
@ -125,59 +127,59 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev,
|
||||||
success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev,
|
&HalInfo,
|
||||||
&HalInfo,
|
&pDirectDraw->dwNumHeaps,
|
||||||
&pDirectDraw->dwNumHeaps,
|
pDirectDraw->pvmList,
|
||||||
pDirectDraw->pvmList,
|
&pDirectDraw->dwNumFourCC,
|
||||||
&pDirectDraw->dwNumFourCC,
|
pDirectDraw->pdwFourCC);
|
||||||
pDirectDraw->pdwFourCC);
|
if (!success)
|
||||||
if (!success)
|
|
||||||
{
|
|
||||||
DPRINT1("DrvGetDirectDrawInfo second call fail\n");
|
|
||||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* We need now convert the DD_HALINFO we got, it can be NT4 driver we
|
|
||||||
* loading ReactOS supporting NT4 and higher to be loading.so we make
|
|
||||||
* the HALInfo compatible here so we can easy pass it to gdi32.dll
|
|
||||||
* without converting it later
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((HalInfo.dwSize != sizeof(DD_HALINFO)) &&
|
|
||||||
(HalInfo.dwSize != sizeof(DD_HALINFO_V4)))
|
|
||||||
{
|
|
||||||
DPRINT1(" Fail not vaild driver DD_HALINFO struct found\n");
|
|
||||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HalInfo.dwSize != sizeof(DD_HALINFO))
|
|
||||||
{
|
|
||||||
if (HalInfo.dwSize == sizeof(DD_HALINFO_V4))
|
|
||||||
{
|
{
|
||||||
/* NT4 Compatible */
|
DPRINT1("DrvGetDirectDrawInfo second call fail\n");
|
||||||
DPRINT1("Got DD_HALINFO_V4 sturct we convert it to DD_HALINFO \n");
|
|
||||||
HalInfo.dwSize = sizeof(DD_HALINFO);
|
|
||||||
HalInfo.lpD3DGlobalDriverData = NULL;
|
|
||||||
HalInfo.lpD3DHALCallbacks = NULL;
|
|
||||||
HalInfo.lpD3DBufCallbacks = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Unknown version found */
|
|
||||||
DPRINT1(" Fail : did not get DD_HALINFO size \n");
|
|
||||||
|
|
||||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy it to user mode pointer the data */
|
|
||||||
RtlCopyMemory(&pDirectDraw->Hal, &HalInfo, sizeof(DD_HALINFO));
|
/* We need now convert the DD_HALINFO we got, it can be NT4 driver we
|
||||||
|
* loading ReactOS supporting NT4 and higher to be loading.so we make
|
||||||
|
* the HALInfo compatible here so we can easy pass it to gdi32.dll
|
||||||
|
* without converting it later
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ((HalInfo.dwSize != sizeof(DD_HALINFO)) &&
|
||||||
|
(HalInfo.dwSize != sizeof(DD_HALINFO_V4)))
|
||||||
|
{
|
||||||
|
DPRINT1(" Fail not vaild driver DD_HALINFO struct found\n");
|
||||||
|
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HalInfo.dwSize != sizeof(DD_HALINFO))
|
||||||
|
{
|
||||||
|
if (HalInfo.dwSize == sizeof(DD_HALINFO_V4))
|
||||||
|
{
|
||||||
|
/* NT4 Compatible */
|
||||||
|
DPRINT1("Got DD_HALINFO_V4 sturct we convert it to DD_HALINFO \n");
|
||||||
|
HalInfo.dwSize = sizeof(DD_HALINFO);
|
||||||
|
HalInfo.lpD3DGlobalDriverData = NULL;
|
||||||
|
HalInfo.lpD3DHALCallbacks = NULL;
|
||||||
|
HalInfo.lpD3DBufCallbacks = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Unknown version found */
|
||||||
|
DPRINT1(" Fail : did not get DD_HALINFO size \n");
|
||||||
|
|
||||||
|
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Copy it to user mode pointer the data */
|
||||||
|
RtlCopyMemory(&pDirectDraw->Hal, &HalInfo, sizeof(DD_HALINFO));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
success = pDirectDraw->EnableDirectDraw( pDirectDraw->Global.dhpdev,
|
success = pDirectDraw->EnableDirectDraw( pDirectDraw->Global.dhpdev,
|
||||||
&pDirectDraw->DD,
|
&pDirectDraw->DD,
|
||||||
&pDirectDraw->Surf,
|
&pDirectDraw->Surf,
|
||||||
|
@ -217,9 +219,8 @@ NtGdiDdCreateDirectDrawObject(HDC hdc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test see if drv got a dx interface or not */
|
/* test see if drv got a dx interface or not */
|
||||||
if (( pDC->DriverFunctions.GetDirectDrawInfo == NULL) ||
|
if ( ( pDC->DriverFunctions.DisableDirectDraw == NULL) ||
|
||||||
( pDC->DriverFunctions.DisableDirectDraw == NULL) ||
|
( pDC->DriverFunctions.EnableDirectDraw == NULL))
|
||||||
( pDC->DriverFunctions.EnableDirectDraw == NULL))
|
|
||||||
{
|
{
|
||||||
DC_UnlockDc(pDC);
|
DC_UnlockDc(pDC);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -83,6 +83,12 @@ DWORD STDCALL NtGdiDdBlt(
|
||||||
|
|
||||||
Blt.ddRVal = DDERR_GENERIC;
|
Blt.ddRVal = DDERR_GENERIC;
|
||||||
|
|
||||||
|
/* MSDN say this member is always set to FALSE in windows 2000 or higher */
|
||||||
|
Blt.IsClipped = FALSE;
|
||||||
|
|
||||||
|
/* MSDN say this member is always unuse in windows 2000 or higher */
|
||||||
|
Blt.dwROPFlags = 0;
|
||||||
|
|
||||||
if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_BLT)
|
if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_BLT)
|
||||||
{
|
{
|
||||||
Blt.lpDD = &pDirectDraw->Global;
|
Blt.lpDD = &pDirectDraw->Global;
|
||||||
|
|
Loading…
Reference in a new issue