Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
vrsprov.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:
Windows Kernel
Development Platform:
Visual C++
- #include "..vrsscan.h"
- #include "util.h"
- #include "vrsprov.h"
- #include "provmn.h"
- CVirusProvider1::CVirusProvider1(IUnknown *punkOut, IUnknown **punkRet)
- {
- cObjRef = 0;
- if(punkOut == NULL)
- *punkRet = (IVirusScanEngine *)this;
- else
- *punkRet = NULL;
- AddRef();
- }
- //QueryInterface
- STDMETHODIMP CVirusProvider1::QueryInterface(REFIID riid, void **ppv)
- {
- *ppv = NULL;
- //IUnknown
- if((riid == IID_IUnknown) || (riid == IID_IVirusScanEngine))
- *ppv = (IVirusScanEngine *)this;
- // Sorry...
- if(*ppv == NULL)
- return ResultFromScode(E_NOINTERFACE);
- ((IUnknown *) *ppv)->AddRef();
- return NOERROR;
- }
- // AddRef - pretty boring
- STDMETHODIMP_(ULONG) CVirusProvider1::AddRef(void)
- {
- cObjRef++;
- return cObjRef;
- }
- // Release - pretty boring as is
- // a provider may want to do delayed unloading here
- STDMETHODIMP_(ULONG) CVirusProvider1::Release(void)
- {
- cObjRef--;
- if(cObjRef != 0)
- return cObjRef;
- delete this;
- return 0;
- }
- // Silly, trivial implementation of scan for virus.
- // Probably call off into existing entry point that does some work.
- STDMETHODIMP CVirusProvider1::ScanForVirus(STGMEDIUM *pstgMedium, DWORD dwFlags, LPVIRUSINFO pvrsinfo)
- {
- if(MessageBox(NULL, TEXT("Do you want to report a virus?"), TEXT("Microsoft VSEngine Test Driver"), MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL) == IDYES)
- {
- if(pvrsinfo != NULL)
- {
- CopyWideStr((pvrsinfo)->wszVirusName, L"Ebola Virus");
- CopyWideStr((pvrsinfo)->wszVirusDescription, L"A nasty little virus");
- }
- return S_FALSE;
- }
- else
- return S_OK;
- }
- STDMETHODIMP CVirusProvider1::DisplayCustomInfo(void)
- {
- MessageBox(NULL, TEXT("This is a fake driver that simulates the functionality of a virus scanner."),
- TEXT("Microsoft VSEngine Test Driver"), MB_OK);
- return S_OK;
- }