fixing smaller bugs in NtGdiDdWaitForVerticalBlank now it is compatible with windows 2000 in all my test case.

svn path=/trunk/; revision=26282
This commit is contained in:
Magnus Olsen 2007-04-08 12:05:22 +00:00
parent 923523688f
commit ce8c107dbc

View file

@ -386,13 +386,19 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank(
PDD_DIRECTDRAW pDirectDraw = NULL; PDD_DIRECTDRAW pDirectDraw = NULL;
NTSTATUS Status = FALSE; NTSTATUS Status = FALSE;
DD_WAITFORVERTICALBLANKDATA WaitForVerticalBlankData; DD_WAITFORVERTICALBLANKDATA WaitForVerticalBlankData;
LPDDHAL_WAITFORVERTICALBLANKDATA pWaitForVerticalBlankData = (LPDDHAL_WAITFORVERTICALBLANKDATA)puWaitForVerticalBlankData;
DPRINT1("NtGdiDdWaitForVerticalBlank\n"); if ((hDirectDrawLocal) &&
(puWaitForVerticalBlankData))
{
RtlZeroMemory(&WaitForVerticalBlankData,sizeof(DD_WAITFORVERTICALBLANKDATA));
_SEH_TRY _SEH_TRY
{ {
ProbeForRead(puWaitForVerticalBlankData, sizeof(DD_WAITFORVERTICALBLANKDATA), 1); ProbeForRead(pWaitForVerticalBlankData, sizeof(DDHAL_WAITFORVERTICALBLANKDATA), 1);
RtlCopyMemory(&WaitForVerticalBlankData,puWaitForVerticalBlankData, sizeof(DD_WAITFORVERTICALBLANKDATA)); WaitForVerticalBlankData.dwFlags = pWaitForVerticalBlankData->dwFlags;
WaitForVerticalBlankData.bIsInVB = pWaitForVerticalBlankData->bIsInVB;
WaitForVerticalBlankData.hEvent = pWaitForVerticalBlankData->hEvent;
} }
_SEH_HANDLE _SEH_HANDLE
{ {
@ -414,9 +420,9 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank(
} }
_SEH_TRY _SEH_TRY
{ {
ProbeForWrite(puWaitForVerticalBlankData, sizeof(DD_WAITFORVERTICALBLANKDATA), 1); ProbeForWrite(pWaitForVerticalBlankData, sizeof(DDHAL_WAITFORVERTICALBLANKDATA), 1);
puWaitForVerticalBlankData->ddRVal = WaitForVerticalBlankData.ddRVal; pWaitForVerticalBlankData->ddRVal = WaitForVerticalBlankData.ddRVal;
puWaitForVerticalBlankData->bIsInVB = WaitForVerticalBlankData.bIsInVB; pWaitForVerticalBlankData->bIsInVB = WaitForVerticalBlankData.bIsInVB;
} }
_SEH_HANDLE _SEH_HANDLE
{ {
@ -427,6 +433,7 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank(
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
} }
} }
}
return ddRVal; return ddRVal;
} }