News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Unload part of PE

Started by RedXVII, April 21, 2006, 10:22:05 PM

Previous topic - Next topic

RedXVII

Ive compiled an executable witch has a few large bitmaps in its Resources. After ive loaded it with directx, i no longer need the them to be in the memory (i think). In fact i dont think i need the .rsrc section at all after that. Anyhow, my question; would it be worthwhile in anyway to unload this from memory seeing as im not going to be using it for anymore? If so, how would i go about doing this?

Another thing; Is it possible to make a section in a PE which is not loaded into memory on execution?

Thx  :U

hutch--

Red,

As long as an EXE is not compressed, the OS is supposed to do this style of paging for you but you don't have much control of how it works. With a one off use of a bitmap, it sound like a perfect candidate for a DLL that uses LoadLibrary() GetProcAddress() which can be unloaded when you have the bitmap you want in seperate memory and you have perfect control of this mechanism.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

RedXVII

Thats a nice idea, but errm...... as a kindof point, im trying to keep it to a single executable without any libraries (aka. dongles and doodles). If the OS handles it already, then ill just twiddle my thumbs and keep on going.  :bg

Thanks hutch

asmfan

Hi Red, i dont know is resource flag DISCARDABLE still usefull, but try... Also it's can be specified for entire section in linker options(D) like R or W or E for read,write and execute...
Russia is a weird place

Vortex

If they are large, why not to store your images as bitmap files?

RedXVII

^^ as i was saying before, im trying to keep it in one neat executable, no extra files. Its kindof a point i want to make to a friend.

Its sounds to me like the OS handles it so im not worried really; just trying to keep my programs from resource hogging.