How to get the PE file's base address after geting the HINSTANCE by LoadLibraryW() under Windows CE?
As a HMODULE isn't the same as the load address of a loaded PE under Windows CE. How can开发者_如何学C I get the load address after geting the HINSTANCE by LoadLibraryW()?
Well I recommend you to read this article: http://support.microsoft.com/kb/326163 it will help you. You need to understand first how WinCE works, the memory architecture I mean.
The idea is that WinCE has a feature called XIP - In Place Code execution, so the code can be loaded from ROM or Flash (usually NOR). This allows you to save valuable RAM. Of course it remains also the classic way to load the code to be execute in RAM. Here there is a trade-off, the execution will be faster from RAM, but if you have modules where the performance is not critical In Place Code execution it's fine.
The first link is quite old, but it helps you to get a picture. This second link is more relevant: http://msdn.microsoft.com/en-us/library/bb331824.aspx because it is targeting WinCE 6.0 (so it applies for WinCe 7.0 too). So you should see what kind of dll is it your module and I think that different algorithms may apply for each case.
Anyway is a daunting task :) success! Please share with was the knowledge you gained! I am curious too.
精彩评论