Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32test\virus\t_vshook.h
18 #if !defined(__T_VSSHOOK_H__)
19 #define __T_VSSHOOK_H__
21 #include <f32plugin.h>
24 The buffer sized used when scanning a file for a virus.
27 const TInt KScanBufferSize = 512;
30 The maximum number of virus signatures that can be stored
31 in a virus scanner definition file.
34 const TInt KMaxVirusSignatures = 100;
38 The actual implementation of the test virus scanning hook.
39 It implements all of the pure virtual functions from CVirusHook.
42 class CTestVirusHook: public CFsPlugin
45 static CTestVirusHook* NewL();
48 virtual void InitialiseL();
49 virtual TInt DoRequestL(TFsPluginRequest& aRequest);
52 enum TOperation {EFileOpen, EFileDelete, EFileRename, EFileClose};
57 TInt VsFileOpen(TFsPluginRequest& aRequest);
58 void VsFileClose(TFsPluginRequest& aRequest);
59 TInt VsFileRename(TFsPluginRequest& aRequest);
60 TInt VsDirRename(TFsPluginRequest& aRequest);
61 TInt VsReadFileSection(TFsPluginRequest& aRequest);
62 TInt VsFileDelete(TFsPluginRequest& aRequest);
63 TInt VirusScannerName(TDes& aName);
67 Signature for binary compatibility testing
72 The virus scanners file server session
77 The virus scanner thread.
82 An array containing the known virus signatures for the test virus
83 scanner. This array is filled up by the virus scanner thread when
87 HBufC8* iKnownSignatures[KMaxVirusSignatures];
89 The number of signatures which have been loaded in the iKnownSignatures
93 TInt iSignaturesLoaded;
95 A pointer to the class containing all of the functions executed within the
96 virus scanning thread.
99 // CTestVsThread* iVsThreadClass;
102 TInt ScanFile(const TDesC& aName);
103 void CleanFile(const TDesC& aName, TInt aOperation);
105 TInt ValidateRequest(TFsPluginRequest& aRequest, TFileName& aFileName);
106 TInt ReadVirusDefinitionFile();
109 An internal buffer used when scanning a file for virus signatures.
112 TBuf8<KScanBufferSize> iScanBuf;