HalAssignSlotResources() cause blue screen

I am developing device driver in win2000. My hardware is
an experimental card. There is a bug in our hardware, the
vendor ID in pci config space is 0, so it cannot be enumerated
by window2000 PnP manager. I must scan PCI bus to find our
hardware manually. My solution is to write a legacy driver, and I
use pci_sample from www.osr.com as the template.

I met a problem now, in DriverEntry(), HalAssignSlotResources()
will be called to get memory and interrupt resource, but this
call cause system crash, blue srceen appeared, and memory dump.
I don’t know why.

I don’t use this function, I call HalGetBusDataByOffset() to
get register memory base address and interrupt level from
PCI config space directly. And use this value in HalTranslatBusAddress()
and HalGetInterruptVector().
But I met problem again. I call IoConnectInterrupt() to install my
ISR handler, this function returns successfully. But when my hardware
triggers an interrupt, my ISR handler is not called. It is very strange.
Who can provide me some value information?

some values:
InterruptLine in PCI config space is 0xb, this value is used as
BusInterruptLevel and BusInterruptVector prameters of
HalGetInterrupt() function.

HalGetInterrupt() return translated interrupt vector 0x81, returned
Irql is 0x7, Affinity is 0x3, because I am developing on 2-cpu SMP.

As I know, win2000 driver for a normal PCI device should be WDM driver,
because it can be enumerated by PnP manager. Because my hardware cannot
be enumerated automatically, I am obliged to design a legacy driver,
who can provide another better solution?

Any help is welcomed, thanks!