source: trunk/EraserDll/FileLockResolver.h @ 55

Revision 55, 1.7 KB checked in by lowjoel, 7 years ago (diff)

Rewrote bits of the file lock resolver to be more efficient.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1// FileLockResolver.h
2// $Id$
3//
4// Eraser. Secure data removal. For Windows.
5// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
6// Copyright © 2002-2006  Garrett Trant (gtrant@heidi.ie).
7// Copyright © 2007 The Eraser Project
8//
9// This program is free software; you can redistribute it and/or
10// modify it under the terms of the GNU General Public License
11// as published by the Free Software Foundation; either version 2
12// of the License, or (at your option) any later version.
13//
14// This program is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with this program; if not, write to the Free Software
21// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22// 02111-1307, USA.
23#pragma once
24#include "EraserDll.h"
25
26class ERASER_API CFileLockResolver
27{
28public:
29   
30    CFileLockResolver(BOOL = FALSE);
31    ~CFileLockResolver(void);
32    void Close();
33private:
34   
35    CFileLockResolver(ERASER_HANDLE, BOOL);
36    inline void AskUser(BOOL val)
37    {
38        m_bAskUser = val;
39    }
40public:
41    void SetHandle(ERASER_HANDLE);
42    static void Resolve(LPCTSTR szFileName, CStringArray&);
43private:
44    BOOL m_bAskUser;   
45    CString m_strLockFileList;
46    ERASER_HANDLE m_hHandle;
47    int m_iMethod;
48    unsigned m_iPasses;
49private:
50    static CString GetLockFilePath(bool path_only = false);
51    void HandleError(LPCTSTR szFileName, DWORD dwErrorCode, int method, unsigned int passes);
52    static DWORD ErrorHandler(LPCTSTR szFileName, DWORD dwErrorCode, void* ctx, void* param);
53};
54
Note: See TracBrowser for help on using the repository browser.