2f59094251f9ac7ef1a0749f58407c925cd176f2
[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 if (!wcsicmp(szFs, L"EXT2"))
95 {
96 // auto block size calculation
97 ClusterSize = 0;
98 }
99 else
100 return FALSE;
101
102 *pClusterSize = ClusterSize;
103 return TRUE;
104 }
105
106 static BOOL CALLBACK
107 AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
108 {
109 PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam;
110 if (ppsh->nPages < MAX_PROPERTY_SHEET_PAGE)
111 {
112 ppsh->phpage[ppsh->nPages++] = hPage;
113 return TRUE;
114 }
115 return FALSE;
116 }
117
118 typedef struct _DRIVE_PROP_PAGE
119 {
120 LPCSTR resname;
121 DLGPROC dlgproc;
122 UINT DriveType;
123 } DRIVE_PROP_PAGE;
124
125 BOOL
126 SH_ShowDriveProperties(WCHAR *pwszDrive, LPCITEMIDLIST pidlFolder, PCUITEMID_CHILD_ARRAY apidl)
127 {
128 HPSXA hpsx = NULL;
129 HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE];
130 PROPSHEETHEADERW psh;
131 CComObject<CDrvDefExt> *pDrvDefExt = NULL;
132 WCHAR wszName[256];
133
134 ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
135 psh.dwSize = sizeof(PROPSHEETHEADERW);
136 psh.dwFlags = 0; // FIXME: make it modeless
137 psh.hwndParent = NULL;
138 psh.nStartPage = 0;
139 psh.phpage = hpsp;
140
141 LPITEMIDLIST completePidl = ILCombine(pidlFolder, apidl[0]);
142 if (!completePidl)
143 return FALSE;
144
145 if (ILGetDisplayNameExW(NULL, completePidl, wszName, ILGDN_NORMAL))
146 {
147 psh.pszCaption = wszName;
148 psh.dwFlags |= PSH_PROPTITLE;
149 }
150
151 ILFree(completePidl);
152
153 CComPtr<IDataObject> pDataObj;
154 HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
155
156 if (SUCCEEDED(hr))
157 {
158 hr = CComObject<CDrvDefExt>::CreateInstance(&pDrvDefExt);
159 if (SUCCEEDED(hr))
160 {
161 pDrvDefExt->AddRef(); // CreateInstance returns object with 0 ref count
162 hr = pDrvDefExt->Initialize(pidlFolder, pDataObj, NULL);
163 if (SUCCEEDED(hr))
164 {
165 hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh);
166 if (FAILED(hr))
167 ERR("AddPages failed\n");
168 } else
169 ERR("Initialize failed\n");
170 }
171
172 hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE, pDataObj);
173 if (hpsx)
174 SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageCallback, (LPARAM)&psh);
175 }
176
177 HWND hwnd = (HWND)PropertySheetW(&psh);
178
179 if (hpsx)
180 SHDestroyPropSheetExtArray(hpsx);
181 if (pDrvDefExt)
182 pDrvDefExt->Release();
183
184 if (!hwnd)
185 return FALSE;
186 return TRUE;
187 }
188
189 static VOID
190 InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
191 {
192 WCHAR wszBuf[100] = {0};
193 WCHAR szDrive[] = L"C:\\";
194 INT iSelIndex;
195 ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
196 DWORD ClusterSize;
197 LRESULT lIndex;
198 HWND hDlgCtrl;
199
200 hDlgCtrl = GetDlgItem(hwndDlg, 28677);
201 iSelIndex = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0);
202 if (iSelIndex == CB_ERR)
203 return;
204
205 if (SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)wszBuf) == CB_ERR)
206 return;
207
208 szDrive[0] = pContext->Drive + L'A';
209
210 if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
211 return;
212
213 if (!wcsicmp(wszBuf, L"FAT16") ||
214 !wcsicmp(wszBuf, L"FAT")) //REACTOS HACK
215 {
216 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
217 {
218 TRACE("FAT16 is not supported on hdd larger than 4G current %lu\n", TotalNumberOfBytes.QuadPart);
219 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
220 return;
221 }
222
223 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, _countof(wszBuf)))
224 {
225 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
226 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
227 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
228 if (lIndex != CB_ERR)
229 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
230 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
231 }
232 }
233 else if (!wcsicmp(wszBuf, L"FAT32"))
234 {
235 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
236 {
237 TRACE("FAT32 is not supported on hdd larger than 32G current %lu\n", TotalNumberOfBytes.QuadPart);
238 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
239 return;
240 }
241
242 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, _countof(wszBuf)))
243 {
244 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
245 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
246 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
247 if (lIndex != CB_ERR)
248 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
249 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
250 }
251 }
252 else if (!wcsicmp(wszBuf, L"NTFS"))
253 {
254 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
255 {
256 TRACE("NTFS is not supported on hdd larger than 2TB current %lu\n", TotalNumberOfBytes.QuadPart);
257 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
258 return;
259 }
260
261 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
262 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, _countof(wszBuf)))
263 {
264 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
265 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
266 if (lIndex != CB_ERR)
267 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
268 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
269 }
270 ClusterSize = 512;
271 for (lIndex = 0; lIndex < 4; lIndex++)
272 {
273 TotalNumberOfBytes.QuadPart = ClusterSize;
274 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf)))
275 {
276 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
277 if (lIndex != CB_ERR)
278 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
279 }
280 ClusterSize *= 2;
281 }
282 }
283 else if (!wcsicmp(wszBuf, L"EXT2"))
284 {
285 if (!GetDefaultClusterSize(wszBuf, &ClusterSize, &TotalNumberOfBytes))
286 {
287 TRACE("EXT2 is not supported on hdd larger than 32T current %lu\n", TotalNumberOfBytes.QuadPart);
288 SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0);
289 return;
290 }
291
292 if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, wszBuf, _countof(wszBuf)))
293 {
294 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
295 SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
296 lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)wszBuf);
297 if (lIndex != CB_ERR)
298 SendMessageW(hDlgCtrl, CB_SETITEMDATA, lIndex, (LPARAM)ClusterSize);
299 SendMessageW(hDlgCtrl, CB_SETCURSEL, 0, 0);
300 }
301 }
302 else
303 {
304 FIXME("unknown fs\n");
305 SendDlgItemMessageW(hwndDlg, 28680, CB_RESETCONTENT, iSelIndex, 0);
306 return;
307 }
308 }
309
310 static VOID
311 InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
312 {
313 WCHAR szText[120];
314 WCHAR szDrive[] = L"C:\\";
315 WCHAR szFs[30] = L"";
316 INT cchText;
317 ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes;
318 DWORD dwIndex, dwDefault;
319 UCHAR uMinor, uMajor;
320 BOOLEAN Latest;
321 HWND hwndFileSystems;
322
323 cchText = GetWindowTextW(hwndDlg, szText, _countof(szText) - 1);
324 if (cchText < 0)
325 cchText = 0;
326 szText[cchText++] = L' ';
327 szDrive[0] = pContext->Drive + L'A';
328 if (GetVolumeInformationW(szDrive, &szText[cchText], _countof(szText) - cchText, NULL, NULL, NULL, szFs, _countof(szFs)))
329 {
330 if (szText[cchText] == UNICODE_NULL)
331 {
332 /* load default volume label */
333 cchText += LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[cchText], _countof(szText) - cchText);
334 }
335 else
336 {
337 /* set volume label */
338 SetDlgItemTextW(hwndDlg, 28679, &szText[cchText]);
339 cchText += wcslen(&szText[cchText]);
340 }
341 }
342
343 StringCchPrintfW(szText + cchText, _countof(szText) - cchText, L" (%c:)", szDrive[0]);
344
345 /* set window text */
346 SetWindowTextW(hwndDlg, szText);
347
348 if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
349 {
350 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, _countof(szText)))
351 {
352 /* add drive capacity */
353 SendDlgItemMessageW(hwndDlg, 28673, CB_ADDSTRING, 0, (LPARAM)szText);
354 SendDlgItemMessageW(hwndDlg, 28673, CB_SETCURSEL, 0, (LPARAM)0);
355 }
356 }
357
358 if (pContext->Options & SHFMT_OPT_FULL)
359 {
360 /* check quick format button */
361 SendDlgItemMessageW(hwndDlg, 28674, BM_SETCHECK, BST_CHECKED, 0);
362 }
363
364 /* enumerate all available filesystems */
365 dwIndex = 0;
366 dwDefault = 0;
367 hwndFileSystems = GetDlgItem(hwndDlg, 28677);
368
369 while(QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest))
370 {
371 if (!wcsicmp(szText, szFs))
372 dwDefault = dwIndex;
373
374 SendMessageW(hwndFileSystems, CB_ADDSTRING, 0, (LPARAM)szText);
375 dwIndex++;
376 }
377
378 if (!dwIndex)
379 {
380 ERR("no filesystem providers\n");
381 return;
382 }
383
384 /* select default filesys */
385 SendMessageW(hwndFileSystems, CB_SETCURSEL, dwDefault, 0);
386 /* setup cluster combo */
387 InsertDefaultClusterSizeForFs(hwndDlg, pContext);
388 /* hide progress control */
389 ShowWindow(GetDlgItem(hwndDlg, 28678), SW_HIDE);
390 }
391
392 static HWND FormatDrvDialog = NULL;
393 static BOOLEAN bSuccess = FALSE;
394
395 static BOOLEAN NTAPI
396 FormatExCB(
397 IN CALLBACKCOMMAND Command,
398 IN ULONG SubAction,
399 IN PVOID ActionInfo)
400 {
401 PDWORD Progress;
402 PBOOLEAN pSuccess;
403 switch(Command)
404 {
405 case PROGRESS:
406 Progress = (PDWORD)ActionInfo;
407 SendDlgItemMessageW(FormatDrvDialog, 28678, PBM_SETPOS, (WPARAM)*Progress, 0);
408 break;
409 case DONE:
410 pSuccess = (PBOOLEAN)ActionInfo;
411 bSuccess = (*pSuccess);
412 break;
413
414 case VOLUMEINUSE:
415 case INSUFFICIENTRIGHTS:
416 case FSNOTSUPPORTED:
417 case CLUSTERSIZETOOSMALL:
418 bSuccess = FALSE;
419 FIXME("\n");
420 break;
421
422 default:
423 break;
424 }
425
426 return TRUE;
427 }
428
429 VOID
430 FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
431 {
432 WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
433 WCHAR szFileSys[40] = {0};
434 WCHAR szLabel[40] = {0};
435 INT iSelIndex;
436 UINT Length;
437 HWND hDlgCtrl;
438 BOOL QuickFormat;
439 DWORD ClusterSize;
440
441 /* set volume path */
442 szDrive[0] = pContext->Drive + L'A';
443
444 /* get filesystem */
445 hDlgCtrl = GetDlgItem(hwndDlg, 28677);
446 iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
447 if (iSelIndex == CB_ERR)
448 {
449 FIXME("\n");
450 return;
451 }
452 Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
453 if ((int)Length == CB_ERR || Length + 1 > _countof(szFileSys))
454 {
455 FIXME("\n");
456 return;
457 }
458
459 /* retrieve the file system */
460 SendMessageW(hDlgCtrl, CB_GETLBTEXT, iSelIndex, (LPARAM)szFileSys);
461 szFileSys[_countof(szFileSys)-1] = L'\0';
462
463 /* retrieve the volume label */
464 hDlgCtrl = GetWindow(hwndDlg, 28679);
465 Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
466 if (Length + 1 > _countof(szLabel))
467 {
468 FIXME("\n");
469 return;
470 }
471 SendMessageW(hDlgCtrl, WM_GETTEXT, _countof(szLabel), (LPARAM)szLabel);
472 szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
473
474 /* check for quickformat */
475 if (SendDlgItemMessageW(hwndDlg, 28674, BM_GETCHECK, 0, 0) == BST_CHECKED)
476 QuickFormat = TRUE;
477 else
478 QuickFormat = FALSE;
479
480 /* get the cluster size */
481 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
482 iSelIndex = SendMessageW(hDlgCtrl, CB_GETCURSEL, 0, 0);
483 if (iSelIndex == CB_ERR)
484 {
485 FIXME("\n");
486 return;
487 }
488 ClusterSize = SendMessageW(hDlgCtrl, CB_GETITEMDATA, iSelIndex, 0);
489 if ((int)ClusterSize == CB_ERR)
490 {
491 FIXME("\n");
492 return;
493 }
494
495 hDlgCtrl = GetDlgItem(hwndDlg, 28680);
496 ShowWindow(hDlgCtrl, SW_SHOW);
497 SendMessageW(hDlgCtrl, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
498 bSuccess = FALSE;
499
500 /* FIXME
501 * will cause display problems
502 * when performing more than one format
503 */
504 FormatDrvDialog = hwndDlg;
505
506 FormatEx(szDrive,
507 FMIFS_HARDDISK, /* FIXME */
508 szFileSys,
509 szLabel,
510 QuickFormat,
511 ClusterSize,
512 FormatExCB);
513
514 ShowWindow(hDlgCtrl, SW_HIDE);
515 FormatDrvDialog = NULL;
516 if (!bSuccess)
517 {
518 pContext->Result = SHFMT_ERROR;
519 }
520 else if (QuickFormat)
521 {
522 pContext->Result = SHFMT_OPT_FULL;
523 }
524 else
525 {
526 pContext->Result = FALSE;
527 }
528 }
529
530 static INT_PTR CALLBACK
531 FormatDriveDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
532 {
533 PFORMAT_DRIVE_CONTEXT pContext;
534
535 switch(uMsg)
536 {
537 case WM_INITDIALOG:
538 InitializeFormatDriveDlg(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam);
539 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
540 return TRUE;
541 case WM_COMMAND:
542 switch(LOWORD(wParam))
543 {
544 case IDOK:
545 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
546 FormatDrive(hwndDlg, pContext);
547 break;
548 case IDCANCEL:
549 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
550 EndDialog(hwndDlg, pContext->Result);
551 break;
552 case 28677: // filesystem combo
553 if (HIWORD(wParam) == CBN_SELENDOK)
554 {
555 pContext = (PFORMAT_DRIVE_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
556 InsertDefaultClusterSizeForFs(hwndDlg, pContext);
557 }
558 break;
559 }
560 }
561 return FALSE;
562 }
563
564 /*************************************************************************
565 * SHFormatDrive (SHELL32.@)
566 */
567
568 DWORD
569 WINAPI
570 SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
571 {
572 FORMAT_DRIVE_CONTEXT Context;
573 int result;
574
575 TRACE("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
576
577 Context.Drive = drive;
578 Context.Options = options;
579
580 result = DialogBoxParamW(shell32_hInstance, MAKEINTRESOURCEW(IDD_FORMAT_DRIVE), hwnd, FormatDriveDlg, (LPARAM)&Context);
581
582 return result;
583 }
584
585