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 :
- use FindResource return HRSRC
- use LoadResource with that HRSRC and return HGLOBAL
- use LockResource lock the HGLOBAL to return a pointer which you want finally .
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 :
- All of pointer address in the address range of module with loaded by LoadLibrary .
- The addresses by step2 and step3 are same .
Who can explain what these functions do exactly ?