Re: Locking a dll -- dont allow loading

From: Dean Ramsier (ramsiernospam_at_nospam.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 16:34:23 -0500

Actually, there will be separate copies of global data for libraries.
Global data is per process, so applications loading this dll via LoadLibrary
each get their own copy of the global data. If the dll is loaded as a
driver and accessed that way (via DeviceIoControl calls, typically), the dll
just lives in device.exe, and attempts to open it can be counted.

-- 
Dean Ramsier - eMVP
"Bruce Eitman (eMVP)" <beitmannospam@NOSPAM_applieddata.NOSPAM_net> wrote in
message news:er%23FNQbHFHA.2784@TK2MSFTNGP09.phx.gbl...
> Is this a driver or just a dll that you are using?  In either case, yes
they
> share the global data.
>
> -- 
> Bruce Eitman (eMVP)
> Senior Engineer
> beitman AT applieddata DOT net
>
> Applied Data Systems
>  www.applieddata.net
> An ISO 9001:2000 Registered Company
> Microsoft WEP Gold-level Member
>
>
> "Jeo" <jeo@ky___BIG-FISH-LITTLE-FISH___bert.com ---Remove all fish> wrote
in
> message news:uW75v8ZHFHA.1396@TK2MSFTNGP10.phx.gbl...
> > How can i count? Since each call to loadLibary will create a new
instance,
> i
> > cannot use global vars in the dll, and the registry will be too slow to
> stop
> > quick loadlibary calls
> >
> >
> >
> >
> > "Bruce Eitman (eMVP)" <beitmannospam@NOSPAM_applieddata.NOSPAM_net>
wrote
> in
> > message news:u%23uKUvZHFHA.2620@tk2msftngp13.phx.gbl...
> > > Return 0 from your init if you count more than one load.
> > >
> > > -- 
> > > Bruce Eitman (eMVP)
> > > Senior Engineer
> > > beitman AT applieddata DOT net
> > >
> > > Applied Data Systems
> > > www.applieddata.net
> > > An ISO 9001:2000 Registered Company
> > > Microsoft WEP Gold-level Member
> > >
> > >
> > > "Jeo" <jeo@ky___BIG-FISH-LITTLE-FISH___bert.com ---Remove all fish>
> wrote
> > > in
> > > message news:O6Oh7%23YHFHA.3472@TK2MSFTNGP09.phx.gbl...
> > >> Hi.
> > >>
> > >>
> > >> Is there a known proven standard way to stop a dll driver being
loaded
> > > more
> > >> than once?
> > >>
> > >> I have a SPI driver and odviously it can only be loaded one at a
time,
> if
> > >> there is 2 instances of the driver running, then the SPI data will
> > > currupt.
> > >>
> > >>
> > >>
> > >> Joe
> > >>
> > >>
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: Somewhat confused about memory management
    ... Global data is shared within a process. ... If, however, you're loading the dll into other ... a driver is loaded exactly once. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: FTDI USB Serial Drivers
    ... The DLL accesses the inf for setup ... from the FTDI driver readme: ... Notes on INF files ... particular VID and PID requires access to a registry editor which (unlike ...
    (microsoft.public.windowsce.platbuilder)
  • Re: FTDI USB Serial Drivers
    ... The DLL accesses the inf for setup ... from the FTDI driver readme: ... Notes on INF files ... particular VID and PID requires access to a registry editor which (unlike ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Reprise: Pended IOCtrl + LoadLibrary == Deadlock?
    ... Is your driver handle open in FILE_FLAG_OVERLAPPED mode? ... > happen at startup and shutdown. ... The dll is loaded and instructed by the ... >>> Devstudio and windbg both use int 3 for breakpoints. ...
    (microsoft.public.development.device.drivers)
  • Re: Locking a dll -- dont allow loading
    ... Is this a driver or just a dll that you are using? ... >> beitman AT applieddata DOT net ...
    (microsoft.public.windowsce.platbuilder)