Robert Shearman : rpcrt4: Implement computing of conformance from a correlation descriptor for conformant strings .

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 16 06:25:07 CDT 2006


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

Author: Robert Shearman <rob at codeweavers.com>
Date:   Mon May 15 16:57:13 2006 +0100

rpcrt4: Implement computing of conformance from a correlation descriptor for conformant strings.

---

 dlls/rpcrt4/ndr_marshall.c |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 4f5d336..1bf3811 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -530,19 +530,18 @@ finish_conf:
 unsigned char *WINAPI NdrConformantStringMarshall(MIDL_STUB_MESSAGE *pStubMsg,
   unsigned char *pszMessage, PFORMAT_STRING pFormat)
 { 
-  unsigned long len, esize;
+  unsigned long esize;
 
   TRACE("(pStubMsg == ^%p, pszMessage == ^%p, pFormat == ^%p)\n", pStubMsg, pszMessage, pFormat);
   
-  assert(pFormat);
   if (*pFormat == RPC_FC_C_CSTRING) {
     TRACE("string=%s\n", debugstr_a((char*)pszMessage));
-    len = strlen((char*)pszMessage)+1;
+    pStubMsg->ActualCount = strlen((char*)pszMessage)+1;
     esize = 1;
   }
   else if (*pFormat == RPC_FC_C_WSTRING) {
     TRACE("string=%s\n", debugstr_w((LPWSTR)pszMessage));
-    len = strlenW((LPWSTR)pszMessage)+1;
+    pStubMsg->ActualCount = strlenW((LPWSTR)pszMessage)+1;
     esize = 2;
   }
   else {
@@ -551,19 +550,16 @@ unsigned char *WINAPI NdrConformantStrin
     return NULL;
   }
 
-  if (pFormat[1] != RPC_FC_PAD) {
-    FIXME("sized string format=%d\n", pFormat[1]);
-  }
-
-  assert( (pStubMsg->BufferLength >= (len*esize + 13)) && (pStubMsg->Buffer != NULL) );
-
-  pStubMsg->MaxCount = pStubMsg->ActualCount = len;
+  if (pFormat[1] == RPC_FC_STRING_SIZED)
+    pFormat = ComputeConformance(pStubMsg, pszMessage, pFormat + 2, 0);
+  else
+    pStubMsg->MaxCount = pStubMsg->ActualCount;
   pStubMsg->Offset = 0;
   WriteConformance(pStubMsg);
   WriteVariance(pStubMsg);
 
-  memcpy(pStubMsg->Buffer, pszMessage, len*esize); /* the string itself */
-  pStubMsg->Buffer += len*esize;
+  memcpy(pStubMsg->Buffer, pszMessage, pStubMsg->ActualCount*esize); /* the string itself */
+  pStubMsg->Buffer += pStubMsg->ActualCount*esize;
 
   STD_OVERFLOW_CHECK(pStubMsg);
 
@@ -582,7 +578,6 @@ void WINAPI NdrConformantStringBufferSiz
   SizeConformance(pStubMsg);
   SizeVariance(pStubMsg);
 
-  assert(pFormat);
   if (*pFormat == RPC_FC_C_CSTRING) {
     /* we need + 1 octet for '\0' */
     TRACE("string=%s\n", debugstr_a((char*)pMemory));
@@ -597,10 +592,6 @@ void WINAPI NdrConformantStringBufferSiz
     ERR("Unhandled string type: %#x\n", *pFormat); 
     /* FIXME: raise an exception */
   }
-
-  if (pFormat[1] != RPC_FC_PAD) {
-    FIXME("sized string format=%d\n", pFormat[1]);
-  }
 }
 
 /************************************************************************
@@ -658,10 +649,6 @@ unsigned char *WINAPI NdrConformantStrin
     esize = 0;
   }
 
-  if (pFormat[1] != RPC_FC_PAD) {
-    FIXME("sized string format=%d\n", pFormat[1]);
-  }
-
   len = pStubMsg->ActualCount;
 
   if (fMustAlloc || !*ppMemory)




More information about the wine-cvs mailing list