A user-defined surface DLL will retrieve information from OpticStudio via the FIXED_DATA5 structure defined in the header file. An example of the header file can be found under '\Zemax\DLL\Surfaces\usersurf.h'.
To access the surface parameters, the DLL reads the variable param in the FIXED_DATA5 structure:
If we need to pass more parameters to the DLL, one way can be to use the datasurf_numvalues and datasurf_values.
To use this, a 'Data' surface has to be used.
Below I have taken a screenshot when debugging a user-defined surface:
I hope this helps but do not hesitate to share your comments.