diff --git a/reactos/lib/ddraw/hal/ddraw.c b/reactos/lib/ddraw/hal/ddraw.c index 63e117dcd95..87f33a2dc04 100644 --- a/reactos/lib/ddraw/hal/ddraw.c +++ b/reactos/lib/ddraw/hal/ddraw.c @@ -369,18 +369,46 @@ HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap } 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; +} diff --git a/reactos/lib/ddraw/main/ddraw.c b/reactos/lib/ddraw/main/ddraw.c index 85ba6979856..990e639f8ca 100644 --- a/reactos/lib/ddraw/main/ddraw.c +++ b/reactos/lib/ddraw/main/ddraw.c @@ -407,8 +407,16 @@ HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface) 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 @@ HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS { 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) diff --git a/reactos/lib/ddraw/rosdraw.h b/reactos/lib/ddraw/rosdraw.h index 1294dc9c543..ba9c30c44a4 100644 --- a/reactos/lib/ddraw/rosdraw.h +++ b/reactos/lib/ddraw/rosdraw.h @@ -89,7 +89,11 @@ HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface); 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); @@ -97,7 +101,11 @@ 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 ***********/ diff --git a/reactos/lib/ddraw/soft/ddraw.c b/reactos/lib/ddraw/soft/ddraw.c index a9a758f8429..ccaf8004d52 100644 --- a/reactos/lib/ddraw/soft/ddraw.c +++ b/reactos/lib/ddraw/soft/ddraw.c @@ -31,3 +31,9 @@ HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap { DX_STUB; } + + +HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h) +{ + DX_STUB; +}