我试图在C#中封送一个hid_device_info结构,但我不知道如何将wchar_t*字符串转换为托管C#字符串。我尝试了MarshalAs属性中所有可能的值,但所有这些值都只返回第一个字符,没有返回其他字符。 我已经尝试用指针替换所有的宽字符串,这样我就可以手动查看它们,这就是我到目前为止所使用的结构: public struct HidDeviceInfo public IntPtr path; // This one marshals fine because it's just a regular char_t*
public ushort vendo