Jump to content
Sign in to follow this  

Help on system call is needed

Recommended Posts



So i wanted to replace devcon.exe remove 'hwid' with internal command in autoit for removing device.

With a bit of looking on microsoft pages and help of PaulA i managed to get some information about but heh i kinda dunno how to 'touch it' and convert to autoit at all. Link to Microsoft: http://msdn2.microsoft.com/en-us/library/ms792970.aspx

Windows Driver Kit: Device Installation SetupDiRemoveDevice The SetupDiRemoveDevice function is the default handler for the <a onclick="java script:Track('ctl00_LibFrame_ctl00|ctl00_LibFrame_ctl01',this);" href="ms793460.aspx">DIF_REMOVE installation request.



IN HDEVINFO DeviceInfoSet,




DeviceInfoSet A handle to a device information set for the local system that contains a device information element that represents the device to remove. DeviceInfoData A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. This is an IN-OUT parameter because DeviceInfoSet.DevInst might be updated with a new handle value upon return. If this is a global removal or the last hardware profile-specific removal, all traces of the device instance are deleted from the registry and the handle will be NULL.

Return Value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved by a call to GetLastError.


The caller of SetupDiRemoveDevice must be a member of the Administrators group.

Only a class installer should call SetupDiRemoveDevice and only in those situations where the class installer must perform device removal operations after SetupDiRemoveDevice completes the default device removal operation. In such situations, the class installer must directly call SetupDiRemoveDevice when the installer processes a DIF_REMOVE request. For more information about calling the default handler, see Calling Default DIF Code Handlers.

SetupDiRemoveDevice removes the device from the system. It deletes the device's hardware and software registry keys and any hardware-profile-specific registry keys (configuration-specific registry keys). This function dynamically stops the device if its DevInst is active and this is a global removal or the last configuration-specific removal. If the device cannot be dynamically stopped, flags are set in the Install Parameter block of the device information set that eventually cause the user to be prompted to restart the computer.

Device removal is either global to all hardware profiles or specific to one hardware profile as specified by the Scope member of the SP_REMOVEDEVICE_PARAMS structure that supplies the class installation parameters for the DIF_REMOVE request. Configuration-specific removal is only appropriate for root-enumerated devices and should only be requested by system code.


Headers: Declared in setupapi.h. Include setupapi.h.

If you guys can point me to right directions on how to convert this, what to do etc.. i will greatly appreciate it.


My little company: Evotec (PL version: Evotec)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this