edbert
驱动牛犊
驱动牛犊
  • 注册日期2003-04-26
  • 最后登录2012-08-11
  • 粉丝0
  • 关注0
  • 积分4分
  • 威望26点
  • 贡献值0点
  • 好评度13点
  • 原创分0分
  • 专家分0分
阅读:1186回复:4

请教:

楼主#
更多 发布于:2004-01-05 11:20
偶现在遇到了几点疑惑,有请大侠们指点:
1.APC的作用与意义是什么?
2.命名事件是不是必须在DISPATCH LEVEL才能被调用,除了DPC中可以设置以外,还有什么地方可以对其进行操作?
3.PCI设备配置中Device ID 和 Vendor ID有什么差别?如:PCI\\VEN_5555&DEV_0000&SUBSYS_00000000
  应该怎样解读?
谢谢!
hhm
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2004-01-05 12:02
异步过程调用

不是,example:If Wait is set to FALSE, the caller can be running at IRQL <= DISPATCH_LEVEL. Otherwise, callers of KeSetEvent must be running at IRQL PASSIVE_LEVEL and in a nonarbitrary thread context.

一个是Device的ID,Vendor自己定义,一个是厂商的ID,固定的

seaquester
驱动大牛
驱动大牛
  • 注册日期2002-05-22
  • 最后登录2016-06-16
  • 粉丝0
  • 关注0
  • 积分500分
  • 威望115点
  • 贡献值0点
  • 好评度107点
  • 原创分0分
  • 专家分52分
板凳#
发布于:2004-01-05 12:28
偶现在遇到了几点疑惑,有请大侠们指点:
1.APC的作用与意义是什么?
2.命名事件是不是必须在DISPATCH LEVEL才能被调用,除了DPC中可以设置以外,还有什么地方可以对其进行操作?
3.PCI设备配置中Device ID 和 Vendor ID有什么差别?如:PCI\\VEN_5555&DEV_0000&SUBSYS_00000000
  应该怎样解读?
谢谢!



2. Event必须在DISPATCH LEVEL或者以下IRQL才能用KeSetEvent signal, 看看DDK中KeSetEvent 的说明吧!

3.Vendor ID是厂商ID,必须向PCISIG申请。
  Device ID是设备ID,由厂商自定,用来区别同一厂商的不同产品。

PCI\\VEN_5555&DEV_0000&SUBSYS_00000000这一句就指出了各个ID
VendorID是 5555
DeviceID是 0000
SUBSYS是Sub System ID
看看PCI Spec就全明白了。
八风舞遥翩,九野弄清音。 鸣高常向月,善舞不迎人。
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
地板#
发布于:2004-01-05 13:44
Asynchronous Procedure Calls
An asynchronous procedure call (APC) is a function that executes asynchronously in the context of a particular thread. When an APC is queued to a thread, the system issues a software interrupt. The next time the thread is scheduled, it will run the APC function. APCs made by the system are called \"kernel-mode APCs.\" APCs made by an application are called \"user-mode APCs.\" A thread must be in an alertable state to run a user-mode APC.

Each thread has its own APC queue. An application queues an APC to a thread by calling the QueueUserAPC function. The calling thread specifies the address of an APC function in the call to QueueUserAPC. The queuing of an APC is a request for the thread to call the APC function.

When a user-mode APC is queued, the thread to which it is queued is not directed to call the APC function unless it is in an alertable state. A thread enters an alertable state when it calls the SleepEx, SignalObjectAndWait, MsgWaitForMultipleObjectsEx, WaitForMultipleObjectsEx, or WaitForSingleObjectEx function. Note that you cannot use WaitForSingleObjectEx to wait on the handle to the object for which the APC is queued. Otherwise, when the asynchronous operation is completed, the handle is set to the signaled state and the thread is no longer in an alertable wait state, so the APC function will not be executed. However, the APC is still queued, so the APC function will be executed if you call another alertable wait function.

Note that the ReadFileEx, SetWaitableTimer, and WriteFileEx functions are implemented using an APC as the completion notification callback mechanism.

花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
edbert
驱动牛犊
驱动牛犊
  • 注册日期2003-04-26
  • 最后登录2012-08-11
  • 粉丝0
  • 关注0
  • 积分4分
  • 威望26点
  • 贡献值0点
  • 好评度13点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-01-07 12:05
1 能否给个使用APC的例子?
2 如果我希望在AddDevice()和Remove()的时候设置一个事件通知上层应用程序,则在何处设置signal 比较合适?
3 我现在运行DDK下的install程序,则参数中的DeviceID (如上所示),是直接给5555,还是给PCI\\VEN_5555&DEV_0000&SUBSYS_00000000?
谢谢!可以继续加分!
hhm
游客

返回顶部