IRP_MN_QUERY_DEVICE_RELATIONS related query

hi

While handling IRP_MN_QUERY_DEVICE_RELATIONS Toaster samples says to free
any existing oldRelations while filling in new relations.

code snippet from toaster sample
//
// Replace the relations structure in the IRP with the new
// one.
//
if (oldRelations) {
ExFreePool (oldRelations);
}

i follow the same method in my driver.

but when doing WHQL tests, driver verifier says i am trying to free invalid
memory.

am i missing out something or is there any other way around to solve this.

Sanesh.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

hi,

While handling IRP_MN_QUERY_DEVICE_RELATIONS Toaster samples says to free
any existing oldRelations while filling in new relations.

code snippet from toaster sample
//
// Replace the relations structure in the IRP with the new
// one.
//
if (oldRelations) {
ExFreePool (oldRelations);
}

i follow the same method in my driver.

I have written some bus extender too. One of them for virtual port
driver, but I have never seen a oldRelation. I ignore in my code
the old entry and setup a new one.

elli


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

— Mathias Ellinger wrote:
> hi,
>
> >While handling IRP_MN_QUERY_DEVICE_RELATIONS Toaster samples says to free
> >any existing oldRelations while filling in new relations.
>
> code snippet from toaster sample
> //
> // Replace the relations structure in the IRP with the new
> // one.
> //
> if (oldRelations) {
> ExFreePool (oldRelations);
> }
>
> >i follow the same method in my driver.
>
> I have written some bus extender too. One of them for virtual port
> driver, but I have never seen a oldRelation. I ignore in my code
> the old entry and setup a new one.

But what problem prevents you from doing as the sample says?

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello ,

NR> But what problem prevents you from doing as the sample says?

Sanesh Kumark has had a problem with driver verifier when he has
delete the oldReleation reference.

I don’t now why Elias has written this code.

if (oldRelations) {
ExFreePool (oldRelations);
}
I habve never seen a oldRelations reference here.

for my knowledge, only a bus driver (PDO) can (must) answer the
IRP_MN_QUERY_DEVICE_RELATIONS request and it is not possible
(usefull ??)that a higher driver (FDO) in the stack can answer.

elli


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Sanesh Kumark has had a problem with driver verifier when he has

delete the oldReleation reference.

I don’t now why Elias has written this code.

>if (oldRelations) {
> ExFreePool (oldRelations);
> }
I habve never seen a oldRelations reference here.

for my knowledge, only a bus driver (PDO) can (must) answer the
IRP_MN_QUERY_DEVICE_RELATIONS request and it is not possible
(usefull ??)that a higher driver (FDO) in the stack can answer.

I heard an opinion (I might be wrong, it seems from a Walter Oney’s
sample) that a (bus?) filter can put something there, so the bus driver
should append its PDO’s to those put by the filter. It is not surprising
that you never saw this, neither did I. However, probably it might happen.
I hope Elias and Walter will say something… Because DDK samples are an
alternative documentation of a sort, so they shouldn’t do strange things.
Also, it is not obvious to me why the PnP architecture should deny
any driver in the stack, except the bus driver, an opportunity to
generate a PDO.

But what did the Driver Verifier say to Sanesh Kumark?


Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi

It says BugCheck 0xC4, DRIVER_VERIFIER_DETECTED_VIOLATION P1=16

P16 means, attempting to free the pool at bad address, passing invalid
address to memory routine.

With Regards,
Sanesh Kumar K

-----Original Message-----
From: Ntdev Reader [mailto:xxxxx@yahoo.com]
Sent: 22 December 2001 11:40 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRP_MN_QUERY_DEVICE_RELATIONS related query

Sanesh Kumark has had a problem with driver verifier when he has
delete the oldReleation reference.

I don’t now why Elias has written this code.

>if (oldRelations) {
> ExFreePool (oldRelations);
> }
I habve never seen a oldRelations reference here.

for my knowledge, only a bus driver (PDO) can (must) answer the
IRP_MN_QUERY_DEVICE_RELATIONS request and it is not possible
(usefull ??)that a higher driver (FDO) in the stack can answer.

I heard an opinion (I might be wrong, it seems from a Walter Oney’s
sample) that a (bus?) filter can put something there, so the bus driver
should append its PDO’s to those put by the filter. It is not surprising
that you never saw this, neither did I. However, probably it might happen.
I hope Elias and Walter will say something… Because DDK samples are an
alternative documentation of a sort, so they shouldn’t do strange things.
Also, it is not obvious to me why the PnP architecture should deny
any driver in the stack, except the bus driver, an opportunity to
generate a PDO.

But what did the Driver Verifier say to Sanesh Kumark?


Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


You are currently subscribed to ntdev as: xxxxx@ctd.hcltech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

So, is this supposed to mean that the Verifier has put an invalid
address there to verify if you attempt, as the DDK sample suggests,
to free it and replace it with your pointer? And when you did it
it called BugCheck? Very strange. My driver does this and the
Verifier does not object.

— “Sanesh Kumar k - CTD, Chennai.” wrote:
> Hi
>
> It says BugCheck 0xC4, DRIVER_VERIFIER_DETECTED_VIOLATION P1=16
>
> P16 means, attempting to free the pool at bad address, passing invalid
> address to memory routine.
>
>
> With Regards,
> Sanesh Kumar K
>
> -----Original Message-----
> From: Ntdev Reader [mailto:xxxxx@yahoo.com]
> Sent: 22 December 2001 11:40 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: IRP_MN_QUERY_DEVICE_RELATIONS related query
>
>
> > Sanesh Kumark has had a problem with driver verifier when he has
> > delete the oldReleation reference.
> >
> > I don’t now why Elias has written this code.
> >
> > >if (oldRelations) {
> > > ExFreePool (oldRelations);
> > > }
> > I habve never seen a oldRelations reference here.
> >
> > for my knowledge, only a bus driver (PDO) can (must) answer the
> > IRP_MN_QUERY_DEVICE_RELATIONS request and it is not possible
> > (usefull ??)that a higher driver (FDO) in the stack can answer.
>
> I heard an opinion (I might be wrong, it seems from a Walter Oney’s
> sample) that a (bus?) filter can put something there, so the bus driver
> should append its PDO’s to those put by the filter. It is not surprising
> that you never saw this, neither did I. However, probably it might happen.
> I hope Elias and Walter will say something… Because DDK samples are an
> alternative documentation of a sort, so they shouldn’t do strange things.
> Also, it is not obvious to me why the PnP architecture should deny
> any driver in the stack, except the bus driver, an opportunity to
> generate a PDO.
>
> But what did the Driver Verifier say to Sanesh Kumark?
>
>
>
>
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@ctd.hcltech.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com