ReactOS  0.4.14-dev-1252-g782ff23
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 
31 extern LONG objs_loaded;
32 
34 public:
36  refcount = 0;
37  ignore = true;
38  stgm_set = false;
39  devices = nullptr;
40 
42 
43  balance = nullptr;
44  }
45 
46  virtual ~BtrfsVolPropSheet() {
47  if (stgm_set) {
48  GlobalUnlock(stgm.hGlobal);
50  }
51 
52  if (devices)
53  free(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 
101  bool readonly;
104  bool uuid_set;
105 
106 private:
108  bool ignore;
109  STGMEDIUM stgm;
110  bool stgm_set;
111  wstring fn;
113 };
114 
116 public:
117  BtrfsChangeDriveLetter(HWND hwnd, const wstring_view& fn) : hwnd(hwnd), fn(fn) {
118  }
119 
120  void show();
121  INT_PTR DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
122 
123 private:
124  void do_change(HWND hwndDlg);
125 
127  wstring fn;
129 };
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
void ShowChangeDriveLetter(HWND hwndDlg)
#define REFIID
Definition: guiddef.h:118
INT_PTR CALLBACK StatsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void do_change(HWND hwndDlg)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
REFIID riid
Definition: precomp.h:44
#define free
Definition: debug_ros.c:5
virtual HRESULT __stdcall ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
btrfs_device * devices
Definition: volpropsheet.h:100
#define CALLBACK
Definition: compat.h:27
INT_PTR CALLBACK DeviceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BtrfsBalance * balance
Definition: volpropsheet.h:102
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
UINT_PTR WPARAM
Definition: windef.h:207
int32_t INT_PTR
Definition: typedefs.h:63
ULONG __stdcall Release()
Definition: volpropsheet.h:69
void ShowScrub(HWND hwndDlg)
WPARAM wParam
Definition: combotst.c:138
void FormatUsage(HWND hwndDlg, wstring &s, btrfs_usage *usage)
long LONG
Definition: pedump.c:60
BtrfsChangeDriveLetter(HWND hwnd, const wstring_view &fn)
Definition: volpropsheet.h:117
virtual HRESULT __stdcall AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
virtual ~BtrfsVolPropSheet()
Definition: volpropsheet.h:46
LONG objs_loaded
Definition: main.cpp:48
LONG_PTR LPARAM
Definition: windef.h:208
ULONG __stdcall AddRef()
Definition: volpropsheet.h:65
void ShowUsage(HWND hwndDlg)
LONG HRESULT
Definition: typedefs.h:78
INT_PTR CALLBACK UsageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void ShowDevices(HWND hwndDlg)
#define __stdcall
Definition: typedefs.h:25
void ResetStats(HWND hwndDlg)
#define InterlockedDecrement
Definition: armddk.h:52
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLdouble s
Definition: gl.h:2039
vector< wchar_t > letters
Definition: volpropsheet.h:128
void ShowStats(HWND hwndDlg, uint64_t devid)
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
UINT64 uint64_t
Definition: types.h:77
void RefreshUsage(HWND hwndDlg)
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
virtual HRESULT __stdcall Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
INT_PTR DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned int ULONG
Definition: retypes.h:1
void RefreshDevList(HWND devlist)
LPARAM lParam
Definition: combotst.c:139