【转】wince6移植之gwes与显示驱动!!
来源:互联网 发布:redis写入mysql 编辑:程序博客网 时间:2024/05/24 06:48
【出处】 http://bluefish.blog.51cto.com/214870/58122
【MSDN相关文章:显示驱动程序开发概念】http://msdn.microsoft.com/zh-cn/library/aa447495.aspx
很无奈没有见过MS的gwes的实现代码。GWES是负责处理图形、窗口和事件的子系统,主要的工作就是处理图形输出和用户交互。显示设备驱动就是被它加载的,同时被GWES加载的还有打印机驱动,键盘驱动,鼠标驱动,触摸屏驱动。
MS的经典图:
CE下所有的显示驱动都必须实现DDI函数集,这些函数用于初始化显示驱动以及把把图像用块传输(Blit)送往显示设备。显示驱动默认的名字叫做Ddi.dll,它本身所导出的函数只有DrvEnableDriver(实际的显示驱动也必须实现)一个,但是这个函数返回了一个包含27个函数指针的数组。GWES就是通过这些函数指针调用显示驱动(打印驱动)的。
看下DrvEnableDriver(是DDI函数之一),MS的解释:This function is the initial driver entry point exported by the driver DLL for devices that link directly to GWES。由于用到MS的GPE类,所以这个函数就直接调用了GPEEnableDriver,这两个函数连参数都一样。还是看下MS对这个函数的解释:This function initializes the callbacks that GDI provides for display drivers. It also fills in the driver entry points for the display driver in the DRVENABLEDATA structure。
最终的xxxDISP类(最终继承于GPE)也就是真正的display驱动类的实例化是在GetGPE函数中实现。GetGPE通过DDI函数DrvGetModes被调用。
GWES加载显示驱动的过程是:去访问候选显示设备列表(这个列表放在HKEY_LOCAL_MACHINE/System/GDI/DisplayCandidates下面,一般是在Platform.reg里建好的),看看是否有驱动程序已经在本机上实例化,如果有的话,GWES会使用它找到的第一个已经实例化的驱动;如果驱动程序没有在本机上实例话或者找不到合适的驱动程序,接下来GWES尝试加载Ddi.dll。默认情况下加载的是Ddi.dll,但是如果注册表项HKEY_LOCAL_MACHINE/System/GDI/Drivers/Display存在,GWES会加载此注册表项所指定的显示驱动。
下面是MS的一个列表可以对照上图进行理解
Element
Description
Application
The application can be simple, such as a Hello World application, or complex, such as a three-dimensional engineering application.
Whichever it is, the application calls GDI functions. Coredll.dll exposes these functions.
Coredll.dll
The major set of functions is exposed through a single DLL, called Coredll.dll.
In most cases, this library does not perform the work. Instead, the library packages the parameters for the function call and then triggers a Local Procedure Call (LPC) to another process.
The specific process depends on the function call. All drawing and windowing calls are sent to Gwes.dll.
Gwes.dll
The Graphics, Windowing and Events Subsystem (GWES) is responsible for all graphical output and all interactions with the user.
The drivers that reside in the GWES address space include display drivers, printer drivers, keyboard drivers, mouse drivers, and touch screen drivers.
Ddi.dll
The default name for the display driver is Ddi.dll. As with most DLLs, Ddi.dll communicates through exported functions.
Ddi.dll exports only the DrvEnableDriver function, which returns a pointer to an array of 27 function pointers to the caller. When GWES requires a display driver, it calls one of these 27 functions.
Writing a device driver involves writing the code for these 27 functions.
Three of these functions are specific to printer drivers, which leaves 24 for the display driver developer.
Hardware
The graphic pipeline ends at the hardware. The display driver communicates to the hardware using the mechanism required by the hardware.
This process typically involves a combination of memory-mapped video buffers and I/O registers.
- 【转】wince6移植之gwes与显示驱动!!
- WinCE6.0驱动移植
- WinCE6.0驱动移植
- WinCE6.0驱动移植( 驱动模型变化, 以及与WinCE5.0的比较)
- WinCE6.0驱动移植( 驱动模型变化, 以及与WinCE5.0的比较)
- WinCE6.0驱动移植( 驱动模型变化, 以及与WinCE5.0的比较)
- wince6.0移植之OAL
- WinCE6.0移植之OAL
- WinCE6.0移植之OAL
- WinCE6.0移植之OAL
- Android GWES之Android窗口治理(转)
- WINCE6.0显示驱动模型介绍
- WINCE6.0显示驱动模型介绍
- wince6移植
- [转]ARM9 2410移植之Nand flash 驱动的编写与移植
- wince6移植之创建.pbcxml文件
- Linunx设备驱动之ADC与触摸屏驱动移植
- s3c2416 AT070TN83的LCD wince6.0驱动移植
- 【原创】Ubuntu的版本命名学习
- C++之父评论C++与Java (转载)
- 关于自绘CListBox的一些疑惑
- META标签详解
- 在非MFC程序中引用CString
- 【转】wince6移植之gwes与显示驱动!!
- 解决EOS启动“不能连接到Server”的问题
- select 中的DISTINCT用法
- SOA数据访问与传统数据访问的区别
- CCNA资源共享
- 我的Total Commander设置
- HYIP-高度出产投资计划
- 提高质量加强软件测试势在必行
- 如何解决SOA产品给企业带来的安全问题