Module: wine Branch: refs/heads/master Commit: 9b791e0983f722de1e1effeefe8f44c8a75db976 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=9b791e0983f722de1e1effee...
Author: Mike McCormack mike@codeweavers.com Date: Fri Apr 21 15:38:25 2006 +0900
rpcrt4: Allocate RpcServerProtseq in a single place.
---
dlls/rpcrt4/rpc_server.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 0fb4545..8889540 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -725,21 +725,34 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpW }
/*********************************************************************** + * alloc_serverprotoseq (internal) + */ +static RpcServerProtseq *alloc_serverprotoseq(UINT MaxCalls, char *Protseq, char *Endpoint) +{ + RpcServerProtseq* ps; + + ps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerProtseq)); + ps->MaxCalls = MaxCalls; + ps->Protseq = Protseq; + ps->Endpoint = Endpoint; + + return ps; +} + +/*********************************************************************** * RpcServerUseProtseqEpExA (RPCRT4.@) */ RPC_STATUS WINAPI RpcServerUseProtseqEpExA( unsigned char *Protseq, UINT MaxCalls, unsigned char *Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy ) { + char *szps = (char*)Protseq, *szep = (char*)Endpoint; RpcServerProtseq* ps;
- TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_a( (char*)Protseq ), MaxCalls, - debugstr_a( (char*)Endpoint ), SecurityDescriptor, + TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_a(szps), MaxCalls, + debugstr_a(szep), SecurityDescriptor, lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
- ps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerProtseq)); - ps->MaxCalls = MaxCalls; - ps->Protseq = RPCRT4_strdupA((char*)Protseq); - ps->Endpoint = RPCRT4_strdupA((char*)Endpoint); + ps = alloc_serverprotoseq(MaxCalls, RPCRT4_strdupA(szps), RPCRT4_strdupA(szep));
return RPCRT4_use_protseq(ps); } @@ -756,10 +769,8 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpE debugstr_w( Endpoint ), SecurityDescriptor, lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
- ps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerProtseq)); - ps->MaxCalls = MaxCalls; - ps->Protseq = RPCRT4_strdupWtoA(Protseq); - ps->Endpoint = RPCRT4_strdupWtoA(Endpoint); + ps = alloc_serverprotoseq(MaxCalls, RPCRT4_strdupWtoA(Protseq), + RPCRT4_strdupWtoA(Endpoint));
return RPCRT4_use_protseq(ps); }