【转】wince6移植之gwes与显示驱动!!

本文介绍了Windows CE下的GWES(图形、窗口和事件子系统)及其与显示驱动程序的交互方式。GWES负责处理图形输出和用户交互,并加载显示驱动程序。显示驱动程序必须实现特定的DDI函数集来响应GWES的请求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

【出处】  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.
内容概要:该研究通过在黑龙江省某示范村进行24小时实地测试,比较了燃煤炉具自动/手动进料生物质炉具的污染物排放特征。结果显示,生物质炉具相比燃煤炉具显著降低了PM2.5、CO和SO2的排放(自动进料分别降低41.2%、54.3%、40.0%;手动进料降低35.3%、22.1%、20.0%),但NOx排放未降低甚至有所增加。研究还发现,经济性和便利性是影响生物质炉具推广的重要因素。该研究不仅提供了实际排放数据支持,还通过Python代码详细复现了排放特征比较、减排效果计算和结果可视化,进一步探讨了燃料性质、动态排放特征、碳平衡计算以及政策建议。 适合人群:从事环境科学研究的学者、政府环保部门工作人员、能源政策制定者、关注农村能源型的社会人士。 使用场景及目标:①评估生物质炉具在农村地区的推广潜力;②为政策制定者提供科学依据,优化补贴政策;③帮助研究人员深入了解生物质炉具的排放特征和技术改进方向;④为企业研发更高效的生物质炉具提供参考。 其他说明:该研究通过大量数据分析和模拟,揭示了生物质炉具在实际应用中的优点和挑战,特别是NOx排放增加的问题。研究还提出了多项具体的技术改进方向和政策建议,如优化进料方式、提高热效率、建设本地颗粒厂等,为生物质炉具的广泛推广提供了可行路径。此外,研究还开发了一个智能政策建议生成系统,可以根据不同地区的特征定制化生成政策建议,为农村能源型提供了有力支持。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值