DeviceOpenFunc

BOOLEAN
DeviceOpenFunc(
    PDEVICE_INFO
pDevInfo
    );

The DeviceOpenFunc function performs operations that must be completed when a video capture device is opened. The function is provided by the kernel-mode driver, and the DeviceOpenFunc name is a placeholder for a driver-specified function name.

Parameters
pDevInfo
Pointer to the DEVICE_INFO structure returned by VC_Init.
Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE. If FALSE, VCKernel.lib sets the Win32 error code value to STATUS_DRIVER_INTERNAL_ERROR.

Coments

The VCKernel.lib library calls the kernel-mode driver’s DeviceOpenFunc function when it receives an IRP_MJ_CREATE function code, which indicates a client is opening the device. User-mode drivers using VCUser.lib send this function code by calling VC_OpenDevice. The DeviceOpenFunc function might enable hardware or allocate memory space. The sample driver, bravado.sys, uses its DeviceOpenFunc function to obtain characteristics of the user’s display device, which are placed in the registry by the user-mode driver (see Opening and Closing a Device, Using VCUser.lib).

Support for a DeviceOpenFunc function is optional. If a driver does support the function, it must place its address in the VC_CALLBACK structure supplied by VCKernel.lib.

See Also

DeviceCloseFunc