2 ms·
The solution in old Win32 APIs was to have a length field as the first member of the struct. The client sets this to sizeof(the_struct). As long as structs ar
by masfuerte 2y ago
The solution in old Win32 APIs was to have a length field as the first member of the struct. The client sets this to sizeof(the_struct). As long as structs are only ever extended the library knows exactly which version it is dealing with from the length.
This got a bit messy because Windows also included compatibility hacks for clients that didn't set the length correctly.