The following functions implemented in on-demand scanning are supported:
Each time KAV SDK detects a malware in a file handled by scanning function, it checks to see if the infected file has already been run once. The following checkups are performed:
In any cleaning mode, the EVENT_PREDETECT callback event raises before detection events. It enables to cancel further scanning of the object by using the corresponding callback function return code (see section "Callback function return values").
When a malicious code is detected within the scanned file and the KAV SDK has verified that the infected file is either present in the start-up list, loaded into system memory or has been started at least once since the KAV SDK initialization, callback function is called with the EVENT_DETECT event (see section "Event notification codes"). As a result, the callback function returns the CLBK_OK return value if the user decides to continue the scanning process.
If the checkups made have shown that infected file has not been run yet, it is not currently loaded into the system memory and is not listed in the start-up list, and this file is protected from deletion, the KAV SDK marks it for future deletion. This deletion will be performed on the next reboot. If this is the case, callback function is called with the EVENT_DELETED event where dwParam1 parameter is set to KDLT_ON_REBOOT. The scanning function continues its work and moves to the next file in the queue of files added for scanning by on-demand file or File Monitor. When scanning is finished, callback function is invoked with the EVENT_REBOOTNEEDED event where the dwParam1 parameter is set to KRT_PROPOSED. This indicates that the end-user's computer must be restarted for infected file to be deleted on the operating system boot-up.
To notify you that the scanned file will be placed on the queue for disinfection KAV SDK calls your callback handler with the EVENT_DISINFECTED. When in this same call the dwParam1 argument of the callback function is initialized to 1, an integer value that stands for literal KDIS_ON_REBOOT, it indicates that attempt to disinfect the queued file will be made on the next start of the operating system.
If a scanning function has been invoked by on-demand scanning or File Monitor with the dwCleaningMode parameter set to KAV_CLEAN_DELETE, scanning will continue only if the EVENT_CLEANFAILED callback event arises indicating that normal scanning procedure has failed to disinfect the file with detected malware. If the EVENT_DISINFECTED arises indicating that the KAV Engine has successfully disinfected the file, scanning task will continue to run. No EVENT_ALLOW_ADVDIS event will be issued.
The KAV SDK now asks the user if the Advanced Disinfection procedure should be started by running callback function with the EVENT_ALLOW_ADVDIS event. If the user returns the CLBK_OK value from the callback function, the KAV SDK invokes the Advanced Disinfection mechanism.
If the user returns the CLBK_CANCEL_OBJECT code, the KAV SDK will skip starting Advanced Disinfection trying to delete infected file in a normal way.
When the Advanced Disinfection mode starts during the scan process, the scan task that initiated start of advanced disinfection procedure gets canceled by KAV SDK. The KAV_S_R_CANCELED value is returned after that. Because the initial scan has been interrupted forcibly, a rescan has to be performed when advanced disinfection process is finished. This happens because the KAV Engine has no information if all of the files that had to be scanned where actually scanned by the time the Advanced Disinfection started. Additionally, all the user and system activity is intercepted by KAV Engine and blocked during the Advanced Disinfection to prevent malware activity.
After the KAV SDK cancels the scanning task initiated by on-demand scan or File Monitor, it starts the new task. The Advanced Disinfection mechanism runs in this newly created task. The user context (*ctx) and scanning mode (dwScanningMode) scanning function parameters and their values are inherited by the new task from the canceled scanning tasks.
As the task starts, the EVENT_ADVDIS_STARTED event is raised and the Advanced Disinfection invokes its malware elimination methods. The following actions are performed:
Blocking will not be made for operations performed by a thread of a trusted process.
EVENT_DETECT eventWhile scanning continues, the KAV Engine marks all the infected objects for deletion and deletes them when possible.
This process is similar to the scanning process running in the KAV_DELETE cleaning mode.
Advanced Disinfection mode is also supported for infected files detected on remote locations such as a network share or a network drive if these files have once been started locally.
Infected file may be locked from deletion by active malware. If the deleting the file is not possible because a malware locks it, the KAV SDK will mark the file to be deleted on the next reboot. When the end-user is restarted, the driver will delete marked file on the system boot-up stage before any malware is able to start and trap the deletion by placing its hooks. If this is the case, callback function is called with the EVENT_DELETED event where dwParam1 parameter is set to KDLT_ON_REBOOT and scanning function proceeds with the next file.
If preparing the file for further deletion fails, callback function is called with the EVENT_ERROR event where dwParam1 parameter is set to KAV_E_DELETE_ON_REBOOT_FAILED. For more information about possible errors, see section "Return codes".
CLBK_OK value from the callback function, the KAV SDK initiates its writing blocking mechanism.If the user returns the CLBK_CANCEL_OBJECT code, the KAV SDK skips scanning the object which is being scanned at the moment and moves to the next object.
If the user returns the CLBK_CANCEL_ALL code, the KAV SDK stops the Advanced Disinfection task and invokes the callback function with the EVENT_REBOOTNEEDED event where dwParam1 parameter is set to KRT_REQUIRED.
It is highly recommended that you perform a full rescan of all the files on the target computer when advanced disinfection is finished and computer is restarted.
EVENT_REBOOTNEEDED event where the dwParam1 parameter is set to KRT_REQUIRED (see section "Callback function prototype").Additional security measures are taken by KAV Engine when running Advanced Disinfection on a Windows 8 platform. See section "Restricted restart and shutdown on Windows 8" for detail.