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 的优先级类型,如下所示:

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

SynchronizeRoutine

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

Context

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

返回值

如果操作成功, 则 VideoPortSynchronizeExecution 返回 TRUE

注解

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

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

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

要求

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

另请参阅

HwVidInterrupt

HwVidSynchronizeExecutionCallback