ReactOS 0.4.16-dev-983-g23ad936
drvdefext.cpp
Go to the documentation of this file.
1/*
2 * Provides default drive shell extension
3 *
4 * Copyright 2005 Johannes Anderwald
5 * Copyright 2012 Rafal Harabien
6 * Copyright 2020 Katayama Hirofumi MZ
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include "precomp.h"
24
25#define _USE_MATH_DEFINES
26#include <math.h>
27#include <devguid.h>
28
29#define NTOS_MODE_USER
30#include <ndk/iofuncs.h>
31#include <ndk/obfuncs.h>
32
34
35typedef enum
36{
41
44 LPGUID lpGuids,
45 UINT uNumberOfGuids,
47UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax);
48
49static VOID
50GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive)
51{
52 DWORD dwMaxComp, dwFileSys;
53 SIZE_T cchText = 0;
54
55 if (GetVolumeInformationW(pwszDrive, pwszText, cchTextMax, NULL, &dwMaxComp, &dwFileSys, NULL, 0))
56 {
57 cchText = wcslen(pwszText);
58 if (cchText == 0)
59 {
60 /* load default volume label */
61 cchText = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, pwszText, cchTextMax);
62 }
63 }
64
65 StringCchPrintfW(pwszText + cchText, cchTextMax - cchText, L" (%c:)", pwszDrive[0]);
66}
67
68static VOID
70{
71 WCHAR wszText[100];
73 SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pwszDrive);
74
75 Length = GetWindowTextW(hwndDlg, wszText, sizeof(wszText) / sizeof(WCHAR));
76 wszText[Length] = L' ';
77 GetDriveNameWithLetter(&wszText[Length + 1], (sizeof(wszText) / sizeof(WCHAR)) - Length - 1, pwszDrive);
78 SetWindowText(hwndDlg, wszText);
79}
80
83
84static BOOLEAN NTAPI
87 IN ULONG SubAction,
88 IN PVOID ActionInfo)
89{
90 PDWORD Progress;
91 PBOOLEAN pSuccess;
92 switch(Command)
93 {
94 case PROGRESS:
95 Progress = (PDWORD)ActionInfo;
97 break;
98 case DONE:
99 pSuccess = (PBOOLEAN)ActionInfo;
100 bChkdskSuccess = (*pSuccess);
101 break;
102
103 case VOLUMEINUSE:
105 case FSNOTSUPPORTED:
108 FIXME("\n");
109 break;
110
111 default:
112 break;
113 }
114
115 return TRUE;
116}
117
118static VOID
119ChkDskNow(HWND hwndDlg, LPCWSTR pwszDrive)
120{
121 //DWORD ClusterSize = 0;
122 WCHAR wszFs[30];
123 ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser;
124 BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE;
125
126 if(!GetVolumeInformationW(pwszDrive, NULL, 0, NULL, NULL, NULL, wszFs, _countof(wszFs)))
127 {
128 FIXME("failed to get drive fs type\n");
129 return;
130 }
131
132 if (!GetDiskFreeSpaceExW(pwszDrive, &FreeBytesAvailableUser, &TotalNumberOfFreeBytes, NULL))
133 {
134 FIXME("failed to get drive space type\n");
135 return;
136 }
137
138 /*if (!GetDefaultClusterSize(wszFs, &ClusterSize, &TotalNumberOfFreeBytes))
139 {
140 FIXME("invalid cluster size\n");
141 return;
142 }*/
143
144 if (SendDlgItemMessageW(hwndDlg, 14000, BM_GETCHECK, 0, 0) == BST_CHECKED)
145 bCorrectErrors = TRUE;
146
147 if (SendDlgItemMessageW(hwndDlg, 14001, BM_GETCHECK, 0, 0) == BST_CHECKED)
148 bScanDrive = TRUE;
149
150 hChkdskDrvDialog = hwndDlg;
152 SendDlgItemMessageW(hwndDlg, 14002, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
153 Chkdsk((LPWSTR)pwszDrive, (LPWSTR)wszFs, bCorrectErrors, TRUE, FALSE, bScanDrive, NULL, NULL, ChkdskCallback); // FIXME: casts
154
157}
158
159static INT_PTR CALLBACK
161 HWND hwndDlg,
162 UINT uMsg,
165{
166 switch(uMsg)
167 {
168 case WM_INITDIALOG:
171 return TRUE;
172 case WM_COMMAND:
173 switch(LOWORD(wParam))
174 {
175 case IDCANCEL:
176 EndDialog(hwndDlg, 0);
177 break;
178 case IDOK:
179 {
180 LPCWSTR pwszDrive = (LPCWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER);
181 ChkDskNow(hwndDlg, pwszDrive);
182 break;
183 }
184 }
185 break;
186 }
187
188 return FALSE;
189}
190
191VOID
193{
194 HBRUSH hBrush;
195
196 if (pDrawItem->CtlID == 14013)
197 {
198 hBrush = CreateSolidBrush(RGB(0, 0, 255));
199 if (hBrush)
200 {
201 FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush);
202 DeleteObject((HGDIOBJ)hBrush);
203 }
204 }
205 else if (pDrawItem->CtlID == 14014)
206 {
207 hBrush = CreateSolidBrush(RGB(255, 0, 255));
208 if (hBrush)
209 {
210 FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush);
211 DeleteObject((HGDIOBJ)hBrush);
212 }
213 }
214 else if (pDrawItem->CtlID == 14015)
215 {
216 HBRUSH hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
217 HBRUSH hMagBrush = CreateSolidBrush(RGB(255, 0, 255));
218 HBRUSH hbrOld;
219 HPEN hBlackPen = (HPEN)GetStockObject(BLACK_PEN);
220 HPEN hDarkBluePen = CreatePen(PS_SOLID, 1, RGB(0, 0, 128));
221 HPEN hDarkMagPen = CreatePen(PS_SOLID, 1, RGB(128, 0, 128));
222 HPEN hOldPen = (HPEN)SelectObject(pDrawItem->hDC, hDarkMagPen);
223 INT xCenter = (pDrawItem->rcItem.left + pDrawItem->rcItem.right) / 2;
224 INT yCenter = (pDrawItem->rcItem.top + pDrawItem->rcItem.bottom - 10) / 2;
225 INT cx = pDrawItem->rcItem.right - pDrawItem->rcItem.left;
226 INT cy = pDrawItem->rcItem.bottom - pDrawItem->rcItem.top - 10;
227 INT xRadial = xCenter + (INT)(cos(M_PI + m_FreeSpacePerc / 100.0f * M_PI * 2.0f) * cx / 2);
228 INT yRadial = yCenter - (INT)(sin(M_PI + m_FreeSpacePerc / 100.0f * M_PI * 2.0f) * cy / 2);
229
230 TRACE("FreeSpace %u a %f cx %d\n", m_FreeSpacePerc, M_PI+m_FreeSpacePerc / 100.0f * M_PI * 2.0f, cx);
231
232 for (INT x = pDrawItem->rcItem.left; x < pDrawItem->rcItem.right; ++x)
233 {
234 double cos_val = (x - xCenter) * 2.0f / cx;
235 INT y = yCenter + (INT)(sin(acos(cos_val)) * cy / 2) - 1;
236 HPEN hCenterPen;
237
238 if (m_FreeSpacePerc < 50 && x == xRadial)
239 SelectObject(pDrawItem->hDC, hDarkBluePen);
240
241 /* Temporarily change pens to draw edges */
242 if (x == pDrawItem->rcItem.left)
243 hCenterPen = (HPEN)SelectObject(pDrawItem->hDC, hBlackPen);
244 else if (x == pDrawItem->rcItem.right - 1)
245 SelectObject(pDrawItem->hDC, hBlackPen);
246
247 MoveToEx(pDrawItem->hDC, x, y, NULL);
248 LineTo(pDrawItem->hDC, x, y + 10);
249 SetPixel(pDrawItem->hDC, x, y + 10, RGB(0, 0, 0));
250
251 /* Restore fill section pens */
252 if (x == pDrawItem->rcItem.left)
253 SelectObject(pDrawItem->hDC, hCenterPen);
254 }
255
256 SelectObject(pDrawItem->hDC, hBlackPen);
257
258 if (m_FreeSpacePerc > 50)
259 {
260 hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hMagBrush);
261
262 Ellipse(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top,
263 pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10);
264
265 SelectObject(pDrawItem->hDC, hBlueBrush);
266
267 if (m_FreeSpacePerc < 100)
268 {
269 Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right,
270 pDrawItem->rcItem.bottom - 10, xRadial, yRadial, pDrawItem->rcItem.left, yCenter);
271 }
272 }
273 else
274 {
275 hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hBlueBrush);
276
277 Ellipse(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top,
278 pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10);
279
280 SelectObject(pDrawItem->hDC, hMagBrush);
281
282 if (m_FreeSpacePerc > 0)
283 {
284 Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right,
285 pDrawItem->rcItem.bottom - 10, pDrawItem->rcItem.left, yCenter, xRadial, yRadial);
286 }
287 }
288
289 SelectObject(pDrawItem->hDC, hbrOld);
290 SelectObject(pDrawItem->hDC, hOldPen);
291
292 DeleteObject(hBlueBrush);
293 DeleteObject(hMagBrush);
294 DeleteObject(hDarkBluePen);
295 DeleteObject(hDarkMagPen);
296 }
297}
298
299// https://stackoverflow.com/questions/3098696/get-information-about-disk-drives-result-on-windows7-32-bit-system/3100268#3100268
300static BOOL
301GetDriveTypeAndCharacteristics(HANDLE hDevice, DEVICE_TYPE *pDeviceType, ULONG *pCharacteristics)
302{
306
308 &DeviceInfo, sizeof(DeviceInfo),
310 if (Status == NO_ERROR)
311 {
312 *pDeviceType = DeviceInfo.DeviceType;
313 *pCharacteristics = DeviceInfo.Characteristics;
314 return TRUE;
315 }
316
317 return FALSE;
318}
319
321{
322 LPCWSTR RootPath = pszDriveRoot;
323 WCHAR szRoot[16], szDeviceName[16];
324 UINT uType;
325 HANDLE hDevice;
327 ULONG ulCharacteristics;
328 BOOL ret;
329
330 lstrcpynW(szRoot, RootPath, _countof(szRoot));
331
332 if (L'a' <= szRoot[0] && szRoot[0] <= 'z')
333 {
334 szRoot[0] += ('A' - 'a');
335 }
336
337 if ('A' <= szRoot[0] && szRoot[0] <= L'Z' &&
338 szRoot[1] == L':' && szRoot[2] == 0)
339 {
340 // 'C:' --> 'C:\'
341 szRoot[2] = L'\\';
342 szRoot[3] = 0;
343 }
344
345 if (!PathIsRootW(szRoot))
346 {
347 return FALSE;
348 }
349
350 uType = GetDriveTypeW(szRoot);
351 if (uType == DRIVE_REMOVABLE)
352 {
353 if (szRoot[0] == L'A' || szRoot[0] == L'B')
354 return TRUE;
355 }
356 else
357 {
358 return FALSE;
359 }
360
362 szDeviceName[4] = szRoot[0];
363 szDeviceName[5] = L':';
365
368 NULL, OPEN_EXISTING, 0, NULL);
369 if (hDevice == INVALID_HANDLE_VALUE)
370 {
371 return FALSE;
372 }
373
374 ret = FALSE;
375 if (GetDriveTypeAndCharacteristics(hDevice, &DeviceType, &ulCharacteristics))
376 {
377 if ((ulCharacteristics & FILE_FLOPPY_DISKETTE) == FILE_FLOPPY_DISKETTE)
378 ret = TRUE;
379 }
380
381 CloseHandle(hDevice);
382
383 return ret;
384}
385
387{
388 WCHAR szRoot[8];
389 MultiByteToWideChar(CP_ACP, 0, pszDriveRoot, -1, szRoot, _countof(szRoot));
390 return IsDriveFloppyW(szRoot);
391}
392
393VOID
395{
396 WCHAR wszVolumeName[MAX_PATH+1] = {0};
397 WCHAR wszFileSystem[MAX_PATH+1] = {0};
398 WCHAR wszBuf[128];
399 BOOL bRet;
400
401 bRet = GetVolumeInformationW(m_wszDrive, wszVolumeName, _countof(wszVolumeName), NULL, NULL, NULL, wszFileSystem, _countof(wszFileSystem));
402 if (bRet)
403 {
404 /* Set volume label and filesystem */
405 SetDlgItemTextW(hwndDlg, 14000, wszVolumeName);
406 SetDlgItemTextW(hwndDlg, 14002, wszFileSystem);
407 }
408 else
409 {
410 LoadStringW(shell32_hInstance, IDS_FS_UNKNOWN, wszFileSystem, _countof(wszFileSystem));
411 SetDlgItemTextW(hwndDlg, 14002, wszFileSystem);
412 }
413
414 /* Set drive type and icon */
416 UINT IconId, TypeStrId = 0;
417 switch (DriveType)
418 {
419 case DRIVE_REMOVABLE:
421 IconId = IDI_SHELL_3_14_FLOPPY;
422 else
423 IconId = IDI_SHELL_REMOVEABLE;
424 break;
425 case DRIVE_CDROM: IconId = IDI_SHELL_CDROM; TypeStrId = IDS_DRIVE_CDROM; break;
426 case DRIVE_REMOTE: IconId = IDI_SHELL_NETDRIVE; TypeStrId = IDS_DRIVE_NETWORK; break;
427 case DRIVE_RAMDISK: IconId = IDI_SHELL_RAMDISK; break;
428 default: IconId = IDI_SHELL_DRIVE; TypeStrId = IDS_DRIVE_FIXED;
429 }
430
432 {
433 /* volume label textbox */
434 SendMessage(GetDlgItem(hwndDlg, 14000), EM_SETREADONLY, TRUE, 0);
435
436 /* disk compression */
437 ShowWindow(GetDlgItem(hwndDlg, 14011), FALSE);
438
439 /* index */
440 ShowWindow(GetDlgItem(hwndDlg, 14012), FALSE);
441 }
442
444 if (hIcon)
445 SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0);
446 if (TypeStrId && LoadStringW(shell32_hInstance, TypeStrId, wszBuf, _countof(wszBuf)))
447 SetDlgItemTextW(hwndDlg, 14001, wszBuf);
448
449 ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes;
450 if(GetDiskFreeSpaceExW(m_wszDrive, &FreeBytesAvailable, &TotalNumberOfBytes, NULL))
451 {
452 /* Init free space percentage used for drawing piechart */
453 m_FreeSpacePerc = (UINT)(FreeBytesAvailable.QuadPart * 100ull / TotalNumberOfBytes.QuadPart);
454
455 /* Used space */
456 if (SH_FormatByteSize(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
457 SetDlgItemTextW(hwndDlg, 14003, wszBuf);
458
459 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
460 SetDlgItemTextW(hwndDlg, 14004, wszBuf);
461
462 /* Free space */
463 if (SH_FormatByteSize(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
464 SetDlgItemTextW(hwndDlg, 14005, wszBuf);
465
466 if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
467 SetDlgItemTextW(hwndDlg, 14006, wszBuf);
468
469 /* Total space */
470 if (SH_FormatByteSize(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf)))
471 SetDlgItemTextW(hwndDlg, 14007, wszBuf);
472
473 if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf)))
474 SetDlgItemTextW(hwndDlg, 14008, wszBuf);
475 }
476 else
477 {
478 m_FreeSpacePerc = 0;
479
480 if (SH_FormatByteSize(0, wszBuf, _countof(wszBuf)))
481 {
482 SetDlgItemTextW(hwndDlg, 14003, wszBuf);
483 SetDlgItemTextW(hwndDlg, 14005, wszBuf);
484 SetDlgItemTextW(hwndDlg, 14007, wszBuf);
485 }
486 if (StrFormatByteSizeW(0, wszBuf, _countof(wszBuf)))
487 {
488 SetDlgItemTextW(hwndDlg, 14004, wszBuf);
489 SetDlgItemTextW(hwndDlg, 14006, wszBuf);
490 SetDlgItemTextW(hwndDlg, 14008, wszBuf);
491 }
492 }
493
494 /* Set drive description */
495 WCHAR wszFormat[50];
496 GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat));
497 swprintf(wszBuf, wszFormat, m_wszDrive[0]);
498 SetDlgItemTextW(hwndDlg, 14009, wszBuf);
499
500 /* show disk cleanup button only for fixed drives */
501 ShowWindow(GetDlgItem(hwndDlg, 14010), DriveType == DRIVE_FIXED);
502}
503
506 HWND hwndDlg,
507 UINT uMsg,
510{
511 switch(uMsg)
512 {
513 case WM_INITDIALOG:
514 {
516 if (ppsp == NULL)
517 break;
518
519 CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(ppsp->lParam);
520 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDrvDefExt);
521 pDrvDefExt->InitGeneralPage(hwndDlg);
522 return TRUE;
523 }
524 case WM_DRAWITEM:
525 {
527
528 if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015)
529 {
530 CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
531 pDrvDefExt->PaintStaticControls(hwndDlg, pDrawItem);
532 return TRUE;
533 }
534 break;
535 }
536 case WM_PAINT:
537 break;
538 case WM_COMMAND:
539 if (LOWORD(wParam) == 14010) /* Disk Cleanup */
540 {
541 CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
542 WCHAR wszBuf[256];
543 DWORD cbBuf = sizeof(wszBuf);
544
546 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\CleanupPath",
547 NULL,
549 NULL,
550 (PVOID)wszBuf,
551 &cbBuf) == ERROR_SUCCESS)
552 {
553 WCHAR wszCmd[MAX_PATH];
554
555 StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]);
556 WCHAR* wszArgs = PathGetArgsW(wszCmd);
557 if (wszArgs && *wszArgs && wszArgs != wszCmd)
558 wszArgs[-1] = UNICODE_NULL;
559 else
560 wszArgs = NULL;
561
562 if (ShellExecuteW(hwndDlg, NULL, wszCmd, wszArgs, NULL, SW_SHOW) <= (HINSTANCE)32)
563 ERR("Failed to create cleanup process %ls\n", wszCmd);
564 }
565 }
566 else if (LOWORD(wParam) == 14000) /* Label */
567 {
568 if (HIWORD(wParam) == EN_CHANGE)
569 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
570 }
571 break;
572 case WM_NOTIFY:
573 if (((LPNMHDR)lParam)->hwndFrom == GetParent(hwndDlg))
574 {
575 /* Property Sheet */
577
578 if (lppsn->hdr.code == PSN_APPLY)
579 {
580 CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
581
582 HRESULT hr = E_FAIL;
583 HWND hLabel = GetDlgItem(hwndDlg, 14000);
584 WCHAR wszBuf[256];
585 *wszBuf = UNICODE_NULL;
586 if (GetWindowTextW(hLabel, wszBuf, _countof(wszBuf)) || GetWindowTextLengthW(hLabel) == 0)
587 hr = CDrivesFolder::SetDriveLabel(hwndDlg, pDrvDefExt->m_wszDrive, wszBuf);
588
590 return TRUE;
591 }
592 }
593 break;
594
595 default:
596 break;
597 }
598
599 return FALSE;
600}
601
604 HWND hwndDlg,
605 UINT uMsg,
608{
609 switch (uMsg)
610 {
611 case WM_INITDIALOG:
612 {
614 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam);
615 return TRUE;
616 }
617 case WM_COMMAND:
618 {
619 WCHAR wszBuf[MAX_PATH];
620 DWORD cbBuf = sizeof(wszBuf);
621 CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
622
623 switch(LOWORD(wParam))
624 {
625 case 14000:
627 break;
628 case 14001:
630 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath",
631 NULL,
633 NULL,
634 (PVOID)wszBuf,
635 &cbBuf) == ERROR_SUCCESS)
636 {
637 WCHAR wszCmd[MAX_PATH];
638
639 StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]);
640
641 if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
642 ERR("Failed to create defrag process %ls\n", wszCmd);
643 }
644 break;
645 case 14002:
647 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath",
648 NULL,
650 NULL,
651 (PVOID)wszBuf,
652 &cbBuf) == ERROR_SUCCESS)
653 {
654 if (ShellExecuteW(hwndDlg, NULL, wszBuf, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
655 ERR("Failed to create backup process %ls\n", wszBuf);
656 }
657 }
658 break;
659 }
660 }
661 return FALSE;
662}
663
666 HWND hwndDlg,
667 UINT uMsg,
670{
673
674 switch(uMsg)
675 {
676 case WM_INITDIALOG:
677 {
678 GUID Guids[2];
679 Guids[0] = GUID_DEVCLASS_DISKDRIVE;
680 Guids[1] = GUID_DEVCLASS_CDROM;
681
682 /* create the hardware page */
684 break;
685 }
686 }
687
688 return FALSE;
689}
690
692{
693 m_wszDrive[0] = L'\0';
694}
695
697{
698
699}
700
701struct CDrop
702{
704 STGMEDIUM stgm;
705 HDROP hDrop;
706
707 explicit CDrop(IDataObject *pDO)
708 {
709 FORMATETC format = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
710 hDrop = SUCCEEDED(hr = pDO->GetData(&format, &stgm)) ? (HDROP)stgm.hGlobal : NULL;
711 }
712
714 {
715 if (hDrop)
717 }
718
720 {
721 return DragQueryFileW(hDrop, -1, NULL, 0);
722 }
723};
724
725static inline bool
727{
729}
730
733{
734 HRESULT hr;
735
736 TRACE("%p %p %p %p\n", this, pidlFolder, pDataObj, hkeyProgID);
737
738 if (!pDataObj)
739 return E_FAIL;
740
741
742 CDrop drop(pDataObj);
743 if (FAILED_UNEXPECTEDLY(hr = drop.hr))
744 return hr;
745
747 {
748 ERR("DragQueryFileW failed\n");
749 return E_FAIL;
750 }
751
752 if (drop.GetCount() > 1)
753 m_Multiple = pDataObj;
754
755 TRACE("Drive properties %ls\n", m_wszDrive);
756
757 return S_OK;
758}
759
761CDrvDefExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
762{
764 return E_NOTIMPL;
765}
766
769{
771 return E_NOTIMPL;
772}
773
775CDrvDefExt::GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
776{
778 return E_NOTIMPL;
779}
780
783{
784 WCHAR szTitle[MAX_PATH], *pszTitle = NULL;
785 if (m_Multiple)
786 {
787 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidl(SHSimpleIDListFromPathW(m_wszDrive));
788 if (SUCCEEDED(SHGetNameAndFlagsW(pidl, SHGDN_INFOLDER, szTitle, _countof(szTitle), NULL)))
789 pszTitle = szTitle;
790 }
791
792 HPROPSHEETPAGE hPage;
794 pszTitle, &PropSheetPageLifetimeCallback<CDrvDefExt>);
795 HRESULT hr = AddPropSheetPage(hPage, pfnAddPage, lParam);
797 return hr;
798 else
799 AddRef(); // For PropSheetPageLifetimeCallback
800 return hr;
801}
802
805{
806 HRESULT hr = AddMainPage(pfnAddPage, lParam);
808 return hr;
809
810 if (m_Multiple)
811 {
812 CDrop drop(m_Multiple);
813 UINT count = SUCCEEDED(drop.hr) ? drop.GetCount() : 0;
814 for (UINT i = 0; ++i < count;) // Skipping the first drive since it already has a page
815 {
816 CComPtr<CDrvDefExt> SheetExt;
817 if (FAILED_UNEXPECTEDLY(hr = ShellObjectCreator(SheetExt)))
818 continue;
819 if (!DragQueryFileW(drop.hDrop, i, SheetExt->m_wszDrive, _countof(SheetExt->m_wszDrive)))
820 continue;
821 if (!IsValidDrivePath(SheetExt->m_wszDrive))
822 continue;
823
824 SheetExt->m_Multiple = m_Multiple;
825 SheetExt->AddMainPage(pfnAddPage, lParam);
826 }
827 }
828 else
829 {
830 HPROPSHEETPAGE hPage;
832 {
835 (LPARAM)this,
836 NULL);
837 if (hPage)
838 pfnAddPage(hPage, lParam);
839 }
840
842 {
845 (LPARAM)this,
846 NULL);
847 if (hPage)
848 pfnAddPage(hPage, lParam);
849 }
850 }
851
852 return S_OK;
853}
854
857{
859 return E_NOTIMPL;
860}
861
864{
866 return E_NOTIMPL;
867}
868
870CDrvDefExt::GetSite(REFIID iid, void **ppvSite)
871{
873 return E_NOTIMPL;
874}
UINT DriveType
unsigned char BOOLEAN
PRTL_UNICODE_STRING_BUFFER Path
#define shell32_hInstance
UINT cchMax
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
valarray< _Tp > acos(const valarray< _Tp > &__x)
Definition: _valarray.h:901
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
#define CF_HDROP
Definition: constants.h:410
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define EXTERN_C
Definition: basetyps.h:12
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
static HRESULT SetDriveLabel(HWND hwndOwner, PCWSTR DrivePath, PCWSTR Label)
static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:505
VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem)
Definition: drvdefext.cpp:192
STDMETHOD() GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
Definition: drvdefext.cpp:775
STDMETHOD() Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID) override
Definition: drvdefext.cpp:732
STDMETHOD() QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
Definition: drvdefext.cpp:761
static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:665
UINT m_FreeSpacePerc
Definition: drvdefext.h:40
STDMETHOD() AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
Definition: drvdefext.cpp:804
static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:603
STDMETHOD() SetSite(IUnknown *punk) override
Definition: drvdefext.cpp:863
STDMETHOD() InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
Definition: drvdefext.cpp:768
STDMETHOD() GetSite(REFIID iid, void **ppvSite) override
Definition: drvdefext.cpp:870
WCHAR m_wszDrive[MAX_PATH]
Definition: drvdefext.h:39
VOID InitGeneralPage(HWND hwndDlg)
Definition: drvdefext.cpp:394
STDMETHOD() ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) override
Definition: drvdefext.cpp:856
HRESULT AddMainPage(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
Definition: drvdefext.cpp:782
CComPtr< IDataObject > m_Multiple
Definition: drvdefext.h:41
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NO_ERROR
Definition: dderror.h:5
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HWPAGE_DISPLAYMODE
Definition: main.h:23
@ HWPD_STANDARDLIST
Definition: main.h:24
HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
static const WCHAR szDeviceName[]
Definition: provider.c:56
#define DEVICE_TYPE
Definition: guid.c:10
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
UINT uFlags
Definition: api.c:59
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrcpynW
Definition: compat.h:738
VOID NTAPI Chkdsk(IN PWCHAR DriveRoot, IN PWCHAR Format, IN BOOLEAN CorrectErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PVOID Unused2, IN PVOID Unused3, IN PFMIFSCALLBACK Callback)
Definition: chkdsk.c:19
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
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
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define RRF_RT_REG_SZ
Definition: driver.c:575
BOOL IsDriveFloppyW(LPCWSTR pszDriveRoot)
Definition: drvdefext.cpp:320
HRESULT SHGetNameAndFlagsW(_In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes)
Definition: utils.cpp:480
static HRESULT AddPropSheetPage(HPROPSHEETPAGE hPage, LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
Definition: precomp.h:151
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1648
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
Definition: path.c:506
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2394
#define swprintf
Definition: precomp.h:40
#define RGB(r, g, b)
Definition: precomp.h:71
HWPAGE_DISPLAYMODE
Definition: drvdefext.cpp:36
@ HWPD_STANDARDLIST
Definition: drvdefext.cpp:37
@ HWPD_LARGELIST
Definition: drvdefext.cpp:38
@ HWPD_MAX
Definition: drvdefext.cpp:39
static BOOL GetDriveTypeAndCharacteristics(HANDLE hDevice, DEVICE_TYPE *pDeviceType, ULONG *pCharacteristics)
Definition: drvdefext.cpp:301
static VOID ChkDskNow(HWND hwndDlg, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:119
static HWND hChkdskDrvDialog
Definition: drvdefext.cpp:81
static VOID GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:50
static bool IsValidDrivePath(PCWSTR Path)
Definition: drvdefext.cpp:726
UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax)
Definition: filedefext.cpp:236
enum HWPAGE_DISPLAYMODE * PHWPAGE_DISPLAYMODE
static VOID InitializeChkDskDialog(HWND hwndDlg, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:69
BOOL IsDriveFloppyA(LPCSTR pszDriveRoot)
Definition: drvdefext.cpp:386
EXTERN_C HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
BOOL IsDriveFloppyW(LPCWSTR pszDriveRoot)
Definition: drvdefext.cpp:320
static BOOLEAN bChkdskSuccess
Definition: drvdefext.cpp:82
static INT_PTR CALLBACK ChkDskDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:160
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
CALLBACKCOMMAND
Definition: fmifs.h:81
@ FSNOTSUPPORTED
Definition: fmifs.h:89
@ VOLUMEINUSE
Definition: fmifs.h:90
@ CLUSTERSIZETOOSMALL
Definition: fmifs.h:98
@ INSUFFICIENTRIGHTS
Definition: fmifs.h:88
@ PROGRESS
Definition: fmifs.h:82
@ FileFsDeviceInformation
Definition: from_kernel.h:222
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define DRIVE_CDROM
Definition: machpc98.h:119
#define M_PI
Definition: macros.h:263
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
DeviceType
Definition: mmdrv.h:42
static HICON
Definition: imagelist.c:80
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static HMENU hmenu
Definition: win.c:66
HICON hIcon
Definition: msconfig.c:44
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define FILE_FLOPPY_DISKETTE
Definition: nt_native.h:809
#define UNICODE_NULL
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:117
#define LOWORD(l)
Definition: pedump.c:82
DWORD * PDWORD
Definition: pedump.c:68
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1238
#define INT
Definition: polytest.cpp:20
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSNRET_INVALID
Definition: prsht.h:130
#define PSN_APPLY
Definition: prsht.h:117
#define PSNRET_NOERROR
Definition: prsht.h:129
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
struct _PSHNOTIFY * LPPSHNOTIFY
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define REFIID
Definition: guiddef.h:118
#define WM_NOTIFY
Definition: richedit.h:61
#define DONE
Definition: rnr20lib.h:14
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2507
HRESULT hr
Definition: shlfolder.c:183
#define IDD_DRIVE_TOOLS
Definition: shresdef.h:424
#define IDS_DRIVE_CDROM
Definition: shresdef.h:112
#define IDD_CHECK_DISK
Definition: shresdef.h:546
#define IDS_DRIVE_FIXED
Definition: shresdef.h:111
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:113
#define IDS_FS_UNKNOWN
Definition: shresdef.h:116
#define IDI_SHELL_3_14_FLOPPY
Definition: shresdef.h:585
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:588
#define IDD_DRIVE_HARDWARE
Definition: shresdef.h:425
#define IDI_SHELL_CDROM
Definition: shresdef.h:590
#define IDI_SHELL_DRIVE
Definition: shresdef.h:587
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:591
#define IDI_SHELL_REMOVEABLE
Definition: shresdef.h:586
#define IDD_DRIVE_PROPERTIES
Definition: shresdef.h:423
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
~CDrop()
Definition: drvdefext.cpp:713
STGMEDIUM stgm
Definition: drvdefext.cpp:704
HRESULT hr
Definition: drvdefext.cpp:703
HDROP hDrop
Definition: drvdefext.cpp:705
UINT GetCount()
Definition: drvdefext.cpp:719
CDrop(IDataObject *pDO)
Definition: drvdefext.cpp:707
Definition: shell.h:41
LPARAM lParam
Definition: prsht.h:227
NMHDR hdr
Definition: prsht.h:330
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
Definition: format.c:58
UINT code
Definition: winuser.h:3170
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * PBOOLEAN
Definition: typedefs.h:53
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43
int ret
HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle)
Definition: propsheet.cpp:243
HPROPSHEETPAGE SH_CreatePropertySheetPageEx(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle, LPFNPSPCALLBACK Callback)
Definition: propsheet.cpp:223
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1394
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:283
#define DRIVE_REMOTE
Definition: winbase.h:279
#define DRIVE_RAMDISK
Definition: winbase.h:281
#define DRIVE_FIXED
Definition: winbase.h:278
#define DRIVE_REMOVABLE
Definition: winbase.h:277
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define BLACK_PEN
Definition: wingdi.h:903
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
BOOL WINAPI Pie(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define WM_PAINT
Definition: winuser.h:1631
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define EM_SETREADONLY
Definition: winuser.h:2026
#define DWLP_USER
Definition: winuser.h:883
#define MAKELPARAM(l, h)
Definition: winuser.h:4019
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define STM_SETICON
Definition: winuser.h:2103
#define IDCANCEL
Definition: winuser.h:842
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_COMMAND
Definition: winuser.h:1751
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1750
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
#define WM_DRAWITEM
Definition: winuser.h:1656
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_In_ int cchText
Definition: winuser.h:4476
#define SendMessage
Definition: winuser.h:5863
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define LR_SHARED
Definition: winuser.h:1111
HWND WINAPI GetParent(_In_ HWND)
#define LoadImage
Definition: winuser.h:5835
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define SW_SHOW
Definition: winuser.h:786
#define SetWindowText
Definition: winuser.h:5877
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BST_CHECKED
Definition: winuser.h:197
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define BM_GETCHECK
Definition: winuser.h:1929
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2033
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185