From: sherzod.l on
Hello.

How do I enable (disable) NIC on windows via api. I need to use most
portable accross any versions of windows code.

Thank you.

From: Maxim S. Shatskih on
> How do I enable (disable) NIC on windows via api. I need to use most
> portable accross any versions of windows code.

SetupDiCallClassInstaller with the proper DIF_xxx code.

Disables any device, NIC too. More so, the Network control panel UI uses the same stuff to disable the NIC as the Device Manager - i.e. SetupDiCallClassInstaller (probably mediated by INetCfg stuff).

See the DEVCON sample.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: sherzod.l on
Maxim S. Shatskih wrote:

>
> SetupDiCallClassInstaller with the proper DIF_xxx code.
>
> Disables any device, NIC too. More so, the Network control panel UI
uses

Thanks. It works fine.