Author: greatlrd
Date: Sun Apr 8 16:05:22 2007
New Revision: 26282
URL:
http://svn.reactos.org/svn/reactos?rev=26282&view=rev
Log:
fixing smaller bugs in NtGdiDdWaitForVerticalBlank now it is compatible with windows 2000
in all my test case.
Modified:
trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c Sun Apr 8 16:05:22 2007
@@ -386,45 +386,52 @@
PDD_DIRECTDRAW pDirectDraw = NULL;
NTSTATUS Status = FALSE;
DD_WAITFORVERTICALBLANKDATA WaitForVerticalBlankData;
-
- DPRINT1("NtGdiDdWaitForVerticalBlank\n");
-
- _SEH_TRY
- {
- ProbeForRead(puWaitForVerticalBlankData, sizeof(DD_WAITFORVERTICALBLANKDATA),
1);
- RtlCopyMemory(&WaitForVerticalBlankData,puWaitForVerticalBlankData,
sizeof(DD_WAITFORVERTICALBLANKDATA));
- }
- _SEH_HANDLE
- {
- Status = _SEH_GetExceptionCode();
- }
- _SEH_END;
-
- if(NT_SUCCESS(Status))
- {
- pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
-
- if (pDirectDraw != NULL)
- {
- if (pDirectDraw->DD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
- {
- WaitForVerticalBlankData.ddRVal = DDERR_GENERIC;
- WaitForVerticalBlankData.lpDD = &pDirectDraw->Global;;
- ddRVal =
pDirectDraw->DD.WaitForVerticalBlank(&WaitForVerticalBlankData);
- }
- _SEH_TRY
- {
- ProbeForWrite(puWaitForVerticalBlankData,
sizeof(DD_WAITFORVERTICALBLANKDATA), 1);
- puWaitForVerticalBlankData->ddRVal =
WaitForVerticalBlankData.ddRVal;
- puWaitForVerticalBlankData->bIsInVB =
WaitForVerticalBlankData.bIsInVB;
- }
- _SEH_HANDLE
- {
- Status = _SEH_GetExceptionCode();
- }
- _SEH_END;
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ LPDDHAL_WAITFORVERTICALBLANKDATA pWaitForVerticalBlankData =
(LPDDHAL_WAITFORVERTICALBLANKDATA)puWaitForVerticalBlankData;
+
+ if ((hDirectDrawLocal) &&
+ (puWaitForVerticalBlankData))
+ {
+
RtlZeroMemory(&WaitForVerticalBlankData,sizeof(DD_WAITFORVERTICALBLANKDATA));
+
+ _SEH_TRY
+ {
+ ProbeForRead(pWaitForVerticalBlankData,
sizeof(DDHAL_WAITFORVERTICALBLANKDATA), 1);
+ WaitForVerticalBlankData.dwFlags = pWaitForVerticalBlankData->dwFlags;
+ WaitForVerticalBlankData.bIsInVB = pWaitForVerticalBlankData->bIsInVB;
+ WaitForVerticalBlankData.hEvent = pWaitForVerticalBlankData->hEvent;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ if(NT_SUCCESS(Status))
+ {
+ pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+
+ if (pDirectDraw != NULL)
+ {
+ if (pDirectDraw->DD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
+ {
+ WaitForVerticalBlankData.ddRVal = DDERR_GENERIC;
+ WaitForVerticalBlankData.lpDD = &pDirectDraw->Global;;
+ ddRVal =
pDirectDraw->DD.WaitForVerticalBlank(&WaitForVerticalBlankData);
+ }
+ _SEH_TRY
+ {
+ ProbeForWrite(pWaitForVerticalBlankData,
sizeof(DDHAL_WAITFORVERTICALBLANKDATA), 1);
+ pWaitForVerticalBlankData->ddRVal =
WaitForVerticalBlankData.ddRVal;
+ pWaitForVerticalBlankData->bIsInVB =
WaitForVerticalBlankData.bIsInVB;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ }
}
}
return ddRVal;