VC_AccessData

BOOLEAN
VC_AccessData(
    PDEVICE_INFO
 pDevInfo,
    PUCHAR pData,
    ULONG Length,
    PACCESS_ROUTINE pAccessFunc,
    PVOID pContext
   
);

The VC_AccessData function provides a means by which kernel-mode video capture drivers can be protected from encountering access violations when referencing user-mode data.

Parameters
pDevInfo
Pointer to the DEVICE_INFO structure returned by VC_Init.
pData
Pointer to user-mode data.
Length
Length of data specified by pData.
pAccessFunc
Pointer to a callback function that accesses the specified data. The callback function must use the following prototype format:
BOOLEAN AccessFunc (PDEVICE_INFO pDevInfo, PUCHAR pData, ULONG Length, PVOID pContext);
pContext
Pointer to driver-supplied context information that is passed to the callback function.
Return Value

If the data specified by pData can be accessed, the function returns the value returned by the callback function. Otherwise the function returns FALSE.

Comments

The kernel-mode driver supplies the address of data to be accessed, along with the address of a callback function that performs an operation on the data, such as copying a bitmap into the frame buffer. The VC_AccessData function wraps the callback function in an exception handler so that if an access violation occurs, the kernel-mode driver can continue to execute. If an access violation occurs, the exception handler returns FALSE.

The function can only be called within the context of the user’s thread. It must not be called from the InterruptAcknowledge or CaptureService functions, because they execute within a system context.