Re: Sharing Code Between Drivers and Applications by Don
Don
Tue Jan 11 19:40:27 CST 2005
Simon, this is just a standard library, not a dll. Essentially the same a
including the sources in two projects.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Simon Morrow" <SimonMorrow@discussions.microsoft.com> wrote in message
news:E4DBFF2E-A09B-4B28-877F-9885BF6F41A0@microsoft.com...
> Hi Don.
> Thanks for the response. Probably best if I give you a bit more
background.
> Our software is supported on different platforms - on one we we use an
NDIS
> intermediate driver to connect to the network and on all others we use
> separate interfaces however they perform very similar functions. In these
> other interfaces we don't need to use the driver therefore we need to
either
> share common code that can be called from either the application or the
> driver. Currently we have a IOCTL for each function that we wish to share
(as
> you're describing). However this is by no means an ideal solution as we're
> having to ship the driver to platforms where it isn't necessary - as you
can
> imagine this adds significantly to QA and maintenance. The method you
mention
> below sounds like exactly what we're looking for. What are these library
> types so I can investigate further? Also do you know of any examples of
these
> types of libraries on the msdn/web?
>
> Many Thanks,
>
> Simon
>
>
> > For the most part the answer here is bad idea. If your code is truly
> > standalone, i.e. no calls to anything outside your functions, you can
build
> > a library and link it to both the driver and the application. This will
> > mean there are two copies running, but it guarantees the same algorithm.
> >
> > There is no special capability to run the same block of code in both an
> > application and a driver. There have been some kludges published they
are
> > all incredible security and reliability holes. If you want only one
piece
> > of code, choose a location, i.e. the driver or the app and use IOCTL's
to
> > request the invocation from whichever doesn't contain the code.
> >
> >
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> >
> > "Simon Morrow" <SimonMorrow@discussions.microsoft.com> wrote in message
> > news:F4FFAE51-B314-4F62-8F66-5E5355F4A545@microsoft.com...
> > > If I wanted to share a function between a driver and an application
how
> > could
> > > I go about doing this? Is there a special type of DLL that can be
shared
> > > between the two?
> > >
> > > Many Thanks,
> > >
> > > Simon
> > >
> >
> >
> >