* "Michael" <mh***@domain.comwrote
* Hi all,
*
* I'm trying to figure out how to use setupapi.dll in C#, specifically the
* SetupDiCallClassInstaller function.
* I'm trying to develop a test suite which tests drivers and part of this
* suite is checking whether devices can be successfully disabled and
enabled.
* I haven't found anything to support this in the .NET framework yet and
seem
* to be stuck interopping this Win32 API stuff.
*
* Anybody w/ experience or know-how (C# source code examples) on how to
* consume this part of the API?
*
* Thanks,
* -MH
*
*
Also,
Does anybody know the proper way to populate the arguments that are passed
to the function call "SetupDiCallClassInstaller" ?
Where do I get the IntPtr for the second parameter and the SP_DEVINFO_DATA
info for the third?
WINSETUPAPI BOOL WINAPI
SetupDiCallClassInstaller(
IN DI_FUNCTION InstallFunction,
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
);
Parameters
InstallFunction - Specifies the device installation request (DIF request) to
pass to the co-installers and class installer. DIF codes have the format
DIF_XXX and are defined in setupapi.h. See Device Installation Function
Codes for more information. Note that for certain DIF requests, the caller
must be a member of the Administrators group. For such DIF requests, this
requirement is listed on the reference page
for the associated default handler.
DeviceInfoSet - Supplies a handle to a device information set for the local
machine.
DeviceInfoData - Supplies a pointer to an SP_DEVINFO_DATA structure that
specifies a device in the DeviceInfoSet. If DeviceInfoData is NULL, this
function calls the installers for the setup class associated with the device
information set.