Rob Shearman : rpcrt4: Handle complex arrays in calc_arg_size.

Alexandre Julliard julliard at winehq.org
Mon Jan 14 09:33:27 CST 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Jan 14 11:54:32 2008 +0000

rpcrt4: Handle complex arrays in calc_arg_size.

---

 dlls/rpcrt4/ndr_marshall.c |    4 ++--
 dlls/rpcrt4/ndr_misc.h     |    2 ++
 dlls/rpcrt4/ndr_stubless.c |    6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index dbcddd2..6ed102f 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -2654,8 +2654,8 @@ static unsigned long ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
   return size;
 }
 
-static unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg,
-                                       PFORMAT_STRING pFormat)
+unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg,
+                                PFORMAT_STRING pFormat)
 {
   PFORMAT_STRING desc;
   unsigned long size = 0;
diff --git a/dlls/rpcrt4/ndr_misc.h b/dlls/rpcrt4/ndr_misc.h
index ebd70b8..b6dfaff 100644
--- a/dlls/rpcrt4/ndr_misc.h
+++ b/dlls/rpcrt4/ndr_misc.h
@@ -62,4 +62,6 @@ extern const NDR_BUFFERSIZE NdrBufferSizer[];
 extern const NDR_MEMORYSIZE NdrMemorySizer[];
 extern const NDR_FREE       NdrFreer[];
 
+unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat);
+
 #endif  /* __WINE_NDR_MISC_H */
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c
index fb76a2f..bc40641 100644
--- a/dlls/rpcrt4/ndr_stubless.c
+++ b/dlls/rpcrt4/ndr_stubless.c
@@ -849,6 +849,12 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
     case RPC_FC_LGFARRAY:
         size = *(const DWORD*)(pFormat + 2);
         break;
+    case RPC_FC_BOGUS_ARRAY:
+        pFormat = ComputeConformance(pStubMsg, NULL, pFormat + 4, *(const WORD*)&pFormat[2]);
+        TRACE("conformance = %ld\n", pStubMsg->MaxCount);
+        pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount);
+        size = ComplexStructSize(pStubMsg, pFormat);
+        size *= pStubMsg->MaxCount;
     default:
         FIXME("Unhandled type %02x\n", *pFormat);
         /* fallthrough */




More information about the wine-cvs mailing list