There's built-in support for marshaling to LPSTR using the
MarshalAs
attribute.
You call would likely be something like this;
bool GetServerName(int index, [MarshalAs(UnmanagedType.LPStr)] string Buffer, int BufSize)
More detailed information on marshaling can be found
here[
^].
Hope this helps,
Fredrik