Commit 8a48621f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

rpcrt4: Add RpcExceptionFilter implementation.

parent d6c94be7
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
@ stub I_RpcConnectionSetSockBuffSize @ stub I_RpcConnectionSetSockBuffSize
@ stub I_RpcDeleteMutex @ stub I_RpcDeleteMutex
@ stub I_RpcEnableWmiTrace # wxp @ stub I_RpcEnableWmiTrace # wxp
@ stdcall I_RpcExceptionFilter(long) @ stdcall I_RpcExceptionFilter(long) RpcExceptionFilter
@ stdcall I_RpcFree(ptr) @ stdcall I_RpcFree(ptr)
@ stdcall I_RpcFreeBuffer(ptr) @ stdcall I_RpcFreeBuffer(ptr)
@ stub I_RpcFreePipeBuffer @ stub I_RpcFreePipeBuffer
...@@ -383,6 +383,7 @@ ...@@ -383,6 +383,7 @@
@ stub RpcErrorResetEnumeration # wxp @ stub RpcErrorResetEnumeration # wxp
@ stdcall RpcErrorSaveErrorInfo(ptr ptr ptr) @ stdcall RpcErrorSaveErrorInfo(ptr ptr ptr)
@ stdcall RpcErrorStartEnumeration(ptr) @ stdcall RpcErrorStartEnumeration(ptr)
@ stdcall RpcExceptionFilter(long)
@ stub RpcFreeAuthorizationContext # wxp @ stub RpcFreeAuthorizationContext # wxp
@ stdcall RpcGetAsyncCallStatus(ptr) RpcAsyncGetCallStatus @ stdcall RpcGetAsyncCallStatus(ptr) RpcAsyncGetCallStatus
@ stub RpcIfIdVectorFree @ stub RpcIfIdVectorFree
......
...@@ -854,9 +854,10 @@ LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status) ...@@ -854,9 +854,10 @@ LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
} }
/****************************************************************************** /******************************************************************************
* RpcExceptionFilter (rpcrt4.@)
* I_RpcExceptionFilter (rpcrt4.@) * I_RpcExceptionFilter (rpcrt4.@)
*/ */
int WINAPI I_RpcExceptionFilter(ULONG ExceptionCode) int WINAPI RpcExceptionFilter(ULONG ExceptionCode)
{ {
TRACE("0x%x\n", ExceptionCode); TRACE("0x%x\n", ExceptionCode);
switch (ExceptionCode) switch (ExceptionCode)
......
...@@ -649,15 +649,15 @@ static void test_RpcStringBindingParseA(void) ...@@ -649,15 +649,15 @@ static void test_RpcStringBindingParseA(void)
ok(options == NULL, "options was %p instead of NULL\n", options); ok(options == NULL, "options was %p instead of NULL\n", options);
} }
static void test_I_RpcExceptionFilter(void) static void test_RpcExceptionFilter(const char *func_name)
{ {
ULONG exception; ULONG exception;
int retval; int retval;
int (WINAPI *pI_RpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), "I_RpcExceptionFilter"); int (WINAPI *pRpcExceptionFilter)(ULONG) = (void *)GetProcAddress(GetModuleHandleA("rpcrt4.dll"), func_name);
if (!pI_RpcExceptionFilter) if (!pRpcExceptionFilter)
{ {
win_skip("I_RpcExceptionFilter not exported\n"); win_skip("%s not exported\n", func_name);
return; return;
} }
...@@ -668,7 +668,7 @@ static void test_I_RpcExceptionFilter(void) ...@@ -668,7 +668,7 @@ static void test_I_RpcExceptionFilter(void)
if (exception == 0x40000005) exception = 0x80000000; if (exception == 0x40000005) exception = 0x80000000;
if (exception == 0x80000005) exception = 0xc0000000; if (exception == 0x80000005) exception = 0xc0000000;
retval = pI_RpcExceptionFilter(exception); retval = pRpcExceptionFilter(exception);
switch (exception) switch (exception)
{ {
case STATUS_DATATYPE_MISALIGNMENT: case STATUS_DATATYPE_MISALIGNMENT:
...@@ -679,17 +679,17 @@ static void test_I_RpcExceptionFilter(void) ...@@ -679,17 +679,17 @@ static void test_I_RpcExceptionFilter(void)
case STATUS_INSTRUCTION_MISALIGNMENT: case STATUS_INSTRUCTION_MISALIGNMENT:
case STATUS_STACK_OVERFLOW: case STATUS_STACK_OVERFLOW:
case STATUS_POSSIBLE_DEADLOCK: case STATUS_POSSIBLE_DEADLOCK:
ok(retval == EXCEPTION_CONTINUE_SEARCH, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n", ok(retval == EXCEPTION_CONTINUE_SEARCH, "%s(0x%x) should have returned %d instead of %d\n",
exception, EXCEPTION_CONTINUE_SEARCH, retval); func_name, exception, EXCEPTION_CONTINUE_SEARCH, retval);
break; break;
case STATUS_GUARD_PAGE_VIOLATION: case STATUS_GUARD_PAGE_VIOLATION:
case STATUS_IN_PAGE_ERROR: case STATUS_IN_PAGE_ERROR:
case STATUS_HANDLE_NOT_CLOSABLE: case STATUS_HANDLE_NOT_CLOSABLE:
trace("I_RpcExceptionFilter(0x%x) returned %d\n", exception, retval); trace("%s(0x%x) returned %d\n", func_name, exception, retval);
break; break;
default: default:
ok(retval == EXCEPTION_EXECUTE_HANDLER, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n", ok(retval == EXCEPTION_EXECUTE_HANDLER, "%s(0x%x) should have returned %d instead of %d\n",
exception, EXCEPTION_EXECUTE_HANDLER, retval); func_name, exception, EXCEPTION_EXECUTE_HANDLER, retval);
} }
} }
} }
...@@ -1198,7 +1198,8 @@ START_TEST( rpc ) ...@@ -1198,7 +1198,8 @@ START_TEST( rpc )
test_towers(); test_towers();
test_I_RpcMapWin32Status(); test_I_RpcMapWin32Status();
test_RpcStringBindingParseA(); test_RpcStringBindingParseA();
test_I_RpcExceptionFilter(); test_RpcExceptionFilter("I_RpcExceptionFilter");
test_RpcExceptionFilter("RpcExceptionFilter");
test_RpcStringBindingFromBinding(); test_RpcStringBindingFromBinding();
test_UuidCreate(); test_UuidCreate();
test_UuidCreateSequential(); test_UuidCreateSequential();
......
...@@ -325,6 +325,8 @@ RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer); ...@@ -325,6 +325,8 @@ RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer);
RPCRTAPI DECLSPEC_NORETURN void RPC_ENTRY RPCRTAPI DECLSPEC_NORETURN void RPC_ENTRY
RpcRaiseException( RPC_STATUS exception ); RpcRaiseException( RPC_STATUS exception );
RPCRTAPI int RPC_ENTRY RpcExceptionFilter(ULONG);
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding ); RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment