[ros-diffs] [cwittich] 31848: Rob Shearman : rpcrt4: Set the fBufferValid flag in NdrProxyGetBuffer. <rob at codeweavers.com>

cwittich at svn.reactos.org cwittich at svn.reactos.org
Fri Jan 18 11:05:54 CET 2008


Author: cwittich
Date: Fri Jan 18 13:05:52 2008
New Revision: 31848

URL: http://svn.reactos.org/svn/reactos?rev=31848&view=rev
Log:
Rob Shearman : rpcrt4: Set the fBufferValid flag in NdrProxyGetBuffer. <rob at codeweavers.com>

Modified:
    trunk/reactos/dll/win32/rpcrt4/cproxy.c

Modified: trunk/reactos/dll/win32/rpcrt4/cproxy.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cproxy.c?rev=31848&r1=31847&r2=31848&view=diff
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/cproxy.c (original)
+++ trunk/reactos/dll/win32/rpcrt4/cproxy.c Fri Jan 18 13:05:52 2008
@@ -364,6 +364,7 @@
     RpcRaiseException(hr);
     return;
   }
+  pStubMsg->fBufferValid = TRUE;
   pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer;
   pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength;
   pStubMsg->Buffer = pStubMsg->BufferStart;
@@ -408,11 +409,13 @@
 void WINAPI NdrProxyFreeBuffer(void *This,
                               PMIDL_STUB_MESSAGE pStubMsg)
 {
-  HRESULT hr;
-
   TRACE("(%p,%p)\n", This, pStubMsg);
-  hr = IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
-                                   (RPCOLEMESSAGE*)pStubMsg->RpcMsg);
+  if (pStubMsg->fBufferValid)
+  {
+    IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
+                                 (RPCOLEMESSAGE*)pStubMsg->RpcMsg);
+    pStubMsg->fBufferValid = TRUE;
+  }
 }
 
 /***********************************************************************




More information about the Ros-diffs mailing list