DLL on Win NT vs. Win 95 
Author Message
 DLL on Win NT vs. Win 95

> ...
>  "relocated a.DLL from 0x100000(?) due to collision with b.DLL"
> Is this a problem? The app runs fine, but Developer Studio
> now always spews out this message (my app links to multiple
> DLLs which in turn all link to another (common) DLL.

I am really guessing on this one, but it could be because under normal
circumstances in NT each DLL receives its own process space and NT creates
stubs to call them through the LPCF (Local Procedure Call Facility) similar
to a RPC type interface. This stub method is necessary to control security.
When running under the Developer Studio(DS), the DS process may try thwart
this and have the dlls run in-process requiring each DLL to relocate. But
remember this is only a guess. You didn't mention if you get this message
when you run your program.  

>   The second change concerns memory allocation from a DLL:
> _CrtIsValidHeapPtr() now asserts whenever I free a pointer
> in a DLL other than the one that allocated it (the DLLs
> statically link the C run-time lib). This was no problem
> under Win95 and no crashes or memory leaks result on WinNT
> 4.0 if I ignore the assertion, but I assume that I have a
> problem here. Is there a standard policy to handle this?
> Obviously I should free() my heap pointers in the DLL that
> malloc()'d them, but is there some elegant scheme to do
> this? Since I'm providing a DLL-based class library, the
> user would have to explicitly "reattach" any storage allocated
> by the lib. This seems kind of tedious. Any suggestions?
> How does MFC solve this?

In NT DLLS don't have their own data segment. Both DLLs are actually using
the proceses data segment. (When more than one process uses a DLL, NT uses
a copy on write.) So it is possible that both DLLs--the malloc'er and the
free'er are working with the correct memory location. What I don't
understand is why you would have the code that mallocs an object in one DLL
and the code that frees an object in another DLL. Can you detail your
architecture a little bit?


Sun, 30 May 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. DLL on Win NT vs. Win 95

2. Win NT vs. Win 95

3. Win NT vs Win 95/98

4. Win 95/95 to Win NT

5. Win NT to Win 95

6. Porting application from Win 95 to Win NT

7. Q: Differences WIN NT / WIN 95 in VC++ 5.0

8. Registry - Win 95/Win NT

9. Win NT to Win 95

10. Win NT 4.0 - Win 95 Registry Reading Problems

11. Win 95 -> Win NT

12. Dialog behaviour in Win 95 and Win NT


Powered by phpBB® Forum Software