Accessing device configuration space - win kernel PCI device
===

I'm writing method to get pci device, given vendor id, device id programmatically  (just like pci_get_device from Linux kernel). 

For that I need to get device object configuration. I read from here for the same: http://msdn.microsoft.com/en-us/library/windows/hardware/ff558707(v=vs.85).aspx

Now to test this, I made fake driver - service installation framework, which will install my I/O device driver and in that from DriverEntry I can test this PCI functionality. 

But OS crashes with irql_not_less_or_equal, at

    irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP,
                                           targetObject,
                                           NULL,
                                           0,
                                           NULL,
                                           &event,
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> &ioStatusBlock);

Can anyone tell me what's wrong with that, (I'm calling this from Driver Entry, and passing current installing driver's deviceObject.)