Device Manager calls xxx_Deinit function to de-initialize your device.
BOOL xxx_Deinit( DWORD hDeviceContext );
Returns TRUE if the device successfully de-initialized, otherwise it returns FALSE.
When the user stops using a device, such as when a PC Card is removed from its socket, Device Manager calls this function. This function is not called by applications.
Your installable device driver should free any resources it has allocated and terminate.