Why is BinaryEODset Needed?
Keywords: BinaryEODset DllCall
Question:
In the reference manual regarding dllcall, it says that if lpbinary is used to pass info from a dll back to a wil script via a dllcall, then binaryeodset is needed to set the end of data point so that the other binary functions can reference the returned data.Can someone explain why this is so?
Answer:
WinBatch and its Binary functions keek track of a EOD number, which indicates how much of the Binary Buffer that you allocated has actually been used. So it is watching carefully at what you are doing with the Binary Buffers.However when a DllCall stores data into a binary buffer, it is a safe bet that whatever function was DllCall'ed does not know how to update the BinaryBuffer EOD number.
Thus, before you can access the data stored by a dllcall in the binary buffer, you must manually set the EOD number to a value large enough for you to access the data. I usually set it to the same size as the binary buffer.
Article ID: W15137