It looks like you will be using the ANSI char set, so you could declare the P/Invoke like so:
[DllImport("yourdll.dll", CharSet = CharSet.Ansi)]
public static extern void set_param([MarshalAs(UnmanagedType.LPStr)] string lpString);
The .NET marshaller handles making copies of strings and converting the data to the right type for you.
If you have an error with an unbalanced stack, you will need to set the calling convention to match your C DLL, for example:
[DllImport("yourdll.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
See pinvoke.net for lots of examples using Windows API functions.
Also see Microsoft's documentation on pinvoking strings.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…