[RPCRT4] Sync with Wine 3.0. CORE-14225

This commit is contained in:
Amine Khaldi 2018-01-20 13:13:03 +01:00
parent 44f07538ba
commit 90155f749f
5 changed files with 14 additions and 13 deletions

View file

@ -41,7 +41,7 @@ typedef struct
static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface )
{
return CONTAINING_RECORD((void *)iface, cstdstubbuffer_delegating_t, stub_buffer);
return CONTAINING_RECORD(iface, cstdstubbuffer_delegating_t, stub_buffer);
}
HRESULT CStdStubBuffer_Construct(REFIID riid,

View file

@ -1116,6 +1116,11 @@ LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, uns
}
#endif
static inline BOOL param_needs_alloc( PARAM_ATTRIBUTES attr )
{
return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue;
}
static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
PFORMAT_STRING pFormat, enum stubless_phase phase,
unsigned short number_of_params)
@ -1151,20 +1156,14 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
{
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
}
else if (params[i].attr.IsOut &&
!params[i].attr.IsIn &&
!params[i].attr.IsBasetype &&
!params[i].attr.IsByValue)
else if (param_needs_alloc(params[i].attr) &&
(!params[i].attr.MustFree || params[i].attr.IsSimpleRef))
{
if (*pTypeFormat != RPC_FC_BIND_CONTEXT) pStubMsg->pfnFree(*(void **)pArg);
}
break;
case STUBLESS_INITOUT:
if (!params[i].attr.IsIn &&
params[i].attr.IsOut &&
!params[i].attr.IsBasetype &&
!params[i].attr.ServerAllocSize &&
!params[i].attr.IsByValue)
if (param_needs_alloc(params[i].attr) && !params[i].attr.ServerAllocSize)
{
if (*pTypeFormat == RPC_FC_BIND_CONTEXT)
{

View file

@ -784,10 +784,8 @@ static RPC_STATUS RPCRT4_stop_listen(BOOL auto_listen)
if (stop_listen) {
RpcServerProtseq *cps;
EnterCriticalSection(&server_cs);
LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry)
RPCRT4_sync_with_server_thread(cps);
LeaveCriticalSection(&server_cs);
}
if (!auto_listen)

View file

@ -151,6 +151,10 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname,
if (pipe != INVALID_HANDLE_VALUE) break;
err = GetLastError();
if (err == ERROR_PIPE_BUSY) {
if (WaitNamedPipeA(pname, NMPWAIT_USE_DEFAULT_WAIT)) {
TRACE("retrying busy server\n");
continue;
}
TRACE("connection failed, error=%x\n", err);
return RPC_S_SERVER_TOO_BUSY;
}