Disable devices

Hello guys!
I want to disable some devices in system (wifi adapters, headset etc.) and I search best way :

  • use SetupDiXXX functions;
  • use driver filter for devices class and try send IRP_MN_STOP to PDO;

What more stable approach?

The first. A driver is not allowed to send state changing pnp requests . Besides a stop request is the incorrect sequence

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?10/?2/?2014 6:50 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Disable devices

Hello guys!
I want to disable some devices in system (wifi adapters, headset etc.) and I search best way :
- use SetupDiXXX functions;
- use driver filter for devices class and try send IRP_MN_STOP to PDO;

What more stable approach?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Doron, thank for help!
The only way to lock the device - use SetupDiXXX functions? If it’s true ho I can understand structure of Device Manager API (how it use PnP manager and how it implement)?

Your best starting point is the source for devcon.exe

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, October 2, 2014 11:51 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Disable devices

Doron, thank for help!
The only way to lock the device - use SetupDiXXX functions? If it’s true ho I can understand structure of Device Manager API (how it use PnP manager and how it implement)?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I faced with problem : function SetupDiGetDeviceInstallParams() sometimes return Flags = DI_NEEDRESTART | DI_NEEDREBOOT. In which case it occurs and how I can avoid this situation (apply changes without reboot), it’s possible?

xxxxx@gmail.com wrote:

I faced with problem : function SetupDiGetDeviceInstallParams() sometimes return Flags = DI_NEEDRESTART | DI_NEEDREBOOT. In which case it occurs and how I can avoid this situation (apply changes without reboot), it’s possible?

It occurs if you are trying to disable or restart a device that still
has an open instance. Assuming that’s the case, there’s nothing you can
do except reboot. You can’t force an application to close your instance.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.