Rob Shearman : rpcrt4: Test and fix I_RpcExceptionFilter.

Alexandre Julliard julliard at winehq.org
Wed Apr 16 08:09:47 CDT 2008


Module: wine
Branch: master
Commit: 4efff322911b224e727dc6df932c357d0e6a279a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4efff322911b224e727dc6df932c357d0e6a279a

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Apr 15 21:50:14 2008 +0100

rpcrt4: Test and fix I_RpcExceptionFilter.

---

 dlls/rpcrt4/rpcrt4_main.c |   10 ++++++++--
 dlls/rpcrt4/tests/rpc.c   |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c
index 02e1dcd..0fddc28 100644
--- a/dlls/rpcrt4/rpcrt4_main.c
+++ b/dlls/rpcrt4/rpcrt4_main.c
@@ -944,8 +944,14 @@ int WINAPI I_RpcExceptionFilter(ULONG ExceptionCode)
     TRACE("0x%x\n", ExceptionCode);
     switch (ExceptionCode)
     {
-    case EXCEPTION_ACCESS_VIOLATION:
-    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case STATUS_DATATYPE_MISALIGNMENT:
+    case STATUS_BREAKPOINT:
+    case STATUS_ACCESS_VIOLATION:
+    case STATUS_ILLEGAL_INSTRUCTION:
+    case STATUS_PRIVILEGED_INSTRUCTION:
+    case STATUS_INSTRUCTION_MISALIGNMENT:
+    case STATUS_STACK_OVERFLOW:
+    case STATUS_POSSIBLE_DEADLOCK:
         return EXCEPTION_CONTINUE_SEARCH;
     default:
         return EXCEPTION_EXECUTE_HANDLER;
diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c
index ace8aff..9fd9993 100644
--- a/dlls/rpcrt4/tests/rpc.c
+++ b/dlls/rpcrt4/tests/rpc.c
@@ -610,6 +610,46 @@ static void test_RpcStringBindingParseA(void)
     ok(options == NULL, "options was %p instead of NULL\n", options);
 }
 
+static void test_I_RpcExceptionFilter(void)
+{
+    ULONG exception;
+    int retval;
+    int (WINAPI *pI_RpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandle("rpcrt4.dll"), "I_RpcExceptionFilter");
+
+    if (!pI_RpcExceptionFilter)
+    {
+        skip("I_RpcExceptionFilter not exported\n");
+        return;
+    }
+
+    for (exception = 0; exception < STATUS_REG_NAT_CONSUMPTION; exception++)
+    {
+        /* skip over uninteresting bits of the number space */
+        if (exception == 2000) exception = 0x40000000;
+        if (exception == 0x40000005) exception = 0x80000000;
+        if (exception == 0x80000005) exception = 0xc0000000;
+
+        retval = pI_RpcExceptionFilter(exception);
+        switch (exception)
+        {
+        case STATUS_DATATYPE_MISALIGNMENT:
+        case STATUS_BREAKPOINT:
+        case STATUS_ACCESS_VIOLATION:
+        case STATUS_ILLEGAL_INSTRUCTION:
+        case STATUS_PRIVILEGED_INSTRUCTION:
+        case 0xc00000aa /* STATUS_INSTRUCTION_MISALIGNMENT */:
+        case STATUS_STACK_OVERFLOW:
+        case 0xc0000194 /* STATUS_POSSIBLE_DEADLOCK */:
+            ok(retval == EXCEPTION_CONTINUE_SEARCH, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n",
+               exception, EXCEPTION_CONTINUE_SEARCH, retval);
+            break;
+        default:
+            ok(retval == EXCEPTION_EXECUTE_HANDLER, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n",
+               exception, EXCEPTION_EXECUTE_HANDLER, retval);
+        }
+    }
+}
+
 START_TEST( rpc )
 {
     trace ( " ** Uuid Conversion and Comparison Tests **\n" );
@@ -620,4 +660,5 @@ START_TEST( rpc )
     test_towers();
     test_I_RpcMapWin32Status();
     test_RpcStringBindingParseA();
+    test_I_RpcExceptionFilter();
 }




More information about the wine-cvs mailing list