Keywords: Answerstring WIL SDK
I cannot find any examples, or documentation that explains this "ANSWERSTRING" macro in the extender. It claims to
have a global buffer somwhere, and returns a large string to the WIL but doesnt return control back to the script. How
is this ANSWERSTRING intended to be used? The comments in the wilx.c do NOT clarify anything.
Basically if you do a GLOBALALLOC in your code for some function and put your answer into the memory buffer that
then you must do two things.
- Return your answer to WinBatch via the ANSWERSTING macro.
- Then GlobalFree your buffer after the ANSWERSTRING macro returns.
If you used the RETSTRING macro instead, the answer would get back to WinBatch, but your code would be over and
there would be a lost GlobalAlloc'ed buffer, creating a memory leak unless you carefully planned for this to occur.
Can you give an example of the script and a short extender case stub that would do what you say. I am confused on
how the SCRIPT will be able to access such a buffer.
Also, can I assume this would work for ANY heap space? Is there any reason malloc cannot be used instead of the
The ASNWERSTRING macro will cause the
contents of the buffer to be copied to a
WinBatch variable. Then the data in the
buffer is redundant and can be eliminated.
Note: In general the GlobalAlloc function is preferred in WinBatch to the malloc function when passing
data from an extender to the main DLL.
Article ID: W14198
Filename: Answerstring Description.txt
File Created: 2017:07:28:12:58:14
Last Updated: 2003:07:24:09:21:47