Robert Shearman : rpcrt4: Make NdrConformantStringUnmarshall use the new Read{Variance, Conformance}

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 15 07:35:03 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 4d65110b906e7247f7fd312651a25962372bcd0b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=4d65110b906e7247f7fd312651a25962372bcd0b

Author: Robert Shearman <rob at codeweavers.com>
Date:   Sat May 13 16:58:31 2006 +0100

rpcrt4: Make NdrConformantStringUnmarshall use the new Read{Variance,Conformance}
functions and adapt them to be callable without having a correlation
descriptor.

---

 dlls/rpcrt4/ndr_marshall.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 6c9e852..65fd57d 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -320,7 +320,7 @@ PFORMAT_STRING ReadConformance(MIDL_STUB
 
 static inline PFORMAT_STRING ReadVariance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
 {
-  if (!IsConformanceOrVariancePresent(pFormat))
+  if (pFormat && !IsConformanceOrVariancePresent(pFormat))
   {
     pStubMsg->Offset = 0;
     pStubMsg->ActualCount = pStubMsg->MaxCount;
@@ -626,18 +626,15 @@ unsigned long WINAPI NdrConformantString
 unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg,
   unsigned char** ppMemory, PFORMAT_STRING pFormat, unsigned char fMustAlloc )
 {
-  unsigned long len, esize, ofs;
+  unsigned long len, esize;
 
   TRACE("(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)\n",
     pStubMsg, *ppMemory, pFormat, fMustAlloc);
 
   assert(pFormat && ppMemory && pStubMsg);
 
-  pStubMsg->Buffer += 4;
-  ofs = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
-  pStubMsg->Buffer += 4;
-  len = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
-  pStubMsg->Buffer += 4;
+  ReadConformance(pStubMsg, NULL);
+  ReadVariance(pStubMsg, NULL);
 
   if (*pFormat == RPC_FC_C_CSTRING) esize = 1;
   else if (*pFormat == RPC_FC_C_WSTRING) esize = 2;
@@ -651,6 +648,8 @@ unsigned char *WINAPI NdrConformantStrin
     FIXME("sized string format=%d\n", pFormat[1]);
   }
 
+  len = pStubMsg->ActualCount;
+
   if (fMustAlloc || !*ppMemory)
     *ppMemory = NdrAllocate(pStubMsg, len*esize + BUFFER_PARANOIA);
 




More information about the wine-cvs mailing list