ReactOS  0.4.13-dev-645-g69454b4
BtrfsDeviceAdd Class Reference

#include <devices.h>

Collaboration diagram for BtrfsDeviceAdd:

Public Member Functions

INT_PTR CALLBACK DeviceAddDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void ShowDialog ()
 
void AddDevice (HWND hwndDlg)
 
 BtrfsDeviceAdd (HINSTANCE hinst, HWND hwnd, WCHAR *cmdline)
 

Private Member Functions

void populate_device_tree (HWND tree)
 

Private Attributes

HINSTANCE hinst
 
HWND hwnd
 
WCHARcmdline
 
devicesel
 
vector< devicedevice_list
 

Detailed Description

Definition at line 139 of file devices.h.

Constructor & Destructor Documentation

◆ BtrfsDeviceAdd()

BtrfsDeviceAdd::BtrfsDeviceAdd ( HINSTANCE  hinst,
HWND  hwnd,
WCHAR cmdline 
)

Definition at line 677 of file devices.cpp.

677  {
678  this->hinst = hinst;
679  this->hwnd = hwnd;
680  this->cmdline = cmdline;
681 
682  sel = nullptr;
683 }
WCHAR * cmdline
Definition: devices.h:151
HINSTANCE hinst
Definition: devices.h:149
device * sel
Definition: devices.h:152

Member Function Documentation

◆ AddDevice()

void BtrfsDeviceAdd::AddDevice ( HWND  hwndDlg)

Definition at line 525 of file devices.cpp.

525  {
526  wstring mess, title;
531 
532  if (!sel) {
533  EndDialog(hwndDlg, 0);
534  return;
535  }
536 
537  if (sel->fstype != L"") {
538  wstring s;
539 
541  throw last_error(GetLastError());
542 
543  wstring_sprintf(mess, s, sel->fstype.c_str());
544  } else {
546  throw last_error(GetLastError());
547  }
548 
550  throw last_error(GetLastError());
551 
552  if (MessageBoxW(hwndDlg, mess.c_str(), title.c_str(), MB_YESNO) != IDYES)
553  return;
554 
557 
558  if (h == INVALID_HANDLE_VALUE)
559  throw last_error(GetLastError());
560 
561  {
562  nt_handle h2;
563 
564  vn.Length = vn.MaximumLength = (uint16_t)(sel->pnp_name.length() * sizeof(WCHAR));
565  vn.Buffer = (WCHAR*)sel->pnp_name.c_str();
566 
568 
570  if (!NT_SUCCESS(Status))
571  throw ntstatus_error(Status);
572 
573  if (!sel->is_disk) {
574  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_LOCK_VOLUME, nullptr, 0, nullptr, 0);
575  if (!NT_SUCCESS(Status))
577  }
578 
579  Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_ADD_DEVICE, &h2, sizeof(HANDLE), nullptr, 0);
580  if (!NT_SUCCESS(Status))
581  throw ntstatus_error(Status);
582 
583  if (!sel->is_disk) {
584  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_DISMOUNT_VOLUME, nullptr, 0, nullptr, 0);
585  if (!NT_SUCCESS(Status))
586  throw ntstatus_error(Status);
587 
588  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_UNLOCK_VOLUME, nullptr, 0, nullptr, 0);
589  if (!NT_SUCCESS(Status))
590  throw ntstatus_error(Status);
591  }
592  }
593 
594  EndDialog(hwndDlg, 0);
595 }
#define FILE_GENERIC_READ
Definition: nt_native.h:653
WCHAR * cmdline
Definition: devices.h:151
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
wstring fstype
Definition: devices.h:41
#define IDS_ADD_DEVICE_CONFIRMATION
Definition: resource.h:97
#define IDYES
Definition: winuser.h:829
LONG NTSTATUS
Definition: precomp.h:26
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
NTSYSCALLAPI NTSTATUS NTAPI NtFsControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG FsControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength)
#define IDS_CONFIRMATION_TITLE
Definition: resource.h:96
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define uint16_t
Definition: nsiface.idl:60
bool is_disk
Definition: devices.h:50
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
device * sel
Definition: devices.h:152
#define FILE_SHARE_READ
Definition: compat.h:125
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FILE_TRAVERSE
Definition: nt_native.h:643
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
#define MB_YESNO
Definition: winuser.h:811
#define OPEN_EXISTING
Definition: compat.h:426
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
void wstring_sprintf(wstring &s, wstring fmt,...)
Definition: main.cpp:225
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3951
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
wstring pnp_name
Definition: devices.h:38
Definition: cookie.c:170
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
__u8 attr
Definition: mkdosfs.c:359
static const WCHAR L[]
Definition: oid.c:1250
GLdouble s
Definition: gl.h:2039
Status
Definition: gdiplustypes.h:24
#define FILE_GENERIC_WRITE
Definition: nt_native.h:660
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
#define FSCTL_BTRFS_ADD_DEVICE
Definition: btrfsioctl.h:20
#define CreateFileW
Definition: compat.h:400
#define IDS_ADD_DEVICE_CONFIRMATION_FS
Definition: resource.h:98
#define IDS_LOCK_FAILED
Definition: resource.h:121
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
#define FILE_FLAG_OPEN_REPARSE_POINT
Definition: disk.h:39
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint vn
Definition: glfuncs.h:238
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
static char title[]
Definition: ps.c:92

Referenced by DeviceAddDlgProc().

◆ DeviceAddDlgProc()

INT_PTR CALLBACK BtrfsDeviceAdd::DeviceAddDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 597 of file devices.cpp.

597  {
598  try {
599  switch (uMsg) {
600  case WM_INITDIALOG:
601  {
604  EnableWindow(GetDlgItem(hwndDlg, IDOK), false);
605  break;
606  }
607 
608  case WM_COMMAND:
609  switch (HIWORD(wParam)) {
610  case BN_CLICKED:
611  switch (LOWORD(wParam)) {
612  case IDOK:
613  AddDevice(hwndDlg);
614  return true;
615 
616  case IDCANCEL:
617  EndDialog(hwndDlg, 0);
618  return true;
619  }
620  break;
621  }
622  break;
623 
624  case WM_NOTIFY:
625  switch (((LPNMHDR)lParam)->code) {
626  case TVN_SELCHANGEDW:
627  {
628  NMTREEVIEWW* nmtv = (NMTREEVIEWW*)lParam;
629  TVITEMW tvi;
630  bool enable = false;
631 
632  RtlZeroMemory(&tvi, sizeof(TVITEMW));
633  tvi.hItem = nmtv->itemNew.hItem;
634  tvi.mask = TVIF_PARAM | TVIF_HANDLE;
635 
636  if (SendMessageW(GetDlgItem(hwndDlg, IDC_DEVICE_TREE), TVM_GETITEMW, 0, (LPARAM)&tvi))
637  sel = tvi.lParam == 0 ? nullptr : (device*)tvi.lParam;
638  else
639  sel = nullptr;
640 
641  if (sel)
642  enable = (!sel->is_disk || !sel->has_parts) && !sel->multi_device;
643 
644  EnableWindow(GetDlgItem(hwndDlg, IDOK), enable);
645  break;
646  }
647  }
648  break;
649  }
650  } catch (const exception& e) {
651  error_message(hwndDlg, e.what());
652  }
653 
654  return false;
655 }
void populate_device_tree(HWND tree)
Definition: devices.cpp:351
#define IDOK
Definition: winuser.h:824
bool multi_device
Definition: devices.h:49
UINT mask
Definition: commctrl.h:3288
bool is_disk
Definition: devices.h:50
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
device * sel
Definition: devices.h:152
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:738
Definition: devices.h:37
#define e
Definition: ke_i.h:82
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
LONG_PTR LPARAM
Definition: windef.h:208
#define TVN_SELCHANGEDW
Definition: commctrl.h:3620
TVITEMW itemNew
Definition: commctrl.h:3610
if(!(yy_init))
Definition: macro.lex.yy.c:714
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HRESULT WINAPI EnableThemeDialogTexture(_In_ HWND hwnd, _In_ DWORD dwFlags)
Definition: uxthemesupp.c:55
void AddDevice(HWND hwndDlg)
Definition: devices.cpp:525
#define BN_CLICKED
Definition: winuser.h:1886
#define WM_COMMAND
Definition: winuser.h:1716
#define TVIF_HANDLE
Definition: commctrl.h:3242
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
GLboolean enable
Definition: glext.h:11120
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HTREEITEM hItem
Definition: commctrl.h:3289
bool has_parts
Definition: devices.h:45
#define HIWORD(l)
Definition: typedefs.h:246
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define TVM_GETITEMW
Definition: commctrl.h:3458
#define TVIF_PARAM
Definition: commctrl.h:3240
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_DEVICE_TREE
Definition: resource.h:304

Referenced by stub_DeviceAddDlgProc().

◆ populate_device_tree()

void BtrfsDeviceAdd::populate_device_tree ( HWND  tree)
private

Definition at line 351 of file devices.cpp.

351  {
352  HWND hwnd = GetParent(tree);
353  unsigned int i;
354  ULONG last_disk_num = 0xffffffff;
355  HTREEITEM diskitem;
360  btrfs_filesystem* bfs = nullptr;
361 
362  static WCHAR btrfs[] = L"\\Btrfs";
363 
364  device_list.clear();
365 
366  {
367  nt_handle mountmgr;
368 
370  InitializeObjectAttributes(&attr, &us, 0, nullptr, nullptr);
371 
374 
375  if (!NT_SUCCESS(Status))
377 
378  {
379  nt_handle btrfsh;
380 
381  us.Length = us.MaximumLength = (uint16_t)(wcslen(btrfs) * sizeof(WCHAR));
382  us.Buffer = btrfs;
383 
384  InitializeObjectAttributes(&attr, &us, 0, nullptr, nullptr);
385 
388  if (NT_SUCCESS(Status)) {
389  ULONG bfssize = 0;
390 
391  do {
392  bfssize += 1024;
393 
394  if (bfs) free(bfs);
395  bfs = (btrfs_filesystem*)malloc(bfssize);
396 
397  Status = NtDeviceIoControlFile(btrfsh, nullptr, nullptr, nullptr, &iosb, IOCTL_BTRFS_QUERY_FILESYSTEMS, nullptr, 0, bfs, bfssize);
399  free(bfs);
400  bfs = nullptr;
401  break;
402  }
403  } while (Status == STATUS_BUFFER_OVERFLOW);
404 
405  if (bfs && bfs->num_devices == 0) { // no mounted filesystems found
406  free(bfs);
407  bfs = nullptr;
408  }
409  }
410  }
411 
412  find_devices(hwnd, &GUID_DEVINTERFACE_DISK, mountmgr, device_list);
413  find_devices(hwnd, &GUID_DEVINTERFACE_VOLUME, mountmgr, device_list);
414  find_devices(hwnd, &GUID_DEVINTERFACE_HIDDEN_VOLUME, mountmgr, device_list);
415  }
416 
417 #ifndef __REACTOS__ // Disabled because building with our <algorithm> seems complex right now...
419 #endif
420 
421  for (i = 0; i < device_list.size(); i++) {
422  if (!device_list[i].ignore) {
423  TVINSERTSTRUCTW tis;
424  HTREEITEM item;
425  wstring name, size;
426 
427  if (device_list[i].disk_num != 0xffffffff && device_list[i].disk_num == last_disk_num)
428  tis.hParent = diskitem;
429  else
430  tis.hParent = TVI_ROOT;
431 
432  tis.hInsertAfter = TVI_LAST;
434  tis.itemex.state = TVIS_EXPANDED;
436 
437  if (device_list[i].disk_num != 0xffffffff) {
438  wstring t;
439 
440  if (!load_string(module, device_list[i].part_num != 0 ? IDS_PARTITION : IDS_DISK_NUM, t))
441  throw last_error(GetLastError());
442 
443  wstring_sprintf(name, t, device_list[i].part_num != 0 ? device_list[i].part_num : device_list[i].disk_num);
444  } else
445  name = device_list[i].pnp_name;
446 
447  // match child Btrfs devices to their parent
448  if (bfs && device_list[i].drive == L"" && device_list[i].fstype == L"Btrfs") {
449  btrfs_filesystem* bfs2 = bfs;
450 
451  while (true) {
452  if (RtlCompareMemory(&bfs2->uuid, &device_list[i].fs_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
453  ULONG j, k;
455 
456  for (j = 0; j < bfs2->num_devices; j++) {
457  if (j == 0)
458  dev = &bfs2->device;
459  else
461 
462  if (RtlCompareMemory(&device_list[i].dev_uuid, &device_list[i].dev_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
463  for (k = 0; k < device_list.size(); k++) {
464  if (k != i && device_list[k].fstype == L"Btrfs" && device_list[k].drive != L"" &&
465  RtlCompareMemory(&device_list[k].fs_uuid, &device_list[i].fs_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
466  device_list[i].drive = device_list[k].drive;
467  break;
468  }
469  }
470 
471  device_list[i].multi_device = bfs2->num_devices > 1;
472 
473  break;
474  }
475  }
476 
477  break;
478  }
479 
480  if (bfs2->next_entry != 0)
481  bfs2 = (btrfs_filesystem*)((uint8_t*)bfs2 + bfs2->next_entry);
482  else
483  break;
484  }
485  }
486 
487  name += L" (";
488 
489  if (device_list[i].friendly_name != L"") {
490  name += device_list[i].friendly_name;
491  name += L", ";
492  }
493 
494  if (device_list[i].drive != L"") {
495  name += device_list[i].drive;
496  name += L", ";
497  }
498 
499  if (device_list[i].fstype != L"") {
500  name += device_list[i].fstype;
501  name += L", ";
502  }
503 
504  format_size(device_list[i].size, size, false);
505  name += size;
506 
507  name += L")";
508 
509  tis.itemex.pszText = (WCHAR*)name.c_str();
510  tis.itemex.cchTextMax = name.length();
511  tis.itemex.lParam = (LPARAM)&device_list[i];
512 
514  if (!item)
516 
517  if (device_list[i].part_num == 0) {
518  diskitem = item;
519  last_disk_num = device_list[i].disk_num;
520  }
521  }
522  }
523 }
#define FILE_GENERIC_READ
Definition: nt_native.h:653
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDS_PARTITION
Definition: resource.h:92
LPARAM lParam
Definition: commctrl.h:3327
HTREEITEM hParent
Definition: commctrl.h:3365
#define TVM_INSERTITEMW
Definition: commctrl.h:3380
iterator end()
Definition: _vector.h:184
static const BYTE us[]
Definition: encode.c:689
#define IOCTL_BTRFS_QUERY_FILESYSTEMS
Definition: btrfsioctl.h:22
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
int ignore(int trapCode, ppc_trap_frame_t *trap)
Definition: mmuobject.c:296
#define free
Definition: debug_ros.c:5
LPWSTR pszText
Definition: commctrl.h:3322
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3236
LONG NTSTATUS
Definition: precomp.h:26
GLdouble GLdouble t
Definition: gl.h:2047
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
UINT stateMask
Definition: commctrl.h:3321
#define IDS_TVM_INSERTITEM_FAILED
Definition: resource.h:208
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define uint16_t
Definition: nsiface.idl:60
#define MOUNTMGR_DEVICE_NAME
Definition: imports.h:76
static int dev
Definition: mkdosfs.c:536
#define FILE_SHARE_READ
Definition: compat.h:125
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
HTREEITEM hInsertAfter
Definition: commctrl.h:3366
static void find_devices(HWND hwnd, const GUID *guid, const nt_handle &mountmgr, vector< device > &device_list)
Definition: devices.cpp:72
#define IDS_CANT_OPEN_MOUNTMGR
Definition: resource.h:207
vector< device > device_list
Definition: devices.h:153
#define offsetof(TYPE, MEMBER)
#define IDS_DISK_NUM
Definition: resource.h:101
LONG_PTR LPARAM
Definition: windef.h:208
#define TVI_LAST
Definition: commctrl.h:3342
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
TVITEMEXW itemex
Definition: commctrl.h:3368
void wstring_sprintf(wstring &s, wstring fmt,...)
Definition: main.cpp:225
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3951
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Definition: cookie.c:170
#define TVI_ROOT
Definition: commctrl.h:3340
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
iterator begin()
Definition: _vector.h:182
int cchTextMax
Definition: commctrl.h:3323
__u8 attr
Definition: mkdosfs.c:359
static const WCHAR L[]
Definition: oid.c:1250
static bool sort_devices(device i, device j)
Definition: devices.cpp:340
#define SYNCHRONIZE
Definition: nt_native.h:61
UINT32 num_devices
Definition: btrfsioctl.h:204
BYTE uint8_t
Definition: msvideo1.c:66
#define TVIS_EXPANDED
Definition: commctrl.h:3256
Status
Definition: gdiplustypes.h:24
#define FILE_GENERIC_WRITE
Definition: nt_native.h:660
HWND WINAPI GetParent(_In_ HWND)
static ATOM item
Definition: dde.c:856
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
#define TVIF_TEXT
Definition: commctrl.h:3238
static const WCHAR friendly_name[]
Definition: devenum.c:38
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
Definition: name.c:36
UINT8 uuid[16]
Definition: btrfsioctl.h:203
size_type size() const
Definition: _vector.h:192
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define TVIF_STATE
Definition: commctrl.h:3241
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define malloc
Definition: debug_ros.c:4
#define TVIF_PARAM
Definition: commctrl.h:3240
void clear()
Definition: _vector.h:650
int k
Definition: mpi.c:3369
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
btrfs_filesystem_device device
Definition: btrfsioctl.h:205
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
void format_size(uint64_t size, wstring &s, bool show_bytes)
Definition: main.cpp:65
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by DeviceAddDlgProc().

◆ ShowDialog()

void BtrfsDeviceAdd::ShowDialog ( )

Definition at line 673 of file devices.cpp.

673  {
675 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static INT_PTR CALLBACK stub_DeviceAddDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: devices.cpp:657
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_DEVICE_ADD
Definition: resource.h:80
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by AddDeviceW().

Member Data Documentation

◆ cmdline

WCHAR* BtrfsDeviceAdd::cmdline
private

Definition at line 151 of file devices.h.

Referenced by AddDevice(), and BtrfsDeviceAdd().

◆ device_list

vector<device> BtrfsDeviceAdd::device_list
private

Definition at line 153 of file devices.h.

Referenced by populate_device_tree().

◆ hinst

HINSTANCE BtrfsDeviceAdd::hinst
private

Definition at line 149 of file devices.h.

Referenced by BtrfsDeviceAdd().

◆ hwnd

HWND BtrfsDeviceAdd::hwnd
private

Definition at line 150 of file devices.h.

Referenced by BtrfsDeviceAdd().

◆ sel

device* BtrfsDeviceAdd::sel
private

Definition at line 152 of file devices.h.

Referenced by AddDevice(), BtrfsDeviceAdd(), and DeviceAddDlgProc().


The documentation for this class was generated from the following files: