Callbacks from driver

hi all,

I am very novice for driver writing. I wanted to write a routine which will
callback to DLL when my card generates a interrupt. (ISR Routine)
pl guide some links or codes which will help to resolve this problem.

Thanks in advance,
Tushar

Hi,

Inside a function in dll, create an user mode event object and send it to your driver via DeviceIoControl, after that wait for a the object to get signalled from the kernel mode and followed by ,u call a another function which service the required stuffs in user mode as isr.

In kernel mode driver, use ObReferenceObjectByHandle to get a kernel mode event and set the event in the Dpc for ISr routine.

once interrupt occurs, your driver isr-dpc sets the event, and the user mode waiting event would get signalled and the following function would get executed…

hope this idea helps…

shiv
----- Original Message -----
From: Tushar Samnerkar
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 10:45 AM
Subject: [ntdev] Callbacks from driver

hi all,

I am very novice for driver writing. I wanted to write a routine which will
callback to DLL when my card generates a interrupt. (ISR Routine)
pl guide some links or codes which will help to resolve this problem.

Thanks in advance,
Tushar

You are currently subscribed to ntdev as: xxxxx@rassit.com
To unsubscribe send a blank email to %%email.unsub%%

Hi Shiva,

Thanks for the quick response.
What I understood from the reply:

  1. Creation of the object in Dll.
  2. Send that instance to Driver through DeviceIoControl.
  3. Driver will independently update this with its own ISR.
  4. Poll this object in DLL from other function.
    So polling will in between DLL-DLL, I am not getting rid of Polling.

Is there any similar kind of code available somewhere on net ?

Thanks once again,
Tushar
----- Original Message -----
From: Shiva Prasad T.S.
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 11:02 AM
Subject: [ntdev] Re: Callbacks from driver

Hi,

Inside a function in dll, create an user mode event object and send it to your driver via DeviceIoControl, after that wait for a the object to get signalled from the kernel mode and followed by ,u call a another function which service the required stuffs in user mode as isr.

In kernel mode driver, use ObReferenceObjectByHandle to get a kernel mode event and set the event in the Dpc for ISr routine.

once interrupt occurs, your driver isr-dpc sets the event, and the user mode waiting event would get signalled and the following function would get executed…

hope this idea helps…

shiv
----- Original Message -----
From: Tushar Samnerkar
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 10:45 AM
Subject: [ntdev] Callbacks from driver

hi all,

I am very novice for driver writing. I wanted to write a routine which will
callback to DLL when my card generates a interrupt. (ISR Routine)
pl guide some links or codes which will help to resolve this problem.

Thanks in advance,
Tushar

You are currently subscribed to ntdev as: xxxxx@rassit.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@nital.stpp.soft.net
To unsubscribe send a blank email to %%email.unsub%%

You don’t have to poll on that object, you can use WaitForxxxObject API,
the call will return after object is signalled or a timeout, if
specified.

Rajiv.

-----Original Message-----
From: Tushar Samnerkar [mailto:xxxxx@nital.stpp.soft.net]
Sent: Tuesday, December 17, 2002 2:20 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Callbacks from driver

Hi Shiva,

Thanks for the quick response.
What I understood from the reply:

  1. Creation of the object in Dll.
  2. Send that instance to Driver through DeviceIoControl.
  3. Driver will independently update this with its own ISR.
  4. Poll this object in DLL from other function.
    So polling will in between DLL-DLL, I am not getting rid of Polling.

Is there any similar kind of code available somewhere on net ?

Thanks once again,
Tushar
----- Original Message -----
From: Shiva Prasad T.S.
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 11:02 AM
Subject: [ntdev] Re: Callbacks from driver

Hi,

Inside a function in dll, create an user mode event object and send it
to your driver via DeviceIoControl, after that wait for a the object to
get signalled from the kernel mode and followed by ,u call a another
function which service the required stuffs in user mode as isr.

In kernel mode driver, use ObReferenceObjectByHandle to get a kernel
mode event and set the event in the Dpc for ISr routine.

once interrupt occurs, your driver isr-dpc sets the event, and the user
mode waiting event would get signalled and the following function would
get executed…

hope this idea helps…

shiv
----- Original Message -----
From: Tushar Samnerkar
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 10:45 AM
Subject: [ntdev] Callbacks from driver

hi all,

I am very novice for driver writing. I wanted to write a routine which
will
callback to DLL when my card generates a interrupt. (ISR Routine)
pl guide some links or codes which will help to resolve this problem.

Thanks in advance,
Tushar

You are currently subscribed to ntdev as: xxxxx@rassit.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@nital.stpp.soft.net
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to %%email.unsub%%

Hi,

Absolutely, it’s not on polling…
it’s based on user mode event notification

http://support.microsoft.com/default.aspx?scid=kb;EN-US;262947

Event.exe: Event Sample Driver for Windows 2000
check out this link for a sample in which KeSetEvent() function is used inside the DPC function to set the user mode event in the application from the driver

i had done it on win2k…not sure about other win OS…

the flow is like this…

user appln:-

  1. create user mode event object using CreateEvent( )
  2. send the event handle to the kernel mode using DeviceIOControl
  3. waitforsingleobject(EventUCreated,.,);
  4. MyProxyusermodeISR();

void MyProxyUserModeIsr()
{
// make read/write to service the device interrupt

}

In driver,

  1. The driver dereferences the user-mode handle into system space & saves the new system handle for later use.
  2. set the event from your DPC of isr once you get an interrupt…

that’s it…go thru the sample, u will get better idea…
regards,

shiv

----- Original Message -----
From: Tushar Samnerkar
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 2:19 PM
Subject: [ntdev] Re: Callbacks from driver

Hi Shiva,

Thanks for the quick response.
What I understood from the reply:

  1. Creation of the object in Dll.
  2. Send that instance to Driver through DeviceIoControl.
  3. Driver will independently update this with its own ISR.
  4. Poll this object in DLL from other function.
    So polling will in between DLL-DLL, I am not getting rid of Polling.

Is there any similar kind of code available somewhere on net ?

Thanks once again,
Tushar
----- Original Message -----
From: Shiva Prasad T.S.
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 11:02 AM
Subject: [ntdev] Re: Callbacks from driver

Hi,

Inside a function in dll, create an user mode event object and send it to your driver via DeviceIoControl, after that wait for a the object to get signalled from the kernel mode and followed by ,u call a another function which service the required stuffs in user mode as isr.

In kernel mode driver, use ObReferenceObjectByHandle to get a kernel mode event and set the event in the Dpc for ISr routine.

once interrupt occurs, your driver isr-dpc sets the event, and the user mode waiting event would get signalled and the following function would get executed…

hope this idea helps…

shiv
----- Original Message -----
From: Tushar Samnerkar
To: NT Developers Interest List
Sent: Tuesday, December 17, 2002 10:45 AM
Subject: [ntdev] Callbacks from driver

hi all,

I am very novice for driver writing. I wanted to write a routine which will
callback to DLL when my card generates a interrupt. (ISR Routine)
pl guide some links or codes which will help to resolve this problem.

Thanks in advance,
Tushar

You are currently subscribed to ntdev as: xxxxx@rassit.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@nital.stpp.soft.net
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@rassit.com
To unsubscribe send a blank email to %%email.unsub%%