TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

removable hardware

Microsoft Device Drivers

 
 
Thread Tools Display Modes
Unread 03-12-2007, 10:42 PM   #1
Brian
Guest
 
Posts: n/a
removable hardware

Is there a registry setting that designates a device to be removable?

Brian

 
Unread 03-12-2007, 10:42 PM   #2
Don Burn
Guest
 
Posts: n/a
Re: removable hardware

Are you setting the Removable bit in the DEVICE_CAPABILITIES structure on
IRP_MN_QUERY_CAPABILITIES? I have not done this with a filter, but in a
bus driver this allowed the remove device to work as you want. Just catch
the completion of the IRP and set the bit.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Brian" <Brian@discussions.microsoft.com> wrote in message
news:8CBA18D5-5437-4F8B-A2F2-23039D7EDF44@microsoft.com...
> Mark,
>
> Hot-plugging is defined in the PCI-Express standard. According to the
> hotplug standard an individual slot can be powered down a PCIE-plugin
> card
> replaced and then powered back up. Logically it should be identical to
> an
> ExpressCard slot on a laptop. I have a bus filter driver that handles
> the
> interrupt when the button to power down the slot is pressed and
> implements
> the state machine defined in the standard. This should be the equivalent
> of
> unplugging an ExpressCard. Asside from the standard procedure, when I
> power
> down or up a slot, I call IoInvalidateDeviceRelations. This does cause a
> Query device relations PNP Irp to be sent and the device list appears to
> be
> updated correctly by PCI.SYS. The problem I am seeing is that the
> devices
> are returning with an error code of 31. Through experimentation I have
> found
> that if I disable the device before powering down and re-enable the
> device
> every thing works. The only difference I can see is that disabling the
> device causes a REMOVE_DEVICE while invalidating bus relations causes a
> surprise removal. I assume the plug in card's driver (out of my control)
> is
> not handling the surprise removal properly. If I can cause the devices
> downstream of me to be "removable" then I can use the "safely remove
> hardware" dialog rather then the device manager, which is much preferable
> from a user standpoint.
>
> Thanks,
>
> Brian
>
> "Mark Roddy" wrote:
>
>> Brian wrote:
>> > Is there a registry setting that designates a device to be removable?
>> >
>> > Brian
>> >

>> What sort of device?
>>



 
Unread 03-12-2007, 10:43 PM   #3
Uwe Sieber
Guest
 
Posts: n/a
Re: removable hardware


Brian wrote:If I can cause the devices
> downstream of me to be "removable" then I can use the "safely remove
> hardware" dialog rather then the device manager, which is much preferable
> from a user standpoint.


As far as I've seen so far a device is listed in the safe
removal dialog when it has the CM_DEVCAP_REMOVABLE bit and
not the CM_DEVCAP_SURPRISEREMOVALOK device capability bit.

Uwe


 
Unread 03-12-2007, 10:44 PM   #4
Mark Roddy
Guest
 
Posts: n/a
Re: removable hardware

Brian wrote:
> Is there a registry setting that designates a device to be removable?
>
> Brian
>

What sort of device?
 
Unread 03-12-2007, 10:44 PM   #5
Brian
Guest
 
Posts: n/a
Re: removable hardware

Mark,

Hot-plugging is defined in the PCI-Express standard. According to the
hotplug standard an individual slot can be powered down a PCIE-plugin card
replaced and then powered back up. Logically it should be identical to an
ExpressCard slot on a laptop. I have a bus filter driver that handles the
interrupt when the button to power down the slot is pressed and implements
the state machine defined in the standard. This should be the equivalent of
unplugging an ExpressCard. Asside from the standard procedure, when I power
down or up a slot, I call IoInvalidateDeviceRelations. This does cause a
Query device relations PNP Irp to be sent and the device list appears to be
updated correctly by PCI.SYS. The problem I am seeing is that the devices
are returning with an error code of 31. Through experimentation I have found
that if I disable the device before powering down and re-enable the device
every thing works. The only difference I can see is that disabling the
device causes a REMOVE_DEVICE while invalidating bus relations causes a
surprise removal. I assume the plug in card's driver (out of my control) is
not handling the surprise removal properly. If I can cause the devices
downstream of me to be "removable" then I can use the "safely remove
hardware" dialog rather then the device manager, which is much preferable
from a user standpoint.

Thanks,

Brian

"Mark Roddy" wrote:

> Brian wrote:
> > Is there a registry setting that designates a device to be removable?
> >
> > Brian
> >

> What sort of device?
>

 
Unread 03-12-2007, 10:44 PM   #6
Don Burn
Guest
 
Posts: n/a
Re: removable hardware

Are you setting the Removable bit in the DEVICE_CAPABILITIES structure on
IRP_MN_QUERY_CAPABILITIES? I have not done this with a filter, but in a
bus driver this allowed the remove device to work as you want. Just catch
the completion of the IRP and set the bit.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"Brian" <Brian@discussions.microsoft.com> wrote in message
news:8CBA18D5-5437-4F8B-A2F2-23039D7EDF44@microsoft.com...
> Mark,
>
> Hot-plugging is defined in the PCI-Express standard. According to the
> hotplug standard an individual slot can be powered down a PCIE-plugin
> card
> replaced and then powered back up. Logically it should be identical to
> an
> ExpressCard slot on a laptop. I have a bus filter driver that handles
> the
> interrupt when the button to power down the slot is pressed and
> implements
> the state machine defined in the standard. This should be the equivalent
> of
> unplugging an ExpressCard. Asside from the standard procedure, when I
> power
> down or up a slot, I call IoInvalidateDeviceRelations. This does cause a
> Query device relations PNP Irp to be sent and the device list appears to
> be
> updated correctly by PCI.SYS. The problem I am seeing is that the
> devices
> are returning with an error code of 31. Through experimentation I have
> found
> that if I disable the device before powering down and re-enable the
> device
> every thing works. The only difference I can see is that disabling the
> device causes a REMOVE_DEVICE while invalidating bus relations causes a
> surprise removal. I assume the plug in card's driver (out of my control)
> is
> not handling the surprise removal properly. If I can cause the devices
> downstream of me to be "removable" then I can use the "safely remove
> hardware" dialog rather then the device manager, which is much preferable
> from a user standpoint.
>
> Thanks,
>
> Brian
>
> "Mark Roddy" wrote:
>
>> Brian wrote:
>> > Is there a registry setting that designates a device to be removable?
>> >
>> > Brian
>> >

>> What sort of device?
>>



 
Unread 03-12-2007, 10:45 PM   #7
Uwe Sieber
Guest
 
Posts: n/a
Re: removable hardware


Brian wrote:If I can cause the devices
> downstream of me to be "removable" then I can use the "safely remove
> hardware" dialog rather then the device manager, which is much preferable
> from a user standpoint.


As far as I've seen so far a device is listed in the safe
removal dialog when it has the CM_DEVCAP_REMOVABLE bit and
not the CM_DEVCAP_SURPRISEREMOVALOK device capability bit.

Uwe


 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 01:34 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional