From 39ded8c54d9c8bdbdf970b2b75be8294e49b3f9f Mon Sep 17 00:00:00 2001 From: 1orenz0 <1orenz0@github> Date: Wed, 25 Apr 2018 20:33:57 +0200 Subject: [PATCH] Fix size_is description when the parameter is out When the argument using to describe size_is is an out parameter, we don't know it's value and it cannot be used to describe the size of another parameter. That's why in that case we can only set a max range --- RpcDecompiler/InternalComplexTypesMisc.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/RpcDecompiler/InternalComplexTypesMisc.cpp b/RpcDecompiler/InternalComplexTypesMisc.cpp index 5423b02..c574ba1 100644 --- a/RpcDecompiler/InternalComplexTypesMisc.cpp +++ b/RpcDecompiler/InternalComplexTypesMisc.cpp @@ -597,7 +597,25 @@ BOOL __fastcall processCorrelationDescriptorNaked( { case FC_DEREFERENCE: - oss << "*" << strCorrelationItem; + + // the correlation item describing the size of the current item + // can derive from an out parameter. In that case, we can only set it + // has a max range and not the exact size since it's not known before the call. + // Ex : + // HRESULT Proc0 ( + // [in] int arg1, + // [out] int *arg2, + // [out][size_is( , *arg2)] int **arg2 + // ); + if (paramDesc.isOut()) + { + oss << ", *" << strCorrelationItem; + } + else + { + oss << "*" << strCorrelationItem; + } + break; case FC_ADD_1: