3,881
社区成员
发帖
与我相关
我的任务
分享
// https://github.com/Microsoft/Windows-driver-samples/
2。驱动安装 链接中的代码 测试在UpdateDriverForPlugAndPlayDevices会报内存损坏 修改如下
//参数传递:
string inf = @"E:\VS2017\VirtualSerial2\ComPort\x64\Debug\VirtualSerial2um\virtualserial2um.inf";
string hwid = @"umdf\virtualserial2um";
[DllImport("newdev.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool UpdateDriverForPlugAndPlayDevices(
IntPtr hwndParent,
[MarshalAs(UnmanagedType.LPWStr)] string HardwareId,
[MarshalAs(UnmanagedType.LPWStr)] string FullInfPath,
int InstallFlags,
bool bRebootRequired
);
// https://social.msdn.microsoft.com/Forums/de-DE/f264c35f-07f4-481e-a121-9ad6bb399ea0/loopbackadapter-aus-c-installieren?forum=visualcsharpde