Archive: System::Call - How to represent void** ?


System::Call - How to represent void** ?
I have 2 functions that I need to call from a dll that gets installed with our product. FuncA gets called, does some stuff and then passes back a pointer to an object. FuncB then takes a pointer to that pointer as a parameter. However, when I call FuncA (which appears to work) and then call FuncB, FuncB causes the whole installer to crash.

Here are some more details...
The first function has the following signature:

int __stdcall FuncA(const char* x, const char* y, void* object)

In my Nullsoft script I call that using the following:

System::Call /NOUNLOAD 'myDLL::FuncA(t `${_X}`, t `${_Y}`, p .${_OBJECT}) i.r0'

The function is doing what it is supposed to, but it does not seem to return a pointer to the object in ${_OBJECT}.

The second function has the following signature:

int __stdcall FuncB(void** object)

In my Nullsoft script I call that using the following:

System::Call /NOUNLOAD 'myDLL::FuncB(*p ${_OBJECT}) i.r0'

Can anyone offer some suggestions on how to properly solve these problems?

1) Why doesn't ${_OBJECT} get the pointer when I call FuncA
2) Am I even close to representing a void** in my System::Call for FuncB?

Thanks!


Unless you are using a nightly, p is not a valid type (use i until 2.47 ships)

When calling FuncB, you do NOT want to use * since it is not a pointer that the system plugin is going to touch, you just want to pass its VALUE

But there is something else wrong here, there is no way FuncA as declared can pass back a pointer, it would have to be void**object, and FuncB would NOT need void** unless its going to give you back a different pointer. So you either typed out the wrong thing in your post, or there is something else you are missing.

Also, it would help if you removed the defines and just used r[X] when testing, would make it more clear to us since we don't know what ${_OBJECT} is