I've got a funny situation in which a program runs out of memory too early. With too early I mean the malloc() and new() are failing because they can't allocate memory while there is still plenty.
The problem is that there is no big enough chunk of memory available. The app requests 300 meg, while there the largest chunk available is 250 f.i.

The cause of this memory "fragmentation" are a couple of DLL's with a bad base address. Most of these DLL's are shipped together with the application so I can use the REBASE tool to give them a sensible address.

But I've got one left... OPENGL32.DLL has a base address of 0x5ED0000 and is a system DLL so I can't modify this one.
I can of course copy this file, rebase it, and put it next to the executable.

But that's not what I want to do. Because this way I'll be missing out on updates (via service packs f.i.).

The "beautifull" way would be to "tell" the loader that it shouldn't use the base address but load it somewhere else.

In other words, I want to force a relocation of a DLL.

Has any of you done this before ?