首页
社区
课程
招聘
[救助]关于DDK中两个函数怎么使用???
发表于: 2006-8-18 10:54 6878

[救助]关于DDK中两个函数怎么使用???

2006-8-18 10:54
6878
恳请各位大侠指导 这两个函数 HalGetInterruptVector 和 IoConnectInterrupt 怎么使用?

谢谢!!!

有没有查看这样函数定义的DDK帮助文档,能发份给我么,或给个下载地址么。我找了好长时间没有找到。。谢谢!!!

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 1309
活跃值: (232)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
Win2k DDK Help 中我见过啊  , 现在没装了
2006-8-18 11:15
0
雪    币: 291
活跃值: (213)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
3
HalGetInterruptVector
The HalGetInterruptVector routine is obsolete and is exported only to support existing drivers. Drivers of PnP devices are assigned resources by the PnP manager, which passes resource lists with each IRP_MN_START_DEVICE request. Drivers that must support a legacy device that cannot be enumerated by the PnP manager should use IoReportDetectedDevice and IoReportResourceForDetection.
ULONG
  HalGetInterruptVector(
    IN INTERFACE_TYPE  InterfaceType,
    IN ULONG  BusNumber,
    IN ULONG  BusInterruptLevel,
    IN ULONG  BusInterruptVector,
    OUT PKIRQL  Irql,
    OUT PKAFFINITY  Affinity
    );

See Also
HalAssignSlotResources, HalGetBusData, HalGetBusDataByOffset, IoAssignResources, IoQueryDeviceDescription, IoConnectInterrupt, IoReportDetectedDevice, IoReportResourceForDetection

------------------------------------------------------------------------
IoConnectInterrupt
The IoConnectInterrupt routine registers a device driver's InterruptService routine (ISR), so that it will be called when a device interrupts on any of a specified set of processors.
NTSTATUS
  IoConnectInterrupt(
    OUT PKINTERRUPT  *InterruptObject,
    IN PKSERVICE_ROUTINE  ServiceRoutine,
    IN PVOID  ServiceContext,
    IN PKSPIN_LOCK  SpinLock  OPTIONAL,
    IN ULONG  Vector,
    IN KIRQL  Irql,
    IN KIRQL  SynchronizeIrql,
    IN KINTERRUPT_MODE    InterruptMode,
    IN BOOLEAN  ShareVector,
    IN KAFFINITY  ProcessorEnableMask,
    IN BOOLEAN  FloatingSave
    );

Parameters
InterruptObject
Pointer to the address of driver-supplied storage for a pointer to a set of interrupt objects. This pointer must be passed in subsequent calls to KeSynchronizeExecution.
ServiceRoutine
Pointer to the entry point for the driver-supplied InterruptService routine.
ServiceContext
Pointer to the driver-determined context that will be supplied to the InterruptService routine when it is called. The ServiceContext area must be in resident memory: in the device extension of a driver-created device object, in the controller extension of a driver-created controller object, or in nonpaged pool allocated by the device driver. See Providing ISR Context Information or details.
SpinLock
Pointer to an initialized spin lock, for which the driver supplies the storage, that will be used to synchronize access to driver-determined data shared by other driver routines. This parameter is required if the ISR handles more than one vector or if the driver has more than one ISR. Otherwise, the driver need not allocate storage for an interrupt spin lock and the input pointer is NULL.
Vector
Specifies the interrupt vector passed in the interrupt resource at the u.Interrupt.Vector member of CM_PARTIAL_RESOURCE_DESCRIPTOR.
Irql
Specifies the DIRQL passed in the interrupt resource at the u.Interrupt.Level member of CM_PARTIAL_RESOURCE_DESCRIPTOR.
SynchronizeIrql
Specifies the DIRQL at which the ISR will execute. If the ISR handles more than one interrupt vector or the driver has more than one ISR, this value must be the highest of the Irql values passed at u.Interrupt.Level in each interrupt resource. Otherwise, the Irql and SynchronizeIrql values are identical.
InterruptMode
Specifies whether the device interrupt is LevelSensitive or Latched.
ShareVector
Specifies whether the interrupt vector is sharable.
ProcessorEnableMask
Specifies a KAFFINITY value representing the set of processors on which device interrupts can occur in this platform. This value is passed in the interrupt resource at u.Interrupt.Affinity.
FloatingSave
Specifies whether to save the floating-point stack when the driver's device interrupts. For X86-based platforms, this value must be set to FALSE.

Return Value
IoConnectInterrupt can return one of the following NTSTATUS values:

STATUS_SUCCESS
STATUS_INVALID_PARAMETER
STATUS_INSUFFICIENT_RESOURCES

Headers
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments
A PnP driver should call IoConnectInterrupt as part of device start-up, before it completes the PnP IRP_MN_START_DEVICE request.

A driver receives raw and translated hardware resources with the IRP_MN_START_DEVICE request at Irp->Parameters.StartDevice.AllocatedResources and Irp->Parameters.StartDevice.AllocatedResourcesTranslated, respectively. To connect its interrupt, a driver uses the resources at AllocatedResourcesTranslated.List.PartialResourceList.PartialDescriptors[]. The driver must scan the array of partial descriptors for resources of type CmResourceTypeInterrupt.

If the driver supplies the storage for the SpinLock, it must call KeInitializeSpinLock before passing its interrupt spin lock to IoConnectInterrupt.

On return from a successful call to IoConnectInterrupt, the caller's ISR can be called if interrupts are enabled on the driver's device or if ShareVector was set to TRUE. (If a driver enables interrupts before IoConnectInterrupt is called, the caller's ISR can be called before IoConnectInterrupt returns.)

Callers of IoConnectInterrupt must be running at IRQL = PASSIVE_LEVEL.

See Also
IoDisconnectInterrupt, KeInitializeSpinLock, KeSynchronizeExecution, CM_PARTIAL_RESOURCE_DESCRIPTOR
2006-8-18 11:17
0
雪    币: 157
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
HalGetInterruptVector 的参数怎么传递啊,都是做什么用的。。。
2006-8-18 11:30
0
雪    币: 291
活跃值: (213)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
5
Parameter不是说得很明白吗?
2006-8-18 12:48
0
游客
登录 | 注册 方可回帖
返回
//