views:

49

answers:

1

Exportable function has the struct as a one of the parameter.

This dll is used by many Exes

One of the Exe needs to send some additional data , so we have added one member at the end of the struct and distributed the dll.

Now my question is, if we put the new dll in other Exes which is not aware of the Extra member cause problems ?

Dll should not try to access the structure data member,which is not present in Exe.

How to handle this situation.

PS: Adding new API is not allowed in the dll.

+1  A: 

If other functions accept the struct by value, i.e. not by taking a pointer to it, then yes, there very likely will be problems. Your calling code will place a larger struct on the stack than the receiving function will remove, causing net stack growth and general badness.

unwind