CM_Reenumerate_DevNode in C#

H

Hraklhs

How can I write in C# the code at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q259697 ?
It is the following:

BOOL ScanForHardwareChanges()
{
DEVINST devInst;
CONFIGRET status;

//
// Get the root devnode.
//

status = CM_Locate_DevNode(&devInst, NULL,
CM_LOCATE_DEVNODE_NORMAL);

if (status != CR_SUCCESS) {
printf("CM_Locate_DevNode failed: %x\n", status);
return FALSE;

}

status = CM_Reenumerate_DevNode(devInst, 0);

if (status != CR_SUCCESS) {
printf("CM_Reenumerate_DevNode failed: %x\n", status));
return FALSE;
}

return TRUE;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top