Author: greatlrd
Date: Wed May 30 22:46:59 2007
New Revision: 26946
URL:
http://svn.reactos.org/svn/reactos?rev=26946&view=rev
Log:
add seh around Main_DirectDraw_AddRef this prevent any crash it can cause
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.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 Wed May 30 22:46:59 2007
@@ -49,11 +49,12 @@
ULONG WINAPI
Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface)
{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
-
- DX_WINDBG_trace();
-
- if (iface!=NULL)
+ ULONG retValue = 0;
+ LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+
+ DX_WINDBG_trace();
+
+ _SEH_TRY
{
This->dwIntRefCnt++;
This->lpLcl->dwLocalRefCnt++;
@@ -63,8 +64,26 @@
This->lpLcl->lpGbl->dwRefCnt++;
}
}
- return This->dwIntRefCnt;
-}
+ _SEH_HANDLE
+ {
+ }
+ _SEH_END;
+
+ _SEH_TRY
+ {
+ retValue = This->dwIntRefCnt;
+ }
+ _SEH_HANDLE
+ {
+ retValue = 0;
+ }
+ _SEH_END;
+
+ return retValue;
+}
+
+
+
ULONG WINAPI
Main_DirectDraw_Release (LPDIRECTDRAW7 iface)