Archive: System plugin question about usage example


System plugin question about usage example
Hi Guys, i am new to NSIS and i am trying to learn how to use system plugin.

From system plugin read me, i am having hard time understanding this usage example.

Usage example
# allocate a buffer and put 'test string' and an int in it
System::Call "*(&t1024 'test string', i 5) p .s"
Pop $0 ; at this point there is no value in $0
# copy to an automatically created buffer
System::Copy 0 $0
Pop $1
# get string and int in $1 buffer
System::Call "*$1(&t1024 .r2, i .r3)"
# free buffer
System::Free $1
# print result
Messagebox MB_OK "$2 and $3" ; i added this statement to check the values
DetailPrint $2
DetailPrint $3

----
----

When i compile, i see values NULL and 0 in $2 and $3 instead of "test string" and 5. Could anyone please explain why is that ?

Thanks


the line...

System::Call"*(&t1024'teststring',i5)p.s"

Is for a newer version of the System plugin that is not actually included with NSIS yet (not sure if there's some alternate download location).

You'll want to use...
System::Call"*(&t1024'teststring',i5)i.s"

For further reference, see the "Docs\System\System.html" document included with your NSIS installation, rather than the online document.

Hopefully those responsible for that portion of the online presence can do something about this situation, as you're certainly not the first to have run into this sort of thing (almost invariably the 'p' vs 'i' issue, for that matter).

It works now !!!
Thanks alot for your help :)