Author: greatlrd
Date: Sun Jun 17 15:22:23 2007
New Revision: 27211
URL:
http://svn.reactos.org/svn/reactos?rev=27211&view=rev
Log:
start implement of DirectDraw_GetCaps
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sun Jun 17 15:22:23 2007
@@ -131,7 +131,7 @@
}
else
{
- /* DirectDraw4 Vtable */
+ /* DirectDraw Vtable */
newThis->lpVtbl = &DirectDraw_Vtable;
newThis->lpLcl = This->lpLcl;
newThis->lpLink = This;
@@ -450,6 +450,74 @@
//LeaveCriticalSection(&ddcs);
return retVal;
}
+
+HRESULT WINAPI
+Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
+ LPDDCAPS pHELCaps)
+{
+ HRESULT retVal = DD_OK;
+
+ DX_WINDBG_trace();
+ if (!(IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS))))
+ {
+ if (!(IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS))))
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+ }
+
+ if ((IsBadWritePtr(pDriverCaps,sizeof(LPDDCAPS))))
+ {
+ /* Setup hardware caps */
+ switch (pDriverCaps->dwSize)
+ {
+ case sizeof(DDCAPS_DX1):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ case sizeof(DDCAPS_DX3):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ case sizeof(DDCAPS_DX5):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+
+ /* DDCAPS_DX6 is same as DDCAPS_DX7 */
+ case sizeof(DDCAPS_DX7):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ default:
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ }
+ }
+
+ if ((IsBadWritePtr(pHELCaps,sizeof(LPDDCAPS))))
+ {
+ /* Setup hardware caps */
+ switch (pHELCaps->dwSize)
+ {
+ case sizeof(DDCAPS_DX1):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ case sizeof(DDCAPS_DX3):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ case sizeof(DDCAPS_DX5):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+
+ /* DDCAPS_DX6 is same as DDCAPS_DX7 */
+ case sizeof(DDCAPS_DX7):
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ default:
+ retVal = DDERR_INVALIDPARAMS;
+ break;
+ }
+ }
+}
+
+
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c Sun Jun 17 15:22:23 2007
@@ -57,13 +57,6 @@
DX_STUB;
}
-HRESULT WINAPI
-Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
- LPDDCAPS pHELCaps)
-{
- DX_WINDBG_trace();
- DX_STUB;
-}
HRESULT WINAPI
Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,