DEVICE_ID NSSTCreateDevice(NsstDevice* device, AppProxy* proxy);
調用時第二參數傳 `NULL`:`NSSTCreateDevice(&device, NULL);`
[DllImport("MyDll.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern ushort NSSTCreateDevice(
ref NsstDevice device, // 結構體傳引用
IntPtr proxy // 指針類型用 IntPtr
);
NsstDevice dev = new NsstDevice {
host = "192.168.1.109",
username = "admin",
password = "admin",
protocol_port = 80,
rtsp_port = 554,
dev_type = NSST_DEVICE_TYPE.NSSTDEV_H
};
ushort deviceId = NSSTCreateDevice(ref dev, IntPtr.Zero); // NULL 對應 IntPtr.Zero