||SQL Server Tips by Gama and Naughter
This is the corollary function to XP_INI_WRITE and is used to read a
non-integer or non-string data. If we knew before hand the size of
the structure we had previously written to the ini file, then we
could call the SDK function “GetPrivateProfileStruct“, but the
problem is that this function assumes you know the size of the
structure you are reading beforehand. It also does not allow this
value to be discovered at runtime. Instead the code uses the
“GetPrivateProfileString“ function to read the data in as a string.
Then it decodes the data as it is encoded in the ini file, ignoring
the checksum, and finally it returns the data using “CExtendedStoredProcedure::ParamSetOutput“.
The above book excerpt is from:
Turbocharge Database Performance with C++ External Procedures
Joseph Gama, P. J. Naughter