Writeable code sections got you down? Fear no more!

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值