Re: not enumerated PCI device

Using the HAL functions is very likely the wrong approach here.

Are you sure it is because of the vendor ID that this device cannot be enumerated? Zero should be a valid vendor ID value from the PCI spec’s point of view. I am not sure about the PCI SIG though, unless this device is from Intel Microsystems (M) Sdn Bhd or Teknor Applicom, Inc., in which case the device is likely a bridge device and unaccessible by your driver anyway.


Bill McKenzie
Windows DDK MVP
OSR - Windows System Software Development, Training, and Consulting

wrote in message news:xxxxx@ntdev…
My driver’s target is a PCI device, but it’s Vendor ID is 0, so it cannot be enumerated by Win2000 PnP manager, so I must write a legacy driver, I use pci_sample from www.osr.com as the template.
The problem is when DriverEntry() reachs HalAssignSlotResource(), system crashes with blue screen, screen snapshot is:

STOP: 0x0000001E (0xC0000005, 0x804560DC, 0x00000001, 0x00001100)
KMODE_EXCEPTION_NOT_HANDLED
Address 804560DC base at 80400000, DateStamp 3d362a77-ntoskrnl.exe

In Win2000 DDK documents, HalAssignSlotResource() is said to be an obsolete function, IoReportDetectedDevice() should be used instead, I tried this one, use DDK sample kernel/serial as the template, I get Memory and Interrupt information of my PCI device from PCI config space using HalGetBusDataByOffset(), then build a CM_RESOURCE_LIST, then call IoReportDetectedDevice(), but blue screen appeared again.

Anyone met similar problem? If HalAssignSlotResource() must be called in DriverEntry()? I don’t call this funtion, get memory and interrupt info from PCI config space, translate them using HalTranslateBusAddress(), MmapIoSpace() and GetInterruptVector(), then call IoConnectInterrupt(), this call success, but when my PCI device trigger interrupt, the ISR handler which I set in IoConnectInterrupt() is not called. I am annoyed.

Any help is welcomed, thanks!

??TOM???Ƴ???·??? ???ղؼС?
???ŷ??͵?800+?Լ??ֻ???룬???ɽ???Ϣ???ղؼС?
???ʹ???ٶ??Ķ???Ҳ???û???ˣ???뿴http://www.163.net/sms/save/

??[ÿ??һЦ] Í»???ò???Ò»?죬?ܶ???ı??ij???г???Ô±??ְλ???Ï£???о??í¾¹???Ò»???
??[ÿ???] ???ҵ???ָ?ϣ???߳???̳???졣???Ƿ??¶???֣???ţ???ԡ???

163.net ?Õ·??? 163.net ???
?×½???
(100 M ,?ɷ?10M???) ?ƽ???
(60 M ,?É·?10M???) Fax to Email
???Õ´??? Email to Fax
???ä·¢?Í´???
300Ôª/??
(??1200???ʼ???) 180Ԫ/??
(??720???ʼ???) 25Ԫ/??
(???Þ½??Õ´???) ???Ô¤??200Ôª
(???ñȳ?;???)
???ɱ?? | ???ʼ??? | ֧???ֻ??ʼ?
??? | ʡֽʡʱ | Ⱥ??? | ???

Hi, Mark

Thank you for your reply, Actually I have looked into windbg document in
regarding BUGCHECK 0xC2.
This BSOD was caused that our kernel mode driver passed NULL POINTER to
ExFreePool. maybe I though it did not take care about NULL POINTER.
As I have not developped kernel mode driver, I would like to know whether
BUGCHEC 0xC2 occurs or not whenever kernel mode driver passed NULL POINTER
to ExFreePool.

Thanks in advance,
Futoshi

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, September 11, 2002 9:39 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

See “Bug Check 0xC2: BAD_POOL_CALLER” in the section “Bug Check Code
Reference” in the latest windbg documentation for complete information
about this bugcheck code.

It is certainly a fatal error to call ExFreePool with any invalid
address.

Will you always get this bugcheck? I give up, probably.

===========================
Mark Roddy
Consultant, Microsoft DDK MVP
Hollis Technology Solutions
xxxxx@hollistech.com
www.hollistech.com
603-321-1032

-----Original Message-----
From: xxxxx@citrix.co.jp
To: “NT Developers Interest List”
Date: Wed, 11 Sep 2002 18:03:33 +0900
Subject: [ntdev] [BugCheck 0xC2]

> Hi, all
>
> I have an quick question.
> If kernel mode driver try to free null poiner using nt!ExFreePool(),
> Can we
> say that we can get BSOD with BugCheck 0xC2 absolutely?
>
> I had an experience so that get BSOD with BugCheck 0xC2 when kernel
> mode
> driver try to do so.
>
> Thanks in advance,
> Futoshi
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@citrix.co.jp
To unsubscribe send a blank email to %%email.unsub%%

Yes ExFreePool will bugcheck on null pointer.

-----Original Message-----
From: xxxxx@citrix.co.jp [mailto:xxxxx@citrix.co.jp]
Sent: Wednesday, September 11, 2002 10:38 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Hi, Mark

Thank you for your reply, Actually I have looked into windbg
document in regarding BUGCHECK 0xC2. This BSOD was caused
that our kernel mode driver passed NULL POINTER to
ExFreePool. maybe I though it did not take care about NULL
POINTER. As I have not developped kernel mode driver, I would
like to know whether BUGCHEC 0xC2 occurs or not whenever
kernel mode driver passed NULL POINTER to ExFreePool.

Thanks in advance,
Futoshi

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, September 11, 2002 9:39 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

See “Bug Check 0xC2: BAD_POOL_CALLER” in the section “Bug Check Code
Reference” in the latest windbg documentation for complete
information
about this bugcheck code.

It is certainly a fatal error to call ExFreePool with any invalid
address.

Will you always get this bugcheck? I give up, probably.

===========================
Mark Roddy
Consultant, Microsoft DDK MVP
Hollis Technology Solutions
xxxxx@hollistech.com
www.hollistech.com
603-321-1032

-----Original Message-----
From: xxxxx@citrix.co.jp
To: “NT Developers Interest List”
> Date: Wed, 11 Sep 2002 18:03:33 +0900
> Subject: [ntdev] [BugCheck 0xC2]
>
> > Hi, all
> >
> > I have an quick question.
> > If kernel mode driver try to free null poiner using
> nt!ExFreePool(),
> > Can we say that we can get BSOD with BugCheck 0xC2 absolutely?
> >
> > I had an experience so that get BSOD with BugCheck 0xC2 when kernel
> > mode driver try to do so.
> >
> > Thanks in advance,
> > Futoshi
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hollistech.com To
> > unsubscribe send a blank email to %%email.unsub%%
>
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@citrix.co.jp To unsubscribe send a blank email
> to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> %%email.unsub%%
>

Thanks Roddy,

I would like to know whether we can say that we lead to BUGCHECK 0xC2 or
not whenever kernel mode driver passed NULL POINTER to nt!ExFreePool.

Thanks a lot.

Futoshi

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, September 12, 2002 9:46 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Yes ExFreePool will bugcheck on null pointer.

-----Original Message-----
From: xxxxx@citrix.co.jp [mailto:xxxxx@citrix.co.jp]
Sent: Wednesday, September 11, 2002 10:38 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Hi, Mark

Thank you for your reply, Actually I have looked into windbg
document in regarding BUGCHECK 0xC2. This BSOD was caused
that our kernel mode driver passed NULL POINTER to
ExFreePool. maybe I though it did not take care about NULL
POINTER. As I have not developped kernel mode driver, I would
like to know whether BUGCHEC 0xC2 occurs or not whenever
kernel mode driver passed NULL POINTER to ExFreePool.

Thanks in advance,
Futoshi

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, September 11, 2002 9:39 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

See “Bug Check 0xC2: BAD_POOL_CALLER” in the section “Bug Check Code
Reference” in the latest windbg documentation for complete
information
about this bugcheck code.

It is certainly a fatal error to call ExFreePool with any invalid
address.

Will you always get this bugcheck? I give up, probably.

===========================
Mark Roddy
Consultant, Microsoft DDK MVP
Hollis Technology Solutions
xxxxx@hollistech.com
www.hollistech.com
603-321-1032

-----Original Message-----
From: xxxxx@citrix.co.jp
To: “NT Developers Interest List”
> Date: Wed, 11 Sep 2002 18:03:33 +0900
> Subject: [ntdev] [BugCheck 0xC2]
>
> > Hi, all
> >
> > I have an quick question.
> > If kernel mode driver try to free null poiner using
> nt!ExFreePool(),
> > Can we say that we can get BSOD with BugCheck 0xC2 absolutely?
> >
> > I had an experience so that get BSOD with BugCheck 0xC2 when kernel
> > mode driver try to do so.
> >
> > Thanks in advance,
> > Futoshi
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hollistech.com To
> > unsubscribe send a blank email to %%email.unsub%%
>
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@citrix.co.jp To unsubscribe send a blank email
> to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@citrix.co.jp
To unsubscribe send a blank email to %%email.unsub%%

bugcheck 0xc2 occurs for many “bad” uses of pool. There is no specific
check for NULL but using a NULL pointer would probably turn into an
attempt to free unallocated memory and thus cause this bugcheck.

you should consider not handing NULL into ExFreePool.

-p

-----Original Message-----
From: xxxxx@citrix.co.jp [mailto:xxxxx@citrix.co.jp]
Sent: Thursday, September 12, 2002 7:44 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Thanks Roddy,

I would like to know whether we can say that we lead to BUGCHECK 0xC2
or not whenever kernel mode driver passed NULL POINTER to nt!ExFreePool.

Thanks a lot.

Futoshi

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, September 12, 2002 9:46 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Yes ExFreePool will bugcheck on null pointer.

-----Original Message-----
From: xxxxx@citrix.co.jp [mailto:xxxxx@citrix.co.jp]
Sent: Wednesday, September 11, 2002 10:38 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

Hi, Mark

Thank you for your reply, Actually I have looked into windbg
document in regarding BUGCHECK 0xC2. This BSOD was caused
that our kernel mode driver passed NULL POINTER to
ExFreePool. maybe I though it did not take care about NULL
POINTER. As I have not developped kernel mode driver, I would
like to know whether BUGCHEC 0xC2 occurs or not whenever
kernel mode driver passed NULL POINTER to ExFreePool.

Thanks in advance,
Futoshi

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, September 11, 2002 9:39 PM
To: NT Developers Interest List
Subject: [ntdev] Re: [BugCheck 0xC2]

See “Bug Check 0xC2: BAD_POOL_CALLER” in the section “Bug Check Code
Reference” in the latest windbg documentation for complete
information
about this bugcheck code.

It is certainly a fatal error to call ExFreePool with any invalid
address.

Will you always get this bugcheck? I give up, probably.

===========================
Mark Roddy
Consultant, Microsoft DDK MVP
Hollis Technology Solutions
xxxxx@hollistech.com
www.hollistech.com
603-321-1032

-----Original Message-----
From: xxxxx@citrix.co.jp
To: “NT Developers Interest List”
> Date: Wed, 11 Sep 2002 18:03:33 +0900
> Subject: [ntdev] [BugCheck 0xC2]
>
> > Hi, all
> >
> > I have an quick question.
> > If kernel mode driver try to free null poiner using
> nt!ExFreePool(),
> > Can we say that we can get BSOD with BugCheck 0xC2 absolutely?
> >
> > I had an experience so that get BSOD with BugCheck 0xC2 when kernel
> > mode driver try to do so.
> >
> > Thanks in advance,
> > Futoshi
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hollistech.com To
> > unsubscribe send a blank email to %%email.unsub%%
>
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@citrix.co.jp To unsubscribe send a blank email
> to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@citrix.co.jp
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to %%email.unsub%%