From 8a48621fc9b56d0ca68e89dd3d6720cd2c4d8db8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 17 Oct 2018 15:57:37 +0200 Subject: [PATCH] rpcrt4: Add RpcExceptionFilter implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/rpcrt4/rpcrt4.spec | 3 ++- dlls/rpcrt4/rpcrt4_main.c | 3 ++- dlls/rpcrt4/tests/rpc.c | 23 ++++++++++++----------- include/rpcdce.h | 2 ++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index aa30ee7bf5e..0dc6789e22e 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -42,7 +42,7 @@ @ stub I_RpcConnectionSetSockBuffSize @ stub I_RpcDeleteMutex @ stub I_RpcEnableWmiTrace # wxp -@ stdcall I_RpcExceptionFilter(long) +@ stdcall I_RpcExceptionFilter(long) RpcExceptionFilter @ stdcall I_RpcFree(ptr) @ stdcall I_RpcFreeBuffer(ptr) @ stub I_RpcFreePipeBuffer @@ -383,6 +383,7 @@ @ stub RpcErrorResetEnumeration # wxp @ stdcall RpcErrorSaveErrorInfo(ptr ptr ptr) @ stdcall RpcErrorStartEnumeration(ptr) +@ stdcall RpcExceptionFilter(long) @ stub RpcFreeAuthorizationContext # wxp @ stdcall RpcGetAsyncCallStatus(ptr) RpcAsyncGetCallStatus @ stub RpcIfIdVectorFree diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index d5d349dc58f..b274139cfb8 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -854,9 +854,10 @@ LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status) } /****************************************************************************** + * RpcExceptionFilter (rpcrt4.@) * I_RpcExceptionFilter (rpcrt4.@) */ -int WINAPI I_RpcExceptionFilter(ULONG ExceptionCode) +int WINAPI RpcExceptionFilter(ULONG ExceptionCode) { TRACE("0x%x\n", ExceptionCode); switch (ExceptionCode) diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c index c9f2a4b7218..d3a3aee6c8c 100644 --- a/dlls/rpcrt4/tests/rpc.c +++ b/dlls/rpcrt4/tests/rpc.c @@ -649,15 +649,15 @@ static void test_RpcStringBindingParseA(void) 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; 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; } @@ -668,7 +668,7 @@ static void test_I_RpcExceptionFilter(void) if (exception == 0x40000005) exception = 0x80000000; if (exception == 0x80000005) exception = 0xc0000000; - retval = pI_RpcExceptionFilter(exception); + retval = pRpcExceptionFilter(exception); switch (exception) { case STATUS_DATATYPE_MISALIGNMENT: @@ -679,17 +679,17 @@ static void test_I_RpcExceptionFilter(void) case STATUS_INSTRUCTION_MISALIGNMENT: case STATUS_STACK_OVERFLOW: case 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); + ok(retval == EXCEPTION_CONTINUE_SEARCH, "%s(0x%x) should have returned %d instead of %d\n", + func_name, exception, EXCEPTION_CONTINUE_SEARCH, retval); break; case STATUS_GUARD_PAGE_VIOLATION: case STATUS_IN_PAGE_ERROR: 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; default: - ok(retval == EXCEPTION_EXECUTE_HANDLER, "I_RpcExceptionFilter(0x%x) should have returned %d instead of %d\n", - exception, EXCEPTION_EXECUTE_HANDLER, retval); + ok(retval == EXCEPTION_EXECUTE_HANDLER, "%s(0x%x) should have returned %d instead of %d\n", + func_name, exception, EXCEPTION_EXECUTE_HANDLER, retval); } } } @@ -1198,7 +1198,8 @@ START_TEST( rpc ) test_towers(); test_I_RpcMapWin32Status(); test_RpcStringBindingParseA(); - test_I_RpcExceptionFilter(); + test_RpcExceptionFilter("I_RpcExceptionFilter"); + test_RpcExceptionFilter("RpcExceptionFilter"); test_RpcStringBindingFromBinding(); test_UuidCreate(); test_UuidCreateSequential(); diff --git a/include/rpcdce.h b/include/rpcdce.h index ee01d889997..fc1fcea77b9 100644 --- a/include/rpcdce.h +++ b/include/rpcdce.h @@ -325,6 +325,8 @@ RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer); RPCRTAPI DECLSPEC_NORETURN void RPC_ENTRY RpcRaiseException( RPC_STATUS exception ); +RPCRTAPI int RPC_ENTRY RpcExceptionFilter(ULONG); + RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding );