ReactOS  0.4.15-dev-3181-g4acf100
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 601 of file drive.cpp.

602 {
603  FORMAT_DRIVE_PARAMS *pParams = reinterpret_cast<FORMAT_DRIVE_PARAMS *>(args);
604  HWND hwndDlg = pParams->hwndDlg;
605  PFORMAT_DRIVE_CONTEXT pContext = pParams->pContext;
606 
607  /* Disable controls during format */
608  HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
610  EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
612  EnableWindow(GetDlgItem(hwndDlg, 28673), FALSE);
613  EnableWindow(GetDlgItem(hwndDlg, 28677), FALSE);
614  EnableWindow(GetDlgItem(hwndDlg, 28680), FALSE);
615  EnableWindow(GetDlgItem(hwndDlg, 28679), FALSE);
616  EnableWindow(GetDlgItem(hwndDlg, 28674), FALSE);
617 
618  FormatDrive(hwndDlg, pContext);
619 
620  /* Re-enable controls after format */
621  EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
622  EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), TRUE);
623  EnableWindow(GetDlgItem(hwndDlg, 28673), TRUE);
624  EnableWindow(GetDlgItem(hwndDlg, 28677), TRUE);
625  EnableWindow(GetDlgItem(hwndDlg, 28680), TRUE);
626  EnableWindow(GetDlgItem(hwndDlg, 28679), TRUE);
627  EnableWindow(GetDlgItem(hwndDlg, 28674), TRUE);
629  pContext->bFormattingNow = FALSE;
630 
631  delete pParams;
632  return 0;
633 }
#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:471
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:598
#define SC_CLOSE
Definition: winuser.h:2568
#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 471 of file drive.cpp.

472 {
473  WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
474  WCHAR szFileSys[40] = {0};
475  WCHAR szLabel[40] = {0};
476  INT iSelIndex;
477  UINT Length;
478  HWND hDlgCtrl;
482  FMIFS_MEDIA_FLAG MediaFlag = FMIFS_HARDDISK;
483 
484  /* set volume path */
485  szDrive[0] = pContext->Drive + L'A';
486 
487  /* get filesystem */
488  hDlgCtrl = GetDlgItem(hwndDlg, 28677);
489  iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
490  if (iSelIndex == CB_ERR)
491  {
492  ERR("Unable to get file system selection\n");
493  return;
494  }
495  Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
496  if ((int)Length == CB_ERR || Length + 1 > _countof(szFileSys))
497  {
498  ERR("Unable to get file system selection\n");
499  return;
500  }
501 
502  /* retrieve the file system */
503  SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)szFileSys);
504  szFileSys[_countof(szFileSys)-1] = L'\0';
505 
506  /* retrieve the volume label */
507  hDlgCtrl = GetWindow(hwndDlg, 28679);
508  Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
509  if (Length + 1 > _countof(szLabel))
510  {
511  ERR("Unable to get volume label\n");
512  return;
513  }
514  SendMessageW(hDlgCtrl, WM_GETTEXT, _countof(szLabel), (LPARAM)szLabel);
515  szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
516 
517  /* check for quickformat */
518  if (SendDlgItemMessageW(hwndDlg, 28674, BM_GETCHECK, 0, 0) == BST_CHECKED)
519  QuickFormat = TRUE;
520  else
521  QuickFormat = FALSE;
522 
523  /* get the cluster size */
524  hDlgCtrl = GetDlgItem(hwndDlg, 28680);
525  iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
526  if (iSelIndex == CB_ERR)
527  {
528  FIXME("\n");
529  return;
530  }
531  ClusterSize = SendMessageW(hDlgCtrl, CB_GETITEMDATA, iSelIndex, 0);
532  if ((int)ClusterSize == CB_ERR)
533  {
534  FIXME("\n");
535  return;
536  }
537 
538  hDlgCtrl = GetDlgItem(hwndDlg, 28680);
539  SendMessageW(hDlgCtrl, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
540  bSuccess = FALSE;
541 
542  /* FIXME
543  * will cause display problems
544  * when performing more than one format
545  */
546  FormatDrvDialog = hwndDlg;
547 
548  /* See if the drive is removable or not */
549  DriveType = GetDriveTypeW(szDrive);
550  switch (DriveType)
551  {
552  case DRIVE_UNKNOWN:
553  case DRIVE_REMOTE:
554  case DRIVE_CDROM:
555  case DRIVE_NO_ROOT_DIR:
556  {
557  FIXME("\n");
558  return;
559  }
560 
561  case DRIVE_REMOVABLE:
562  MediaFlag = FMIFS_FLOPPY;
563  break;
564 
565  case DRIVE_FIXED:
566  case DRIVE_RAMDISK:
567  MediaFlag = FMIFS_HARDDISK;
568  break;
569  }
570 
571  /* Format the drive */
572  FormatEx(szDrive,
573  MediaFlag,
574  szFileSys,
575  szLabel,
576  QuickFormat,
577  ClusterSize,
578  FormatExCB);
579 
581  if (!bSuccess)
582  {
583  pContext->Result = SHFMT_ERROR;
584  }
585  else if (QuickFormat)
586  {
587  pContext->Result = SHFMT_OPT_FULL;
588  }
589  else
590  {
591  pContext->Result = FALSE;
592  }
593 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1602
#define CB_GETLBTEXTLEN
Definition: winuser.h:1936
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
#define CB_GETLBTEXT
Definition: winuser.h:1935
#define SHFMT_ERROR
Definition: shlobj.h:292
#define CB_GETITEMDATA
Definition: winuser.h:1933
#define WM_GETTEXT
Definition: winuser.h:1601
#define MAKELPARAM(l, h)
Definition: winuser.h:3984
#define DRIVE_RAMDISK
Definition: winbase.h:252
UINT DriveType
int32_t INT
Definition: typedefs.h:58
static BOOLEAN bSuccess
Definition: drive.cpp:432
#define CB_GETCURSEL
Definition: winuser.h:1926
#define DRIVE_REMOVABLE
Definition: winbase.h:248
static HWND FormatDrvDialog
Definition: drive.cpp:431
#define PBM_SETRANGE
Definition: commctrl.h:2183
#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:1901
BOOL QuickFormat
Definition: format.c:66
#define DRIVE_UNKNOWN
Definition: winbase.h:253
#define CB_ERR
Definition: winuser.h:2411
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:435
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)
static const WCHAR L[]
Definition: oid.c:1250
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 636 of file drive.cpp.

637 {
638  PFORMAT_DRIVE_CONTEXT pContext;
639 
640  switch(uMsg)
641  {
642  case WM_INITDIALOG:
645  return TRUE;
646  case WM_COMMAND:
647  switch(LOWORD(wParam))
648  {
649  case IDOK:
650  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
651  if (pContext->bFormattingNow)
652  break;
653 
654  if (ShellMessageBoxW(shell32_hInstance, hwndDlg,
658  {
659  pContext->bFormattingNow = TRUE;
660 
662  pParams->hwndDlg = hwndDlg;
663  pParams->pContext = pContext;
664 
665  unsigned tid;
666  HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, DoFormatDrive, pParams, 0, &tid);
668  }
669  break;
670  case IDCANCEL:
671  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
672  if (pContext->bFormattingNow)
673  break;
674 
675  EndDialog(hwndDlg, pContext->Result);
676  break;
677  case 28677: // filesystem combo
678  if (HIWORD(wParam) == CBN_SELENDOK)
679  {
680  pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
681  if (pContext->bFormattingNow)
682  break;
683 
684  InsertDefaultClusterSizeForFs(hwndDlg, pContext);
685  }
686  break;
687  }
688  }
689  return FALSE;
690 }
#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:237
#define FALSE
Definition: types.h:117
#define CBN_SELENDOK
Definition: winuser.h:1964
#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:352
#define IDS_FORMAT_TITLE
Definition: shresdef.h:198
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1723
#define shell32_hInstance
PFORMAT_DRIVE_CONTEXT pContext
Definition: drive.cpp:598
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define ShellMessageBoxW
Definition: precomp.h:58
#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:601
#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:1722
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 435 of file drive.cpp.

439 {
440  PDWORD Progress;
441  PBOOLEAN pSuccess;
442  switch(Command)
443  {
444  case PROGRESS:
445  Progress = (PDWORD)ActionInfo;
446  SendDlgItemMessageW(FormatDrvDialog, 28678, PBM_SETPOS, (WPARAM)*Progress, 0);
447  break;
448  case DONE:
449  pSuccess = (PBOOLEAN)ActionInfo;
450  bSuccess = (*pSuccess);
453  break;
454 
455  case VOLUMEINUSE:
456  case INSUFFICIENTRIGHTS:
457  case FSNOTSUPPORTED:
458  case CLUSTERSIZETOOSMALL:
459  bSuccess = FALSE;
460  FIXME("Unsupported command in FormatExCB\n");
461  break;
462 
463  default:
464  break;
465  }
466 
467  return TRUE;
468 }
#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:432
static HWND FormatDrvDialog
Definition: drive.cpp:431
#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:58
#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:84
#define TRUE
Definition: types.h:120
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
static const WCHAR L[]
Definition: oid.c:1250

Referenced by InsertDefaultClusterSizeForFs().

◆ InitializeFormatDriveDlg()

static VOID InitializeFormatDriveDlg ( HWND  hwndDlg,
PFORMAT_DRIVE_CONTEXT  pContext 
)
static

Definition at line 352 of file drive.cpp.

353 {
354  WCHAR szText[120];
355  WCHAR szDrive[] = L"C:\\";
356  WCHAR szFs[30] = L"";
357  INT cchText;
358  ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
359  DWORD dwIndex, dwDefault;
360  UCHAR uMinor, uMajor;
361  BOOLEAN Latest;
362  HWND hwndFileSystems;
363 
364  cchText = GetWindowTextW(hwndDlg, szText, _countof(szText) - 1);
365  if (cchText < 0)
366  cchText = 0;
367  szText[cchText++] = L' ';
368  szDrive[0] = pContext->Drive + L'A';
369  if (GetVolumeInformationW(szDrive, &szText[cchText], _countof(szText) - cchText, NULL, NULL, NULL, szFs, _countof(szFs)))
370  {
371  if (szText[cchText] == UNICODE_NULL)
372  {
373  /* load default volume label */
375  }
376  else
377  {
378  /* set volume label */
379  SetDlgItemTextW(hwndDlg, 28679, &szText[cchText]);
381  }
382  }
383 
384  StringCchPrintfW(szText + cchText, _countof(szText) - cchText, L" (%c:)", szDrive[0]);
385 
386  /* set window text */
387  SetWindowTextW(hwndDlg, szText);
388 
389  if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
390  {
391  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, _countof(szText)))
392  {
393  /* add drive capacity */
394  SendDlgItemMessageW(hwndDlg, 28673, CB_ADDSTRING, 0, (LPARAM)szText);
395  SendDlgItemMessageW(hwndDlg, 28673, CB_SETCURSEL, 0, (LPARAM)0);
396  }
397  }
398 
399  if (pContext->Options & SHFMT_OPT_FULL)
400  {
401  /* check quick format button */
402  SendDlgItemMessageW(hwndDlg, 28674, BM_SETCHECK, BST_CHECKED, 0);
403  }
404 
405  /* enumerate all available filesystems */
406  dwIndex = 0;
407  dwDefault = 0;
408  hwndFileSystems = GetDlgItem(hwndDlg, 28677);
409 
410  while(QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest))
411  {
412  if (!wcsicmp(szText, szFs))
413  dwDefault = dwIndex;
414 
415  SendMessageW(hwndFileSystems, CB_ADDSTRING, 0, (LPARAM)szText);
416  dwIndex++;
417  }
418 
419  if (!dwIndex)
420  {
421  ERR("no filesystem providers\n");
422  return;
423  }
424 
425  /* select default filesys */
426  SendMessageW(hwndFileSystems, CB_SETCURSEL, dwDefault, 0);
427  /* setup cluster combo */
428  InsertDefaultClusterSizeForFs(hwndDlg, pContext);
429 }
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:237
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
#define UNICODE_NULL
static const WCHAR szText[]
Definition: dialog.c:139
#define CB_ADDSTRING
Definition: winuser.h:1919
unsigned char BOOLEAN
LONG_PTR LPARAM
Definition: windef.h:208
_In_ int cchText
Definition: winuser.h:4441
#define BM_SETCHECK
Definition: winuser.h:1904
#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
static const WCHAR L[]
Definition: oid.c:1250
#define CB_SETCURSEL
Definition: winuser.h:1944
#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 237 of file drive.cpp.

238 {
239  WCHAR wszBuf[100] = {0};
240  WCHAR wszDefaultSize[100] = {0};
241  PCWSTR pwszFsSizeLimit;
242  WCHAR szDrive[] = L"C:\\";
243  INT iSelIndex;
244  ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
246  LRESULT lIndex;
247  HWND hDlgCtrl;
248 
249  hDlgCtrl = GetDlgItem(hwndDlg, 28677);
250  iSelIndex = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
251  if (iSelIndex == CB_ERR)
252  return;
253 
254  if (SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)wszBuf) == CB_ERR)
255  return;
256 
257  szDrive[0] = pContext->Drive + L'A';
258 
259  if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
260  return;
261 
262  if (!wcsicmp(wszBuf, L"FAT16") ||
263  !wcsicmp(wszBuf, L"FAT")) // REACTOS HACK
264  {
265  pwszFsSizeLimit = L"4GB";
266  }
267  else if (!wcsicmp(wszBuf, L"FAT32"))
268  {
269  pwszFsSizeLimit = L"32GB";
270  }
271  else if (!wcsicmp(wszBuf, L"FATX"))
272  {
273  pwszFsSizeLimit = L"1GB/32GB";
274  }
275  else if (!wcsicmp(wszBuf, L"NTFS"))
276  {
277  pwszFsSizeLimit = L"256TB";
278  }
279  else if (!wcsicmp(wszBuf, L"EXT2"))
280  {
281  pwszFsSizeLimit = L"32TB";
282  }
283  else
284  {
285  pwszFsSizeLimit = L"16EB";
286  }
287 
288  if (!wcsicmp(wszBuf, L"FAT16") ||
289  !wcsicmp(wszBuf, L"FAT") || // REACTOS HACK
290  !wcsicmp(wszBuf, L"FAT32") ||
291  !wcsicmp(wszBuf, L"FATX") ||
292  !wcsicmp(wszBuf, L"NTFS") ||
293  !wcsicmp(wszBuf, L"EXT2") ||
294  !wcsicmp(wszBuf, L"BtrFS"))
295  {
296  if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
297  {
298  TRACE("%S is not supported on drive larger than %S, current size: %lu\n", wszBuf, pwszFsSizeLimit, TotalNumberOfBytes.QuadPart);
299  SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
300  return;
301  }
302 
303  if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszDefaultSize, _countof(wszDefaultSize)))
304  {
305  hDlgCtrl = GetDlgItem(hwndDlg, 28680); // Get the window handle of "allocation unit size" combobox
306  SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
307  lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszDefaultSize);
308  if (lIndex != CB_ERR)
309  SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
310  SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
311  }
312 
313  if (!wcsicmp(wszBuf, L"NTFS"))
314  {
315  ClusterSize = 512;
316  for (lIndex = 0; lIndex < 4; lIndex++)
317  {
318  TotalNumberOfBytes.QuadPart = ClusterSize;
319  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszDefaultSize, _countof(wszDefaultSize)))
320  {
321  lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszDefaultSize);
322  if (lIndex != CB_ERR)
323  SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
324  }
325  ClusterSize *= 2;
326  }
327  }
328 
329  SendMessageW(GetDlgItem(hwndDlg, 28675), BM_SETCHECK, BST_UNCHECKED, 0);
330  if (!wcsicmp(wszBuf, L"EXT2") ||
331  !wcsicmp(wszBuf, L"BtrFS") ||
332  !wcsicmp(wszBuf, L"NTFS"))
333  {
334  /* Enable the "Enable Compression" button */
335  EnableWindow(GetDlgItem(hwndDlg, 28675), TRUE);
336  }
337  else
338  {
339  /* Disable the "Enable Compression" button */
340  EnableWindow(GetDlgItem(hwndDlg, 28675), FALSE);
341  }
342  }
343  else
344  {
345  FIXME("Unknown filesystem: %ls\n", wszBuf);
346  SendDlgItemMessageW(hwndDlg, 28680, CB_RESETCONTENT, iSelIndex, 0);
347  return;
348  }
349 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
#define CB_SETITEMDATA
Definition: winuser.h:1949
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define TRUE
Definition: types.h:120
#define CB_GETLBTEXT
Definition: winuser.h:1935
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:1926
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:1919
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_RESETCONTENT
Definition: winuser.h:1942
#define CB_ERR
Definition: winuser.h:2411
#define BM_SETCHECK
Definition: winuser.h:1904
#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
static const WCHAR L[]
Definition: oid.c:1250
#define CB_SETCURSEL
Definition: winuser.h:1944
#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:5819
#define CB_DELETESTRING
Definition: winuser.h:1920
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 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
static const WCHAR L[]
Definition: oid.c:1250
#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  if (ret == 0)
232  return S_FALSE;
233  return E_FAIL;
234 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2162
HWND hwndParent
Definition: prsht.h:295
BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
Definition: precomp.h:128
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:1984
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define ZeroMemory
Definition: winbase.h:1664
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
LPCWSTR pszCaption
Definition: prsht.h:301
if SUCCEEDED(hr)
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define S_FALSE
Definition: winerror.h:2357
#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
static const WCHAR L[]
Definition: oid.c:1250
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 698 of file drive.cpp.

699 {
701  int result;
702 
703  TRACE("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
704 
705  Context.Drive = drive;
706  Context.Options = options;
707  Context.Result = FALSE;
708  Context.bFormattingNow = FALSE;
709 
710  if (!IsSystemDrive(&Context))
711  {
713  }
714  else
715  {
718  TRACE("SHFormatDrive(): The provided drive for format is a system volume! Aborting...\n");
719  }
720 
721  return result;
722 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
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:488
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:636
#define ShellMessageBoxW
Definition: precomp.h:58
#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

Referenced by format_drive_thread().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ bSuccess

BOOLEAN bSuccess = FALSE
static

Definition at line 432 of file drive.cpp.

Referenced by AllowWinstaAccess(), AsyncInetDownload(), CopyKeyName(), CreateClientProcess(), CreateNewKey(), DoExport(), DoImport(), DoWriteFile(), DPLAYX_ConstructData(), DPLAYX_DestructData(), DPLAYX_GetConnectionSettingsA(), DPLAYX_GetConnectionSettingsW(), EnablePrivilege(), EnablePrivilegeInCurrentProcess(), CInstalledApps::Enum(), 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(), GetName(), hash_file(), CDeviceView::Initialize(), INTERNET_AsyncCall(), IntGdiGetFontResourceInfo(), IsUrlValid(), IsWlanAdapter(), LaunchProcess(), CDeviceView::ListDevicesByType(), LoadDIBImage(), LoadTextFileToEdit(), main(), 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 431 of file drive.cpp.

Referenced by FormatDrive(), and FormatExCB().