ingam
驱动牛犊
驱动牛犊
  • 注册日期2003-04-01
  • 最后登录2004-11-30
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1499回复:1

驱动程序打开了一个对象句柄,应用程序如何使用?

楼主#
更多 发布于:2003-06-03 14:45
我在MSDN上看到如下的描述:
Shared Object Handles
A driver that shares object handles between kernel mode and user mode must be carefully written to avoid accidentally creating security holes. Here are some guidelines:

   Create handles in kernel mode and pass them to user mode, instead of the other way around. Handles created by a user-mode component and passed to the driver should not be trusted.

我找了许多资料,都感到有些不理解:驱动程序是怎样将Handle传递给用户程序的?应用程序如何得到驱动程序打开的Handle?

我是这样理解的:驱动程序在某个进程A的上下文环境中运行时,调用系统例程如ZwCreateFile()打开一个句柄,在调用时指定句柄属性为OBJ_INHERIT。
当A进程创建一个子进程时,操作系统自动将前述的句柄复制到子进程的Handle Table中。

请问高手,应用程序如何使用驱动程序打开的对象句柄(object handle)?
blue_wind
驱动中牛
驱动中牛
  • 注册日期2002-11-24
  • 最后登录2006-11-30
  • 粉丝0
  • 关注0
  • 积分16分
  • 威望3点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-06-04 12:06
ReadFile(),WriteFile(),DeviceIoControl()
好东西大家共享,没必要做从复的劳动! 冒着微软的炮火前进!前进!前进!进!
游客

返回顶部