WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DllCall Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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 keep 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
File Created: 2012:10:22:13:49:56
Last Updated: 2012:10:22:13:49:56