interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is running (with DebuPrint),
and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.

What kind of interrupt (usb or a hardware interrupt)? What kind of
problem? A bugcheck? An interrupt storm? The more details you provide,
the more help you can get.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is
running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

hi Doron,

Thank you for your respond. I hav
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, July 24, 2007 1:48 PM
Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)? What kind of problem? A bugcheck? An interrupt storm? The more details you provide, the more help you can get.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Doron,

Thank you for your respond. I have hardware interrupt and it works correct when I run Checked driver version,
but ISR is not called when I run Free version. In first case I use DebugPrint.

Andrew
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, July 24, 2007 1:48 PM
Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)? What kind of problem? A bugcheck? An interrupt storm? The more details you provide, the more help you can get.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Please post the code in your start device handler which connects the
interrupt, DbgPrint really should not have anything to do with this.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 2:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

Hi Doron,

Thank you for your respond. I have hardware interrupt and it works
correct when I run Checked driver version,

but ISR is not called when I run Free version. In first case I use
DebugPrint.

Andrew

----- Original Message -----

From: Doron Holan mailto:xxxxx

To: Windows System Software Devs Interest List
mailto:xxxxx

Sent: Tuesday, July 24, 2007 1:48 PM

Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)? What kind
of problem? A bugcheck? An interrupt storm? The more details you
provide, the more help you can get.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version
is running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

I do nothing special in case: IRP_MN_START_DEVICE.

NTSTATUS
MyDispatchPnp (… )

case IRP_MN_START_DEVICE:

IoCopyCurrentIrpStackLocationToNext(Irp);

KeInitializeEvent(&event, NotificationEvent,
FALSE
);

IoSetCompletionRoutine(Irp,
(PIO_COMPLETION_ROUTINE) MyCompletionRoutine,
&event,
TRUE,
TRUE,
TRUE);

status = IoCallDriver(dInfo->NextLowerDriver, Irp);

if (STATUS_PENDING == status) {
KeWaitForSingleObject(
&event,
Executive, // Waiting for reason of a driver
KernelMode, // Must be kernelmode if event memory is in stack
FALSE, // No allert
NULL); // No timeout
}

if (NT_SUCCESS(status) && NT_SUCCESS(Irp->IoStatus.Status)) {

status = MyStartDevice(DeviceObject, Irp);
if(NT_SUCCESS(status))
{

status = CreateMyThread(dInfo);

if (!NT_SUCCESS (status))
return status;

}
}

status = IoSetDeviceInterfaceState(&dInfo->InterfaceName, TRUE);

if (NT_SUCCESS (status)) {
SET_NEW_PNP_STATE(dInfo, Started);
}
else
{
DebugPrint((“IoSetDeviceInterfaceState failed: 0x%x\n”, status));
return status;
}

Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

IoReleaseRemoveLock(&dInfo->RemoveLock, Irp);
return status;

I call IoConnectInterrupt and enable interrupt in MyDispatchPnp (see below)

NTSTATUS MyDispatchPnp (…)

{

status = IoConnectInterrupt( &dInfo->InterruptObject, (PKSERVICE_ROUTINE)MyIsr, (PVOID)dInfo, NULL,
dInfo->InterruptVector, dInfo->InterruptLevel, dInfo->InterruptLevel,
dInfo->InterruptMode, dInfo->InterruptShare, dInfo->InterruptAffinity, FALSE);

if ( !NT_SUCCESS(status) )
{
DebugPrint((“Unable to install ISR\n”));
}
else
{
DebugPrint((“Installed ISR for interrupt\n”));

// enable interrupt here
KeSynchronizeExecution( dInfo->InterruptObject, EnableChipInterrupt, dInfo );
}

status = initialize(dInfo);

if(status!=STATUS_SUCCESS) {
DebugPrint((“Inititilize() failed: %08x\n”,status));
return status;
}

KeInitializeEvent( &dInfo->PollThreadEvent, NotificationEvent, FALSE );

return status;
}

}

Thank you

----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, July 24, 2007 2:17 PM
Subject: RE: [ntdev] interrupt: Free and Release

Please post the code in your start device handler which connects the interrupt, DbgPrint really should not have anything to do with this.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 2:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

Hi Doron,

Thank you for your respond. I have hardware interrupt and it works correct when I run Checked driver version,

but ISR is not called when I run Free version. In first case I use DebugPrint.

Andrew

----- Original Message -----

From: Doron Holan

To: Windows System Software Devs Interest List

Sent: Tuesday, July 24, 2007 1:48 PM

Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)? What kind of problem? A bugcheck? An interrupt storm? The more details you provide, the more help you can get.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Did you mean that IoConnectInterrupt is called from MyStartDevice, not
MyDIspatchPnp? Does initialize() enable the interrupt in hw?

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 3:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

I do nothing special in case: IRP_MN_START_DEVICE.

NTSTATUS
MyDispatchPnp (… )

case IRP_MN_START_DEVICE:

IoCopyCurrentIrpStackLocationToNext(Irp);

KeInitializeEvent(&event, NotificationEvent,
FALSE
);

IoSetCompletionRoutine(Irp,
(PIO_COMPLETION_ROUTINE)
MyCompletionRoutine,
&event,
TRUE,
TRUE,
TRUE);

status = IoCallDriver(dInfo->NextLowerDriver, Irp);

if (STATUS_PENDING == status) {
KeWaitForSingleObject(
&event,
Executive, // Waiting for reason of a driver
KernelMode, // Must be kernelmode if event memory is in
stack
FALSE, // No allert
NULL); // No timeout
}

if (NT_SUCCESS(status) && NT_SUCCESS(Irp->IoStatus.Status)) {

status = MyStartDevice(DeviceObject, Irp);
if(NT_SUCCESS(status))
{

status = CreateMyThread(dInfo);

if (!NT_SUCCESS (status))
return status;

}
}

status = IoSetDeviceInterfaceState(&dInfo->InterfaceName, TRUE);

if (NT_SUCCESS (status)) {
SET_NEW_PNP_STATE(dInfo, Started);
}
else
{
DebugPrint((“IoSetDeviceInterfaceState failed: 0x%x\n”,
status));
return status;
}

Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

IoReleaseRemoveLock(&dInfo->RemoveLock, Irp);
return status;

I call IoConnectInterrupt and enable interrupt in MyDispatchPnp (see
below)

NTSTATUS MyDispatchPnp (…)

{

status = IoConnectInterrupt( &dInfo->InterruptObject,
(PKSERVICE_ROUTINE)MyIsr, (PVOID)dInfo, NULL,
dInfo->InterruptVector, dInfo->InterruptLevel,
dInfo->InterruptLevel,
dInfo->InterruptMode, dInfo->InterruptShare,
dInfo->InterruptAffinity, FALSE);

if ( !NT_SUCCESS(status) )
{
DebugPrint((“Unable to install ISR\n”));
}
else
{
DebugPrint((“Installed ISR for interrupt\n”));

// enable interrupt here
KeSynchronizeExecution( dInfo->InterruptObject,
EnableChipInterrupt, dInfo );
}

status = initialize(dInfo);

if(status!=STATUS_SUCCESS) {
DebugPrint((“Inititilize() failed: %08x\n”,status));
return status;
}

KeInitializeEvent( &dInfo->PollThreadEvent, NotificationEvent, FALSE );

return status;
}

}

Thank you

----- Original Message -----

From: Doron Holan mailto:xxxxx

To: Windows System Software Devs Interest List
mailto:xxxxx

Sent: Tuesday, July 24, 2007 2:17 PM

Subject: RE: [ntdev] interrupt: Free and Release

Please post the code in your start device handler which connects
the interrupt, DbgPrint really should not have anything to do with this.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 2:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

Hi Doron,

Thank you for your respond. I have hardware interrupt and it
works correct when I run Checked driver version,

but ISR is not called when I run Free version. In first case I
use DebugPrint.

Andrew

----- Original Message -----

From: Doron Holan mailto:xxxxx

To: Windows System Software Devs Interest List
mailto:xxxxx

Sent: Tuesday, July 24, 2007 1:48 PM

Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)?
What kind of problem? A bugcheck? An interrupt storm? The more details
you provide, the more help you can get.

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey
Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked
version is running (with DebuPrint),

and does not work when Free version of my driver is
running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR
Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR
Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Yes, IoConnectedInterrupt is called from MyStartDevice, not MyDIspatchPnp.

KeSynchronizeExecution( dInfo->InterruptObject, EnableChipInterrupt, dInfo ) function enables the interrupt in hw.

----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, July 24, 2007 3:44 PM
Subject: RE: [ntdev] interrupt: Free and Release

Did you mean that IoConnectInterrupt is called from MyStartDevice, not MyDIspatchPnp? Does initialize() enable the interrupt in hw?

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 3:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

I do nothing special in case: IRP_MN_START_DEVICE.

NTSTATUS
MyDispatchPnp (… )

case IRP_MN_START_DEVICE:

IoCopyCurrentIrpStackLocationToNext(Irp);

KeInitializeEvent(&event, NotificationEvent,
FALSE
);

IoSetCompletionRoutine(Irp,
(PIO_COMPLETION_ROUTINE) MyCompletionRoutine,
&event,
TRUE,
TRUE,
TRUE);

status = IoCallDriver(dInfo->NextLowerDriver, Irp);

if (STATUS_PENDING == status) {
KeWaitForSingleObject(
&event,
Executive, // Waiting for reason of a driver
KernelMode, // Must be kernelmode if event memory is in stack
FALSE, // No allert
NULL); // No timeout
}

if (NT_SUCCESS(status) && NT_SUCCESS(Irp->IoStatus.Status)) {

status = MyStartDevice(DeviceObject, Irp);
if(NT_SUCCESS(status))
{

status = CreateMyThread(dInfo);

if (!NT_SUCCESS (status))
return status;

}
}

status = IoSetDeviceInterfaceState(&dInfo->InterfaceName, TRUE);

if (NT_SUCCESS (status)) {
SET_NEW_PNP_STATE(dInfo, Started);
}
else
{
DebugPrint((“IoSetDeviceInterfaceState failed: 0x%x\n”, status));
return status;
}

Irp->IoStatus.Status = status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

IoReleaseRemoveLock(&dInfo->RemoveLock, Irp);
return status;

I call IoConnectInterrupt and enable interrupt in MyDispatchPnp (see below)

NTSTATUS MyDispatchPnp (…)

{

status = IoConnectInterrupt( &dInfo->InterruptObject, (PKSERVICE_ROUTINE)MyIsr, (PVOID)dInfo, NULL,
dInfo->InterruptVector, dInfo->InterruptLevel, dInfo->InterruptLevel,
dInfo->InterruptMode, dInfo->InterruptShare, dInfo->InterruptAffinity, FALSE);

if ( !NT_SUCCESS(status) )
{
DebugPrint((“Unable to install ISR\n”));
}
else
{
DebugPrint((“Installed ISR for interrupt\n”));

// enable interrupt here
KeSynchronizeExecution( dInfo->InterruptObject, EnableChipInterrupt, dInfo );
}

status = initialize(dInfo);

if(status!=STATUS_SUCCESS) {
DebugPrint((“Inititilize() failed: %08x\n”,status));
return status;
}

KeInitializeEvent( &dInfo->PollThreadEvent, NotificationEvent, FALSE );

return status;
}

}

Thank you

----- Original Message -----

From: Doron Holan

To: Windows System Software Devs Interest List

Sent: Tuesday, July 24, 2007 2:17 PM

Subject: RE: [ntdev] interrupt: Free and Release

Please post the code in your start device handler which connects the interrupt, DbgPrint really should not have anything to do with this.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 2:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] interrupt: Free and Release

Hi Doron,

Thank you for your respond. I have hardware interrupt and it works correct when I run Checked driver version,

but ISR is not called when I run Free version. In first case I use DebugPrint.

Andrew

----- Original Message -----

From: Doron Holan

To: Windows System Software Devs Interest List

Sent: Tuesday, July 24, 2007 1:48 PM

Subject: RE: [ntdev] interrupt: Free and Release

What kind of interrupt (usb or a hardware interrupt)? What kind of problem? A bugcheck? An interrupt storm? The more details you provide, the more help you can get.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Kamchatnikov
Sent: Tuesday, July 24, 2007 1:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt: Free and Release

Hi,

I have a problem with interrupt. It works when Checked version is running (with DebuPrint),

and does not work when Free version of my driver is running.

Could someone help me in my case?

Thank you.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Andrey Kamchatnikov wrote:

Yes, IoConnectedInterrupt is called from MyStartDevice, not MyDIspatchPnp.

KeSynchronizeExecution( dInfo->InterruptObject, EnableChipInterrupt,
dInfo ) function enables the interrupt in hw.

Where did you get the DebugPrint macro? Note that, in most cases, such
a macro does not print anything in a free build. If you are using the
lack of debug output to conclude that the interrupt aren’t happening,
then you have fooled yourself.

You still haven’t shown us the ISR.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.