VideoPortSynchronizeExecution function (video.h)

The VideoPortSynchronizeExecution function synchronizes the execution of a miniport driver-supplied HwVidSynchronizeExecutionCallback function with the miniport driver's HwVidInterrupt function, if any. Otherwise, it runs HwVidSynchronizeExecutionCallback at a raised priority.

Syntax

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

Parameters

HwDeviceExtension

Pointer to the miniport driver's device extension.

Priority

Specifies the type of priority at which the given SynchronizeRoutine must be run, as one of the following:

  • If Priority is set to VpLowPriority, the current thread is raised to the highest noninterrupt-masking priority. Accordingly, the current thread can be preempted only by an ISR if a device interrupts.
  • If Priority is set to VpMediumPriority and the miniport driver has an ISR associated with its video adapter, the call to the given SynchronizeRoutine is synchronized with the miniport driver's HwVidInterrupt function. Otherwise, synchronization is made at the VpLowPriority level.
  • VpHighPriority has the same effect as VpMediumPriority.

SynchronizeRoutine

Pointer to the miniport driver's HwVidSynchronizeExecutionCallback function.

Context

Pointer to a caller-supplied context to be passed to the miniport driver's HwVidSynchronizeExecutionCallback function. This pointer can be NULL.

Return value

If the operation succeeds, VideoPortSynchronizeExecution returns TRUE.

Remarks

Miniport drivers seldom call this routine unless either of the following conditions hold:

  • The miniport driver's HwVidInterrupt function shares memory with other miniport driver functions. In order to access the shared memory in a multiprocessor-safe way, such miniport driver functions must call VideoPortSynchronizeExecution with HwVidSynchronizeExecutionCallback. This miniport driver function can safely access the shared memory because the video port driver prevents the HwVidInterrupt function from accessing the same memory concurrently.
  • The adapter must be programmed with a sequence of commands without being subject to a context switch. For example, a miniport driver's SvgaHwIoPortXxx function that has buffered a sequence of I/O instructions and validated the sequence might call VideoPortSynchronizeExecution with HwVidSynchronizeExecutionCallback. This miniport driver function can transfer the buffered and validated I/O stream to the adapter very quickly.
A caller should specify the lowest practical Priority value for the work HwVidSynchronizeExecutionCallback must do. Any CallbackRoutine that is run at a high hardware priority (VpMediumPriority or VpHighPriority) should return control as quickly as possible. A driver with such a high-priority HwVidSynchronizeExecutionCallback function should be designed to do as much work as possible in every other driver function except one of both of its HwVidSynchronizeExecutionCallback and HwVidInterrupt functions.

Callers of VideoPortSynchronizeExecution must be running at IRQL

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of the Windows operating systems.
Target Platform Desktop
Header video.h (include Video.h)
Library Videoprt.lib
DLL Videoprt.sys
IRQL <= DIRQL

See also

HwVidInterrupt

HwVidSynchronizeExecutionCallback