VC_SynchronizeDPC

BOOLEAN
VC_SynchronizeDPC(
    PDEVICE_INFO
pDevInfo,
    PSYNC_ROUTINE
pSync,
    PVOID
pContext
);

The VC_SynchronizeDPC function synchronizes access to objects that are referenced by a kernel-mode video capture driver’s CaptureService function.

Parameters
pDevInfo
Pointer to the DEVICE_INFO structure returned by VC_Init.
pSync
Pointer to a callback function. The callback function must use the following prototype format:
BOOLEAN pSync(PVOID pContext);
pContext
Pointer to context information to be passed to the callback function.
Return Value

Returns the callback function’s return value.

Comments

A driver’s CaptureService function executes at an IRQL of DISPATCH_LEVEL. If other code within the driver must access the same objects (frame buffers, data structures, and so on) that the CaptureService function references, then all code that references the objects, including the code within CaptureService, must be synchronized by using VC_SynchronizeDPC.

To use VC_SynchronizeDPC, place each piece of code that references the objects to be protected into a callback function. Specify each callback function as a pSync parameter to a VC_SynchronizeDPC call. Typically, you use the pContext parameter to indicate the objects to be referenced.

The VC_SynchronizeDPC function acquires a spin lock and executes the callback function at an IRQL of DISPATCH_LEVEL. If you access an object only within code that is included in VC_SynchronizeDPC callbacks, then other processors cannot simultaneously access the object, and lower-priority code on the current processor cannot obtain access.

Code that calls VC_SynchronizeDPC must be executing at an IRQL of DISPATCH_LEVEL or lower.

See Also

VC_SynchronizeExecution