NdrSendReceive: Update the message buffer info after the call to I_RpcSendReceive.

svn path=/trunk/; revision=14442
This commit is contained in:
Eric Kohl 2005-04-02 15:11:36 +00:00
parent 87c424ef42
commit 23ffe8c3f8

View file

@ -248,6 +248,7 @@ unsigned char *WINAPI NdrGetBuffer(MIDL_STUB_MESSAGE *stubmsg, unsigned long buf
stubmsg->BufferEnd = stubmsg->Buffer + stubmsg->BufferLength; stubmsg->BufferEnd = stubmsg->Buffer + stubmsg->BufferLength;
return (stubmsg->Buffer = (unsigned char *)stubmsg->RpcMsg->Buffer); return (stubmsg->Buffer = (unsigned char *)stubmsg->RpcMsg->Buffer);
} }
/*********************************************************************** /***********************************************************************
* NdrFreeBuffer [RPCRT4.@] * NdrFreeBuffer [RPCRT4.@]
*/ */
@ -262,28 +263,34 @@ void WINAPI NdrFreeBuffer(MIDL_STUB_MESSAGE *pStubMsg)
/************************************************************************ /************************************************************************
* NdrSendReceive [RPCRT4.@] * 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?) */ /* FIXME: how to handle errors? (raise exception?) */
if (!stubmsg) { if (!pStubMsg) {
ERR("NULL stub message. No action taken.\n"); ERR("NULL stub message. No action taken.\n");
return NULL; return NULL;
} }
if (!stubmsg->RpcMsg) { if (!pStubMsg->RpcMsg) {
ERR("RPC Message not present in stub message. No action taken.\n"); ERR("RPC Message not present in stub message. No action taken.\n");
return NULL; return NULL;
} }
/* FIXME: Seems wrong. Where should this really come from, and when? */ /* 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"); WARN("I_RpcSendReceive did not return success.\n");
/* FIXME: raise exception? */ /* 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? */ /* FIXME: is this the right return value? */
return NULL; return NULL;
} }