From: Hasitha on
Hi all,
Thank you very much in advance.

I am writing 3 drivers for one PCI device. Each driver have separate
functionality.
they are use interrupts. I use

NtStatus = HalAssignSlotResources (RegistryPath,
NULL,
pDriverObject,
pDeviceObject,
PCIBus,
bus_number,
slot.u.AsULONG,
&Resources);
for(i= 0; i<Resources->List[0].PartialResourceList.Count; i++){
if(Resources->List[0].PartialResourceList.PartialDescriptors[i].Type
==CmResourceTypeInterrupt ){
intLeval
=Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Level;

intVector=Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Vector;
}

}
ShareVector = TRUE;

MappedVector = HalGetInterruptVector(
FILE_DEVICE_UNKNOWN, // Interface type
bus_number, // Bus number
Leval, // Bus interrupt level
Vector, // Bus interrupt vector
&irql, // IRQ level
&Affinity // Affinity mask
);

NtStatus = IoConnectInterrupt(
&(pDevEex->InterruptObject),
adc_driver_isr,
pDeviceObject,
NULL,
MappedVector,
irql,
irql,
LevelSensitive,//Latched,
ShareVector,
Affinity,
FALSE
);
Function to register interrupts.

Problem is i cannot use that drivers simultaneously. Get Blue Screens.
What wold be the reason for it.
your corporation is highly appreciated.

From: Alexander Grigoriev on
Why are you using HalAssignSlotResources? You should write a WDM PNP driver,
and you'll be getting your resources in your IRP_MJ_START_DEVICE handler.


"Hasitha" <Hasitha(a)discussions.microsoft.com> wrote in message
news:C652F62D-3814-4AC3-A06A-3588B4CC420F(a)microsoft.com...
> Hi all,
> Thank you very much in advance.
>
> I am writing 3 drivers for one PCI device. Each driver have separate
> functionality.
> they are use interrupts. I use
>
> NtStatus = HalAssignSlotResources (RegistryPath,
> NULL,
> pDriverObject,
> pDeviceObject,
> PCIBus,
> bus_number,
> slot.u.AsULONG,
> &Resources);
> for(i= 0; i<Resources->List[0].PartialResourceList.Count; i++){
> if(Resources->List[0].PartialResourceList.PartialDescriptors[i].Type
> ==CmResourceTypeInterrupt ){
> intLeval
> =Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Level;
>
> intVector=Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Vector;
> }
>
> }
> ShareVector = TRUE;
>
> MappedVector = HalGetInterruptVector(
> FILE_DEVICE_UNKNOWN, // Interface type
> bus_number, // Bus number
> Leval, // Bus interrupt level
> Vector, // Bus interrupt vector
> &irql, // IRQ level
> &Affinity // Affinity mask
> );
>
> NtStatus = IoConnectInterrupt(
> &(pDevEex->InterruptObject),
> adc_driver_isr,
> pDeviceObject,
> NULL,
> MappedVector,
> irql,
> irql,
> LevelSensitive,//Latched,
> ShareVector,
> Affinity,
> FALSE
> );
> Function to register interrupts.
>
> Problem is i cannot use that drivers simultaneously. Get Blue Screens.
> What wold be the reason for it.
> your corporation is highly appreciated.
>


From: Hasitha on
Thankx for the responce.

> Why are you using HalAssignSlotResources? You should write a WDM PNP driver,
> and you'll be getting your resources in your IRP_MJ_START_DEVICE handler.
Currently i am use DDK to develop driver.
I do not want to use PNP drivers.
what should be the reson for the error.


"Alexander Grigoriev" wrote:

> Why are you using HalAssignSlotResources? You should write a WDM PNP driver,
> and you'll be getting your resources in your IRP_MJ_START_DEVICE handler.
>
>
> "Hasitha" <Hasitha(a)discussions.microsoft.com> wrote in message
> news:C652F62D-3814-4AC3-A06A-3588B4CC420F(a)microsoft.com...
> > Hi all,
> > Thank you very much in advance.
> >
> > I am writing 3 drivers for one PCI device. Each driver have separate
> > functionality.
> > they are use interrupts. I use
> >
> > NtStatus = HalAssignSlotResources (RegistryPath,
> > NULL,
> > pDriverObject,
> > pDeviceObject,
> > PCIBus,
> > bus_number,
> > slot.u.AsULONG,
> > &Resources);
> > for(i= 0; i<Resources->List[0].PartialResourceList.Count; i++){
> > if(Resources->List[0].PartialResourceList.PartialDescriptors[i].Type
> > ==CmResourceTypeInterrupt ){
> > intLeval
> > =Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Level;
> >
> > intVector=Resources->List[0].PartialResourceList.PartialDescriptors[i].u.Interrupt.Vector;
> > }
> >
> > }
> > ShareVector = TRUE;
> >
> > MappedVector = HalGetInterruptVector(
> > FILE_DEVICE_UNKNOWN, // Interface type
> > bus_number, // Bus number
> > Leval, // Bus interrupt level
> > Vector, // Bus interrupt vector
> > &irql, // IRQ level
> > &Affinity // Affinity mask
> > );
> >
> > NtStatus = IoConnectInterrupt(
> > &(pDevEex->InterruptObject),
> > adc_driver_isr,
> > pDeviceObject,
> > NULL,
> > MappedVector,
> > irql,
> > irql,
> > LevelSensitive,//Latched,
> > ShareVector,
> > Affinity,
> > FALSE
> > );
> > Function to register interrupts.
> >
> > Problem is i cannot use that drivers simultaneously. Get Blue Screens.
> > What wold be the reason for it.
> > your corporation is highly appreciated.
> >
>
>
>
From: Tim Roberts on
Hasitha <Hasitha(a)discussions.microsoft.com> wrote:
>
>> Why are you using HalAssignSlotResources? You should write a WDM PNP driver,
>> and you'll be getting your resources in your IRP_MJ_START_DEVICE handler.
>
>Currently i am use DDK to develop driver.
>I do not want to use PNP drivers.
>what should be the reson for the error.

The reason is that you are using an unsupported mechanism to get your
resources. You should write your driver as a PnP driver. How do you
expect to install your driver?
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: Hasitha on
> The reason is that you are using an unsupported mechanism to get your
> resources. You should write your driver as a PnP driver. How do you
> expect to install your driver?
I am new for the this fied. I got info from here.
http://support.microsoft.com/default.aspx/kb/152044
if i write PNP driver can i use 2 drivers whth interrupt in same device.


"Tim Roberts" wrote:

> Hasitha <Hasitha(a)discussions.microsoft.com> wrote:
> >
> >> Why are you using HalAssignSlotResources? You should write a WDM PNP driver,
> >> and you'll be getting your resources in your IRP_MJ_START_DEVICE handler.
> >
> >Currently i am use DDK to develop driver.
> >I do not want to use PNP drivers.
> >what should be the reson for the error.
>
> The reason is that you are using an unsupported mechanism to get your
> resources. You should write your driver as a PnP driver. How do you
> expect to install your driver?
> --
> Tim Roberts, timr(a)probo.com
> Providenza & Boekelheide, Inc.
>