i need to install a device driver (INF file) through c#. I used the function UpdateDriverForPlugAndPlayDevices. However, it returns me FALSE, but the GetLastError() returns a value 0, which indicates Success message for the installation. Not sure if i am proceeding in the correct way or not. Can anyone help? Thanks in advance, P
You should look at the source for devcon. It is available in the WDK and is exactly what you need. Specifically look for the way that devcon will install an INF file. I still use the Windows 7 WDK, and it's located at C:\WinDDK\7600.16385.1\src\setup\devcon
.
You'll probably find it's using the SetupCopyOEMInf()
function, which you should try using from your C# application too.