VC_Cleanup

VOID
VC_Cleanup(
    PDRIVER_OBJECT
pDriverObject
   
);

The VC_Cleanup function deallocates the system resources that were allocated by a previous call to VC_Init.

Parameters
pDriverObject
The driver object pointer received as input to the driver’s DriverEntry function.
Return Value

None.

Comments

A kernel-mode video capture driver should call VC_Cleanup if a failure occurs within its DriverEntry function after VC_Init has been called.

Additionally, the VCKernel.lib library specifies VC_Cleanup as the function to be called when the kernel-mode driver is unloaded (by assigning the function’s address to the driver object’s DriverUnload member).

The VC_Cleanup function performs the following operations, in the order listed:

  1. Cancels outstanding IRPs.

  2. Calls the kernel-mode driver’s CleanupFunc function.

  3. Unmaps mapped I/O memory space.

  4. Removes the device’s interrupt objects.

  5. Releases system resources (interrupt number, DMA channel, and so on) reserved for the device.

  6. Removes the device object associated with the device.

For more information about driver objects, device objects and interrupt objects, see the Kernel-Mode Drivers Design Guide.