Re: XP SP2 WDM driver - Sharing Memory between driver and application

From: Arkady Frenkel (arkadyf_at_hotmailxdotxcom)
Date: 01/12/05


Date: Wed, 12 Jan 2005 22:15:19 +0200

Really , that do possible and defined in
http://www.microsoft.com/whdc/driver/kernel/KM-UMGuide.mspx
Arkady

"JimE" <JimE@NOSPAMmacrolink.com> wrote in message
news:C11B2C1A-91AF-4E1D-BED9-07A54C349D2E@microsoft.com...
> Just a couple of suggestions - I've never worked on a driver like that:
>
> Get Walter Oney's Programming the Windows Driver Model 2nd edition. It has
> most everything you will need to know to write a WDM driver. NT is very
> different.
>
> You might attempt to allocate all the buffer space you need from
> NonPagedPool when you start your device. I have no idea if that much space
> can be allocated, but if it can, it will never get paged to disk.
>
> Sharing buffer space of any type between a user application and a kernel
> mode driver is generally not a good idea. A set of custom IOCTL codes to
> manipulate the data/device might be a better approach.
>
> Of course, these suggestions are provided without warranty, blah, blah,
> blah...
>
> "Paulo" wrote:
>
> > :
> > Hi all,
> >
> > I have to confess... I'm almost translating my application from
> > Windows to Linux just because I can't make a WDM driver for my PCI
> > card... Help me, please!
> > I have a motion control PCI card that can command 2 motors. That
> > card generate interrupts. I have an application and an old driver (VxD)
> > working very well with Windows 98 SE, but now I'm trying to make a WDM
> > driver for Windows XP Professional SP2 because Microsoft is not selling
> > Win98 anymore.
> > In my new WDM driver, the communication with the PCI card from the
> > driver and from the application (I pass an address from the driver to
> > the application, so the app can communicate directly with the card) is
> > tested and working fine. The interrupt service routine (ISR) is working
> > very weel too.
> > The only big problem is that I need to share 10 buffers between the
> > driver and the user app (velocity, aceleration, etc). Those buffers
> > can't be swaped to the disk and some of then are 1MB length, and one is
> > 9MB lentgth. They are filled with velocity, aceleration and other
> > information by the application, and the driver fill some buffers with
> > other kind of information.
> > My PCI card has no memory, so I have to make use of "user buffers"
> > (created in the app) or "system buffers" (created in the driver).
> > The most important thing is that those buffers MUST be used (read &
> > write) inside the ISR, at any moment, as weel as the buffers MUST be
> > accessed (read & write) from the user app at any time (of course, not
> > when the driver is inside the ISR). The app must be running all the time
> > because it needs to get events from the user to communicate the driver
> > to start or stop listening to interrupts, so it seems to me that I can't
> > return STATUS_PENDING with METHOD_DIRECT (can I?).
> > And the two big questions are:
> > 1. Is that realy possible? (Are you sure?)
> > 2. How?
> >
> > I've been reading all the posts about this subject from all lists
> > and years, since Jan.2004 to this day, and I couldn't find a way to get
> > that driver working ok.
> > I also have the Viscarola & Mason "Windows NT Device Driver
> > Development" book... Good help, but couldn't sove the problem.
> > Can you help me?
> > Thanks a lot.
> >
> > Paulo.
> >
> >



Relevant Pages

  • sendto: no buffer space available (yet no queue and plenty mbufs)
    ... I'm experiencing the em intel nic 100/1000 mb driver produces the ... 'no buffer space available' error when I break the connection (pull out ... yet netstat -m and netstat -an shows no packets in queue ...
    (freebsd-isp)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... Printing, however, is actually handled by the printer driver software & the ... a local system it pretty much points the finger at the server configuration. ... connecting the printer directly to my iMac since it needs to be shared ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... I am using the Gutenprint driver, because with the other driver none of ... applications - including Excel, but not with Word. ... connecting the printer directly to my iMac since it needs to be shared ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)
  • Re: Printer will scan but not print...HELP ME PLZ!!!!!!!!!!!!!!!!!!!!!!!!!
    ... "Unable to communicate with the device ... >What happens if you go into the Control Panel, ... >> Then please right click on the status monitor to ... >> driver or because the drive is missing or corrupt. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... I am using the Gutenprint driver, because with the other driver none of ... Mac OS print preview, so I think my printer is printing me exactly what ... I then tried to use the toolbar 'print' button, ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)