Bug check - IoGetDeviceProperty

I have a bus driver that covers several different devices. At START_DEVICE
time, I need to identify the device so that I can create the proper number of
child devices. I use calls to IoGetDeviceProperty() to do this. Everything has
been working fine for months, but now on an occasional computer we are seeing a
bugcheck 0xCA, type 2. I’ve done some postmortem and determined that the
bugcheck occurs when the driver calls IoGetDeviceProperty().

Actually, the bugcheck occurs on Windows 2000. On XP, the system doesn’t
trap, but IoGetDeviceProperty() returns STATUS_INVALID_DEVICE_REQUEST. This is
essentially the same status in a less violent form.

I’m at a loss as to why this error occurs at all. The type 2 violation
indicates a bogus PDO pointer. I’m using the PDO pointer given to me by
IoAttachDeviceToDeviceStack() at AddDevice time. I have verified that the
pointer is not changing. How can the kernel gripe about a PDO pointer that it
generated when my device was enumerated and later handed to me when I attached?

I saw one posting from about a year ago where someone else bumped into this,
but there was no substantive followup. Just wondering if anyone else knows
anything about it.

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.


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

Just checking, but you say that you are using the DeviceObject returned by
IoAttachDeviceToDeviceStack, as a PDO when in fact what is returned by
IoAttachDeviceToDeviceStack is the device object you are stacked on top of,
which may or may not be a PDO. You were given the PDO in AddDevice, (and you
used it when you called IoAttachDeviceToDeviceStack,) that device object is
the one you should use for your call to IoGetDeviceProperty.

-----Original Message-----
From: Chris Myers [mailto:xxxxx@quatech.com]
Sent: Thursday, February 21, 2002 4:10 PM
To: NT Developers Interest List
Subject: [ntdev] Bug check - IoGetDeviceProperty

I have a bus driver that covers several different
devices. At START_DEVICE time, I need to identify the device
so that I can create the proper number of child devices. I
use calls to IoGetDeviceProperty() to do this. Everything
has been working fine for months, but now on an occasional
computer we are seeing a bugcheck 0xCA, type 2. I’ve done
some postmortem and determined that the bugcheck occurs when
the driver calls IoGetDeviceProperty().

Actually, the bugcheck occurs on Windows 2000. On XP,
the system doesn’t trap, but IoGetDeviceProperty() returns
STATUS_INVALID_DEVICE_REQUEST. This is essentially the same
status in a less violent form.

I’m at a loss as to why this error occurs at all. The
type 2 violation indicates a bogus PDO pointer. I’m using
the PDO pointer given to me by
IoAttachDeviceToDeviceStack() at AddDevice time. I have
verified that the pointer is not changing. How can the
kernel gripe about a PDO pointer that it generated when my
device was enumerated and later handed to me when I attached?

I saw one posting from about a year ago where someone
else bumped into this, but there was no substantive followup.
Just wondering if anyone else knows anything about it.

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.


You are currently subscribed to ntdev as:
xxxxx@stratus.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

** Reply to message from “Roddy, Mark” on Fri, 22 Feb
2002 08:17:36 -0500

Mark,

> Just checking, but you say that you are using the DeviceObject returned by
> IoAttachDeviceToDeviceStack, as a PDO when in fact what is returned by
> IoAttachDeviceToDeviceStack is the device object you are stacked on top of,
> which may or may not be a PDO. You were given the PDO in AddDevice, (and you
> used it when you called IoAttachDeviceToDeviceStack,) that device object is
> the one you should use for your call to IoGetDeviceProperty.

I think you’ve nailed it there. It’s always such fun to miss something so
simple and have it come back to bite you in the @$$ :-)! Every machine I’ve
worked on has had the two values be the same in all of my drivers, so I never
noticed this before. There’s obviously some kind of filter slipping in between
on the problem machines. Anyway, I don’t think I’ll be making this particular
mistake again. Thanks!!!

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.


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

> I’m at a loss as to why this error occurs at all. The type 2 violation

indicates a bogus PDO pointer.

Try disassembling IoGetDeviceProperty.

Max