[DllImport("setupapi.dll")]
static extern UInt32 CM_Reenumerate_DevNode_Ex(UInt32 dnDevInst, UInt32 ulFlags, IntPtr hMachine);
Declare Function CM_Reenumerate_DevNode_Ex Lib "setupapi.dll" (dnDevInst As UInt32, ulFlags As UInt32, hMachine As IntPtr) As UInt32
None.
Do you know one? Please contribute it!
Please add some!
Please add some!
ulFlags:
const uint CM_REENUMERATE_NORMAL = 0x00000000;
const uint CM_REENUMERATE_SYNCHRONOUS = 0x00000001;
// XP and later versions
const uint CM_REENUMERATE_RETRY_INSTALLATION = 0x00000002;
const uint CM_REENUMERATE_ASYNCHRONOUS = 0x00000004;
Result:
const uint CR_SUCCESS = 0x00000000;
:
Please add some!
public bool RescanDevices()
{
UInt32 devRoot;
if(CM_Locate_DevNode_Ex(out devRoot, IntPtr.Zero, 0, IntPtr.Zero) != CR_SUCCESS) return false;
if(CM_Reenumerate_DevNode_Ex(devRoot, 0, IntPtr.Zero) != CR_SUCCESS) return false;
return true;
}