Issue with inline assembler DLL function call [message #475543] |
Tue, 02 October 2012 11:27 |
iRANian
Messages: 4308 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
Inside a plugin I call Console_Input via inline assembler, the generated call is:
call near ptr __imp_?Console_Input@@YAXPBD@Z ; Console_Input(char const *)
However, when I call that function using the normal (non-assembler) syntax, the following call is generated:
call ds:__imp_?Console_Input@@YAXPBD@Z ; Console_Input(char const *)
If I wrap Console_Input() inside another function in my plugin and call that wrapper instead, it works correctly, I'm using the following assembler code to call Console_Input():
Any suggestions? The call that's generated for the assembler code causes the fds to crash.
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
Re: Issue with inline assembler DLL function call [message #475554 is a reply to message #475543] |
Tue, 02 October 2012 17:48 |
|
We have run into this problem before in scripts, the simple answer is that you cant call a function that's imported from another dll inside an ASM block (at least we never found such a way)
Thats why the HookupAT3x function exists in all the SSGM plugins.
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
|
|
|
|