From e60bf30f95a5d8c3f8b3fe2314818aaa4bcbd5a4 Mon Sep 17 00:00:00 2001 From: Saveliy Tretiakov Date: Fri, 24 Mar 2006 14:14:34 +0000 Subject: [PATCH] Implement RpcBindingCopy() svn path=/trunk/; revision=21374 --- reactos/dll/win32/rpcrt4/rpc_binding.c | 36 ++++++++++++++++++++++++++ reactos/dll/win32/rpcrt4/rpcrt4.spec | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/rpcrt4/rpc_binding.c b/reactos/dll/win32/rpcrt4/rpc_binding.c index 8e9cbc9941e..75b3deaf8e2 100644 --- a/reactos/dll/win32/rpcrt4/rpc_binding.c +++ b/reactos/dll/win32/rpcrt4/rpc_binding.c @@ -592,6 +592,42 @@ static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src) return ndst; } +/*********************************************************************** + * RpcBindingCopy (RPCRT4.@) + */ +RPC_STATUS RPC_ENTRY RpcBindingCopy( + RPC_BINDING_HANDLE SourceBinding, + RPC_BINDING_HANDLE* DestinationBinding) +{ + TRACE("RpcBindingCopy called\n"); + RpcBinding *DestBinding = 0, *SrcBinding = (RpcBinding*)SourceBinding; + + if(SrcBinding->server) + { + *DestinationBinding = NULL; + return RPC_S_WRONG_KIND_OF_BINDING; + } + + DestBinding = (RpcBinding*) + HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcBinding)); + + if(!DestBinding) + { + *DestinationBinding = NULL; + return ERROR_NOT_ENOUGH_MEMORY; + } + + memcpy(DestBinding, SrcBinding, sizeof(RpcBinding)); + DestBinding->refs = 1; + DestBinding->Next = NULL; + DestBinding->server = FALSE; + DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1); + DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1); + DestBinding->Endpoint = RPCRT4_strndupA(SrcBinding->Endpoint, -1); + + *DestinationBinding = DestBinding; + return RPC_S_OK; +} /*********************************************************************** * RpcStringBindingComposeA (RPCRT4.@) diff --git a/reactos/dll/win32/rpcrt4/rpcrt4.spec b/reactos/dll/win32/rpcrt4/rpcrt4.spec index ad4e04f544a..ef526693525 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4.spec +++ b/reactos/dll/win32/rpcrt4/rpcrt4.spec @@ -369,7 +369,7 @@ @ stub RpcAsyncGetCallStatus @ stub RpcAsyncInitializeHandle @ stub RpcAsyncRegisterInfo -@ stub RpcBindingCopy +@ stdcall RpcBindingCopy(ptr ptr) @ stdcall RpcBindingFree(ptr) @ stdcall RpcBindingFromStringBindingA(str ptr) @ stdcall RpcBindingFromStringBindingW(wstr ptr)