Details
Description
There are a few interesting class attributes which are mostly implemented statically in the stack:
usMaxInstance
usNumInstance
usMaxClassAttr
usMaxInstanceAttr
These values in fact have to be dynamic. For instance, usNumInstance has to increase with each new instance creation and the usMaxInstance has to increment when this creation leads to a higher maximum instance ID of the object class. Correspondingly, when an instance is deleted, the values have to be lowered eventually. This is mostly implemented, but might be better abstracted.
For the usMaxClassAttr and usMaxInstanceAttr attributes, we should respect the attribute flags, ignoring disabled attributes, and adapting the class attributes accordingly. Such a mechanism is currently missing mostly, so the host would have to set the maximum values explicitly. An exception is the ID object which already implements this dynamics. So just maybe consolidate this mechanism. See CipId_UpdateClassAttributes().