ReactOS  0.4.14-dev-1331-g167fa2c
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 648 of file devices.cpp.

648  {
649  this->hinst = hinst;
650  this->hwnd = hwnd;
651  this->cmdline = cmdline;
652 
653  sel = nullptr;
654 }
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 496 of file devices.cpp.

496  {
497  wstring mess, title;
502 
503  if (!sel) {
504  EndDialog(hwndDlg, 0);
505  return;
506  }
507 
508  if (sel->fstype != L"") {
509  wstring s;
510 
512  throw last_error(GetLastError());
513 
514  wstring_sprintf(mess, s, sel->fstype.c_str());
515  } else {
517  throw last_error(GetLastError());
518  }
519 
521  throw last_error(GetLastError());
522 
523  if (MessageBoxW(hwndDlg, mess.c_str(), title.c_str(), MB_YESNO) != IDYES)
524  return;
525 
528 
529  if (h == INVALID_HANDLE_VALUE)
530  throw last_error(GetLastError());
531 
532  {
533  nt_handle h2;
534 
535  vn.Length = vn.MaximumLength = (uint16_t)(sel->pnp_name.length() * sizeof(WCHAR));
536  vn.Buffer = (WCHAR*)sel->pnp_name.c_str();
537 
539 
541  if (!NT_SUCCESS(Status))
542  throw ntstatus_error(Status);
543 
544  if (!sel->is_disk) {
545  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_LOCK_VOLUME, nullptr, 0, nullptr, 0);
546  if (!NT_SUCCESS(Status))
548  }
549 
550  Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_ADD_DEVICE, &h2, sizeof(HANDLE), nullptr, 0);
551  if (!NT_SUCCESS(Status))
552  throw ntstatus_error(Status);
553 
554  if (!sel->is_disk) {
555  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_DISMOUNT_VOLUME, nullptr, 0, nullptr, 0);
556  if (!NT_SUCCESS(Status))
557  throw ntstatus_error(Status);
558 
559  Status = NtFsControlFile(h2, nullptr, nullptr, nullptr, &iosb, FSCTL_UNLOCK_VOLUME, nullptr, 0, nullptr, 0);
560  if (!NT_SUCCESS(Status))
561  throw ntstatus_error(Status);
562  }
563  }
564 
565  EndDialog(hwndDlg, 0);
566 }
#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:98
#define IDYES
Definition: winuser.h:829
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
LONG NTSTATUS
Definition: precomp.h:26
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
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:97
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define uint16_t
Definition: nsiface.idl:60
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
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:434
#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:201
#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:19
#define CreateFileW
Definition: compat.h:408
#define IDS_ADD_DEVICE_CONFIRMATION_FS
Definition: resource.h:99
#define IDS_LOCK_FAILED
Definition: resource.h:122
#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
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 568 of file devices.cpp.

568  {
569  try {
570  switch (uMsg) {
571  case WM_INITDIALOG:
572  {
575  EnableWindow(GetDlgItem(hwndDlg, IDOK), false);
576  break;
577  }
578 
579  case WM_COMMAND:
580  switch (HIWORD(wParam)) {
581  case BN_CLICKED:
582  switch (LOWORD(wParam)) {
583  case IDOK:
584  AddDevice(hwndDlg);
585  return true;
586 
587  case IDCANCEL:
588  EndDialog(hwndDlg, 0);
589  return true;
590  }
591  break;
592  }
593  break;
594 
595  case WM_NOTIFY:
596  switch (((LPNMHDR)lParam)->code) {
597  case TVN_SELCHANGEDW:
598  {
599  NMTREEVIEWW* nmtv = (NMTREEVIEWW*)lParam;
600  TVITEMW tvi;
601  bool enable = false;
602 
603  RtlZeroMemory(&tvi, sizeof(TVITEMW));
604  tvi.hItem = nmtv->itemNew.hItem;
605  tvi.mask = TVIF_PARAM | TVIF_HANDLE;
606 
607  if (SendMessageW(GetDlgItem(hwndDlg, IDC_DEVICE_TREE), TVM_GETITEMW, 0, (LPARAM)&tvi))
608  sel = tvi.lParam == 0 ? nullptr : (device*)tvi.lParam;
609  else
610  sel = nullptr;
611 
612  if (sel)
613  enable = (!sel->is_disk || !sel->has_parts) && !sel->multi_device;
614 
615  EnableWindow(GetDlgItem(hwndDlg, IDOK), enable);
616  break;
617  }
618  }
619  break;
620  }
621  } catch (const exception& e) {
622  error_message(hwndDlg, e.what());
623  }
624 
625  return false;
626 }
void populate_device_tree(HWND tree)
Definition: devices.cpp:331
#define IDOK
Definition: winuser.h:824
bool multi_device
Definition: devices.h:49
UINT mask
Definition: commctrl.h:3312
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:785
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:3644
TVITEMW itemNew
Definition: commctrl.h:3634
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:496
#define BN_CLICKED
Definition: winuser.h:1907
#define WM_COMMAND
Definition: winuser.h:1722
#define TVIF_HANDLE
Definition: commctrl.h:3266
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:3313
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:3482
#define TVIF_PARAM
Definition: commctrl.h:3264
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
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:302

Referenced by stub_DeviceAddDlgProc().

◆ populate_device_tree()

void BtrfsDeviceAdd::populate_device_tree ( HWND  tree)
private

Definition at line 331 of file devices.cpp.

331  {
332  HWND hwnd = GetParent(tree);
333  unsigned int i;
334  ULONG last_disk_num = 0xffffffff;
335  HTREEITEM diskitem;
340  btrfs_filesystem* bfs = nullptr;
341 
342  static WCHAR btrfs[] = L"\\Btrfs";
343 
344  device_list.clear();
345 
346  {
347  mountmgr mm;
348 
349  {
350  nt_handle btrfsh;
351 
352  us.Length = us.MaximumLength = (uint16_t)(wcslen(btrfs) * sizeof(WCHAR));
353  us.Buffer = btrfs;
354 
355  InitializeObjectAttributes(&attr, &us, 0, nullptr, nullptr);
356 
359  if (NT_SUCCESS(Status)) {
360  ULONG bfssize = 0;
361 
362  do {
363  bfssize += 1024;
364 
365  if (bfs) free(bfs);
366  bfs = (btrfs_filesystem*)malloc(bfssize);
367 
368  Status = NtDeviceIoControlFile(btrfsh, nullptr, nullptr, nullptr, &iosb, IOCTL_BTRFS_QUERY_FILESYSTEMS, nullptr, 0, bfs, bfssize);
370  free(bfs);
371  bfs = nullptr;
372  break;
373  }
374  } while (Status == STATUS_BUFFER_OVERFLOW);
375 
376  if (bfs && bfs->num_devices == 0) { // no mounted filesystems found
377  free(bfs);
378  bfs = nullptr;
379  }
380  }
381  }
382 
383  find_devices(hwnd, &GUID_DEVINTERFACE_DISK, mm, device_list);
384  find_devices(hwnd, &GUID_DEVINTERFACE_VOLUME, mm, device_list);
385  find_devices(hwnd, &GUID_DEVINTERFACE_HIDDEN_VOLUME, mm, device_list);
386  }
387 
388 #ifndef __REACTOS__ // Disabled because building with our <algorithm> seems complex right now...
390 #endif
391 
392  for (i = 0; i < device_list.size(); i++) {
393  if (!device_list[i].ignore) {
394  TVINSERTSTRUCTW tis;
395  HTREEITEM item;
396  wstring name, size;
397 
398  if (device_list[i].disk_num != 0xffffffff && device_list[i].disk_num == last_disk_num)
399  tis.hParent = diskitem;
400  else
401  tis.hParent = TVI_ROOT;
402 
403  tis.hInsertAfter = TVI_LAST;
405  tis.itemex.state = TVIS_EXPANDED;
407 
408  if (device_list[i].disk_num != 0xffffffff) {
409  wstring t;
410 
411  if (!load_string(module, device_list[i].part_num != 0 ? IDS_PARTITION : IDS_DISK_NUM, t))
412  throw last_error(GetLastError());
413 
414  wstring_sprintf(name, t, device_list[i].part_num != 0 ? device_list[i].part_num : device_list[i].disk_num);
415  } else
416  name = device_list[i].pnp_name;
417 
418  // match child Btrfs devices to their parent
419  if (bfs && device_list[i].drive == L"" && device_list[i].fstype == L"Btrfs") {
420  btrfs_filesystem* bfs2 = bfs;
421 
422  while (true) {
423  if (RtlCompareMemory(&bfs2->uuid, &device_list[i].fs_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
424  ULONG j, k;
426 
427  for (j = 0; j < bfs2->num_devices; j++) {
428  if (j == 0)
429  dev = &bfs2->device;
430  else
432 
433  if (RtlCompareMemory(&device_list[i].dev_uuid, &device_list[i].dev_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
434  for (k = 0; k < device_list.size(); k++) {
435  if (k != i && device_list[k].fstype == L"Btrfs" && device_list[k].drive != L"" &&
436  RtlCompareMemory(&device_list[k].fs_uuid, &device_list[i].fs_uuid, sizeof(BTRFS_UUID)) == sizeof(BTRFS_UUID)) {
437  device_list[i].drive = device_list[k].drive;
438  break;
439  }
440  }
441 
442  device_list[i].multi_device = bfs2->num_devices > 1;
443 
444  break;
445  }
446  }
447 
448  break;
449  }
450 
451  if (bfs2->next_entry != 0)
452  bfs2 = (btrfs_filesystem*)((uint8_t*)bfs2 + bfs2->next_entry);
453  else
454  break;
455  }
456  }
457 
458  name += L" (";
459 
460  if (device_list[i].friendly_name != L"") {
461  name += device_list[i].friendly_name;
462  name += L", ";
463  }
464 
465  if (device_list[i].drive != L"") {
466  name += device_list[i].drive;
467  name += L", ";
468  }
469 
470  if (device_list[i].fstype != L"") {
471  name += device_list[i].fstype;
472  name += L", ";
473  }
474 
475  format_size(device_list[i].size, size, false);
476  name += size;
477 
478  name += L")";
479 
480  tis.itemex.pszText = (WCHAR*)name.c_str();
481  tis.itemex.cchTextMax = (int)name.length();
482  tis.itemex.lParam = (LPARAM)&device_list[i];
483 
485  if (!item)
487 
488  if (device_list[i].part_num == 0) {
489  diskitem = item;
490  last_disk_num = device_list[i].disk_num;
491  }
492  }
493  }
494 }
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:3351
HTREEITEM hParent
Definition: commctrl.h:3389
#define TVM_INSERTITEMW
Definition: commctrl.h:3404
iterator end()
Definition: _vector.h:184
static const BYTE us[]
Definition: encode.c:689
#define IOCTL_BTRFS_QUERY_FILESYSTEMS
Definition: btrfsioctl.h:21
_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:3346
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3260
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:3345
#define IDS_TVM_INSERTITEM_FAILED
Definition: resource.h:205
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
static int dev
Definition: mkdosfs.c:536
#define FILE_SHARE_READ
Definition: compat.h:125
static void find_devices(HWND hwnd, const GUID *guid, const mountmgr &mm, vector< device > &device_list)
Definition: devices.cpp:73
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
uint32_t num_devices
Definition: btrfsioctl.h:190
HTREEITEM hInsertAfter
Definition: commctrl.h:3390
vector< device > device_list
Definition: devices.h:153
#define offsetof(TYPE, MEMBER)
#define IDS_DISK_NUM
Definition: resource.h:102
LONG_PTR LPARAM
Definition: windef.h:208
#define TVI_LAST
Definition: commctrl.h:3366
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:3392
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
uint32_t next_entry
Definition: btrfsioctl.h:188
Definition: cookie.c:201
#define TVI_ROOT
Definition: commctrl.h:3364
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
iterator begin()
Definition: _vector.h:182
int cchTextMax
Definition: commctrl.h:3347
__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:320
#define SYNCHRONIZE
Definition: nt_native.h:61
BYTE uint8_t
Definition: msvideo1.c:66
#define TVIS_EXPANDED
Definition: commctrl.h:3280
Status
Definition: gdiplustypes.h:24
HWND WINAPI GetParent(_In_ HWND)
static ATOM item
Definition: dde.c:856
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define TVIF_TEXT
Definition: commctrl.h:3262
static const WCHAR friendly_name[]
Definition: devenum.c:40
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
uint8_t uuid[16]
Definition: btrfsioctl.h:189
Definition: name.c:38
size_type size() const
Definition: _vector.h:192
unsigned int ULONG
Definition: retypes.h:1
#define TVIF_STATE
Definition: commctrl.h:3265
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define malloc
Definition: debug_ros.c:4
#define TVIF_PARAM
Definition: commctrl.h:3264
void clear()
Definition: _vector.h:653
int k
Definition: mpi.c:3369
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
btrfs_filesystem_device device
Definition: btrfsioctl.h:191
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
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 644 of file devices.cpp.

644  {
646 }
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:628
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: