It seems you have to Pop the result in a variable to get the function return value .
What if I have
Does this sequence screw the stack or the initial $0 value?Push $0
SimpleSC:<call>
Pop $0
Pop $0
Thanks,
Mario
6 posts
Does this sequence screw the stack or the initial $0 value?Push $0
SimpleSC:<call>
Pop $0
Pop $0
/* presuming $0 is your counter */
Push $0 ; Stack: $0:counter
SimpleSC::ServiceIsRunning "MyService" ; Stack: errorcode running $0:counter
Pop $0 ; $0 = errorcode ; Stack: running $0:counter
Pop $1 ; $1 = running ; Stack: $0:counter
Pop $0 ; $0 = $0:counter ; Stack: -empty- Additionally.. if you're afraid of stack/variable corruption, it might be useful to just make your own variable...[...]
Var /global counter
StrCpy $counter 0
IntOp $counter $counter - 1
[...] ...so that you don't have to worry about what plugins/macros/you do to the stack and NSIS's predefined variables.