关闭

Writeable code sections got you down? Fear no more!

285人阅读 评论(0) 收藏 举报

Virtual Memory changes included in Windows Mobile 6.1 can relocate read-only code sections out of Slot 0 and into a higher address range. This change was taken to relieve pressure from our coveted, read-write Slot 0. This change will be transparent to most developers since code sections are by default, read-only and do not assume code sections will be adjacent.

 

However, if you are intentionally including the “W” (write) attribute on a code section and your DLL is greater than 64kb, then you may be affected. Luckily, dumpbin.exe already knows to display a warning:

 

C:/WM612/release>dumpbin myDll.dll

 

60000020 flags

         Code

         Execute Read

 

DUMPBIN : warning LNK4078: multiple '.text' sections found with different attributes (E0000020)

 

SECTION HEADER #2

E0000020 flags

         Code

         Execute Read Write

 

There is nothing programmatically wrong with the above and most modules will work without modification. However, if you are seeing some strange results in recent versions of Windows Mobile, you may want to try and restrict your module to Slot 0 by adding the following registry key:

 

[HKEY_LOCAL_MACHINE/System/Loader/LoadModuleLow]

    "MyDll.dll"=dword:1  << change DLL name to match

 

Please note that using the above key will force your entire module into Slot 0 and prevent other modules from loading in that slot. The above registry setting should be used with caution and only for modules with a writeable code section.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:9821次
    • 积分:105
    • 等级:
    • 排名:千里之外
    • 原创:0篇
    • 转载:6篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档