CreateFile() - WinCE 6.0 [英] CreateFile() - WinCE 6.0

查看:115
本文介绍了CreateFile() - WinCE 6.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我正在开发基于WinCE 6的设备。我必须为我的BSP中的一些低级驱动程序编写一些"包装"驱动程序以获得特定功能。

I am working on a WinCE 6 based device. I had to write some 'wrapper' drivers around some of the low level drivers in my BSP for a particular functionality.

我有一个一般性问题,我想知道是否有人可以传递他们的评论。

I have a general question and am wondering if somebody could pass on their comments.

从应用程序调用CreateFile()来获取驱动程序的句柄非常耗时(我在考虑用户空间到内核空间切换这里可能是时间延迟了)?我知道我的问题很模糊,因为我在这里没有定义什么,我称之为
'时间密集',但对此有任何一般性评论。

Is the call to CreateFile() from an application to get a handle to a driver quite time intensive (I am thinking of user space to kernel space switch here so may be time delay here)? I know my questions is vague, as I am not defining here what it that I call 'time intensive' but any general comments on this please.

此外,对于上下文上面的问题,假设驱动程序中的底层Open()函数没有执行任何操作 - 只需将句柄返回到某个设备上下文结构。

Also, for the context of above question, assume that the underlying Open() function in the driver is not doing any operation at - just returning the handle to some device context structure.

谢谢,

Samie

推荐答案

这将取决于时间密集的意义,可能更多的是,你的包装器如何运作正在使用。 如果您的包装器被调用很多,并且每次调用它时都调用CreateFile(),那么答案是肯定的CreateFile()是时间相关的。 
你最好有一个CreateFile()和CloseHandle()的包装函数。

It is going to depend on what time intensive means and probably more so, how your wrapper functions are being used.  If your wrapper is called a lot and you call CreateFile() every time it is called, then the answer is yes CreateFile() is time intesive.  You are probably better off to have a wrapper functions for CreateFile() and CloseHandle().


这篇关于CreateFile() - WinCE 6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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