VideoPortSynchronizeExecution 函数 (video.h)

VideoPortSynchronizeExecution 函数将微型端口驱动程序提供的 HwVidSynchronizeExecutionCallback 函数与微型端口驱动程序的 HwVidInterrupt 函数(如果有)同步执行。 否则,它会以提升的优先级运行 HwVidSynchronizeExecutionCallback

语法

VIDEOPORT_DEPRECATED BOOLEAN VIDEOPORT_API VideoPortSynchronizeExecution(
  PVOID                         HwDeviceExtension,
  VIDEO_SYNCHRONIZE_PRIORITY    Priority,
  PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine,
  PVOID                         Context
);

参数

HwDeviceExtension

指向微型端口驱动程序的设备扩展的指针。

Priority

指定必须运行给定 SynchronizeRoutine 的优先级类型,如下所示:

  • 如果 优先级 设置为 VpLowPriority,则当前线程将提升为最高非中断掩码优先级。 因此,如果设备中断,则当前线程只能被 ISR 抢占。
  • 如果 Priority 设置为 VpMediumPriority,并且微型端口驱动程序具有与其视频适配器关联的 ISR,则调用给定的 SynchronizeRoutine 与微型端口驱动程序的 HwVidInterrupt 函数同步。 否则,同步是在 VpLowPriority 级别进行的。
  • VpHighPriority 的效果与 VpMediumPriority相同。

SynchronizeRoutine

指向微型端口驱动程序的 HwVidSynchronizeExecutionCallback 函数的指针。

Context

指向要传递给微型端口驱动程序的 HwVidSynchronizeExecutionCallback 函数的调用方提供的上下文的指针。 此指针可以 NULL

返回值

如果作成功,VideoPortSynchronizeExecution 返回 true

言论

微型端口驱动程序很少调用此例程,除非满足以下任一条件:

  • 微型端口驱动程序的 HwVidInterrupt 函数与其他微型端口驱动程序函数共享内存。 若要以多处理器安全的方式访问共享内存,此类微型端口驱动程序函数必须使用 HwVidSynchronizeExecutionCallback调用 VideoPortSynchronizeExecution。 此微型端口驱动程序函数可以安全地访问共享内存,因为视频端口驱动程序阻止 HwVidInterrupt 函数并发访问同一内存。
  • 适配器必须使用一系列命令进行编程,而不会受到上下文切换的约束。 例如,微型端口驱动程序的 SvgaHwIoPortXxx 函数缓冲了一系列 I/O 指令,并验证该序列可能会使用 HwVidSynchronizeExecutionCallback调用 VideoPortSynchronizeExecution。 此微型端口驱动程序函数可以快速将缓冲和验证的 I/O 流传输到适配器。
调用方应为 HwVidSynchronizeExecutionCallback 的工作指定最低实际 优先级 值。 任何以高硬件优先级(VpMediumPriorityVpHighPriority) 运行的任何 CallbackRoutine 都应尽快返回控制。 具有此类高优先级 HwVidSynchronizeExecutionCallback 函数的驱动程序应设计为在所有其他驱动程序函数中尽可能多地执行工作,但除其 HwVidSynchronizeExecutionCallbackHwVidInterrupt 函数之一外。

VideoPortSynchronizeExecution 的调用方必须在 IRQL 上运行

要求

要求 价值
最低支持的客户端 在 Windows 2000 及更高版本的 Windows作系统中可用。
目标平台 桌面
标头 video.h (include Video.h)
Videoprt.lib
DLL Videoprt.sys
IRQL <= DIRQL

另请参阅

HwVidInterrupt

HwVidSynchronizeExecutionCallback