safely removing a device from a kernel mode driver

Hi,

How can I safely remove/disable a device from a kernel mode driver? Can some
one refer me to the correct API?

I tried using IoRequestDeviceEject() and it removes the device just like I
wanted, but I also get a message box saying that there is a problem in
ejecting the device because it is not removable.

Is there an API that will request the PnP manager to remove the device?

Thanks,

Shahar

No, there is no way to do this from kernel mode. You need to have a
user mode application do this for you. Disabling a device on the user's
behalf is not really user friendly. If this is your own device, you can
mark yourself as failed vai IoInvalidateDeviceState.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Sunday, August 22, 2004 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] safely removing a device from a kernel mode driver

Hi,
How can I safely remove/disable a device from a kernel mode driver? Can
some one refer me to the correct API?
I tried using IoRequestDeviceEject() and it removes the device just like
I wanted, but I also get a message box saying that there is a problem in
ejecting the device because it is not removable.
Is there an API that will request the PnP manager to remove the device?

Thanks,
Shahar

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com

I disable and enable the device in order to install myself as a filter on
it.
This is part of the installation of my software and the user is notified
during the installation that I'm going to do that.
This is done instead of restarting the whole system.
Is there anything wrong with this design?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Sunday, August 22, 2004 10:01 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel mode driver

No, there is no way to do this from kernel mode. You need to have a
user mode application do this for you. Disabling a device on the user's
behalf is not really user friendly. If this is your own device, you can
mark yourself as failed vai IoInvalidateDeviceState.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Sunday, August 22, 2004 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] safely removing a device from a kernel mode driver

Hi,
How can I safely remove/disable a device from a kernel mode driver? Can
some one refer me to the correct API?
I tried using IoRequestDeviceEject() and it removes the device just like
I wanted, but I also get a message box saying that there is a problem in
ejecting the device because it is not removable.
Is there an API that will request the PnP manager to remove the device?

Thanks,
Shahar

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ''
To unsubscribe send a blank email to xxxxx@lists.osr.com

What is wrong is doing this from kernel mode instead of from user mode where
this operation is supported.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Monday, August 23, 2004 4:23 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel
mode driver

I disable and enable the device in order to install myself as
a filter on it.
This is part of the installation of my software and the user
is notified during the installation that I’m going to do that.
This is done instead of restarting the whole system.
Is there anything wrong with this design?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Sunday, August 22, 2004 10:01 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel
mode driver

No, there is no way to do this from kernel mode. You need to
have a user mode application do this for you. Disabling a
device on the user’s behalf is not really user friendly. If
this is your own device, you can mark yourself as failed vai
IoInvalidateDeviceState.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Sunday, August 22, 2004 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] safely removing a device from a kernel mode driver

Hi,
How can I safely remove/disable a device from a kernel mode
driver? Can some one refer me to the correct API?
I tried using IoRequestDeviceEject() and it removes the
device just like I wanted, but I also get a message box
saying that there is a problem in ejecting the device because
it is not removable.
Is there an API that will request the PnP manager to remove
the device?

Thanks,
Shahar

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

I’m going to do this from user mode.
Thank You.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Monday, August 23, 2004 1:11 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel mode driver

What is wrong is doing this from kernel mode instead of from user mode where
this operation is supported.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Monday, August 23, 2004 4:23 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel
mode driver

I disable and enable the device in order to install myself as
a filter on it.
This is part of the installation of my software and the user
is notified during the installation that I’m going to do that.
This is done instead of restarting the whole system.
Is there anything wrong with this design?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Sunday, August 22, 2004 10:01 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel
mode driver

No, there is no way to do this from kernel mode. You need to
have a user mode application do this for you. Disabling a
device on the user’s behalf is not really user friendly. If
this is your own device, you can mark yourself as failed vai
IoInvalidateDeviceState.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Sunday, August 22, 2004 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] safely removing a device from a kernel mode driver

Hi,
How can I safely remove/disable a device from a kernel mode
driver? Can some one refer me to the correct API?
I tried using IoRequestDeviceEject() and it removes the
device just like I wanted, but I also get a message box
saying that there is a problem in ejecting the device because
it is not removable.
Is there an API that will request the PnP manager to remove
the device?

Thanks,
Shahar

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@safend.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Sounds good to me.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Monday, August 23, 2004 1:23 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel mode driver

I disable and enable the device in order to install myself as a filter
on
it.
This is part of the installation of my software and the user is notified
during the installation that I'm going to do that.
This is done instead of restarting the whole system.
Is there anything wrong with this design?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Sunday, August 22, 2004 10:01 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] safely removing a device from a kernel mode driver

No, there is no way to do this from kernel mode. You need to have a
user mode application do this for you. Disabling a device on the user's
behalf is not really user friendly. If this is your own device, you can
mark yourself as failed vai IoInvalidateDeviceState.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shahar Talmi
Sent: Sunday, August 22, 2004 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] safely removing a device from a kernel mode driver

Hi,
How can I safely remove/disable a device from a kernel mode driver? Can
some one refer me to the correct API?
I tried using IoRequestDeviceEject() and it removes the device just like
I wanted, but I also get a message box saying that there is a problem in
ejecting the device because it is not removable.
Is there an API that will request the PnP manager to remove the device?

Thanks,
Shahar

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
''
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com