CM_Reenumerate_DevNode in C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hraklhs

    CM_Reenumerate_DevNode in C#

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

    BOOL ScanForHardware Changes()
    {
    DEVINST devInst;
    CONFIGRET status;

    //
    // Get the root devnode.
    //

    status = CM_Locate_DevNo de(&devInst, NULL,
    CM_LOCATE_DEVNO DE_NORMAL);

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

    }

    status = CM_Reenumerate_ DevNode(devInst , 0);

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

    return TRUE;
    }
Working...