VC_RemoveDriver

LRESULT
VC_RemoveDriver(
PVC_PROFILE_INFO
pProfile
);

The VC_RemoveDriver function unloads a kernel-mode video capture driver and marks the kernel-mode driver service for deletion.

Parameters

pProfile

Address of the VC_PROFILE_INFO structure returned by VC_OpenProfileAccess.

Return Value

Returns one the following error values.

Value Definition
DRVCNF_OK Indicates the driver service has been marked for deletion.
DRVCNF_CANCEL Indicates an error occurred.

Comments

The VC_RemoveDriver function performs the following operations, in order:

1.Unloads the kernel-mode driver, if it is loaded.

2.Sets the kernel-mode driver service's start type to SERVICE_DEMAND_START, so it will not automatically reload when the system is restarted. (For details, see ChangeServiceConfig in the Win32 SDK.)

3.Calls DeleteService, described in the Win32 SDK, to mark the kernel-mode driver service for deletion.

A user-mode driver should call VC_RemoveDriver when its DriverProc function receives a DRV_REMOVE message. Before calling VC_RemoveDriver, the driver should call VC_ConfigAccess to determine if the client has Administrators privilege.

The profile information handle specified by pProfile remains open after this function removes the registry entry. Use VC_CloseProfileAccess to close the profile information handle after calling VC_RemoveDriver.