Windows CE 6.0中的内存访问 [英] Memory access in Windows CE 6.0

查看:136
本文介绍了Windows CE 6.0中的内存访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我们使用的应用程序"InitCarte.exe"在使用之前初始化PC104卡。

此应用程序目前在CE5.0下工作。它使用以下代码初始化PC卡104的寄存器:
$


" *(PUCHAR)(0x800D0000 + 0x1200)=(UCHAR)(valueToWrite);" ; $


在CE6.0中,由于用户和内核内存空间分离,这已不再可能。



根据我们的研究,我们的应用程序可以写入此寄存器的唯一方法是通过内核模式DLL。



(1)这是要采取的方向?有没有更有效的方法来执行此操作?

$
我们试图制作这样的dll ......但是当它没有被定义为运行时我们无法加载在内核中(.bib中的"K"标志)...因此无法访问所需的地址...
$


目前我们有:



* 1子项目InitCarteDLL(用于驱动程序)和子项目InitCarte(应用程序)



* in InitCarteDLL

- 来源:InitCarteDLL.cpp定义函数DllMain和ICD_InitPC104(uchar):后者函数包含代码"*(PUCHAR)(0x800D0000 + 0x1200)=(UCHAR)(valeurAEcrire);" ;
$
- .Bib带有标志"NK K"

- .Def带有"LIBRARY InitCarteDLL   出口ICD_InitPC104" b $ b - .Reg在HKLM / Drivers / BuiltIn / InitCarteDLL下添加键:

- Dll = InitCarteDLL.dll

- 订单= 4

- 在InitCarte(应用程序)中的前缀= ICD



*:

- 设置>链路>附加库:添加到InitCarteDLL.lib的路径

- 源代码:extern ICD_InitPC104和call。



目前,应用程序确实如此不启动。

如果我们删除"K"来自DLL的.bib的标志,应用程序启动并执行dll函数,但是在用户模式下(我们推断出对VirtualAlloc函数的调用:返回指向用户地址的指针(0x80000))。



(2)你能否确认这表明dll处于用户模式?是否有正确的方法可以确定,而不是在我们不需要的时候调用VirtualAlloc?

(3)如何使用应用程序(用户)的内核模式dll?



谢谢,

Hello,

We use an application "InitCarte.exe" to initialize a PC104 card before using it.
This application worked so far under CE5.0. It initializes a register of the PC card 104 with the following code:

"*(PUCHAR)(0x800D0000+0x1200) = (UCHAR)(valueToWrite);"

In CE6.0 this is no longer possible because of the separation of user and kernel memory spaces.

According to our research, the only way our application can write this register is via a kernel-mode DLL.

(1) Is this the direction to take? is there not a more efficient way to perform this action?

We tried to make such a dll ... but we fail to load when it is not defined as running in the kernel("K" flag in the .bib) ... and therefore can not access the desired address ...

For the moment we have:

* 1 subproject InitCarteDLL (for the driver) and a subproject InitCarte (application)

* in InitCarteDLL
- Source: InitCarteDLL.cpp defining functions DllMain and ICD_InitPC104(uchar): the latter function contains the code "*(PUCHAR)(0x800D0000+0x1200) = (UCHAR)(valeurAEcrire);"
- .Bib with flags "NK K"
- .Def with "LIBRARY InitCarteDLL    EXPORTS ICD_InitPC104"
- .Reg adding keys under HKLM/Drivers/BuiltIn/InitCarteDLL :
- Dll = InitCarteDLL.dll
- Order = 4
- Prefix = ICD

* in InitCarte (the application):
- Settings> Link> Additionnal Libraries: Adding the path to InitCarteDLL.lib
- Source code: extern ICD_InitPC104 and call.

As it stands, the application does not launch.
If we remove the "K" flag from .bib of the DLL, the application launches and the dll function is executed but in user mode (we deduce this information that a call to the VirtualAlloc function : returns a pointer to a user address (0x80000)).

(2) Can you confirm that this indicates that the dll is in user-mode? is there a proper way to be sure, rather than calling VirtualAlloc while we do not need?
(3) how to use a kernel-mode dll from a application (user)?

Thank you,

Brian

推荐答案

你必须开发一个内核模式流驱动程序。请参阅以下msdn链接以了解流驱动程序开发

you have to develop a kernel mode stream driver. see the following msdn link to know about stream driver development

http://msdn.microsoft.com/en-us/library/ee484885.aspx

http://msdn.microsoft.com/en-us/library/ee484885.aspx

另见网络直播

https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032357235&CountryCode=US

https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032357235&CountryCode=US

还可以使用这个简单的工具来创建一个窗口ce流驱动程序

Also use this simple tool to create a window ce stream driver

http://cedriverwiz.codeplex.com/

http://cedriverwiz.codeplex.com/


这篇关于Windows CE 6.0中的内存访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆