Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Raab314159

Do you know *exactly* what's a DLL?

This topic is 5380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could you describe then what''s happening when a you call a WIN API procedure that''s not in RAM? I assume there''s some paging involved, but other than that, I have no idea... Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
The basic idea goes like this...

At program load, load all .dll files into memory that are required (if they aren''t already loaded). It gets all the function locations in the .dll and adds the .dll''s base address to that, so you now know the actual memory address of said function. So, when you call the function, it does a normal function call to the memory address of the function. If a .dll is sitting in ram, and hasn''t been used in a while, it will get swapped to the disk, and the operating system keeps track of which is in memory and in a swap file. If the program makes a call to a function that''s in swap, it generates a general protection fault, which would call the OS''s memory manager saying that it tried to access a memory location that was swapped to hard drive. The memory manager would then put it back into ram, and return from the interrupt and allow the program to keep going. I also assume it keeps a list of currently loaded .dll files, that way it only loads each one once, so if it''s not loaded, it loads it.. if it is, it just gives you the address of it in memory.

Share this post


Link to post
Share on other sites
VMs are special little things. Take an OS class when you get to college.

Unless you''re absolutely dying to find out. In which case, read about it for a few months.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!