Revert tree-restructure attempt: r66583, r66582, r66581, r66578, sauf ntdll changes...
[reactos.git] / reactos / dll / win32 / shell32 / dialogs / drive.cpp
1 /*
2 * Shell Library Functions
3 *
4 * Copyright 2005 Johannes Anderwald
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "precomp.h"
22
23 #define MAX_PROPERTY_SHEET_PAGE 32
24
25 WINE_DEFAULT_DEBUG_CHANNEL(shell);
26
27 typedef struct
28 {
29 WCHAR Drive;
30 UINT Options;
31 UINT Result;
32 } FORMAT_DRIVE_CONTEXT, *PFORMAT_DRIVE_CONTEXT;
33
34 EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
35 HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle);
36
37 static BOOL
38 GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes)
39 {
40 DWORD ClusterSize;
41
42 if (!wcsicmp(szFs, L"FAT16") ||
43 !wcsicmp(szFs, L"FAT")) //REACTOS HACK
44 {
45 if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024))
46 ClusterSize = 2048;
47 else if (TotalNumberOfBytes->QuadPart <= (32 * 1024 * 1024))
48 ClusterSize = 512;
49 else if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
50 ClusterSize = 1024;
51 else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
52 ClusterSize = 2048;
53 else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024))
54 ClusterSize = 4096;
55 else if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024))
56 ClusterSize = 8192;
57 else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
58 ClusterSize = 16384;
59 else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL))
60 ClusterSize = 32768;
61 else if (TotalNumberOfBytes->QuadPart <= (4096LL * 1024LL * 1024LL))
62 ClusterSize = 8192;
63 else
64 return FALSE;
65 }
66 else if (!wcsicmp(szFs, L"FAT32"))
67 {
68 if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
69 ClusterSize = 512;
70 else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
71 ClusterSize = 1024;
72 else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024))
73 ClusterSize = 2048;
74 else if (TotalNumberOfBytes->QuadPart <= (8192LL * 1024LL * 1024LL))
75 ClusterSize = 2048;
76 else if (TotalNumberOfBytes->QuadPart <= (16384LL * 1024LL * 1024LL))
77 ClusterSize = 8192;
78 else if (TotalNumberOfBytes->QuadPart <= (32768LL * 1024LL * 1024LL))
79 ClusterSize = 16384;
80 else
81 return FALSE;
82 }
83 else if (!wcsicmp(szFs, L"NTFS"))
84 {
85 if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024))
86 ClusterSize = 512;
87 else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
88 ClusterSize = 1024;
89 else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL))
90 ClusterSize = 2048;
91 else
92 ClusterSize = 2048;
93 }
94 else
95 return FALSE;
96
97 *pClusterSize = ClusterSize;
98 return TRUE;
99 }
100
101 static BOOL CALLBACK
102 AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
103 {
104 PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam;
105 if (ppsh->nPages < MAX_PROPERTY_SHEET_PAGE)
106 {
107 ppsh->phpage[ppsh->nPages++] = hPage;
108 return TRUE;
109 }
110 return FALSE;
111 }
112
113 typedef struct _DRIVE_PROP_PAGE
114 {
115 LPCSTR resname;
116 DLGPROC dlgproc;
117 UINT DriveType;
118 } DRIVE_PROP_PAGE;
119
120 BOOL
121 SH_ShowDriveProperties(WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *apidl)
122 {
123 HPSXA hpsx = NULL;
124 HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE];
125 PROPSHEETHEADERW psh;
126 CComObject<CDrvDefExt> *pDrvDefExt = NULL;
127
128 ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
129 psh.dwSize = sizeof(PROPSHEETHEADERW);
130 psh.dwFlags = 0; // FIXME: make it modeless
131 psh.hwndParent = NULL;
132 psh.nStartPage = 0;
133 psh.phpage = hpsp;
134
135 WCHAR wszName[256];
136 if (GetVolumeInformationW(pwszDrive, wszName, sizeof(wszName) / sizeof(WCHAR), NULL, NULL, NULL, NULL, 0))
137 {
138 psh.pszCaption = wszName;
139 psh.dwFlags |= PSH_PROPTITLE;
140 if (wszName[0] == UNICODE_NULL)
141 {
142 /* FIXME: check if disk is a really a local hdd */
143 UINT i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, sizeof(wszName) / sizeof(WCHAR) - 6);
144 StringCchPrintf(wszName + i, sizeof(wszName) / sizeof(WCHAR) - i, L" (%s)", pwszDrive);
145 }
146 }
147
148 CComPtr<IDataObject> pDataObj;
149 HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
150
151 if (SUCCEEDED(hr))
152 {
153 hr = CComObject<CDrvDefExt>::CreateInstance(&pDrvDefExt);
154 if (SUCCEEDED(hr))
155 {
156 pDrvDefExt->AddRef(); // CreateInstance returns object with 0 ref count
157 hr = pDrvDefExt->Initialize(pidlFolder, pDataObj, NULL);
158 if (SUCCEEDED(hr))
159 {
160 hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh);
161 if (FAILED(hr))
162 ERR("AddPages failed\n");
163 } else
164 ERR("Initialize failed\n");
165 }
166
167 hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE, pDataObj);
168 if (hpsx)
169 SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageCallback, (LPARAM)&psh);
170 }
171
172 HWND hwnd = (HWND)PropertySheetW(&psh);
173
174 if (hpsx)
175 SHDestroyPropSheetExtArray(hpsx);
176 if (pDrvDefExt)
177 pDrvDefExt->Release();
178
179 if (!hwnd)
180 return FALSE;
181 return TRUE;
182 }
183
184 static VOID
185 InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
186 {
187 WCHAR wszBuf[100] = {0};
188 WCHAR szDrive[] = L"C:\\";
189 INT iSelIndex;
190 ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
191 DWORD ClusterSize;
192 LRESULT lIndex;
193 HWND hDlgCtrl;
194
195 hDlgCtrl = GetDlgItem(hwndDlg, 28677);
196 iSelIndex = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
197 if (iSelIndex == CB_ERR)
198 return;
199
200 if (SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)wszBuf) == CB_ERR)
201 return;
202
203 szDrive[0] = pContext->Drive + 'A';
204
205 if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
206 return;
207
208 if (!wcsicmp(wszBuf, L"FAT16") ||
209 !wcsicmp(wszBuf, L"FAT")) //REACTOS HACK
210 {
211 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
212 {
213 TRACE("FAT16 is not supported on hdd larger than 4G current %lu\n", TotalNumberOfBytes.QuadPart);
214 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
215 return;
216 }
217
218 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, sizeof(wszBuf) / sizeof(WCHAR)))
219 {
220 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
221 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
222 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
223 if (lIndex != CB_ERR)
224 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
225 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
226 }
227 }
228 else if (!wcsicmp(wszBuf, L"FAT32"))
229 {
230 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
231 {
232 TRACE("FAT32 is not supported on hdd larger than 32G current %lu\n", TotalNumberOfBytes.QuadPart);
233 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
234 return;
235 }
236
237 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, sizeof(wszBuf) / sizeof(WCHAR)))
238 {
239 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
240 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
241 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
242 if (lIndex != CB_ERR)
243 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
244 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
245 }
246 }
247 else if (!wcsicmp(wszBuf, L"NTFS"))
248 {
249 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
250 {
251 TRACE("NTFS is not supported on hdd larger than 2TB current %lu\n", TotalNumberOfBytes.QuadPart);
252 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
253 return;
254 }
255
256 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
257 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, sizeof(wszBuf) / sizeof(WCHAR)))
258 {
259 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
260 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
261 if (lIndex != CB_ERR)
262 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
263 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
264 }
265 ClusterSize = 512;
266 for (lIndex = 0; lIndex < 4; lIndex++)
267 {
268 TotalNumberOfBytes.QuadPart = ClusterSize;
269 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR)))
270 {
271 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
272 if (lIndex != CB_ERR)
273 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
274 }
275 ClusterSize *= 2;
276 }
277 }
278 else
279 {
280 FIXME("unknown fs\n");
281 SendDlgItemMessageW(hwndDlg, 28680, CB_RESETCONTENT, iSelIndex, 0);
282 return;
283 }
284 }
285
286 static VOID
287 InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
288 {
289 WCHAR szText[120];
290 WCHAR szDrive[] = L"C:\\";
291 WCHAR szFs[30] = L"";
292 INT cchText;
293 ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
294 DWORD dwIndex, dwDefault;
295 UCHAR uMinor, uMajor;
296 BOOLEAN Latest;
297 HWND hwndFileSystems;
298
299 cchText = GetWindowTextW(hwndDlg, szText, sizeof(szText) / sizeof(WCHAR) - 1);
300 if (cchText < 0)
301 cchText = 0;
302 szText[cchText++] = L' ';
303 szDrive[0] = pContext->Drive + L'A';
304 if (GetVolumeInformationW(szDrive, &szText[cchText], (sizeof(szText) / sizeof(WCHAR)) - cchText, NULL, NULL, NULL, szFs, sizeof(szFs) / sizeof(WCHAR)))
305 {
306 if (szText[cchText] == UNICODE_NULL)
307 {
308 /* load default volume label */
309 cchText += LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[cchText], (sizeof(szText) / sizeof(WCHAR)) - cchText);
310 }
311 else
312 {
313 /* set volume label */
314 SetDlgItemTextW(hwndDlg, 28679, &szText[cchText]);
315 cchText += wcslen(&szText[cchText]);
316 }
317 }
318
319 StringCchPrintfW(szText + cchText, _countof(szText) - cchText, L" (%c)", szDrive[0]);
320
321 /* set window text */
322 SetWindowTextW(hwndDlg, szText);
323
324 if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
325 {
326 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, sizeof(szText) / sizeof(WCHAR)))
327 {
328 /* add drive capacity */
329 SendDlgItemMessageW(hwndDlg, 28673, CB_ADDSTRING, 0, (LPARAM)szText);
330 SendDlgItemMessageW(hwndDlg, 28673, CB_SETCURSEL, 0, (LPARAM)0);
331 }
332 }
333
334 if (pContext->Options & SHFMT_OPT_FULL)
335 {
336 /* check quick format button */
337 SendDlgItemMessageW(hwndDlg, 28674, BM_SETCHECK, BST_CHECKED, 0);
338 }
339
340 /* enumerate all available filesystems */
341 dwIndex = 0;
342 dwDefault = 0;
343 hwndFileSystems = GetDlgItem(hwndDlg, 28677);
344
345 while(QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest))
346 {
347 if (!wcsicmp(szText, szFs))
348 dwDefault = dwIndex;
349
350 SendMessageW(hwndFileSystems, CB_ADDSTRING, 0, (LPARAM)szText);
351 dwIndex++;
352 }
353
354 if (!dwIndex)
355 {
356 ERR("no filesystem providers\n");
357 return;
358 }
359
360 /* select default filesys */
361 SendMessageW(hwndFileSystems, CB_SETCURSEL, dwDefault, 0);
362 /* setup cluster combo */
363 InsertDefaultClusterSizeForFs(hwndDlg, pContext);
364 /* hide progress control */
365 ShowWindow(GetDlgItem(hwndDlg, 28678), SW_HIDE);
366 }
367
368 static HWND FormatDrvDialog = NULL;
369 static BOOLEAN bSuccess = FALSE;
370
371 static BOOLEAN NTAPI
372 FormatExCB(
373 IN CALLBACKCOMMAND Command,
374 IN ULONG SubAction,
375 IN PVOID ActionInfo)
376 {
377 PDWORD Progress;
378 PBOOLEAN pSuccess;
379 switch(Command)
380 {
381 case PROGRESS:
382 Progress = (PDWORD)ActionInfo;
383 SendDlgItemMessageW(FormatDrvDialog, 28678, PBM_SETPOS, (WPARAM)*Progress, 0);
384 break;
385 case DONE:
386 pSuccess = (PBOOLEAN)ActionInfo;
387 bSuccess = (*pSuccess);
388 break;
389
390 case VOLUMEINUSE:
391 case INSUFFICIENTRIGHTS:
392 case FSNOTSUPPORTED:
393 case CLUSTERSIZETOOSMALL:
394 bSuccess = FALSE;
395 FIXME("\n");
396 break;
397
398 default:
399 break;
400 }
401
402 return TRUE;
403 }
404
405 VOID
406 FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
407 {
408 WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
409 WCHAR szFileSys[40] = {0};
410 WCHAR szLabel[40] = {0};
411 INT iSelIndex;
412 UINT Length;
413 HWND hDlgCtrl;
414 BOOL QuickFormat;
415 DWORD ClusterSize;
416
417 /* set volume path */
418 szDrive[0] = pContext->Drive;
419
420 /* get filesystem */
421 hDlgCtrl = GetDlgItem(hwndDlg, 28677);
422 iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
423 if (iSelIndex == CB_ERR)
424 {
425 FIXME("\n");
426 return;
427 }
428 Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
429 if ((int)Length == CB_ERR || Length + 1 > sizeof(szFileSys) / sizeof(WCHAR))
430 {
431 FIXME("\n");
432 return;
433 }
434
435 /* retrieve the file system */
436 SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)szFileSys);
437 szFileSys[(sizeof(szFileSys)/sizeof(WCHAR))-1] = L'\0';
438
439 /* retrieve the volume label */
440 hDlgCtrl = GetWindow(hwndDlg, 28679);
441 Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
442 if (Length + 1 > sizeof(szLabel) / sizeof(WCHAR))
443 {
444 FIXME("\n");
445 return;
446 }
447 SendMessageW(hDlgCtrl, WM_GETTEXT, sizeof(szLabel) / sizeof(WCHAR), (LPARAM)szLabel);
448 szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
449
450 /* check for quickformat */
451 if (SendDlgItemMessageW(hwndDlg, 28674, BM_GETCHECK, 0, 0) == BST_CHECKED)
452 QuickFormat = TRUE;
453 else
454 QuickFormat = FALSE;
455
456 /* get the cluster size */
457 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
458 iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
459 if (iSelIndex == CB_ERR)
460 {
461 FIXME("\n");
462 return;
463 }
464 ClusterSize = SendMessageW(hDlgCtrl, CB_GETITEMDATA, iSelIndex, 0);
465 if ((int)ClusterSize == CB_ERR)
466 {
467 FIXME("\n");
468 return;
469 }
470
471 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
472 ShowWindow(hDlgCtrl, SW_SHOW);
473 SendMessageW(hDlgCtrl, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
474 bSuccess = FALSE;
475
476 /* FIXME
477 * will cause display problems
478 * when performing more than one format
479 */
480 FormatDrvDialog = hwndDlg;
481
482 FormatEx(szDrive,
483 FMIFS_HARDDISK, /* FIXME */
484 szFileSys,
485 szLabel,
486 QuickFormat,
487 ClusterSize,
488 FormatExCB);
489
490 ShowWindow(hDlgCtrl, SW_HIDE);
491 FormatDrvDialog = NULL;
492 if (!bSuccess)
493 {
494 pContext->Result = SHFMT_ERROR;
495 }
496 else if (QuickFormat)
497 {
498 pContext->Result = SHFMT_OPT_FULL;
499 }
500 else
501 {
502 pContext->Result = FALSE;
503 }
504 }
505
506 static INT_PTR CALLBACK
507 FormatDriveDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
508 {
509 PFORMAT_DRIVE_CONTEXT pContext;
510
511 switch(uMsg)
512 {
513 case WM_INITDIALOG:
514 InitializeFormatDriveDlg(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam);
515 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
516 return TRUE;
517 case WM_COMMAND:
518 switch(LOWORD(wParam))
519 {
520 case IDOK:
521 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
522 FormatDrive(hwndDlg, pContext);
523 break;
524 case IDCANCEL:
525 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
526 EndDialog(hwndDlg, pContext->Result);
527 break;
528 case 28677: // filesystem combo
529 if (HIWORD(wParam) == CBN_SELENDOK)
530 {
531 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
532 InsertDefaultClusterSizeForFs(hwndDlg, pContext);
533 }
534 break;
535 }
536 }
537 return FALSE;
538 }
539
540 /*************************************************************************
541 * SHFormatDrive (SHELL32.@)
542 */
543
544 DWORD
545 WINAPI
546 SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
547 {
548 FORMAT_DRIVE_CONTEXT Context;
549 int result;
550
551 TRACE("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
552
553 Context.Drive = drive;
554 Context.Options = options;
555
556 result = DialogBoxParamW(shell32_hInstance, MAKEINTRESOURCEW(IDD_FORMAT_DRIVE), hwnd, FormatDriveDlg, (LPARAM)&Context);
557
558 return result;
559 }
560
561