summaryrefslogtreecommitdiff
path: root/NSCmpts/WipefreeSpace.h
blob: 9c68a2083243934ad2b76725a461c2c466aed90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// WipefreeSpace.h : Declaration of the CWipefreeSpace

#ifndef __WIPEFREESPACE_H_
#define __WIPEFREESPACE_H_

#include "resource.h"       // main symbols
#include "../Common/CmptData.h"
#include <contexthelp.h>

#define MAX_DRIVES 15

/////////////////////////////////////////////////////////////////////////////
// CWipefreeSpace
class ATL_NO_VTABLE CWipefreeSpace : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CWipefreeSpace, &CLSID_WipefreeSpace>,
	public ISupportErrorInfo,
	public IDispatchImpl<ISecureShutdownDOS, &IID_ISecureShutdownDOS, &LIBID_NightSecCmpts>,
	public IPropertyPageImpl<CWipefreeSpace>,
//	public CDialogImpl<CWipefreeSpace>
	public CDialogImplEx,
	public CContextHelp<CWipefreeSpace>
{
// Construction
public:
	CWipefreeSpace() : CDialogImplEx(IDD)
	{
		m_dwTitleID = IDS_TITLEWipeFreeSpace;
		m_dwHelpFileID = IDS_NSHELPFILE;
		m_dwDocStringID = IDS_DOCSTRINGWipeFreeSpace;
		m_bCustomDrives = true;
	}
	~CWipefreeSpace()
		{ ATLTRACE(_T("Destroying WipefreeSpace\n")); }

DECLARE_REGISTRY_RESOURCEID(IDR_WIPEFREESPACE)

BEGIN_COM_MAP(CWipefreeSpace)
	COM_INTERFACE_ENTRY(ISecureShutdownDOS)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY_IMPL(IPropertyPage)
END_COM_MAP()

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// ISecureShutdownDOS
public:
	STDMETHOD(get_Info)(/*[in]*/ NightSecInfo nsItem, /*[out, retval]*/ VARIANT* pvVal);
	STDMETHOD(GetBatchText)(/*[out, retval]*/ BSTR* psText);
	STDMETHOD(SetData)(/*[in]*/ IUnknown* pUnk);

// Data
protected:
	bool m_bCustomDrives;
	int m_nDrives;
	CPropertyBag m_Data;


///////////////////////////////////////////////////////////////////
// Property Sheet Stuff

public:

	enum {IDD = IDD_WIPEFREESPACE};

	BEGIN_MSG_MAP(CWipefreeSpace)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_RANGE_HANDLER(IDC_FIRST_DRIVE, IDC_FIRST_DRIVE + MAX_DRIVES - 1, OnDrivesChange)
		CHAIN_MSG_MAP(IPropertyPageImpl<CWipefreeSpace>)
		CHAIN_MSG_MAP(CContextHelp<CWipefreeSpace>)
	END_MSG_MAP()

	BEGIN_HELP_MAP(NS_HELP_FILE)
		HELP_ID(IDC_FIRST_DRIVE, 4024)
		HELP_ID(IDC_FIRST_DRIVE2, 4024)
		HELP_ID(IDC_FIRST_DRIVE3, 4024)
		HELP_ID(IDC_FIRST_DRIVE4, 4024)
		HELP_ID(IDC_FIRST_DRIVE5, 4024)
		HELP_ID(IDC_FIRST_DRIVE6, 4024)
		HELP_ID(IDC_FIRST_DRIVE7, 4024)
		HELP_ID(IDC_FIRST_DRIVE8, 4024)
		HELP_ID(IDC_FIRST_DRIVE9, 4024)
		HELP_ID(IDC_FIRST_DRIVE10, 4024)
		HELP_ID(IDC_FIRST_DRIVE11, 4024)
		HELP_ID(IDC_FIRST_DRIVE12, 4024)
		HELP_ID(IDC_FIRST_DRIVE13, 4024)
		HELP_ID(IDC_FIRST_DRIVE14, 4024)
		HELP_ID(IDC_FIRST_DRIVE15, 4024)
	END_HELP_MAP

// Property Sheet Messages
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnDrivesChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

public:
	STDMETHOD(Apply)(void);

};

#endif //__WIPEFREESPACE_H_