adding more seh, everthing need warp around seh in ddraw.

svn path=/trunk/; revision=27032
This commit is contained in:
Magnus Olsen 2007-06-07 01:27:38 +00:00
parent 9ad6d62b37
commit 8c5a2928ed
2 changed files with 82 additions and 59 deletions

View file

@ -4,25 +4,35 @@
* PROJECT: ReactOS DirectX * PROJECT: ReactOS DirectX
* FILE: ddraw/ddraw/ddraw_displaymode.c * FILE: ddraw/ddraw/ddraw_displaymode.c
* PURPOSE: IDirectDraw7 Implementation * PURPOSE: IDirectDraw7 Implementation
* PROGRAMMER: Maarten Bosma * PROGRAMMER: Maarten Bosma, Magnus Olsen (add seh support)
* *
*/ */
#include "rosdraw.h" #include "rosdraw.h"
/* PSEH for SEH Support */
#include <pseh/pseh.h>
HRESULT WINAPI HRESULT WINAPI
Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags, Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
LPDDSURFACEDESC2 pDDSD, LPVOID pContext, LPDDENUMMODESCALLBACK2 pCallback) LPDDSURFACEDESC2 pDDSD, LPVOID pContext, LPDDENUMMODESCALLBACK2 pCallback)
{ {
HRESULT ret = DD_OK;
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
INT iMode = 0; INT iMode = 0;
DEVMODE DevMode; DEVMODE DevMode;
DX_WINDBG_trace(); DX_WINDBG_trace();
_SEH_TRY
{
if(!pCallback) if(!pCallback)
return DDERR_INVALIDPARAMS; {
ret = DDERR_INVALIDPARAMS;
}
else
{
DevMode.dmSize = sizeof(DEVMODE); DevMode.dmSize = sizeof(DEVMODE);
DevMode.dmDriverExtra = 0; DevMode.dmDriverExtra = 0;
@ -78,10 +88,16 @@ Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
} }
if((*pCallback)(&SurfaceDesc, pContext) == DDENUMRET_CANCEL) if((*pCallback)(&SurfaceDesc, pContext) == DDENUMRET_CANCEL)
return DD_OK; break;
}
} }
return DD_OK; }
_SEH_HANDLE
{
}
_SEH_END;
return ret;
} }
HRESULT WINAPI HRESULT WINAPI

View file

@ -137,10 +137,17 @@ Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
DX_WINDBG_trace(); DX_WINDBG_trace();
// EnterCriticalSection(&ddcs); // EnterCriticalSection(&ddcs);
_SEH_TRY
{
if (This->lpLcl->lpGbl->lpExclusiveOwner == This->lpLcl) if (This->lpLcl->lpGbl->lpExclusiveOwner == This->lpLcl)
{ {
retVal = DDERR_NOEXCLUSIVEMODE; retVal = DDERR_NOEXCLUSIVEMODE;
} }
}
_SEH_HANDLE
{
}
_SEH_END;
// LeaveCriticalSection(&ddcs); // LeaveCriticalSection(&ddcs);
return retVal; return retVal;
} }