Robert Shearman : oleaut32: Add an exception handler around code executed on the server side from the typelib marshaler .

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 18 05:13:27 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: a05672e55f64641603ad562df5773f73f18f4f63
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=a05672e55f64641603ad562df5773f73f18f4f63

Author: Robert Shearman <rob at codeweavers.com>
Date:   Mon Jul 17 20:19:27 2006 +0100

oleaut32: Add an exception handler around code executed on the server side from the typelib marshaler.

---

 dlls/oleaut32/tmarshal.c |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 2dee9d7..396cca3 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -40,12 +40,14 @@ #include "winbase.h"
 #include "winnls.h"
 #include "winreg.h"
 #include "winuser.h"
+#include "excpt.h"
 
 #include "ole2.h"
 #include "propidl.h" /* for LPSAFEARRAY_User* functions */
 #include "typelib.h"
 #include "variant.h"
 #include "wine/debug.h"
+#include "wine/exception.h"
 
 static const WCHAR IDispatchW[] = { 'I','D','i','s','p','a','t','c','h',0};
 
@@ -1785,12 +1787,30 @@ TMStubImpl_Invoke(
     }
 
     args[0] = (DWORD)This->pUnk;
-    res = _invoke(
-	(*((FARPROC**)args[0]))[fdesc->oVft/4],
-	fdesc->callconv,
-	(xargs-args),
-	args
-    );
+
+    __TRY
+    {
+        res = _invoke(
+            (*((FARPROC**)args[0]))[fdesc->oVft/4],
+            fdesc->callconv,
+            (xargs-args),
+            args
+        );
+    }
+    __EXCEPT(NULL)
+    {
+        DWORD dwExceptionCode = GetExceptionCode();
+        ERR("invoke call failed with exception 0x%08lx (%ld)\n", dwExceptionCode, dwExceptionCode);
+        if (FAILED(dwExceptionCode))
+            hres = dwExceptionCode;
+        else
+            hres = HRESULT_FROM_WIN32(dwExceptionCode);
+    }
+    __ENDTRY
+
+    if (hres != S_OK)
+        return hres;
+
     buf.curoff = 0;
 
     xargs = args+1;




More information about the wine-cvs mailing list