Question about Dynamic Audio Subdevices and IUnregisterSubdevice::UnregisterSubDevice

I am a bit perplexed by the relationship between
IUnregisterSubdevice::UnregisterSubdevice() and PcRegisterSubdevice().

WDK Docs state that UnregisterSubdevice() “… deletes the registration of a
subdevice that was previousl registered by a call to PcRegisterSubdevice()”

Well, indeed, it seems to do that and much more. It also seems to destroy
the binding of the Port and Miniport for the Port driver that is being
unregistered with the result being that (in this particular case) my Wave
PCI Miniport gets destroyed.

I was not expecting that. More to the point, I am not sure how to put it
back outside of the StartDevice() where I have an PIRP to pass to
IPort::Init() method even if I were to recreate (or keep a reference to the
original) Miniport object.

So how does one actually register / unregister / re-register a PortCls Port
object or more particularly, how - after the Port drops it reference
(binding) to the Miniport, do you put it back when you don’t have an PIRP to
pass into IPort::Init()?

Thanks all,
-dave

I think I can answer my own question after some spelunking and a bit of ‘try
it and watch for the bsod’:

Basically, the PIRP parameter to PcRegisterSubdevice() appears to be
‘optional’ and may be NULL. At least that seems to work just fine.

If any of you can confirm that this is indeed true and the correct course of
action for dynamically created audio subdevices in PortCls, please add a
reply to this.

Thanks,
-dave


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, July 19, 2007 4:22 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about Dynamic Audio Subdevices and
IUnregisterSubdevice::UnregisterSubDevice

I am a bit perplexed by the relationship between
IUnregisterSubdevice::UnregisterSubdevice() and PcRegisterSubdevice().

WDK Docs state that UnregisterSubdevice() “… deletes the registration of a
subdevice that was previousl registered by a call to PcRegisterSubdevice()”

Well, indeed, it seems to do that and much more. It also seems to destroy
the binding of the Port and Miniport for the Port driver that is being
unregistered with the result being that (in this particular case) my Wave
PCI Miniport gets destroyed.

I was not expecting that. More to the point, I am not sure how to put it
back outside of the StartDevice() where I have an PIRP to pass to
IPort::Init() method even if I were to recreate (or keep a reference to the
original) Miniport object.

So how does one actually register / unregister / re-register a PortCls Port
object or more particularly, how - after the Port drops it reference
(binding) to the Miniport, do you put it back when you don’t have an PIRP to
pass into IPort::Init()?

Thanks all,
-dave


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

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

PcRegisterSubdevice doesn’t take a PIRP as a parameter, so I assume you’re still talking about IPort::Init ;->

The PIRP parameter is an historical artifact (might have been needed in the really early Win98 days, and the need for compatibility keeps it around).

It is entirely unused in any of the implementations that support dynamic subdevices. Some pre-SP checked builds of XP will ASSERT if it is NULL, but even then it wasn’t used…

Sorry, I’d have answered the earlier post, but I was “head down”, debugging a DSF USB simulation problem for an intern, most of yesterday.


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, July 19, 2007 5:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question about Dynamic Audio Subdevices and IUnregisterSubdevice::UnregisterSubDevice

I think I can answer my own question after some spelunking and a bit of ‘try it and watch for the bsod’:

Basically, the PIRP parameter to PcRegisterSubdevice() appears to be ‘optional’ and may be NULL. At least that seems to work just fine.

If any of you can confirm that this is indeed true and the correct course of action for dynamically created audio subdevices in PortCls, please add a reply to this.

Thanks,
-dave


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, July 19, 2007 4:22 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about Dynamic Audio Subdevices and IUnregisterSubdevice::UnregisterSubDevice
I am a bit perplexed by the relationship between IUnregisterSubdevice::UnregisterSubdevice() and PcRegisterSubdevice().

WDK Docs state that UnregisterSubdevice() “… deletes the registration of a subdevice that was previousl registered by a call to PcRegisterSubdevice()”

Well, indeed, it seems to do that and much more. It also seems to destroy the binding of the Port and Miniport for the Port driver that is being unregistered with the result being that (in this particular case) my Wave PCI Miniport gets destroyed.

I was not expecting that. More to the point, I am not sure how to put it back outside of the StartDevice() where I have an PIRP to pass to IPort::Init() method even if I were to recreate (or keep a reference to the original) Miniport object.

So how does one actually register / unregister / re-register a PortCls Port object or more particularly, how - after the Port drops it reference (binding) to the Miniport, do you put it back when you don’t have an PIRP to pass into IPort::Init()?

Thanks all,
-dave

Bob,

Yes, I mean Port->Init(). It was a long day but thankfully you got the
point. I was going to go back to a W2K RTM Checked build and see what
happens but now that I know that it will ASSERT() (but otherwise still
ignore it) I will not bother with that effort.

Thanks for your reply. I am sure this labels me as a novice WDMAudio guy
(and that would not be inaccurate).

I thought the interns were supposed to do the work :wink:

Thanks,
-dave

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Friday, July 20, 2007 9:50 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question about Dynamic Audio Subdevices and
IUnregisterSubdevice::UnregisterSubDevice

PcRegisterSubdevice doesn’t take a PIRP as a parameter, so I assume you’re
still talking about IPort::Init ;->

The PIRP parameter is an historical artifact (might have been needed in the
really early Win98 days, and the need for compatibility keeps it around).

It is entirely unused in any of the implementations that support dynamic
subdevices. Some pre-SP checked builds of XP will ASSERT if it is NULL, but
even then it wasn’t used…

Sorry, I’d have answered the earlier post, but I was “head down”, debugging
a DSF USB simulation problem for an intern, most of yesterday.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, July 19, 2007 5:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question about Dynamic Audio Subdevices and
IUnregisterSubdevice::UnregisterSubDevice

I think I can answer my own question after some spelunking and a bit of ‘try
it and watch for the bsod’:

Basically, the PIRP parameter to PcRegisterSubdevice() appears to be
‘optional’ and may be NULL. At least that seems to work just fine.

If any of you can confirm that this is indeed true and the correct course of
action for dynamically created audio subdevices in PortCls, please add a
reply to this.

Thanks,
-dave


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, July 19, 2007 4:22 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about Dynamic Audio Subdevices and
IUnregisterSubdevice::UnregisterSubDevice
I am a bit perplexed by the relationship between
IUnregisterSubdevice::UnregisterSubdevice() and PcRegisterSubdevice().

WDK Docs state that UnregisterSubdevice() “… deletes the registration of a
subdevice that was previousl registered by a call to PcRegisterSubdevice()”

Well, indeed, it seems to do that and much more. It also seems to destroy
the binding of the Port and Miniport for the Port driver that is being
unregistered with the result being that (in this particular case) my Wave
PCI Miniport gets destroyed.

I was not expecting that. More to the point, I am not sure how to put it
back outside of the StartDevice() where I have an PIRP to pass to
IPort::Init() method even if I were to recreate (or keep a reference to the
original) Miniport object.

So how does one actually register / unregister / re-register a PortCls Port
object or more particularly, how - after the Port drops it reference
(binding) to the Miniport, do you put it back when you don’t have an PIRP to
pass into IPort::Init()?

Thanks all,
-dave


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

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

>>
I was going to go back to a W2K RTM Checked build and see what happens but now that I know that it will ASSERT() (but otherwise still ignore it) I will not bother with that effort.
<<

Remember that IUnregisterSubdevice is only available via hotfix (might be in some SPs, also? Don’t know- could have sworn it made Server SP1 and XP SP2, but I may well be wrong) for anything pre-Vista.

>
Thanks for your reply. I am sure this labels me as a novice WDMAudio guy
(and that would not be inaccurate).
<<

Nah- a novice usually sounds a lot more uncertain and probably wouldn’t be able to figure out he/she needed to call IPort::Init in the first place. An experienced dev infrequesntly wandering into the audio arena, maybe.

>
I thought the interns were supposed to do the work :wink:
<<

What, and let them have ALL the fun?

Actually, he’d been stuck for over a week and not getting any substantial help. I find it hard not to offer assistance if I’m reasonably suited in those cases, and since we use DSF a bit in our own tests and I’d like to use it more, it seemed like a good use of my time [I didn’t expect the way things turned out].

Besides, it turned out to be educational for me- I know a lot more about EHCI and those bottom parts of the USB stack than I used to [jury’s out on whether I actually *retain* any of it].

I’ll save the rest for my [soon to be] blog- no need to waste OSR’s space on war stories when Microsoft is willing to provide it.

The QFE is documented in KB835221 http://support.microsoft.com/kb/835221
which also seems to have been further updated by a QFE documented in
KB888111 http://support.microsoft.com/kb/888111

Best I can tell, however, these both contain the same version of PortCls.sys
and that is the only componenent involved in supplying the IUnregisterXxxx
dynamic registration features. The other parts of the QFE(s) are apparently
related to UAA and the HD Audio bus driver, etc.

XP-SP2 and later support the feature. Now I just need to figure out how to
get the QFE - more mail to xxxxx@m-sft I guess…

Thanks again for the help.
-dave

Yes, all of the code supporting the feature lives in portcls.sys.

The ability to dynamically create and remove subdevices was part of the HD audio requirements [I believe the H/W can sense the type(s) of device plugged in, or something to that effect- didn’t matter to much to me- I just shuffle the bits around ;-\>], which is why you need the HD Audio QFEs and / or SPs to have the feature.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Friday, July 20, 2007 9:04 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question about Dynamic Audio Subdevices and IUnregisterSubdevice::UnregisterSubDevice

The QFE is documented in KB835221 http://support.microsoft.com/kb/835221
which also seems to have been further updated by a QFE documented in
KB888111 http://support.microsoft.com/kb/888111

Best I can tell, however, these both contain the same version of PortCls.sys
and that is the only componenent involved in supplying the IUnregisterXxxx
dynamic registration features. The other parts of the QFE(s) are apparently
related to UAA and the HD Audio bus driver, etc.

XP-SP2 and later support the feature. Now I just need to figure out how to
get the QFE - more mail to xxxxx@m-sft I guess…

Thanks again for the help.
-dave