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