First of all sorry for bothering you. I know that my question is not related directly to file systems, but I just don’t know who can help me. May be you can at least forward me to the right place to ask the question.
I’m trying to write virtual device driver for WinXP that will handle some interrupt. As far as I understood it I need to claim interrupt resource using IoReportResourceForDetection, then register my device using IoReportDetectedDevice and then connect ISR to the interrupt vector using IoConnectInterrupt.
My problem starts with IoReportResourceForDetection - I tried any vector 32-255 and always received the same answer - conflicts detected. My interrupt is level and shared. Here is the code excerpt:
BOOLEAN Reserve_Vector( IN PDRIVER_OBJECT DriverObject,
OUT PCM_RESOURCE_LIST ReservedInterrupt )
{
NTSTATUS Status;
BOOLEAN ConflictFound = FALSE;
DbgPrint(“TestDevice Reserve_Vector: try to reserve recommended vector %d\r\n”, RECOMMENDED_VECTOR);
if (! ReservedInterrupt)
{
return FALSE;
}
// init resource list with the only resource - interrupt vector
ReservedInterrupt->Count = 1;
ReservedInterrupt->List[0].InterfaceType = InterfaceTypeUndefined;
ReservedInterrupt->List[0].BusNumber = 0;
ReservedInterrupt->List[0].PartialResourceList.Version = 1;
ReservedInterrupt->List[0].PartialResourceList.Revision = 1;
ReservedInterrupt->List[0].PartialResourceList.Count = 1;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareShared;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = DISPATCH_LEVEL+1;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = RECOMMENDED_VECTOR;
ReservedInterrupt->List[0].PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = (ULONG)-1;
// try recommended first
Status = IoReportResourceForDetection( DriverObject,
ReservedInterrupt,
sizeof(CM_RESOURCE_LIST),
NULL,
NULL,
0,
&ConflictFound);
if ((Status == STATUS_SUCCESS) && (!ConflictFound))
{
// recommended reserved
return TRUE;
}
if ((Status == STATUS_CONFLICTING_ADDRESSES) && ConflictFound)
{
DbgPrint(“TestDevice Reserve_Vector: recommended vector reservation %d is conflicting. Try other\r\n”, RECOMMENDED_VECTOR);
return FALSE;
}
…
–
?? Dmitry Kaptsenel, Intel Software Solutions Group