diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2018-05-21 19:47:00 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-05-22 01:11:59 +0200 |
commit | c4878f9009d41ee9b06d8d408ffcacf50fded61f (patch) | |
tree | 7388f5e3f0b447a00669da1b7bb39d228165b64d /basic | |
parent | 4b84229afc16dee4b150950463bff7e6df793ffc (diff) |
tdf#97231: basic: do not use extra wrapping for string marshaling
previous approach did wrap string reference once again, making
practically "a pointer to pointer to string" so this code was not
working correctly for RegQueryValueExA WinAPI call.
String is already provided as a reference (see marshalString(), so
no reason to wrap its reference.
This approach was just copied from from dllmgr-x86.cxx plus some
minor changes to make both versions similar.
Reviewed-on: https://gerrit.libreoffice.org/54645
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Conflicts:
basic/source/runtime/dllmgr-x64.cxx
Change-Id: I85065112407de3f078265d2c76437814402eb1b3
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/dllmgr-x64.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index 8f2b0abdef8c..9d95a87a8146 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -32,6 +32,7 @@ #include <basic/sbx.hxx> #include <basic/sbxvar.hxx> +#include "runtime.hxx" #include <osl/thread.h> #include <osl/diagnose.h> #include <rtl/ref.hxx> @@ -256,9 +257,15 @@ SbError marshal( std::vector< char > & blob, std::size_t offset, MarshalData & data) { OSL_ASSERT(variable != 0); - if (!(variable->GetFlags() & SbxFlagBits::Reference)) { - if ((variable->GetType() & SbxARRAY) == 0) { - switch (variable->GetType()) { + + SbxDataType eVarType = variable->GetType(); + bool bByVal = !(variable->GetFlags() & SbxFlagBits::Reference); + if( !bByVal && !SbiRuntime::isVBAEnabled() && eVarType == SbxSTRING ) + bByVal = true; + + if (bByVal) { + if ((eVarType & SbxARRAY) == 0) { + switch (eVarType) { case SbxINTEGER: add(blob, variable->GetInteger(), outer ? 8 : 2, offset); break; @@ -307,8 +314,8 @@ SbError marshal( } } } else { - if ((variable->GetType() & SbxARRAY) == 0) { - switch (variable->GetType()) { + if ((eVarType & SbxARRAY) == 0) { + switch (eVarType) { case SbxINTEGER: case SbxLONG: case SbxSINGLE: |