ReactOS  0.4.15-dev-5112-g22d8c0f
drive.cpp File Reference
#include "precomp.h"
#include <process.h>
Include dependency graph for drive.cpp:

Go to the source code of this file.

Classes

struct  FORMAT_DRIVE_CONTEXT
 
struct  _DRIVE_PROP_PAGE
 
struct  FORMAT_DRIVE_PARAMS
 

Typedefs

typedef struct FORMAT_DRIVE_CONTEXTPFORMAT_DRIVE_CONTEXT
 
typedef struct _DRIVE_PROP_PAGE DRIVE_PROP_PAGE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx (HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj)
 
HPROPSHEETPAGE SH_CreatePropertySheetPage (LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
 
static BOOL IsSystemDrive (PFORMAT_DRIVE_CONTEXT pContext)
 
static BOOL GetDefaultClusterSize (LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes)
 
HRESULT SH_ShowDriveProperties (WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
 
static VOID InsertDefaultClusterSizeForFs (HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
 
static VOID InitializeFormatDriveDlg (HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
 
static BOOLEAN NTAPI FormatExCB (IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
 
VOID FormatDrive (HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
 
static unsigned __stdcall DoFormatDrive (void *args)
 
static INT_PTR CALLBACK FormatDriveDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
DWORD WINAPI SHFormatDrive (HWND hwnd, UINT drive, UINT fmtID, UINT options)
 

Variables

static HWND FormatDrvDialog = NULL
 
static BOOLEAN bSuccess = FALSE
 

Typedef Documentation

◆ DRIVE_PROP_PAGE

◆ PFORMAT_DRIVE_CONTEXT

Function Documentation

◆ DoFormatDrive()

static unsigned __stdcall DoFormatDrive ( void args)
static

Definition at line 599 of file drive.cpp.

600 {
601  FORMAT_DRIVE_PARAMS *pParams = reinterpret_cast<FORMAT_DRIVE_PARAMS *>(args);
602  HWND hwndDlg = pParams->hwndDlg;
603  PFORMAT_DRIVE_CONTEXT pContext = pParams->pContext;
604 
605  /* Disable controls during format */
606  HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
608  EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
610  EnableWindow(GetDlgItem(hwndDlg, 28673), FALSE);
611  EnableWindow(GetDlgItem(hwndDlg, 28677), FALSE);
612  EnableWindow(GetDlgItem(hwndDlg, 28680), FALSE);
613  EnableWindow(GetDlgItem(hwndDlg, 28679), FALSE);
614  EnableWindow(GetDlgItem(hwndDlg, 28674), FALSE);
615 
616  FormatDrive(hwndDlg, pContext);
617 
618  /* Re-enable controls after format */
619  EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
620  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), TRUE);
621  EnableWindow(GetDlgItem(hwndDlg, 28673), TRUE);
622  EnableWindow(GetDlgItem(hwndDlg, 28677), TRUE);
623  EnableWindow(GetDlgItem(hwndDlg, 28680), TRUE);
624  EnableWindow(GetDlgItem(hwndDlg, 28679), TRUE);
625  EnableWindow(GetDlgItem(hwndDlg, 28674), TRUE);
627  pContext->bFormattingNow = FALSE;
628 
629  delete pParams;
630  return 0;
631 }
#define IDOK
Definition: winuser.h:824
#define MF_BYCOMMAND
Definition: winuser.h:202
#define TRUE
Definition: types.h:120
Definition: match.c:390
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
VOID FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
Definition: drive.cpp:469
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
PFORMAT_DRIVE_CONTEXT pContext
Definition: drive.cpp:596
#define SC_CLOSE
Definition: winuser.h:2582
#define MF_GRAYED
Definition: winuser.h:129
#define IDCANCEL
Definition: winuser.h:825
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by FormatDriveDlg().

◆ FormatDrive()

VOID FormatDrive ( HWND  hwndDlg,
PFORMAT_DRIVE_CONTEXT  pContext 
)

Definition at line 469 of file drive.cpp.

470 {
471  WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
472  WCHAR szFileSys[40] = {0};
473  WCHAR szLabel[40] = {0};
474  INT iSelIndex;
475  UINT Length;
476  HWND hDlgCtrl;
480  FMIFS_MEDIA_FLAG MediaFlag = FMIFS_HARDDISK;
481 
482  /* set volume path */
483  szDrive[0] = pContext->Drive + L'A';
484 
485  /* get filesystem */
486  hDlgCtrl = GetDlgItem(hwndDlg, 28677);
487  iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
488  if (iSelIndex == CB_ERR)
489  {
490  ERR("Unable to get file system selection\n");
491  return;
492  }
493  Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
494  if ((int)Length == CB_ERR || Length + 1 > _countof(szFileSys))
495  {
496  ERR("Unable to get file system selection\n");
497  return;
498  }
499 
500  /* retrieve the file system */
501  SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)szFileSys);
502  szFileSys[_countof(szFileSys)-1] = L'\0';
503 
504  /* retrieve the volume label */
505  hDlgCtrl = GetWindow(hwndDlg, 28679);
506  Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
507  if (Length + 1 > _countof(szLabel))
508  {
509  ERR("Unable to get volume label\n");
510  return;
511  }
512  SendMessageW(hDlgCtrl, WM_GETTEXT, _countof(szLabel), (LPARAM)szLabel);
513  szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
514 
515  /* check for quickformat */
516  if (SendDlgItemMessageW(hwndDlg, 28674, BM_GETCHECK, 0, 0) == BST_CHECKED)
517  QuickFormat = TRUE;
518  else
519  QuickFormat = FALSE;
520 
521  /* get the cluster size */
522  hDlgCtrl = GetDlgItem(hwndDlg, 28680);
523  iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
524  if (iSelIndex == CB_ERR)
525  {
526  FIXME("\n");
527  return;
528  }
529  ClusterSize = SendMessageW(hDlgCtrl, CB_GETITEMDATA, iSelIndex, 0);
530  if ((int)ClusterSize == CB_ERR)
531  {
532  FIXME("\n");
533  return;
534  }
535 
536  hDlgCtrl = GetDlgItem(hwndDlg, 28680);
537  SendMessageW(hDlgCtrl, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
538  bSuccess = FALSE;
539 
540  /* FIXME
541  * will cause display problems
542  * when performing more than one format
543  */
544  FormatDrvDialog = hwndDlg;
545 
546  /* See if the drive is removable or not */
547  DriveType = GetDriveTypeW(szDrive);
548  switch (DriveType)
549  {
550  case DRIVE_UNKNOWN:
551  case DRIVE_REMOTE:
552  case DRIVE_CDROM:
553  case DRIVE_NO_ROOT_DIR:
554  {
555  FIXME("\n");
556  return;
557  }
558 
559  case DRIVE_REMOVABLE:
560  MediaFlag = FMIFS_FLOPPY;
561  break;
562 
563  case DRIVE_FIXED:
564  case DRIVE_RAMDISK:
565  MediaFlag = FMIFS_HARDDISK;
566  break;
567  }
568 
569  /* Format the drive */
570  FormatEx(szDrive,
571  MediaFlag,
572  szFileSys,
573  szLabel,
574  QuickFormat,
575  ClusterSize,
576  FormatExCB);
577 
579  if (!bSuccess)
580  {
581  pContext->Result = SHFMT_ERROR;
582  }
583  else if (QuickFormat)
584  {
585  pContext->Result = SHFMT_OPT_FULL;
586  }
587  else
588  {
589  pContext->Result = FALSE;
590  }
591 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define CB_GETLBTEXTLEN
Definition: winuser.h:1943
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
#define CB_GETLBTEXT
Definition: winuser.h:1942
#define SHFMT_ERROR
Definition: shlobj.h:292
#define CB_GETITEMDATA
Definition: winuser.h:1940
#define WM_GETTEXT
Definition: winuser.h:1608
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define DRIVE_RAMDISK
Definition: winbase.h:252
UINT DriveType
int32_t INT
Definition: typedefs.h:58
static BOOLEAN bSuccess
Definition: drive.cpp:430
#define CB_GETCURSEL
Definition: winuser.h:1933
#define DRIVE_REMOVABLE
Definition: winbase.h:248
static HWND FormatDrvDialog
Definition: drive.cpp:429
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define L(x)
Definition: ntvdm.h:50
#define DRIVE_REMOTE
Definition: winbase.h:250
#define DRIVE_CDROM
Definition: machpc98.h:115
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:111
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1908
BOOL QuickFormat
Definition: format.c:66
#define DRIVE_UNKNOWN
Definition: winbase.h:253
#define CB_ERR
Definition: winuser.h:2425
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID NTAPI FormatEx(IN PWCHAR DriveRoot, IN FMIFS_MEDIA_FLAG MediaFlag, IN PWCHAR Format, IN PWCHAR Label, IN BOOLEAN QuickFormat, IN ULONG ClusterSize, IN PFMIFSCALLBACK Callback)
Definition: format.c:38
#define _countof(array)
Definition: sndvol32.h:68
static BOOLEAN NTAPI FormatExCB(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: drive.cpp:433
DWORD ClusterSize
Definition: format.c:67
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:254
#define DRIVE_FIXED
Definition: winbase.h:249
#define ERR(fmt,...)
Definition: debug.h:110
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define BST_CHECKED
Definition: winuser.h:197
#define SHFMT_OPT_FULL
Definition: shlobj.h:298
FMIFS_MEDIA_FLAG
Definition: fmifs.h:37

Referenced by DoFormatDrive().

◆ FormatDriveDlg()

static INT_PTR CALLBACK FormatDriveDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 634 of file drive.cpp.

635 {
636  PFORMAT_DRIVE_CONTEXT pContext;
637 
638  switch(uMsg)
639  {
640  case WM_INITDIALOG:
643  return TRUE;
644  case WM_COMMAND:
645  switch(LOWORD(wParam))
646  {
647  case IDOK:
648  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
649  if (pContext->bFormattingNow)
650  break;
651 
652  if (ShellMessageBoxW(shell32_hInstance, hwndDlg,
656  {
657  pContext->bFormattingNow = TRUE;
658 
660  pParams->hwndDlg = hwndDlg;
661  pParams->pContext = pContext;
662 
663  unsigned tid;
664  HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, DoFormatDrive, pParams, 0, &tid);
666  }
667  break;
668  case IDCANCEL:
669  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
670  if (pContext->bFormattingNow)
671  break;
672 
673  EndDialog(hwndDlg, pContext->Result);
674  break;
675  case 28677: // filesystem combo
676  if (HIWORD(wParam) == CBN_SELENDOK)
677  {
678  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
679  if (pContext->bFormattingNow)
680  break;
681 
682  InsertDefaultClusterSizeForFs(hwndDlg, pContext);
683  }
684  break;
685  }
686  }
687  return FALSE;
688 }
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define MB_ICONWARNING
Definition: winuser.h:780
static VOID InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
Definition: drive.cpp:235
#define FALSE
Definition: types.h:117
#define CBN_SELENDOK
Definition: winuser.h:1971
#define MB_OKCANCEL
Definition: winuser.h:798
#define IDS_FORMAT_WARNING
Definition: shresdef.h:199
PVOID HANDLE
Definition: typedefs.h:73
static VOID InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
Definition: drive.cpp:350
#define IDS_FORMAT_TITLE
Definition: shresdef.h:198
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1730
#define shell32_hInstance
PFORMAT_DRIVE_CONTEXT pContext
Definition: drive.cpp:596
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define ShellMessageBoxW
Definition: precomp.h:59
#define NULL
Definition: types.h:112
HANDLE hThread
Definition: wizard.c:28
struct FORMAT_DRIVE_CONTEXT * PFORMAT_DRIVE_CONTEXT
#define HIWORD(l)
Definition: typedefs.h:247
static unsigned __stdcall DoFormatDrive(void *args)
Definition: drive.cpp:599
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
static TfClientId tid
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by SHFormatDrive().

◆ FormatExCB()

static BOOLEAN NTAPI FormatExCB ( IN CALLBACKCOMMAND  Command,
IN ULONG  SubAction,
IN PVOID  ActionInfo 
)
static

Definition at line 433 of file drive.cpp.

437 {
438  PDWORD Progress;
439  PBOOLEAN pSuccess;
440  switch(Command)
441  {
442  case PROGRESS:
443  Progress = (PDWORD)ActionInfo;
444  SendDlgItemMessageW(FormatDrvDialog, 28678, PBM_SETPOS, (WPARAM)*Progress, 0);
445  break;
446  case DONE:
447  pSuccess = (PBOOLEAN)ActionInfo;
448  bSuccess = (*pSuccess);
451  break;
452 
453  case VOLUMEINUSE:
454  case INSUFFICIENTRIGHTS:
455  case FSNOTSUPPORTED:
456  case CLUSTERSIZETOOSMALL:
457  bSuccess = FALSE;
458  FIXME("Unsupported command in FormatExCB\n");
459  break;
460 
461  default:
462  break;
463  }
464 
465  return TRUE;
466 }
#define TRUE
Definition: types.h:120
Definition: fmifs.h:68
#define PBM_SETPOS
Definition: commctrl.h:2184
UINT_PTR WPARAM
Definition: windef.h:207
Definition: shell.h:41
static BOOLEAN bSuccess
Definition: drive.cpp:430
static HWND FormatDrvDialog
Definition: drive.cpp:429
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_FORMAT_TITLE
Definition: shresdef.h:198
#define MB_ICONINFORMATION
Definition: winuser.h:796
char * PBOOLEAN
Definition: retypes.h:11
#define IDS_FORMAT_COMPLETE
Definition: shresdef.h:200
#define shell32_hInstance
#define ShellMessageBoxW
Definition: precomp.h:59
#define MB_OK
Definition: winuser.h:784
DWORD * PDWORD
Definition: pedump.c:68
#define DONE
Definition: rnr20lib.h:14
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by FormatDrive().

◆ GetDefaultClusterSize()

static BOOL GetDefaultClusterSize ( LPWSTR  szFs,
PDWORD  pClusterSize,
PULARGE_INTEGER  TotalNumberOfBytes 
)
static

Definition at line 68 of file drive.cpp.

69 {
71 
72  if (!wcsicmp(szFs, L"FAT16") ||
73  !wcsicmp(szFs, L"FAT")) // REACTOS HACK
74  {
75  if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024))
76  ClusterSize = 2048;
77  else if (TotalNumberOfBytes->QuadPart <= (32 * 1024 * 1024))
78  ClusterSize = 512;
79  else if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
80  ClusterSize = 1024;
81  else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
82  ClusterSize = 2048;
83  else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024))
84  ClusterSize = 4096;
85  else if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024))
86  ClusterSize = 8192;
87  else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
88  ClusterSize = 16384;
89  else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL))
90  ClusterSize = 32768;
91  else if (TotalNumberOfBytes->QuadPart <= (4096LL * 1024LL * 1024LL))
92  ClusterSize = 8192;
93  else
94  return FALSE;
95  }
96  else if (!wcsicmp(szFs, L"FAT32"))
97  {
98  if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
99  ClusterSize = 512;
100  else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
101  ClusterSize = 1024;
102  else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024))
103  ClusterSize = 2048;
104  else if (TotalNumberOfBytes->QuadPart <= (8192LL * 1024LL * 1024LL))
105  ClusterSize = 2048;
106  else if (TotalNumberOfBytes->QuadPart <= (16384LL * 1024LL * 1024LL))
107  ClusterSize = 8192;
108  else if (TotalNumberOfBytes->QuadPart <= (32768LL * 1024LL * 1024LL))
109  ClusterSize = 16384;
110  else
111  return FALSE;
112  }
113  else if (!wcsicmp(szFs, L"FATX"))
114  {
115  if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024))
116  ClusterSize = 2048;
117  else if (TotalNumberOfBytes->QuadPart <= (32 * 1024 * 1024))
118  ClusterSize = 512;
119  else if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
120  ClusterSize = 1024;
121  else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
122  ClusterSize = 2048;
123  else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024))
124  ClusterSize = 4096;
125  else if (TotalNumberOfBytes->QuadPart <= (8192LL * 1024LL * 1024LL))
126  ClusterSize = 2048;
127  else if (TotalNumberOfBytes->QuadPart <= (16384LL * 1024LL * 1024LL))
128  ClusterSize = 8192;
129  else if (TotalNumberOfBytes->QuadPart <= (32768LL * 1024LL * 1024LL))
130  ClusterSize = 16384;
131  else
132  return FALSE;
133  }
134  else if (!wcsicmp(szFs, L"NTFS"))
135  {
136  if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024))
137  ClusterSize = 512;
138  else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
139  ClusterSize = 1024;
140  else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL))
141  ClusterSize = 2048;
142  else
143  ClusterSize = 2048;
144  }
145  else if (!wcsicmp(szFs, L"EXT2"))
146  {
147  // auto block size calculation
148  ClusterSize = 0;
149  }
150  else if (!wcsicmp(szFs, L"BtrFS"))
151  {
152  // auto block size calculation
153  ClusterSize = 0;
154  }
155  else
156  return FALSE;
157 
158  *pClusterSize = ClusterSize;
159  return TRUE;
160 }
#define LL
Definition: tui.h:150
#define TRUE
Definition: types.h:120
#define L(x)
Definition: ntvdm.h:50
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define FALSE
Definition: types.h:117
DWORD ClusterSize
Definition: format.c:67
unsigned long DWORD
Definition: ntddk_ex.h:95
#define wcsicmp
Definition: compat.h:15

Referenced by InsertDefaultClusterSizeForFs().

◆ InitializeFormatDriveDlg()

static VOID InitializeFormatDriveDlg ( HWND  hwndDlg,
PFORMAT_DRIVE_CONTEXT  pContext 
)
static

Definition at line 350 of file drive.cpp.

351 {
352  WCHAR szText[120];
353  WCHAR szDrive[] = L"C:\\";
354  WCHAR szFs[30] = L"";
355  INT cchText;
356  ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
357  DWORD dwIndex, dwDefault;
358  UCHAR uMinor, uMajor;
359  BOOLEAN Latest;
360  HWND hwndFileSystems;
361 
362  cchText = GetWindowTextW(hwndDlg, szText, _countof(szText) - 1);
363  if (cchText < 0)
364  cchText = 0;
365  szText[cchText++] = L' ';
366  szDrive[0] = pContext->Drive + L'A';
367  if (GetVolumeInformationW(szDrive, &szText[cchText], _countof(szText) - cchText, NULL, NULL, NULL, szFs, _countof(szFs)))
368  {
369  if (szText[cchText] == UNICODE_NULL)
370  {
371  /* load default volume label */
373  }
374  else
375  {
376  /* set volume label */
377  SetDlgItemTextW(hwndDlg, 28679, &szText[cchText]);
378  cchText += wcslen(&szText[cchText]);
379  }
380  }
381 
382  StringCchPrintfW(szText + cchText, _countof(szText) - cchText, L" (%c:)", szDrive[0]);
383 
384  /* set window text */
385  SetWindowTextW(hwndDlg, szText);
386 
387  if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
388  {
389  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, _countof(szText)))
390  {
391  /* add drive capacity */
392  SendDlgItemMessageW(hwndDlg, 28673, CB_ADDSTRING, 0, (LPARAM)szText);
393  SendDlgItemMessageW(hwndDlg, 28673, CB_SETCURSEL, 0, (LPARAM)0);
394  }
395  }
396 
397  if (pContext->Options & SHFMT_OPT_FULL)
398  {
399  /* check quick format button */
400  SendDlgItemMessageW(hwndDlg, 28674, BM_SETCHECK, BST_CHECKED, 0);
401  }
402 
403  /* enumerate all available filesystems */
404  dwIndex = 0;
405  dwDefault = 0;
406  hwndFileSystems = GetDlgItem(hwndDlg, 28677);
407 
408  while(QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest))
409  {
410  if (!wcsicmp(szText, szFs))
411  dwDefault = dwIndex;
412 
413  SendMessageW(hwndFileSystems, CB_ADDSTRING, 0, (LPARAM)szText);
414  dwIndex++;
415  }
416 
417  if (!dwIndex)
418  {
419  ERR("no filesystem providers\n");
420  return;
421  }
422 
423  /* select default filesys */
424  SendMessageW(hwndFileSystems, CB_SETCURSEL, dwDefault, 0);
425  /* setup cluster combo */
426  InsertDefaultClusterSizeForFs(hwndDlg, pContext);
427 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
static VOID InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
Definition: drive.cpp:235
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define L(x)
Definition: ntvdm.h:50
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define UNICODE_NULL
#define CB_ADDSTRING
Definition: winuser.h:1926
unsigned char BOOLEAN
LONG_PTR LPARAM
Definition: windef.h:208
_In_ int cchText
Definition: winuser.h:4455
#define BM_SETCHECK
Definition: winuser.h:1911
#define IDS_DRIVE_FIXED
Definition: shresdef.h:113
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define wcsicmp
Definition: compat.h:15
unsigned char UCHAR
Definition: xmlstorage.h:181
#define CB_SETCURSEL
Definition: winuser.h:1951
#define ERR(fmt,...)
Definition: debug.h:110
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
#define shell32_hInstance
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define BST_CHECKED
Definition: winuser.h:197
#define SHFMT_OPT_FULL
Definition: shlobj.h:298
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
BOOLEAN NTAPI QueryAvailableFileSystemFormat(IN DWORD Index, IN OUT PWCHAR FileSystem, OUT UCHAR *Major, OUT UCHAR *Minor, OUT BOOLEAN *LatestVersion)
Definition: query.c:14

Referenced by FormatDriveDlg().

◆ InsertDefaultClusterSizeForFs()

static VOID InsertDefaultClusterSizeForFs ( HWND  hwndDlg,
PFORMAT_DRIVE_CONTEXT  pContext 
)
static

Definition at line 235 of file drive.cpp.

236 {
237  WCHAR wszBuf[100] = {0};
238  WCHAR wszDefaultSize[100] = {0};
239  PCWSTR pwszFsSizeLimit;
240  WCHAR szDrive[] = L"C:\\";
241  INT iSelIndex;
242  ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
244  LRESULT lIndex;
245  HWND hDlgCtrl;
246 
247  hDlgCtrl = GetDlgItem(hwndDlg, 28677);
248  iSelIndex = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
249  if (iSelIndex == CB_ERR)
250  return;
251 
252  if (SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)wszBuf) == CB_ERR)
253  return;
254 
255  szDrive[0] = pContext->Drive + L'A';
256 
257  if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
258  return;
259 
260  if (!wcsicmp(wszBuf, L"FAT16") ||
261  !wcsicmp(wszBuf, L"FAT")) // REACTOS HACK
262  {
263  pwszFsSizeLimit = L"4GB";
264  }
265  else if (!wcsicmp(wszBuf, L"FAT32"))
266  {
267  pwszFsSizeLimit = L"32GB";
268  }
269  else if (!wcsicmp(wszBuf, L"FATX"))
270  {
271  pwszFsSizeLimit = L"1GB/32GB";
272  }
273  else if (!wcsicmp(wszBuf, L"NTFS"))
274  {
275  pwszFsSizeLimit = L"256TB";
276  }
277  else if (!wcsicmp(wszBuf, L"EXT2"))
278  {
279  pwszFsSizeLimit = L"32TB";
280  }
281  else
282  {
283  pwszFsSizeLimit = L"16EB";
284  }
285 
286  if (!wcsicmp(wszBuf, L"FAT16") ||
287  !wcsicmp(wszBuf, L"FAT") || // REACTOS HACK
288  !wcsicmp(wszBuf, L"FAT32") ||
289  !wcsicmp(wszBuf, L"FATX") ||
290  !wcsicmp(wszBuf, L"NTFS") ||
291  !wcsicmp(wszBuf, L"EXT2") ||
292  !wcsicmp(wszBuf, L"BtrFS"))
293  {
294  if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
295  {
296  TRACE("%S is not supported on drive larger than %S, current size: %lu\n", wszBuf, pwszFsSizeLimit, TotalNumberOfBytes.QuadPart);
297  SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
298  return;
299  }
300 
301  if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszDefaultSize, _countof(wszDefaultSize)))
302  {
303  hDlgCtrl = GetDlgItem(hwndDlg, 28680); // Get the window handle of "allocation unit size" combobox
304  SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
305  lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszDefaultSize);
306  if (lIndex != CB_ERR)
307  SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
308  SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
309  }
310 
311  if (!wcsicmp(wszBuf, L"NTFS"))
312  {
313  ClusterSize = 512;
314  for (lIndex = 0; lIndex < 4; lIndex++)
315  {
316  TotalNumberOfBytes.QuadPart = ClusterSize;
317  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszDefaultSize, _countof(wszDefaultSize)))
318  {
319  lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszDefaultSize);
320  if (lIndex != CB_ERR)
321  SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
322  }
323  ClusterSize *= 2;
324  }
325  }
326 
327  SendMessageW(GetDlgItem(hwndDlg, 28675), BM_SETCHECK, BST_UNCHECKED, 0);
328  if (!wcsicmp(wszBuf, L"EXT2") ||
329  !wcsicmp(wszBuf, L"BtrFS") ||
330  !wcsicmp(wszBuf, L"NTFS"))
331  {
332  /* Enable the "Enable Compression" button */
333  EnableWindow(GetDlgItem(hwndDlg, 28675), TRUE);
334  }
335  else
336  {
337  /* Disable the "Enable Compression" button */
338  EnableWindow(GetDlgItem(hwndDlg, 28675), FALSE);
339  }
340  }
341  else
342  {
343  FIXME("Unknown filesystem: %ls\n", wszBuf);
344  SendDlgItemMessageW(hwndDlg, 28680, CB_RESETCONTENT, iSelIndex, 0);
345  return;
346  }
347 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
#define CB_SETITEMDATA
Definition: winuser.h:1956
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define TRUE
Definition: types.h:120
#define CB_GETLBTEXT
Definition: winuser.h:1942
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
#define CB_GETCURSEL
Definition: winuser.h:1933
#define L(x)
Definition: ntvdm.h:50
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
#define CB_ADDSTRING
Definition: winuser.h:1926
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_RESETCONTENT
Definition: winuser.h:1949
#define CB_ERR
Definition: winuser.h:2425
#define BM_SETCHECK
Definition: winuser.h:1911
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
DWORD ClusterSize
Definition: format.c:67
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define wcsicmp
Definition: compat.h:15
#define CB_SETCURSEL
Definition: winuser.h:1951
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define shell32_hInstance
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
#define IDS_DEFAULT_CLUSTER_SIZE
Definition: shresdef.h:225
#define SendMessage
Definition: winuser.h:5833
#define CB_DELETESTRING
Definition: winuser.h:1927
LONG_PTR LRESULT
Definition: windef.h:209
static BOOL GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes)
Definition: drive.cpp:68
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342

Referenced by FormatDriveDlg(), and InitializeFormatDriveDlg().

◆ IsSystemDrive()

static BOOL IsSystemDrive ( PFORMAT_DRIVE_CONTEXT  pContext)
static

Definition at line 51 of file drive.cpp.

52 {
53  WCHAR wszDriveLetter[6], wszSystemDrv[6];
54 
55  wszDriveLetter[0] = pContext->Drive + L'A';
56  StringCchCatW(wszDriveLetter, _countof(wszDriveLetter), L":");
57 
58  if (!GetEnvironmentVariableW(L"SystemDrive", wszSystemDrv, _countof(wszSystemDrv)))
59  return FALSE;
60 
61  if (!wcsicmp(wszDriveLetter, wszSystemDrv))
62  return TRUE;
63 
64  return FALSE;
65 }
#define TRUE
Definition: types.h:120
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define wcsicmp
Definition: compat.h:15
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:614

Referenced by SHFormatDrive().

◆ SH_CreatePropertySheetPage()

HPROPSHEETPAGE SH_CreatePropertySheetPage ( LPCSTR  resname,
DLGPROC  dlgproc,
LPARAM  lParam,
LPWSTR  szTitle 
)

◆ SH_ShowDriveProperties()

HRESULT SH_ShowDriveProperties ( WCHAR pwszDrive,
LPCITEMIDLIST  pidlFolder,
PCUITEMID_CHILD_ARRAY  apidl 
)

Definition at line 170 of file drive.cpp.

171 {
172  HPSXA hpsx = NULL;
174  PROPSHEETHEADERW psh;
175  CComObject<CDrvDefExt> *pDrvDefExt = NULL;
176  WCHAR wszName[256];
177 
178  ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
179  psh.dwSize = sizeof(PROPSHEETHEADERW);
180  psh.dwFlags = 0; // FIXME: make it modeless
181  psh.hwndParent = NULL;
182  psh.nStartPage = 0;
183  psh.phpage = hpsp;
184 
185  LPITEMIDLIST completePidl = ILCombine(pidlFolder, apidl[0]);
186  if (!completePidl)
187  return E_OUTOFMEMORY;
188 
189  if (ILGetDisplayNameExW(NULL, completePidl, wszName, ILGDN_NORMAL))
190  {
191  psh.pszCaption = wszName;
192  psh.dwFlags |= PSH_PROPTITLE;
193  }
194 
195  ILFree(completePidl);
196 
197  CComPtr<IDataObject> pDataObj;
198  HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
199 
200  if (SUCCEEDED(hr))
201  {
202  hr = CComObject<CDrvDefExt>::CreateInstance(&pDrvDefExt);
203  if (SUCCEEDED(hr))
204  {
205  pDrvDefExt->AddRef(); // CreateInstance returns object with 0 ref count
206  hr = pDrvDefExt->Initialize(pidlFolder, pDataObj, NULL);
207  if (SUCCEEDED(hr))
208  {
209  hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh);
210  if (FAILED(hr))
211  ERR("AddPages failed\n");
212  } else
213  ERR("Initialize failed\n");
214  }
215 
217  if (hpsx)
219  }
220 
221  // NOTE: Currently property sheet is modal. If we make it modeless, then it returns HWND.
222  INT_PTR ret = PropertySheetW(&psh);
223 
224  if (hpsx)
226  if (pDrvDefExt)
227  pDrvDefExt->Release();
228 
229  if (ret >= 0)
230  return S_OK;
231  return E_FAIL;
232 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2150
HWND hwndParent
Definition: prsht.h:295
BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
Definition: precomp.h:129
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1973
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define ZeroMemory
Definition: winbase.h:1667
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
struct _PROPSHEETHEADERW PROPSHEETHEADERW
int32_t INT_PTR
Definition: typedefs.h:64
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define L(x)
Definition: ntvdm.h:50
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPCWSTR pszCaption
Definition: prsht.h:301
if SUCCEEDED(hr)
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define ILGDN_NORMAL
Definition: undocshell.h:69
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSH_PROPTITLE
Definition: prsht.h:40
LONG HRESULT
Definition: typedefs.h:79
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
int ret
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj)
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define MAX_PROPERTY_SHEET_PAGE
UINT nStartPage
Definition: prsht.h:304

Referenced by DrivesContextMenuCallback(), and SH_ShowPropertiesDialog().

◆ SHCreatePropSheetExtArrayEx()

EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx ( HKEY  hKey,
LPCWSTR  pszSubKey,
UINT  max_iface,
IDataObject pDataObj 
)

Referenced by SH_ShowDriveProperties().

◆ SHFormatDrive()

DWORD WINAPI SHFormatDrive ( HWND  hwnd,
UINT  drive,
UINT  fmtID,
UINT  options 
)

Definition at line 696 of file drive.cpp.

697 {
699  int result;
700 
701  TRACE("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
702 
703  Context.Drive = drive;
704  Context.Options = options;
705  Context.Result = FALSE;
706  Context.bFormattingNow = FALSE;
707 
708  if (!IsSystemDrive(&Context))
709  {
711  }
712  else
713  {
716  TRACE("SHFormatDrive(): The provided drive for format is a system volume! Aborting...\n");
717  }
718 
719  return result;
720 }
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define IDS_NO_FORMAT_TITLE
Definition: shresdef.h:203
GLuint64EXT * result
Definition: glext.h:11304
#define SHFMT_ERROR
Definition: shlobj.h:292
static BOOL IsSystemDrive(PFORMAT_DRIVE_CONTEXT pContext)
Definition: drive.cpp:51
#define MB_ICONWARNING
Definition: winuser.h:780
#define FALSE
Definition: types.h:117
LONG_PTR LPARAM
Definition: windef.h:208
int options
Definition: main.c:106
#define TRACE(s)
Definition: solgame.cpp:4
#define IDD_FORMAT_DRIVE
Definition: shresdef.h:490
static char drive[2]
Definition: batch.c:28
#define shell32_hInstance
static INT_PTR CALLBACK FormatDriveDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drive.cpp:634
#define ShellMessageBoxW
Definition: precomp.h:59
#define MB_OK
Definition: winuser.h:784
#define IDS_NO_FORMAT
Definition: shresdef.h:204
struct tagContext Context
Definition: acpixf.h:1034
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022

Referenced by format_drive_thread().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ bSuccess

BOOLEAN bSuccess = FALSE
static

Definition at line 430 of file drive.cpp.

Referenced by _ShowPropertiesDialogThread(), AsyncInetDownload(), CFSFolder::CallBack(), ChangeOutputCP_(), CopyKeyName(), CreateClientProcess(), CreateNewKey(), DoExport(), DoImport(), DoWriteFile(), DPLAYX_ConstructData(), DPLAYX_DestructData(), DPLAYX_GetConnectionSettingsA(), DPLAYX_GetConnectionSettingsW(), EnablePrivilege(), EnablePrivilegeInCurrentProcess(), CInstalledApps::Enum(), RunOnceExEntry::Exec(), RunOnceExSection::Exec(), RunOnceExInstance::Exec(), FormatDrive(), FormatExCB(), FTP_Connect(), FTP_ConnectToHost(), FTP_ConvertFileProp(), FTP_DoPassive(), FTP_FtpCreateDirectoryW(), FTP_FtpDeleteFileW(), FTP_FtpGetCurrentDirectoryW(), FTP_FtpGetFileW(), FTP_FtpOpenFileW(), FTP_FtpPutFileW(), FTP_FtpRemoveDirectoryW(), FTP_FtpRenameFileW(), FTP_FtpSetCurrentDirectoryW(), FTP_InitListenSocket(), FTP_ParseDirectory(), FTP_ParsePermission(), FTP_SendAccount(), FTP_SendPassword(), FTP_SendPort(), FTP_SendStore(), FTP_SendType(), CInstalledApplicationInfo::GetApplicationRegString(), GetName(), hash_file(), CDeviceView::Initialize(), INTERNET_AsyncCall(), IntGdiGetFontResourceInfo(), IsUrlValid(), IsWlanAdapter(), LaunchProcess(), CDeviceView::ListDevicesByType(), LoadTextFileToEdit(), main(), MDEVOBJ_bDisable(), CNewMenu::NewItemByNonCommand(), NOTEPAD_FindNext(), CGridView::OnPaint(), OnTimer(), OpenAdapterHandle(), OpenDriverHandle(), ParseCommandPart(), ParsePrimary(), PipeReadThread(), CApplicationView::ProcessWindowMessage(), ReadText(), CDeviceView::RecurseChildDevices(), RecycleBinDlg(), RefreshTreeItem(), RenderFILENAMEA(), RenderFILENAMEW(), CShellLink::Resolve(), CAvailableApplicationInfo::RetrieveGeneralInfo(), SaveServicesToFile(), SaveTextFileFromEdit(), SetDriverLoadPrivilege(), CShellLink::SetIconLocation(), SHGetPathFromIDListA(), WlanConnect(), WlanDisconnect(), WlanPrintCurrentStatus(), WlanScan(), wmain(), WriteEncodedText(), WriteEvent(), and wWinMain().

◆ FormatDrvDialog

HWND FormatDrvDialog = NULL
static

Definition at line 429 of file drive.cpp.

Referenced by FormatDrive(), and FormatExCB().