implement Hal WaitForVerticalBlank
Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
Modified: trunk/reactos/lib/ddraw/rosdraw.h
Modified: trunk/reactos/lib/ddraw/soft/ddraw.c

Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
--- trunk/reactos/lib/ddraw/hal/ddraw.c	2005-10-30 06:02:18 UTC (rev 18867)
+++ trunk/reactos/lib/ddraw/hal/ddraw.c	2005-10-30 07:41:33 UTC (rev 18868)
@@ -369,18 +369,46 @@
 	}
 
 	mem.lpDD = &This->DirectDrawGlobal;	
+	mem.ddRVal = DDERR_NOTPALETTIZED;
+
 	if (This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) != DDHAL_DRIVER_HANDLED)
 	{
 	   return DDERR_NODRIVERSUPPORT;
 	}
 
-
 	ddscaps->dwCaps = mem.DDSCaps.dwCaps;
 	ddscaps->dwCaps2 = mem.ddsCapsEx.dwCaps2;
     ddscaps->dwCaps3 = mem.ddsCapsEx.dwCaps3;
 	ddscaps->dwCaps4 = mem.ddsCapsEx.dwCaps4;
 	*total = mem.dwTotal;
 	*free = mem.dwFree;
-
+	
 	return mem.ddRVal;
 }
+
+HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h) 
+{
+
+	IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+	DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData;
+
+	if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) 
+	{
+		return DDERR_NODRIVERSUPPORT;
+	}
+	  
+	WaitVectorData.lpDD = &This->DirectDrawGlobal;
+	WaitVectorData.dwFlags = dwFlags;
+	WaitVectorData.hEvent = (DWORD)h;
+	WaitVectorData.ddRVal = DDERR_NOTPALETTIZED;
+
+	if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED)
+	{
+	   return DDERR_NODRIVERSUPPORT;
+	}
+
+	return WaitVectorData.ddRVal;
+
+	return DD_OK;
+}

Modified: trunk/reactos/lib/ddraw/main/ddraw.c
--- trunk/reactos/lib/ddraw/main/ddraw.c	2005-10-30 06:02:18 UTC (rev 18867)
+++ trunk/reactos/lib/ddraw/main/ddraw.c	2005-10-30 07:41:33 UTC (rev 18868)
@@ -407,8 +407,16 @@
 HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
 												   HANDLE h)
 {
-  
-   	DX_STUB;
+
+    DWORD ret;
+
+    if((ret = Hal_DirectDraw_WaitForVerticalBlank( iface,  dwFlags, h)) == DD_OK)
+		return ret;
+
+	if((ret = Hel_DirectDraw_WaitForVerticalBlank( iface,  dwFlags, h)) == DD_OK)
+		return ret;
+
+	return DDERR_NOTINITIALIZED;   	
 }
 
 HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
@@ -416,7 +424,7 @@
 {	
 	DWORD ret;
 
-     if((ret = Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
+    if((ret = Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
 		return ret;
 
 	if((ret = Hel_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)

Modified: trunk/reactos/lib/ddraw/rosdraw.h
--- trunk/reactos/lib/ddraw/rosdraw.h	2005-10-30 06:02:18 UTC (rev 18867)
+++ trunk/reactos/lib/ddraw/rosdraw.h	2005-10-30 07:41:33 UTC (rev 18868)
@@ -89,17 +89,25 @@
 VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface);
 
 HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
-				   LPDWORD total, LPDWORD free);											   
+				   LPDWORD total, LPDWORD free);	
 
+HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
+					HANDLE h); 
 
+
+
 HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface);
 HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface);
 VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface);
 
 HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
-				   LPDWORD total, LPDWORD free);											   
+				   LPDWORD total, LPDWORD free);	
 
+HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
+					HANDLE h); 
 
+
+
 /*********** Macros ***********/
 
 #define DX_STUB \

Modified: trunk/reactos/lib/ddraw/soft/ddraw.c
--- trunk/reactos/lib/ddraw/soft/ddraw.c	2005-10-30 06:02:18 UTC (rev 18867)
+++ trunk/reactos/lib/ddraw/soft/ddraw.c	2005-10-30 07:41:33 UTC (rev 18868)
@@ -31,3 +31,9 @@
 {
 	DX_STUB;
 }
+
+
+HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h) 
+{
+	DX_STUB;
+}