I load a module(exe/dll) by LoadLibrary and get a pointer of a binary resource in it .
Microsoft note that should use three steps :
I don't understand why MS design this process so strangely ?
if you want to detect the length of resource , you must use SizeofResource with the pointer returned from first step, but cannot input the pointer returned from step2 and step3 .
If check the pointer address outputted from these steps , I got the result :
Who can explain what these functions do exactly ?
These functions date from the Windows 3.x days when memory was scarce, and resources were kept on disk until they were needed. FindResource finds them in the resource table of the disk file and LoadResource loads them into memory. The memory is allocated as "movable", which means the memory manager can move it around as needed to free up space to make larger contiguous chunks. The memory therefore needed to be locked using LockResource before it could be accessed.
Since Windows 2000/XP a lot of these steps are redundant but the functions remain for backwards compatibility.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With