1.9 KiB
1.9 KiB
page_type, languages, products, name, urlFragment, description, extendedZipContent
| page_type | languages | products | name | urlFragment | description | extendedZipContent | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sample |
|
|
IAmsiStream interface sample | iamsistream-sample | Demonstrates how to use the Antimalware Scan Interface to scan a stream. |
|
IAmsiStream interface sample
Demonstrates how to use the Antimalware Scan Interface to scan a stream.
The sample implements the IAmsiStream interface so that an antimalware provider can use it to scan the contents of a stream.
The sample demonstrates a stream where the data comes from a file and a stream where the data comes from an in-memory buffer.
Instructions
- Load the Project solution.
- Go to Project Properties, Debugging.
- To scan an in-memory buffer, leave the Command Arguments blank. To scan a file, enter the file's complete path in the Command Arguments.
- Press F5 to build and run.
Sample output
Creating stream object with file name: C:\sample.txt
Calling antimalware->Scan() ...
GetAttribute() called with: attribute = 0, bufferSize = 1
GetAttribute() called with: attribute = 0, bufferSize = 68
GetAttribute() called with: attribute = 1, bufferSize = 1
GetAttribute() called with: attribute = 1, bufferSize = 28
GetAttribute() called with: attribute = 2, bufferSize = 8
GetAttribute() called with: attribute = 3, bufferSize = 8
Read() called with: position = 0, size = 507
GetAttribute() called with: attribute = 4, bufferSize = 8
GetAttribute() called with: attribute = 6, bufferSize = 8
GetAttribute() called with: attribute = 8, bufferSize = 8
GetAttribute() called with: attribute = 2, bufferSize = 8
GetAttribute() called with: attribute = 3, bufferSize = 8
Scan result is 1. IsMalware: 0
Provider display name: Windows Defender Antivirus
Leaving with hr = 0x0