Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

CM_Reenumerate_DevNode_Ex (setupapi)
 
.
Summary
The CM_Reenumerate_DevNode_Ex function enumerates the devices identified by a specified device node and all of its children.

C# Signature:

[DllImport("setupapi.dll")]
static extern UInt32 CM_Reenumerate_DevNode_Ex(UInt32 dnDevInst, UInt32 ulFlags, IntPtr hMachine);

VB Signature:

Declare Function CM_Reenumerate_DevNode_Ex Lib "setupapi.dll" (dnDevInst As UInt32, ulFlags As UInt32, hMachine As IntPtr) As UInt32

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Please add some!

Tips & Tricks:

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;
  :

Sample Code:

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;
}

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions