用Marshal.StructureToPtr和Marshal.PtrToStructure,函数声明里只用IntPtr。
另外,szDeviceName是char型的,应该设CharSet=CharSet.Ansi