ReactOS 0.4.15-dev-8241-g63935f8
volpropsheet.h
Go to the documentation of this file.
1/* Copyright (c) Mark Harmstone 2016-17
2 *
3 * This file is part of WinBtrfs.
4 *
5 * WinBtrfs is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public Licence as published by
7 * the Free Software Foundation, either version 3 of the Licence, or
8 * (at your option) any later version.
9 *
10 * WinBtrfs is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public Licence for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public Licence
16 * along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
17
18#pragma once
19
20#include <shlobj.h>
21#ifndef __REACTOS__
22#include "../btrfsioctl.h"
23#include "../btrfs.h"
24#else
25#include "btrfsioctl.h"
26#include "btrfs.h"
27#endif
28#include "balance.h"
29#include "scrub.h"
30
31extern LONG objs_loaded;
32
34public:
36 refcount = 0;
37 ignore = true;
38 stgm_set = false;
39 devices = nullptr;
40
42
43 balance = nullptr;
44 }
45
47 if (stgm_set) {
48 GlobalUnlock(stgm.hGlobal);
50 }
51
52 if (devices)
54
56
57 if (balance)
58 delete balance;
59 }
60
61 // IUnknown
62
64
67 }
68
71
72 if (rc == 0)
73 delete this;
74
75 return rc;
76 }
77
78 // IShellExtInit
79
80 virtual HRESULT __stdcall Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject* pdtobj, HKEY hkeyProgID);
81
82 // IShellPropSheetExt
83
85 virtual HRESULT __stdcall ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam);
86
87 void FormatUsage(HWND hwndDlg, wstring& s, btrfs_usage* usage);
88 void RefreshUsage(HWND hwndDlg);
89 void ShowUsage(HWND hwndDlg);
91 void RefreshDevList(HWND devlist);
93 void ShowDevices(HWND hwndDlg);
94 void ShowScrub(HWND hwndDlg);
95 void ShowChangeDriveLetter(HWND hwndDlg);
97 void ShowStats(HWND hwndDlg, uint64_t devid);
98 void ResetStats(HWND hwndDlg);
99
105
106private:
108 bool ignore;
109 STGMEDIUM stgm;
111 wstring fn;
113};
114
116public:
117 BtrfsChangeDriveLetter(HWND hwnd, const wstring_view& fn) : hwnd(hwnd), fn(fn) {
118 }
119
120 void show();
122
123private:
124 void do_change(HWND hwndDlg);
125
127 wstring fn;
129};
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
BtrfsChangeDriveLetter(HWND hwnd, const wstring_view &fn)
Definition: volpropsheet.h:117
void do_change(HWND hwndDlg)
vector< wchar_t > letters
Definition: volpropsheet.h:128
void ShowScrub(HWND hwndDlg)
virtual HRESULT __stdcall ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
INT_PTR CALLBACK DeviceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK UsageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
void FormatUsage(HWND hwndDlg, wstring &s, btrfs_usage *usage)
void ShowDevices(HWND hwndDlg)
BtrfsBalance * balance
Definition: volpropsheet.h:102
void RefreshDevList(HWND devlist)
INT_PTR CALLBACK StatsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void ShowStats(HWND hwndDlg, uint64_t devid)
void ShowUsage(HWND hwndDlg)
void ResetStats(HWND hwndDlg)
virtual HRESULT __stdcall AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
btrfs_device * devices
Definition: volpropsheet.h:100
ULONG __stdcall Release()
Definition: volpropsheet.h:69
void ShowChangeDriveLetter(HWND hwndDlg)
virtual ~BtrfsVolPropSheet()
Definition: volpropsheet.h:46
void RefreshUsage(HWND hwndDlg)
ULONG __stdcall AddRef()
Definition: volpropsheet.h:65
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define free
Definition: debug_ros.c:5
DLGPROC DlgProc
Definition: desk.c:122
UINT64 uint64_t
Definition: types.h:77
#define CALLBACK
Definition: compat.h:35
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
GLdouble s
Definition: gl.h:2039
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
REFIID riid
Definition: atlbase.h:39
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
#define REFIID
Definition: guiddef.h:118
int32_t INT_PTR
Definition: typedefs.h:64
#define __stdcall
Definition: typedefs.h:25
uint32_t ULONG
Definition: typedefs.h:59
LONG objs_loaded
Definition: main.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
static void Initialize()
Definition: xlate.c:212