Aspects of the subject matter described herein relate to antivirus
protection and transactions. In aspects, a filter detects that a file is
participating in a transaction and then may cause the file to be scanned
together with any changes that have made to the file during the
transaction. After a file is scanned, a cache entry may be updated to
indicate that the file is clean. The cache entry may be used subsequently
for like-type states. For example, if the file was scanned inside a
transaction, the cache entry may be used later in the transaction. If the
file was scanned outside a transaction, the cache entry may be used later
for requests pertaining to files not in a transaction. Cache entries may
be discarded when they are invalid or no longer useful.