mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
NdrSendReceive: Update the message buffer info after the call to I_RpcSendReceive.
svn path=/trunk/; revision=14442
This commit is contained in:
parent
87c424ef42
commit
23ffe8c3f8
1 changed files with 15 additions and 8 deletions
|
@ -233,12 +233,12 @@ unsigned char* WINAPI NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_M
|
|||
unsigned char *WINAPI NdrGetBuffer(MIDL_STUB_MESSAGE *stubmsg, unsigned long buflen, RPC_BINDING_HANDLE handle)
|
||||
{
|
||||
TRACE("(stubmsg == ^%p, buflen == %lu, handle == %p): wild guess.\n", stubmsg, buflen, handle);
|
||||
|
||||
|
||||
assert( stubmsg && stubmsg->RpcMsg );
|
||||
|
||||
/* I guess this is our chance to put the binding handle into the RPC_MESSAGE */
|
||||
stubmsg->RpcMsg->Handle = handle;
|
||||
|
||||
|
||||
stubmsg->RpcMsg->BufferLength = buflen;
|
||||
if (I_RpcGetBuffer(stubmsg->RpcMsg) != S_OK)
|
||||
return NULL;
|
||||
|
@ -248,6 +248,7 @@ unsigned char *WINAPI NdrGetBuffer(MIDL_STUB_MESSAGE *stubmsg, unsigned long buf
|
|||
stubmsg->BufferEnd = stubmsg->Buffer + stubmsg->BufferLength;
|
||||
return (stubmsg->Buffer = (unsigned char *)stubmsg->RpcMsg->Buffer);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NdrFreeBuffer [RPCRT4.@]
|
||||
*/
|
||||
|
@ -262,28 +263,34 @@ void WINAPI NdrFreeBuffer(MIDL_STUB_MESSAGE *pStubMsg)
|
|||
/************************************************************************
|
||||
* NdrSendReceive [RPCRT4.@]
|
||||
*/
|
||||
unsigned char *WINAPI NdrSendReceive( MIDL_STUB_MESSAGE *stubmsg, unsigned char *buffer )
|
||||
unsigned char *WINAPI NdrSendReceive( MIDL_STUB_MESSAGE *pStubMsg, unsigned char *buffer )
|
||||
{
|
||||
TRACE("(stubmsg == ^%p, buffer == ^%p)\n", stubmsg, buffer);
|
||||
TRACE("(pStubMsg == ^%p, buffer == ^%p)\n", pStubMsg, buffer);
|
||||
|
||||
/* FIXME: how to handle errors? (raise exception?) */
|
||||
if (!stubmsg) {
|
||||
if (!pStubMsg) {
|
||||
ERR("NULL stub message. No action taken.\n");
|
||||
return NULL;
|
||||
}
|
||||
if (!stubmsg->RpcMsg) {
|
||||
if (!pStubMsg->RpcMsg) {
|
||||
ERR("RPC Message not present in stub message. No action taken.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* FIXME: Seems wrong. Where should this really come from, and when? */
|
||||
stubmsg->RpcMsg->DataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
|
||||
pStubMsg->RpcMsg->DataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
|
||||
|
||||
if (I_RpcSendReceive(stubmsg->RpcMsg) != RPC_S_OK) {
|
||||
if (I_RpcSendReceive(pStubMsg->RpcMsg) != RPC_S_OK) {
|
||||
WARN("I_RpcSendReceive did not return success.\n");
|
||||
/* FIXME: raise exception? */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pStubMsg->BufferLength = pStubMsg->RpcMsg->BufferLength;
|
||||
pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer;
|
||||
pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength;
|
||||
pStubMsg->Buffer = pStubMsg->BufferStart;
|
||||
|
||||
/* FIXME: is this the right return value? */
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue