473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with using Win32 API setupapi.dll in C#

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
Jul 20 '06 #1
3 7803
Have you taken a look at:
http://www.pinvoke.net/default.aspx/...ClassInstaller

I haven't gone through to look and see if allt he "user defined types" are
also given, but that may help you out.

--
Adam Clauss

"Michael" <mh***@domain.comwrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
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

Jul 21 '06 #2
Adam,

Yes, I stopped by there the other day. It was a little helpful but of
limited use :(.

-MH
"Adam Clauss" <ca*****@tamu.eduwrote in message
news:12*************@corp.supernews.com...
Have you taken a look at:
http://www.pinvoke.net/default.aspx/...ClassInstaller

I haven't gone through to look and see if allt he "user defined types" are
also given, but that may help you out.

--
Adam Clauss

"Michael" <mh***@domain.comwrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
>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


Jul 22 '06 #3
* "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.
Jul 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: FloydPW | last post by:
I am attmempting to enable/disable a device in C#. I am able to locate it and tell it to disable, but the device will not disable even upon reboot. I am hoping someone can lead me in the right...
0
by: Dale McGorman | last post by:
The following is some code that I am trying to bring over from VB 6.0, that I have working there. I am trying to get to where I can talk to a USB device. I am stuck on how to correctly pass params...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
5
by: trint | last post by:
I know that this function IS in this dll that comes with windows xp that allows bidirectional printing (you can search "bidispl.dll" on MSDN). However, I keep getting the same error all day, go to...
0
by: NeuroScript LLC | last post by:
I have code that enumerates the serial ports. On all windows versions except NT 4.0 it works. In 4.0 I get the following error message: "The procedure entry point SetupDiEnumDeviceInterfaces could...
3
by: James | last post by:
I'm interested in learning C++. I'm not sure exactly what this means. I'm currently a VB.NET/C#.NET programmer (both Windows Forms and ASP.NET). I am totally clueless when it comes to C++. I've...
5
by: BK-Chicago | last post by:
I am in the midst of porting a massive MFC application from VS6.0 to VS8.0. While i have fixed most of the compile time errors, i do have quite a linker error that i have not been able to resolve....
7
by: Rymfax | last post by:
I would really appreciate it if someone could help me figure out what I'm doing wrong trying to PInvoke SetupDiEnumDriverInfo. All the other PInvokes i've done up to this point work fine. Whenver...
3
by: Rymfax | last post by:
I was hoping someone could help me get SetupInstallFromInfSection working properly. I'm trying to start in install section in a driver INF (hal.inf specifically). I'm doing this in C#, but I also...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.