Will adding data members (at the end) problems with the exported structure?

The exported function has a structure as one of the parameters. This DLL is used by many Exes

One of the EXEs needs to send some additional data, so we added one element to the end of the structure and allocated the DLL.

Now my question is, if we put a new DLL in other EXEs that don't know about the extra member, will it cause problems?

A DLL should not try to access a data member of a structure that is not in the EXE. How can I handle this situation?

Note. Adding new API to DLL is prohibited.

0


a source to share


1 answer


If other functions take value struct

by value, i.e. without pointing a pointer to it, then yes, there will likely be problems. Your calling code struct

will push a larger one onto the stack than the receive function will be removed, causing the network stack to grow and overall bad.



+1


a source







All Articles