标签:硬件 war 扫描 overflow mgr last extern device err
public static class Win32Api { public const int CM_LOCATE_DEVNODE_NORMAL = 0x00000000; public const int CM_REENUMERATE_NORMAL = 0x00000000; public const int CR_SUCCESS = 0x00000000; [DllImport("CfgMgr32.dll", SetLastError=true)] public static extern int CM_Locate_DevNodeA(ref int pdnDevInst, string pDeviceID, int ulFlags); [DllImport("CfgMgr32.dll", SetLastError=true)] public static extern int CM_Reenumerate_DevNode(int dnDevInst, int ulFlags); }
调用方法:
int pdnDevInst = 0;
Win32Api.CM_Locate_DevNodeA(ref pdnDevInst, null, Win32Api.CM_LOCATE_DEVNODE_NORMAL); Win32Api.CM_Reenumerate_DevNode(pdnDevInst, Win32Api.CM_REENUMERATE_NORMAL);
参考链接:
标签:硬件 war 扫描 overflow mgr last extern device err
原文地址:https://www.cnblogs.com/sherlock-merlin/p/10925310.html