The answer is don't use those Windows 16 bit historic legacy junk calls. See the note on the link in the answer above.
MSDN => This function is provided only for compatibility with 16-bit versions of Windows. Applications should store initialization information in the registry.
That is the reason you have to import the DLL headers and play around with marshalling the string data and they don't provide access to this stuff. At a guess the text will also be in ASCII codepage 850 mode (its based on old DOS) and you might get caught outwith stringBuilder in some country languages unless you set the encoding. I really don't know why you would want to do this out of a C# program ever and it's more dangerous than just directly accessing the files if it really has to be there.
The correct solution is to put the stuff into the registry like 32/64 bit programs are supposed to. If you really do want to store in config files just use the normal read write API calls or a file stream into a stock standard text file.
INI files are deprecated in favor of the registry for about a dozen good reasons and modern code shouldn't be using them.