我通过WFSStartUp
程序
C#
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public unsafe struct WFSVERSION
{
public ushort wVersion;
public ushort wLowVersion;
public ushort wHighVersion;
public fixed char szDescription[256 + 1];
public fixed char szSystemStatus[256 + 1];
}
[DllImport("msxfs.dll", CharSet = CharSet.Ansi, CallingConvention = XFSConstants.CALLINGCONVENTION)]
public static extern int WFSStartUp(int dwVersionsRequired, ref WFSVERSION lpWFSVersion);
WFSVERSION m_Version = new WFSVERSION();
int requestVersion = 0x00010202;
int hResult = WFSStartUp(requestVersion, ref m_Version);
返回值hResult
没问题但m_Version.szDescription
不正确(m_Version.szDescription[0] = 'W'
,m_Version.szDescription[1] = 0
,...)
如何解决这个问题?