diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index bec104235a4..f8e2451ad18 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -399,7 +399,7 @@ RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, UUID* ObjectUuid) RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection) { RpcBinding* NewBinding; - TRACE("(*RpcBinding == ^%p, Connection == ^%p)\n", *Binding, Connection); + TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection); RPCRT4_AllocBinding(&NewBinding, Connection->server); NewBinding->Protseq = RPCRT4_strdupA(Connection->Protseq); @@ -1096,3 +1096,22 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) { FIXME("Unknown protseq %s - we probably need to implement it one day\n", debugstr_w(protseq)); return RPC_S_PROTSEQ_NOT_SUPPORTED; } + +/*********************************************************************** + * RpcImpersonateClient (RPCRT4.@) + * + * Impersonates the client connected via a binding handle so that security + * checks are done in the context of the client. + * + * PARAMS + * BindingHandle [I] Handle to the binding to the client. + * + * RETURNS + * Success: RPS_S_OK. + * Failure: RPC_STATUS value. + */ +RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle) +{ + FIXME("(%p): stub\n", BindingHandle); + return RPC_S_NO_CONTEXT_AVAILABLE; +} diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index cd87c48ef71..080db93a316 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -317,6 +317,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, } } if (dwRead != sizeof(common_hdr)) { + WARN("Short read of header, %ld/%d bytes\n", dwRead, sizeof(common_hdr)); status = RPC_S_PROTOCOL_ERROR; goto fail; } @@ -331,6 +332,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, hdr_length = RPCRT4_GetHeaderSize((RpcPktHdr*)&common_hdr); if (hdr_length == 0) { + WARN("header length == 0\n"); status = RPC_S_PROTOCOL_ERROR; goto fail; } @@ -348,6 +350,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, } } if (dwRead != hdr_length - sizeof(common_hdr)) { + WARN("bad header length, %ld/%ld bytes\n", dwRead, hdr_length - sizeof(common_hdr)); status = RPC_S_PROTOCOL_ERROR; goto fail; } @@ -363,6 +366,9 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, default: pMsg->BufferLength = common_hdr.frag_len - hdr_length; } + + TRACE("buffer length = %u\n", pMsg->BufferLength); + status = I_RpcGetBuffer(pMsg); if (status != RPC_S_OK) goto fail; @@ -388,12 +394,15 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, } } if (dwRead != data_length) { + WARN("bad data length, %ld/%ld\n", dwRead, data_length); status = RPC_S_PROTOCOL_ERROR; goto fail; } + /* when there is no more data left, it should be the last packet */ if (buffer_length == pMsg->BufferLength && ((*Header)->common.flags & RPC_FLG_LAST) == 0) { + WARN("no more data left, but not last packet\n"); status = RPC_S_PROTOCOL_ERROR; goto fail; } @@ -580,6 +589,7 @@ RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg) status = RPC_S_CALL_FAILED; /* ? */ goto fail; default: + WARN("bad packet type %d\n", hdr->common.ptype); goto fail; } diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 7a5aa9c1fae..a7a5b9b34a3 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -72,7 +72,7 @@ @ stub RpcGetAsyncCallStatus @ stub RpcIfIdVectorFree @ stub RpcIfInqId -@ stub RpcImpersonateClient +@ stdcall RpcImpersonateClient(ptr) @ stub RpcInitializeAsyncHandle @ stub RpcMgmtBindingInqParameter # win9x @ stub RpcMgmtBindingSetParameter # win9x