Re: How queue APC from kernel?
From: Don Burn (burn_at_stopspam.acm.org)
Date: 12/22/04
- Next message: Automate: "Virtual COM port, DDK or SDK?"
- Previous message: Hannes: "Re: How queue APC from kernel?"
- In reply to: Hannes: "Re: How queue APC from kernel?"
- Next in thread: Alexander Grigoriev: "Re: How queue APC from kernel?"
- Reply: Alexander Grigoriev: "Re: How queue APC from kernel?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Dec 2004 13:33:58 -0500
Hannes,
I've done this type of architecture with a queue and a semaphore. You
have a common control block you queue using ExInterlockedXXX queue routine
and increment the semphore, the main thread waits on the semaphore and
dequeues an item to process. You probably should have a lookaside list for
allocating the control blocks.
The kernel actually has a kernel queue that does the instertion and
notification, unfortunately it is only documented in the IFS kit.
-- Don Burn (MVP, Windows DDK) Windows 2k/XP/2k3 Filesystem and Driver Consulting Remove StopSpam from the email to reply "Hannes" <hannes@nospam.nospam> wrote in message news:130329E4-515D-4B5A-950A-569AD0E24B4D@microsoft.com... > The exact problem I'm having is; I'm writing a driver which will service a > 4-port serial card (among many other tasks). I am communicating with the > vendor supplied card driver, which will invoke different callback functions > in my driver, depending on which serial port needs service. > > My callback function(s) will not carry out the actual send/receive > operations, I rather want to execute these on a main thread in my driver. My > idea is that the callback function(s) should queue some APC to be executed by > my main thread, and I would store the port to be serviced, along with the > operation required (e.g. rx or tx) inside the APC to be executed. > > Just setting an event to wake up my main thread is not enough, since the > event can't carry any data to indicate port number and/or desired operation. > Also, I can't use mulitple events, since a kernel thread only can wait for a > maximum of 3 events. > > We're using a similar method in a user space application, so that's why I'm > fairly familiar with QueueUserAPC in user space. Would therefore like to make > a similar approach in kernel space. > > - Am I missing something? Is there a better approach? > - Will DPC's be able to do this for me? (as oppose to APC's) > > Thanks, > > / Hannes.
- Next message: Automate: "Virtual COM port, DDK or SDK?"
- Previous message: Hannes: "Re: How queue APC from kernel?"
- In reply to: Hannes: "Re: How queue APC from kernel?"
- Next in thread: Alexander Grigoriev: "Re: How queue APC from kernel?"
- Reply: Alexander Grigoriev: "Re: How queue APC from kernel?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|