| 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 | |
|---|
| 26 | class ERASER_API CFileLockResolver |
|---|
| 27 | { |
|---|
| 28 | public: |
|---|
| 29 | |
|---|
| 30 | CFileLockResolver(BOOL = FALSE); |
|---|
| 31 | ~CFileLockResolver(void); |
|---|
| 32 | void Close(); |
|---|
| 33 | private: |
|---|
| 34 | |
|---|
| 35 | CFileLockResolver(ERASER_HANDLE, BOOL); |
|---|
| 36 | inline void AskUser(BOOL val) |
|---|
| 37 | { |
|---|
| 38 | m_bAskUser = val; |
|---|
| 39 | } |
|---|
| 40 | public: |
|---|
| 41 | void SetHandle(ERASER_HANDLE); |
|---|
| 42 | static void Resolve(LPCTSTR szFileName, CStringArray&); |
|---|
| 43 | private: |
|---|
| 44 | BOOL m_bAskUser; |
|---|
| 45 | CString m_strLockFileList; |
|---|
| 46 | ERASER_HANDLE m_hHandle; |
|---|
| 47 | int m_iMethod; |
|---|
| 48 | unsigned m_iPasses; |
|---|
| 49 | private: |
|---|
| 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 | |
|---|