Author: greatlrd
Date: Mon Dec 10 10:34:54 2007
New Revision: 31120
URL:
http://svn.reactos.org/svn/reactos?rev=31120&view=rev
Log:
patch from Kamil Hornicek tykef at atlas dot cz (irc nick : Pigglesworth)
Fixed Main_DirectDraw_GetDisplayMode for dx1, dx2
Fixed some compile warnings
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c
trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h Mon Dec 10 10:34:54 2007
@@ -78,6 +78,11 @@
HRESULT WINAPI
Main_DirectDraw_GetDisplayMode (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDSURFACEDESC pDDSD);
+
+HRESULT WINAPI
+Main_DirectDraw_GetDisplayMode4 (
LPDDRAWI_DIRECTDRAW_INT This,
LPDDSURFACEDESC2 pDDSD);
@@ -203,3 +208,4 @@
DWORD CALLBACK HelDdSurfUnlock(LPDDHAL_UNLOCKDATA lpUnLockData);
DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLayData);
+
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c Mon Dec 10 10:34:54 2007
@@ -37,7 +37,7 @@
}
}
- if (IsBadCodePtr(pCallback))
+ if (IsBadCodePtr((LPVOID)pCallback))
{
ret = DDERR_INVALIDPARAMS;
}
@@ -135,7 +135,7 @@
}
}
- if (IsBadCodePtr(pCallback))
+ if (IsBadCodePtr((LPVOID)pCallback))
{
ret = DDERR_INVALIDPARAMS;
}
@@ -265,7 +265,7 @@
DevMode.dmBitsPerPel = dwBPP;
DevMode.dmDisplayFrequency = dwRefreshRate;
- DX_WINDBG_trace_res(dwHeight, dwWidth, dwBPP, dwRefreshRate);
+ DX_WINDBG_trace_res(dwWidth, dwHeight,dwBPP, dwRefreshRate);
retval = ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN);
/* FIXME: Are we supposed to set CDS_SET_PRIMARY as well ? */
@@ -367,18 +367,18 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD)
+Main_DirectDraw_GetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDDSD)
{
HRESULT retVal = DD_OK;
DX_WINDBG_trace();
_SEH_TRY
{
- if(IsBadWritePtr(pDDSD,sizeof(LPDWORD)))
+ if(IsBadWritePtr(pDDSD,sizeof(LPDDSURFACEDESC)))
{
retVal = DDERR_INVALIDPARAMS;
}
- else if (pDDSD->dwSize != sizeof(DDSURFACEDESC2))
+ else if (pDDSD->dwSize != sizeof(DDSURFACEDESC))
{
retVal = DDERR_INVALIDPARAMS;
}
@@ -401,3 +401,39 @@
return retVal;
}
+
+HRESULT WINAPI
+Main_DirectDraw_GetDisplayMode4 (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD)
+{
+ HRESULT retVal = DD_OK;
+ DX_WINDBG_trace();
+
+ _SEH_TRY
+ {
+ if(IsBadWritePtr(pDDSD,sizeof(LPDDSURFACEDESC2)))
+ {
+ retVal = DDERR_INVALIDPARAMS;
+ }
+ else if (pDDSD->dwSize != sizeof(DDSURFACEDESC2))
+ {
+ retVal = DDERR_INVALIDPARAMS;
+ }
+ else
+ {
+ // FIXME: More stucture members might need to be filled
+
+ pDDSD->dwFlags |= DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_PITCH
| DDSD_REFRESHRATE;
+ pDDSD->dwHeight = This->lpLcl->lpGbl->vmiData.dwDisplayHeight;
+ pDDSD->dwWidth = This->lpLcl->lpGbl->vmiData.dwDisplayWidth;
+ pDDSD->ddpfPixelFormat =
This->lpLcl->lpGbl->vmiData.ddpfDisplay;
+ pDDSD->dwRefreshRate = This->lpLcl->lpGbl->dwMonitorFrequency;
+ pDDSD->lPitch = This->lpLcl->lpGbl->vmiData.lDisplayPitch;
+ }
+ }
+ _SEH_HANDLE
+ {
+ }
+ _SEH_END;
+
+ return retVal;
+}
Modified: trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/createsurface.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/createsurface.c Mon Dec 10 10:34:54 2007
@@ -165,7 +165,7 @@
/* FIXME ThisSurfaceMore->dmiDDrawReserved7.wMonitorsAttachedToDesktop
*/
ThisSurfaceMore->dmiDDrawReserved7.wMonitorsAttachedToDesktop = 1;
pDDraw->lpLcl->lpPrimary = ThisSurfInt;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)pDDraw);
+ Main_DirectDraw_AddRef(pDDraw);
}
else
{
@@ -246,3 +246,4 @@
}
+
Modified: trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Vtable/D…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c (original)
+++ trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c Mon Dec 10 10:34:54 2007
@@ -84,7 +84,7 @@
LPDDCAPS pHELCaps);
HRESULT WINAPI
-Main_DirectDraw_GetDisplayMode (
+Main_DirectDraw_GetDisplayMode4 (
LPDIRECTDRAW4 iface,
LPDDSURFACEDESC2 pDDSD);
@@ -186,7 +186,7 @@
Main_DirectDraw_EnumSurfaces,
Main_DirectDraw_FlipToGDISurface,
Main_DirectDraw_GetCaps,
- Main_DirectDraw_GetDisplayMode,
+ Main_DirectDraw_GetDisplayMode4,
Main_DirectDraw_GetFourCCCodes,
Main_DirectDraw_GetGDISurface,
Main_DirectDraw_GetMonitorFrequency,
Modified: trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Vtable/D…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c (original)
+++ trunk/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c Mon Dec 10 10:34:54 2007
@@ -88,7 +88,7 @@
LPDDCAPS pHELCaps);
HRESULT WINAPI
-Main_DirectDraw_GetDisplayMode (
+Main_DirectDraw_GetDisplayMode4 (
LPDIRECTDRAW7 iface,
LPDDSURFACEDESC2 pDDSD);
@@ -201,7 +201,7 @@
Main_DirectDraw_EnumSurfaces,
Main_DirectDraw_FlipToGDISurface,
Main_DirectDraw_GetCaps, /* (GetCaps done) */
- Main_DirectDraw_GetDisplayMode, /* (GetDisplayMode testing / devloping)
*/
+ Main_DirectDraw_GetDisplayMode4, /* (GetDisplayMode testing / devloping)
*/
Main_DirectDraw_GetFourCCCodes, /* (GetFourCCCodes done) */
Main_DirectDraw_GetGDISurface,
Main_DirectDraw_GetMonitorFrequency, /* (GetMonitorFrequency done) */
@@ -221,3 +221,4 @@
Main_DirectDraw_EvaluateMode
};
+