how DLL are loaded in memory

hi all,
I have a question regarding a loading the DLL in the memory.If two
applications load the same DLL in the memory will there be two copies of the
DLL in the address space of the each application or there will be one copy
of DLL in the memory shared between the two Applications ??

Thanx,
Ajitabh


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

AFAIK, dlls map into the address space of the process that loads them. So each
application will have a separate copy of the dll in its address space.

Hassan

Ajitabh Prakash wrote:

hi all,
I have a question regarding a loading the DLL in the memory.If two
applications load the same DLL in the memory will there be two copies of the
DLL in the address space of the each application or there will be one copy
of DLL in the memory shared between the two Applications ??

Thanx,
Ajitabh


You are currently subscribed to ntdev as: xxxxx@trimedia.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The mapping is to each process. But the physical memory is the same, even
if the virtual
address isn’t. This scheme is the normal way. There is an exception. When
debugging the
DLL, there is a need to put breakpoints in the code. In that case the pages
are treated as
copy-on-write, which means that for the process that is being debugged the
page will be
copied to a new physical spot before inserting the breakpoints, so other
processes sharing
that dll are not subject to the break.

George

At 10:21 AM 3/16/01 -0800, you wrote:

AFAIK, dlls map into the address space of the process that loads them. So each
application will have a separate copy of the dll in its address space.

Hassan

Ajitabh Prakash wrote:

> hi all,
> I have a question regarding a loading the DLL in the
memory.If two
> applications load the same DLL in the memory will there be two copies
of the
> DLL in the address space of the each application or there will be one copy
> of DLL in the memory shared between the two Applications ??
>
> Thanx,
> Ajitabh
>
> —
> You are currently subscribed to ntdev as: xxxxx@trimedia.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@brd.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


George Blat
BRD Corp
8016 188th SW, Edmonds, WA 98026

phone: 425-775-7475
fax: 781-998-5940
mailto:xxxxx@brd.com
http://www.brd.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yes, sources are shared but data isn’t. So if the concern is whether some data
will be modified simultaneously by two application then answer is no. Each
application will have its own copy of data.
Hassan

George Blat wrote:

The mapping is to each process. But the physical memory is the same, even
if the virtual
address isn’t. This scheme is the normal way. There is an exception. When
debugging the
DLL, there is a need to put breakpoints in the code. In that case the pages
are treated as
copy-on-write, which means that for the process that is being debugged the
page will be
copied to a new physical spot before inserting the breakpoints, so other
processes sharing
that dll are not subject to the break.

George

At 10:21 AM 3/16/01 -0800, you wrote:
>AFAIK, dlls map into the address space of the process that loads them. So each
>application will have a separate copy of the dll in its address space.
>
>Hassan
>
>Ajitabh Prakash wrote:
>
> > hi all,
> > I have a question regarding a loading the DLL in the
> memory.If two
> > applications load the same DLL in the memory will there be two copies
> of the
> > DLL in the address space of the each application or there will be one copy
> > of DLL in the memory shared between the two Applications ??
> >
> > Thanx,
> > Ajitabh
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@trimedia.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@brd.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


George Blat
BRD Corp
8016 188th SW, Edmonds, WA 98026

phone: 425-775-7475
fax: 781-998-5940
mailto:xxxxx@brd.com
http://www.brd.com


You are currently subscribed to ntdev as: xxxxx@trimedia.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Windows 2000 changes the behavior of shared DLL libraries.

Under previous versions of NT, the code segments of the DLL would be shared
by all processes using the DLL. As mentioned by others, a copy of the data
segment would exist for each process that used the DLL.

Under 2000, applications can take steps to load a specific version of a DLL
from a specific location on physical storage. Presumably, this could be a
different version of the library from another process that was using another
version of the library. In this case, I would imagine there would be 2
copies of the code segments loaded into memory each of which might have
slightly different instructions. They would not share virtual memory address
nor would they share physical memory addresses.

ERX

-----Original Message-----
From: Hassan Khan [mailto:xxxxx@trimedia.com]
Sent: Friday, March 16, 2001 2:56 PM
To: NT Developers Interest List
Subject: [ntdev] Re: how DLL are loaded in memory

Yes, sources are shared but data isn’t. So if the concern is
whether some data
will be modified simultaneously by two application then
answer is no. Each
application will have its own copy of data.
Hassan

George Blat wrote:

> The mapping is to each process. But the physical memory is
the same, even
> if the virtual
> address isn’t. This scheme is the normal way. There is an
exception. When
> debugging the
> DLL, there is a need to put breakpoints in the code. In
that case the pages
> are treated as
> copy-on-write, which means that for the process that is
being debugged the
> page will be
> copied to a new physical spot before inserting the
breakpoints, so other
> processes sharing
> that dll are not subject to the break.
>
> George
>
> At 10:21 AM 3/16/01 -0800, you wrote:
> >AFAIK, dlls map into the address space of the process that
loads them. So each
> >application will have a separate copy of the dll in its
address space.
> >
> >Hassan
> >
> >Ajitabh Prakash wrote:
> >
> > > hi all,
> > > I have a question regarding a loading the DLL in the
> > memory.If two
> > > applications load the same DLL in the memory will there
be two copies
> > of the
> > > DLL in the address space of the each application or
there will be one copy
> > > of DLL in the memory shared between the two Applications ??
> > >
> > > Thanx,
> > > Ajitabh
> > >
> > > —
> > > You are currently subscribed to ntdev as:
xxxxx@trimedia.com
> > > To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> >—
> >You are currently subscribed to ntdev as: xxxxx@brd.com
> >To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> -------------------------------------------
> George Blat
> BRD Corp
> 8016 188th SW, Edmonds, WA 98026
>
> phone: 425-775-7475
> fax: 781-998-5940
> mailto:xxxxx@brd.com
> http://www.brd.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@trimedia.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@mediasite.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I have a question regarding a loading the DLL in the memory.If
two

applications load the same DLL in the memory will there be two copies of
the
DLL in the address space of the each application or there will be one copy
of DLL in the memory shared between the two Applications ??

Each DLL has a base address specified in the linker command line when it was
built.
When the DLL is loaded, if this part of the address space if free - then the
DLL is loaded by directly memory-mapping the image file.
Otherwise, some other address is used for a DLL, it is mapped as
copy-on-write and then relocations are applied, dirtying the DLL’s code and
data pages and making it process private.
It is only the performance issue - the DLL will work the same way in both
cases.

So:

  • if the DLL is loaded without any relocations (did not clash with any other
    DLL and any other memory allocation in the process) - then it is loaded
    “shared”.
  • otherwise, it is loaded “private” - the pages are dirtied by the
    relocation engine.

Choosing a good base address for a DLL (thus avoiding relocations) leads to
a significant performance gain. Relocations are bad both in terms of time
and memory load.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I think, the data segment will also be in a
copy-on-write page. Correct me if I’m wrong.
-Sajeev.

others, a copy of the data
segment would exist for each process that used the
DLL.


Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If two apps load the same DLL only one copy of the code resides in memory.
But: For each app you’ll have one separate data set.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

At any time only 1 copy of DLL will present in Memory( By sharing the same
physical page. Initially Each application has Read access to this Page ). If
any application tries to write to this page CPU will generate some
exception. Later this will dispatched to Virtual Memory Manager. After
analysing the Page fault the VMM determines the particular page is
Copy-On-Write. The contents of the current physical Page were copied to a
new Physical page. The virtual table entry also updated to point to new
Physical Page Form this point that applicatin will have seperate copy of
that Page.

I hope this will give some info .

Regards,
Satish K.S

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 12:00 AM
Subject: [ntdev] Re: how DLL are loaded in memory

> If two apps load the same DLL only one copy of the code resides in memory.
> But: For each app you’ll have one separate data set.
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This raises another question,
How are debuggers able to modify code pages of another process/DLL ?

Taher

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Satish
Sent: Wednesday, March 21, 2001 2:38 PM
To: NT Developers Interest List
Cc: xxxxx@pco.de
Subject: [ntdev] Re: how DLL are loaded in memory

At any time only 1 copy of DLL will present in Memory( By sharing the same
physical page. Initially Each application has Read access to this Page ). If
any application tries to write to this page CPU will generate some
exception. Later this will dispatched to Virtual Memory Manager. After
analysing the Page fault the VMM determines the particular page is
Copy-On-Write. The contents of the current physical Page were copied to a
new Physical page. The virtual table entry also updated to point to new
Physical Page Form this point that applicatin will have seperate copy of
that Page.

I hope this will give some info .

Regards,
Satish K.S

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 12:00 AM
Subject: [ntdev] Re: how DLL are loaded in memory

> If two apps load the same DLL only one copy of the code resides in memory.
> But: For each app you’ll have one separate data set.
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@veritas.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

When the debugger modify code page. VMM will make another copy again and
that page is private to that Debugger.

Regards,
Satish K.S

----- Original Message -----
From: “Taher Vohra”
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 4:55 PM
Subject: [ntdev] Re: how DLL are loaded in memory

> This raises another question,
> How are debuggers able to modify code pages of another process/DLL ?
>
>
>
> Taher
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> Sent: Wednesday, March 21, 2001 2:38 PM
> To: NT Developers Interest List
> Cc: xxxxx@pco.de
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> At any time only 1 copy of DLL will present in Memory( By sharing the same
> physical page. Initially Each application has Read access to this Page ).
If
> any application tries to write to this page CPU will generate some
> exception. Later this will dispatched to Virtual Memory Manager. After
> analysing the Page fault the VMM determines the particular page is
> Copy-On-Write. The contents of the current physical Page were copied to a
> new Physical page. The virtual table entry also updated to point to new
> Physical Page Form this point that applicatin will have seperate copy of
> that Page.
>
> I hope this will give some info .
>
> Regards,
> Satish K.S
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Wednesday, March 21, 2001 12:00 AM
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> > If two apps load the same DLL only one copy of the code resides in
memory.
> > But: For each app you’ll have one separate data set.
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@veritas.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Debuggers normally put an INT3 instruction at the point in code
where the breakpoint needs to be set.

But if it modifies its own copy of the code page, then how does the
breakpoint get hit ?

Taher
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Satish
Sent: Wednesday, March 21, 2001 4:11 PM
To: NT Developers Interest List
Subject: [ntdev] Re: how DLL are loaded in memory

When the debugger modify code page. VMM will make another copy again and
that page is private to that Debugger.

Regards,
Satish K.S

----- Original Message -----
From: “Taher Vohra”
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 4:55 PM
Subject: [ntdev] Re: how DLL are loaded in memory

> This raises another question,
> How are debuggers able to modify code pages of another process/DLL ?
>
>
>
> Taher
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> Sent: Wednesday, March 21, 2001 2:38 PM
> To: NT Developers Interest List
> Cc: xxxxx@pco.de
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> At any time only 1 copy of DLL will present in Memory( By sharing the same
> physical page. Initially Each application has Read access to this Page ).
If
> any application tries to write to this page CPU will generate some
> exception. Later this will dispatched to Virtual Memory Manager. After
> analysing the Page fault the VMM determines the particular page is
> Copy-On-Write. The contents of the current physical Page were copied to a
> new Physical page. The virtual table entry also updated to point to new
> Physical Page Form this point that applicatin will have seperate copy of
> that Page.
>
> I hope this will give some info .
>
> Regards,
> Satish K.S
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Wednesday, March 21, 2001 12:00 AM
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> > If two apps load the same DLL only one copy of the code resides in
memory.
> > But: For each app you’ll have one separate data set.
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@veritas.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@veritas.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

There’s a good chapter on the Jeffrey Ritcher’s book Adanced Windows about
this topic

Matteo

----- Original Message -----
From: “Taher Vohra”
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 12:25 PM
Subject: [ntdev] Re: how DLL are loaded in memory

> This raises another question,
> How are debuggers able to modify code pages of another process/DLL ?
>
>
>
> Taher
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> Sent: Wednesday, March 21, 2001 2:38 PM
> To: NT Developers Interest List
> Cc: xxxxx@pco.de
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> At any time only 1 copy of DLL will present in Memory( By sharing the same
> physical page. Initially Each application has Read access to this Page ).
If
> any application tries to write to this page CPU will generate some
> exception. Later this will dispatched to Virtual Memory Manager. After
> analysing the Page fault the VMM determines the particular page is
> Copy-On-Write. The contents of the current physical Page were copied to a
> new Physical page. The virtual table entry also updated to point to new
> Physical Page Form this point that applicatin will have seperate copy of
> that Page.
>
> I hope this will give some info .
>
> Regards,
> Satish K.S
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Wednesday, March 21, 2001 12:00 AM
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> > If two apps load the same DLL only one copy of the code resides in
memory.
> > But: For each app you’ll have one separate data set.
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@veritas.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@dolce.it
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The debugger simulates a write from the debugged process, causing a copy on write, but “as if” the process itself did it. The
debugger never has “its own” copy of the page.
-DH
----- Original Message -----
From: “Taher Vohra”
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 7:26 AM
Subject: [ntdev] Re: how DLL are loaded in memory

> Debuggers normally put an INT3 instruction at the point in code
> where the breakpoint needs to be set.
>
> But if it modifies its own copy of the code page, then how does the
> breakpoint get hit ?
>
>
> Taher
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> Sent: Wednesday, March 21, 2001 4:11 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> When the debugger modify code page. VMM will make another copy again and
> that page is private to that Debugger.
>
> Regards,
> Satish K.S
>
> ----- Original Message -----
> From: “Taher Vohra”
> To: “NT Developers Interest List”
> Sent: Wednesday, March 21, 2001 4:55 PM
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> > This raises another question,
> > How are debuggers able to modify code pages of another process/DLL ?
> >
> >
> >
> > Taher
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> > Sent: Wednesday, March 21, 2001 2:38 PM
> > To: NT Developers Interest List
> > Cc: xxxxx@pco.de
> > Subject: [ntdev] Re: how DLL are loaded in memory
> >
> >
> > At any time only 1 copy of DLL will present in Memory( By sharing the same
> > physical page. Initially Each application has Read access to this Page ).
> If
> > any application tries to write to this page CPU will generate some
> > exception. Later this will dispatched to Virtual Memory Manager. After
> > analysing the Page fault the VMM determines the particular page is
> > Copy-On-Write. The contents of the current physical Page were copied to a
> > new Physical page. The virtual table entry also updated to point to new
> > Physical Page Form this point that applicatin will have seperate copy of
> > that Page.
> >
> > I hope this will give some info .
> >
> > Regards,
> > Satish K.S
> >
> > ----- Original Message -----
> > From:
> > To: “NT Developers Interest List”
> > Sent: Wednesday, March 21, 2001 12:00 AM
> > Subject: [ntdev] Re: how DLL are loaded in memory
> >
> >
> > > If two apps load the same DLL only one copy of the code resides in
> memory.
> > > But: For each app you’ll have one separate data set.
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@veritas.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@veritas.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

----- Original Message -----
From: “Taher Vohra”
To: “NT Developers Interest List”
Sent: Wednesday, March 21, 2001 5:56 PM
Subject: [ntdev] Re: how DLL are loaded in memory

> Debuggers normally put an INT3 instruction at the point in code
> where the breakpoint needs to be set.
>
> But if it modifies its own copy of the code page, then how does the
> breakpoint get hit ?
>

I didnt not get u properly.

>
> Taher
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> Sent: Wednesday, March 21, 2001 4:11 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> When the debugger modify code page. VMM will make another copy again and
> that page is private to that Debugger.
>
> Regards,
> Satish K.S
>
> ----- Original Message -----
> From: “Taher Vohra”
> To: “NT Developers Interest List”
> Sent: Wednesday, March 21, 2001 4:55 PM
> Subject: [ntdev] Re: how DLL are loaded in memory
>
>
> > This raises another question,
> > How are debuggers able to modify code pages of another process/DLL ?
> >
> >
> >
> > Taher
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Satish
> > Sent: Wednesday, March 21, 2001 2:38 PM
> > To: NT Developers Interest List
> > Cc: xxxxx@pco.de
> > Subject: [ntdev] Re: how DLL are loaded in memory
> >
> >
> > At any time only 1 copy of DLL will present in Memory( By sharing the
same
> > physical page. Initially Each application has Read access to this
Page ).
> If
> > any application tries to write to this page CPU will generate some
> > exception. Later this will dispatched to Virtual Memory Manager. After
> > analysing the Page fault the VMM determines the particular page is
> > Copy-On-Write. The contents of the current physical Page were copied to
a
> > new Physical page. The virtual table entry also updated to point to new
> > Physical Page Form this point that applicatin will have seperate copy of
> > that Page.
> >
> > I hope this will give some info .
> >
> > Regards,
> > Satish K.S
> >
> > ----- Original Message -----
> > From:
> > To: “NT Developers Interest List”
> > Sent: Wednesday, March 21, 2001 12:00 AM
> > Subject: [ntdev] Re: how DLL are loaded in memory
> >
> >
> > > If two apps load the same DLL only one copy of the code resides in
> memory.
> > > But: For each app you’ll have one separate data set.
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@veritas.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@aalayance.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@veritas.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Ajitabh,

There will be only a single copy of the DLL loaded into the memory shared
by both the applications.

rgds,
Ashok

*************************************
K.V.S.Ashok Kumar,
Systems Engineer - Microsoft labs,
Network & Systems S/W group,
E&I Solutions, Wipro Technologies,
Hi-Tech City, Madhapur,
Hyderabad.
Ph: +91-40-6565363(D)
Fax: +91-40-3119801
E-mail : xxxxx@wipro.com
visit us at: http://www.wipro.com
“Success is the ability to go from one failure to
another with no loss of enthusiasm” - Churchill
*************************************

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Ajitabh Prakash
Sent: Friday, March 16, 2001 11:23 PM
To: NT Developers Interest List
Subject: [ntdev] how DLL are loaded in memory

hi all,
I have a question regarding a loading the DLL in the memory.If two
applications load the same DLL in the memory will there be two copies of the
DLL in the address space of the each application or there will be one copy
of DLL in the memory shared between the two Applications ??

Thanx,
Ajitabh


You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

There will be single copy of CODE but multiple DATA (one for each
application). i.e., applications cannot share global variables in the DLL as
in Win 3.1

jojan

-----Original Message-----
From: Ashok Kumar Vijaya Srinivas Kadavakollu
[mailto:xxxxx@wipro.com]
Sent: Thursday, April 05, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: how DLL are loaded in memory

Hi Ajitabh,

There will be only a single copy of the DLL loaded into the
memory shared
by both the applications.

rgds,
Ashok

*************************************
K.V.S.Ashok Kumar,
Systems Engineer - Microsoft labs,
Network & Systems S/W group,
E&I Solutions, Wipro Technologies,
Hi-Tech City, Madhapur,
Hyderabad.
Ph: +91-40-6565363(D)
Fax: +91-40-3119801
E-mail : xxxxx@wipro.com
visit us at: http://www.wipro.com
“Success is the ability to go from one failure to
another with no loss of enthusiasm” - Churchill
*************************************

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Ajitabh Prakash
Sent: Friday, March 16, 2001 11:23 PM
To: NT Developers Interest List
Subject: [ntdev] how DLL are loaded in memory

hi all,
I have a question regarding a loading the DLL in
the memory.If two
applications load the same DLL in the memory will there be
two copies of the
DLL in the address space of the each application or there
will be one copy
of DLL in the memory shared between the two Applications ??

Thanx,
Ajitabh


You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@nestec.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I’m in this thread late, so this may have been mentioned before.

Because copy-on-write is on, if any portion of the DLL memory is modified,
a separate copy of the modified page is created for the current process.
This happens when applications patch the executable (text) pages.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com