阅读:1186回复:4
请教:
偶现在遇到了几点疑惑,有请大侠们指点:
1.APC的作用与意义是什么? 2.命名事件是不是必须在DISPATCH LEVEL才能被调用,除了DPC中可以设置以外,还有什么地方可以对其进行操作? 3.PCI设备配置中Device ID 和 Vendor ID有什么差别?如:PCI\\VEN_5555&DEV_0000&SUBSYS_00000000 应该怎样解读? 谢谢! |
|
|
沙发#
发布于: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,固定的 |
|
板凳#
发布于:2004-01-05 12:28
偶现在遇到了几点疑惑,有请大侠们指点: 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就全明白了。 |
|
|
地板#
发布于: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. |
|
|
地下室#
发布于:2004-01-07 12:05
1 能否给个使用APC的例子?
2 如果我希望在AddDevice()和Remove()的时候设置一个事件通知上层应用程序,则在何处设置signal 比较合适? 3 我现在运行DDK下的install程序,则参数中的DeviceID (如上所示),是直接给5555,还是给PCI\\VEN_5555&DEV_0000&SUBSYS_00000000? 谢谢!可以继续加分! |
|
|