ReactOS  0.4.14-dev-41-g31d7680
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  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #include "precomp.h"
23 
24 #define _USE_MATH_DEFINES
25 #include <math.h>
26 
28 
29 static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
30 
31 typedef enum
32 {
37 
40  LPGUID lpGuids,
41  UINT uNumberOfGuids,
43 UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax);
44 
45 static VOID
46 GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive)
47 {
48  DWORD dwMaxComp, dwFileSys;
49  SIZE_T cchText = 0;
50 
51  if (GetVolumeInformationW(pwszDrive, pwszText, cchTextMax, NULL, &dwMaxComp, &dwFileSys, NULL, 0))
52  {
53  cchText = wcslen(pwszText);
54  if (cchText == 0)
55  {
56  /* load default volume label */
57  cchText = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, pwszText, cchTextMax);
58  }
59  }
60 
61  StringCchPrintfW(pwszText + cchText, cchTextMax - cchText, L" (%c:)", pwszDrive[0]);
62 }
63 
64 static VOID
65 InitializeChkDskDialog(HWND hwndDlg, LPCWSTR pwszDrive)
66 {
67  WCHAR wszText[100];
68  UINT Length;
69  SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pwszDrive);
70 
71  Length = GetWindowTextW(hwndDlg, wszText, sizeof(wszText) / sizeof(WCHAR));
72  wszText[Length] = L' ';
73  GetDriveNameWithLetter(&wszText[Length + 1], (sizeof(wszText) / sizeof(WCHAR)) - Length - 1, pwszDrive);
74  SetWindowText(hwndDlg, wszText);
75 }
76 
79 
80 static BOOLEAN NTAPI
83  IN ULONG SubAction,
84  IN PVOID ActionInfo)
85 {
86  PDWORD Progress;
87  PBOOLEAN pSuccess;
88  switch(Command)
89  {
90  case PROGRESS:
91  Progress = (PDWORD)ActionInfo;
92  SendDlgItemMessageW(hChkdskDrvDialog, 14002, PBM_SETPOS, (WPARAM)*Progress, 0);
93  break;
94  case DONE:
95  pSuccess = (PBOOLEAN)ActionInfo;
96  bChkdskSuccess = (*pSuccess);
97  break;
98 
99  case VOLUMEINUSE:
100  case INSUFFICIENTRIGHTS:
101  case FSNOTSUPPORTED:
102  case CLUSTERSIZETOOSMALL:
104  FIXME("\n");
105  break;
106 
107  default:
108  break;
109  }
110 
111  return TRUE;
112 }
113 
114 static VOID
115 ChkDskNow(HWND hwndDlg, LPCWSTR pwszDrive)
116 {
117  //DWORD ClusterSize = 0;
118  WCHAR wszFs[30];
119  ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser;
120  BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE;
121 
122  if(!GetVolumeInformationW(pwszDrive, NULL, 0, NULL, NULL, NULL, wszFs, _countof(wszFs)))
123  {
124  FIXME("failed to get drive fs type\n");
125  return;
126  }
127 
128  if (!GetDiskFreeSpaceExW(pwszDrive, &FreeBytesAvailableUser, &TotalNumberOfFreeBytes, NULL))
129  {
130  FIXME("failed to get drive space type\n");
131  return;
132  }
133 
134  /*if (!GetDefaultClusterSize(wszFs, &ClusterSize, &TotalNumberOfFreeBytes))
135  {
136  FIXME("invalid cluster size\n");
137  return;
138  }*/
139 
140  if (SendDlgItemMessageW(hwndDlg, 14000, BM_GETCHECK, 0, 0) == BST_CHECKED)
141  bCorrectErrors = TRUE;
142 
143  if (SendDlgItemMessageW(hwndDlg, 14001, BM_GETCHECK, 0, 0) == BST_CHECKED)
144  bScanDrive = TRUE;
145 
146  hChkdskDrvDialog = hwndDlg;
148  SendDlgItemMessageW(hwndDlg, 14002, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
149  Chkdsk((LPWSTR)pwszDrive, (LPWSTR)wszFs, bCorrectErrors, TRUE, FALSE, bScanDrive, NULL, NULL, ChkdskCallback); // FIXME: casts
150 
153 }
154 
155 static INT_PTR CALLBACK
157  HWND hwndDlg,
158  UINT uMsg,
159  WPARAM wParam,
160  LPARAM lParam)
161 {
162  switch(uMsg)
163  {
164  case WM_INITDIALOG:
167  return TRUE;
168  case WM_COMMAND:
169  switch(LOWORD(wParam))
170  {
171  case IDCANCEL:
172  EndDialog(hwndDlg, 0);
173  break;
174  case IDOK:
175  {
176  LPCWSTR pwszDrive = (LPCWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER);
177  ChkDskNow(hwndDlg, pwszDrive);
178  break;
179  }
180  }
181  break;
182  }
183 
184  return FALSE;
185 }
186 
187 VOID
189 {
190  HBRUSH hBrush;
191 
192  if (pDrawItem->CtlID == 14013)
193  {
194  hBrush = CreateSolidBrush(RGB(0, 0, 255));
195  if (hBrush)
196  {
197  FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush);
198  DeleteObject((HGDIOBJ)hBrush);
199  }
200  }
201  else if (pDrawItem->CtlID == 14014)
202  {
203  hBrush = CreateSolidBrush(RGB(255, 0, 255));
204  if (hBrush)
205  {
206  FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush);
207  DeleteObject((HGDIOBJ)hBrush);
208  }
209  }
210  else if (pDrawItem->CtlID == 14015)
211  {
212  HBRUSH hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
213  HBRUSH hMagBrush = CreateSolidBrush(RGB(255, 0, 255));
214  HBRUSH hbrOld;
215  HPEN hDarkBluePen = CreatePen(PS_SOLID, 1, RGB(0, 0, 128));
216  HPEN hDarkMagPen = CreatePen(PS_SOLID, 1, RGB(128, 0, 128));
217  HPEN hOldPen = (HPEN)SelectObject(pDrawItem->hDC, hDarkMagPen);
218  INT xCenter = (pDrawItem->rcItem.left + pDrawItem->rcItem.right) / 2;
219  INT yCenter = (pDrawItem->rcItem.top + pDrawItem->rcItem.bottom - 10) / 2;
220  INT cx = pDrawItem->rcItem.right - pDrawItem->rcItem.left;
221  INT cy = pDrawItem->rcItem.bottom - pDrawItem->rcItem.top - 10;
222  INT xRadial = xCenter + (INT)(cos(M_PI + m_FreeSpacePerc / 100.0f * M_PI * 2.0f) * cx / 2);
223  INT yRadial = yCenter - (INT)(sin(M_PI + m_FreeSpacePerc / 100.0f * M_PI * 2.0f) * cy / 2);
224 
225  TRACE("FreeSpace %u a %f cx %d\n", m_FreeSpacePerc, M_PI+m_FreeSpacePerc / 100.0f * M_PI * 2.0f, cx);
226 
227  for (INT x = pDrawItem->rcItem.left; x < pDrawItem->rcItem.right; ++x)
228  {
229  double cos_val = (x - xCenter) * 2.0f / cx;
230  INT y = yCenter + (INT)(sin(acos(cos_val)) * cy / 2) - 1;
231 
232  if (m_FreeSpacePerc < 50 && x == xRadial)
233  SelectObject(pDrawItem->hDC, hDarkBluePen);
234 
235  MoveToEx(pDrawItem->hDC, x, y, NULL);
236  LineTo(pDrawItem->hDC, x, y + 10);
237  }
238 
239  SelectObject(pDrawItem->hDC, hOldPen);
240 
241  if (m_FreeSpacePerc > 50)
242  {
243  hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hMagBrush);
244 
245  Ellipse(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top,
246  pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10);
247 
248  SelectObject(pDrawItem->hDC, hBlueBrush);
249 
250  if (m_FreeSpacePerc < 100)
251  {
252  Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right,
253  pDrawItem->rcItem.bottom - 10, xRadial, yRadial, pDrawItem->rcItem.left, yCenter);
254  }
255  }
256  else
257  {
258  hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hBlueBrush);
259 
260  Ellipse(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top,
261  pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10);
262 
263  SelectObject(pDrawItem->hDC, hMagBrush);
264 
265  if (m_FreeSpacePerc > 0)
266  {
267  Pie(pDrawItem->hDC, pDrawItem->rcItem.left, pDrawItem->rcItem.top, pDrawItem->rcItem.right,
268  pDrawItem->rcItem.bottom - 10, pDrawItem->rcItem.left, yCenter, xRadial, yRadial);
269  }
270  }
271 
272  SelectObject(pDrawItem->hDC, hbrOld);
273 
274  DeleteObject(hBlueBrush);
275  DeleteObject(hMagBrush);
276  DeleteObject(hDarkBluePen);
277  DeleteObject(hDarkMagPen);
278  }
279 }
280 
281 VOID
283 {
284  WCHAR wszVolumeName[MAX_PATH+1] = {0};
285  WCHAR wszFileSystem[MAX_PATH+1] = {0};
286  WCHAR wszBuf[128];
287  BOOL bRet;
288 
289  bRet = GetVolumeInformationW(m_wszDrive, wszVolumeName, _countof(wszVolumeName), NULL, NULL, NULL, wszFileSystem, _countof(wszFileSystem));
290  if (bRet)
291  {
292  /* Set volume label and filesystem */
293  SetDlgItemTextW(hwndDlg, 14000, wszVolumeName);
294  SetDlgItemTextW(hwndDlg, 14002, wszFileSystem);
295  }
296  else
297  {
298  LoadStringW(shell32_hInstance, IDS_FS_UNKNOWN, wszFileSystem, _countof(wszFileSystem));
299  SetDlgItemTextW(hwndDlg, 14002, wszFileSystem);
300  }
301 
302  /* Set drive type and icon */
304  UINT IconId, TypeStrId = 0;
305  switch (DriveType)
306  {
307  case DRIVE_REMOVABLE: IconId = IDI_SHELL_3_14_FLOPPY; break;
308  case DRIVE_CDROM: IconId = IDI_SHELL_CDROM; TypeStrId = IDS_DRIVE_CDROM; break;
309  case DRIVE_REMOTE: IconId = IDI_SHELL_NETDRIVE; TypeStrId = IDS_DRIVE_NETWORK; break;
310  case DRIVE_RAMDISK: IconId = IDI_SHELL_RAMDISK; break;
311  default: IconId = IDI_SHELL_DRIVE; TypeStrId = IDS_DRIVE_FIXED;
312  }
313 
315  {
316  /* volume label textbox */
317  SendMessage(GetDlgItem(hwndDlg, 14000), EM_SETREADONLY, TRUE, 0);
318 
319  /* disk compression */
320  ShowWindow(GetDlgItem(hwndDlg, 14011), FALSE);
321 
322  /* index */
323  ShowWindow(GetDlgItem(hwndDlg, 14012), FALSE);
324  }
325 
327  if (hIcon)
328  SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0);
329  if (TypeStrId && LoadStringW(shell32_hInstance, TypeStrId, wszBuf, _countof(wszBuf)))
330  SetDlgItemTextW(hwndDlg, 14001, wszBuf);
331 
332  ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes;
333  if(GetDiskFreeSpaceExW(m_wszDrive, &FreeBytesAvailable, &TotalNumberOfBytes, NULL))
334  {
335  /* Init free space percentage used for drawing piechart */
336  m_FreeSpacePerc = (UINT)(FreeBytesAvailable.QuadPart * 100ull / TotalNumberOfBytes.QuadPart);
337 
338  /* Used space */
339  if (SH_FormatByteSize(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
340  SetDlgItemTextW(hwndDlg, 14003, wszBuf);
341 
342  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
343  SetDlgItemTextW(hwndDlg, 14004, wszBuf);
344 
345  /* Free space */
346  if (SH_FormatByteSize(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
347  SetDlgItemTextW(hwndDlg, 14005, wszBuf);
348 
349  if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, _countof(wszBuf)))
350  SetDlgItemTextW(hwndDlg, 14006, wszBuf);
351 
352  /* Total space */
353  if (SH_FormatByteSize(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf)))
354  SetDlgItemTextW(hwndDlg, 14007, wszBuf);
355 
356  if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf)))
357  SetDlgItemTextW(hwndDlg, 14008, wszBuf);
358  }
359  else
360  {
361  m_FreeSpacePerc = 0;
362 
363  if (SH_FormatByteSize(0, wszBuf, _countof(wszBuf)))
364  {
365  SetDlgItemTextW(hwndDlg, 14003, wszBuf);
366  SetDlgItemTextW(hwndDlg, 14005, wszBuf);
367  SetDlgItemTextW(hwndDlg, 14007, wszBuf);
368  }
369  if (StrFormatByteSizeW(0, wszBuf, _countof(wszBuf)))
370  {
371  SetDlgItemTextW(hwndDlg, 14004, wszBuf);
372  SetDlgItemTextW(hwndDlg, 14006, wszBuf);
373  SetDlgItemTextW(hwndDlg, 14008, wszBuf);
374  }
375  }
376 
377  /* Set drive description */
378  WCHAR wszFormat[50];
379  GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat));
380  swprintf(wszBuf, wszFormat, m_wszDrive[0]);
381  SetDlgItemTextW(hwndDlg, 14009, wszBuf);
382 
383  /* show disk cleanup button only for fixed drives */
384  ShowWindow(GetDlgItem(hwndDlg, 14010), DriveType == DRIVE_FIXED);
385 }
386 
389  HWND hwndDlg,
390  UINT uMsg,
391  WPARAM wParam,
392  LPARAM lParam)
393 {
394  switch(uMsg)
395  {
396  case WM_INITDIALOG:
397  {
399  if (ppsp == NULL)
400  break;
401 
402  CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(ppsp->lParam);
403  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDrvDefExt);
404  pDrvDefExt->InitGeneralPage(hwndDlg);
405  return TRUE;
406  }
407  case WM_DRAWITEM:
408  {
410 
411  if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015)
412  {
413  CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
414  pDrvDefExt->PaintStaticControls(hwndDlg, pDrawItem);
415  return TRUE;
416  }
417  break;
418  }
419  case WM_PAINT:
420  break;
421  case WM_COMMAND:
422  if (LOWORD(wParam) == 14010) /* Disk Cleanup */
423  {
424  CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
425  WCHAR wszBuf[256];
426  DWORD cbBuf = sizeof(wszBuf);
427 
429  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\CleanupPath",
430  NULL,
432  NULL,
433  (PVOID)wszBuf,
434  &cbBuf) == ERROR_SUCCESS)
435  {
436  WCHAR wszCmd[MAX_PATH];
437 
438  StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]);
439 
440  if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
441  ERR("Failed to create cleanup process %ls\n", wszCmd);
442  }
443  }
444  else if (LOWORD(wParam) == 14000) /* Label */
445  {
446  if (HIWORD(wParam) == EN_CHANGE)
447  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
448  }
449  break;
450  case WM_NOTIFY:
451  if (((LPNMHDR)lParam)->hwndFrom == GetParent(hwndDlg))
452  {
453  /* Property Sheet */
454  LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
455 
456  if (lppsn->hdr.code == PSN_APPLY)
457  {
458  CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
459  WCHAR wszBuf[256];
460 
461  if (GetDlgItemTextW(hwndDlg, 14000, wszBuf, _countof(wszBuf)))
462  SetVolumeLabelW(pDrvDefExt->m_wszDrive, wszBuf);
464  return TRUE;
465  }
466  }
467  break;
468 
469  default:
470  break;
471  }
472 
473  return FALSE;
474 }
475 
478  HWND hwndDlg,
479  UINT uMsg,
480  WPARAM wParam,
481  LPARAM lParam)
482 {
483  switch (uMsg)
484  {
485  case WM_INITDIALOG:
486  {
488  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam);
489  return TRUE;
490  }
491  case WM_COMMAND:
492  {
493  WCHAR wszBuf[MAX_PATH];
494  DWORD cbBuf = sizeof(wszBuf);
495  CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
496 
497  switch(LOWORD(wParam))
498  {
499  case 14000:
501  break;
502  case 14001:
504  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath",
505  NULL,
507  NULL,
508  (PVOID)wszBuf,
509  &cbBuf) == ERROR_SUCCESS)
510  {
511  WCHAR wszCmd[MAX_PATH];
512 
513  StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]);
514 
515  if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
516  ERR("Failed to create defrag process %ls\n", wszCmd);
517  }
518  break;
519  case 14002:
521  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath",
522  NULL,
524  NULL,
525  (PVOID)wszBuf,
526  &cbBuf) == ERROR_SUCCESS)
527  {
528  if (ShellExecuteW(hwndDlg, NULL, wszBuf, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
529  ERR("Failed to create backup process %ls\n", wszBuf);
530  }
531  }
532  break;
533  }
534  }
535  return FALSE;
536 }
537 
540  HWND hwndDlg,
541  UINT uMsg,
542  WPARAM wParam,
543  LPARAM lParam)
544 {
547 
548  switch(uMsg)
549  {
550  case WM_INITDIALOG:
551  {
553 
554  /* create the hardware page */
556  break;
557  }
558  }
559 
560  return FALSE;
561 }
562 
564 {
565  m_wszDrive[0] = L'\0';
566 }
567 
569 {
570 
571 }
572 
574 CDrvDefExt::Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID)
575 {
576  FORMATETC format;
577  STGMEDIUM stgm;
578  HRESULT hr;
579 
580  TRACE("%p %p %p %p\n", this, pidlFolder, pDataObj, hkeyProgID);
581 
582  if (!pDataObj)
583  return E_FAIL;
584 
585  format.cfFormat = CF_HDROP;
586  format.ptd = NULL;
587  format.dwAspect = DVASPECT_CONTENT;
588  format.lindex = -1;
589  format.tymed = TYMED_HGLOBAL;
590 
591  hr = pDataObj->GetData(&format, &stgm);
592  if (FAILED(hr))
593  return hr;
594 
595  if (!DragQueryFileW((HDROP)stgm.hGlobal, 0, m_wszDrive, _countof(m_wszDrive)))
596  {
597  ERR("DragQueryFileW failed\n");
598  ReleaseStgMedium(&stgm);
599  return E_FAIL;
600  }
601 
602  ReleaseStgMedium(&stgm);
603  TRACE("Drive properties %ls\n", m_wszDrive);
604 
605  return S_OK;
606 }
607 
609 CDrvDefExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
610 {
612  return E_NOTIMPL;
613 }
614 
617 {
619  return E_NOTIMPL;
620 }
621 
623 CDrvDefExt::GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
624 {
626  return E_NOTIMPL;
627 }
628 
631 {
632  HPROPSHEETPAGE hPage;
633 
636  (LPARAM)this,
637  NULL);
638  if (hPage)
639  pfnAddPage(hPage, lParam);
640 
642  {
645  (LPARAM)this,
646  NULL);
647  if (hPage)
648  pfnAddPage(hPage, lParam);
649  }
650 
652  {
655  (LPARAM)this,
656  NULL);
657  if (hPage)
658  pfnAddPage(hPage, lParam);
659  }
660 
661  return S_OK;
662 }
663 
666 {
668  return E_NOTIMPL;
669 }
670 
673 {
675  return E_NOTIMPL;
676 }
677 
679 CDrvDefExt::GetSite(REFIID iid, void **ppvSite)
680 {
682  return E_NOTIMPL;
683 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:477
static BOOLEAN NTAPI ChkdskCallback(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: drvdefext.cpp:81
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2376
#define STM_SETICON
Definition: winuser.h:2074
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IN
Definition: typedefs.h:38
static HICON
Definition: imagelist.c:84
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2208
#define IDI_SHELL_DRIVE
Definition: shresdef.h:472
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define IDOK
Definition: winuser.h:824
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
UINT SH_FormatByteSize(LONGLONG cbSize, LPWSTR pwszResult, UINT cchResultMax)
Definition: filedefext.cpp:182
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
static HMENU hmenu
Definition: win.c:66
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:388
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define EM_SETREADONLY
Definition: winuser.h:1997
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2036
struct _PSHNOTIFY * LPPSHNOTIFY
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define _countof(array)
Definition: fontsub.cpp:30
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: drvdefext.cpp:623
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define INT
Definition: polytest.cpp:20
#define DRIVE_RAMDISK
Definition: winbase.h:252
#define CALLBACK
Definition: compat.h:27
LONG top
Definition: windef.h:292
#define IDD_DRIVE_PROPERTIES
Definition: shresdef.h:322
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
Definition: fmifs.h:68
UINT DriveType
#define RRF_RT_REG_SZ
Definition: driver.c:575
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define PBM_SETPOS
Definition: commctrl.h:2156
virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
Definition: drvdefext.cpp:665
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:309
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_APPLY
Definition: prsht.h:117
Definition: shell.h:41
LONG left
Definition: windef.h:291
UINT uFlags
Definition: api.c:60
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:62
CALLBACKCOMMAND
Definition: fmifs.h:66
char * LPSTR
Definition: xmlstorage.h:182
LONG right
Definition: windef.h:293
#define E_FAIL
Definition: ddrawi.h:102
virtual HRESULT WINAPI SetSite(IUnknown *punk)
Definition: drvdefext.cpp:672
#define IDS_DRIVE_CDROM
Definition: shresdef.h:106
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:56
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define DRIVE_REMOVABLE
Definition: winbase.h:248
HWPAGE_DISPLAYMODE
Definition: main.h:22
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
static INT_PTR CALLBACK ChkDskDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:156
enum HWPAGE_DISPLAYMODE * PHWPAGE_DISPLAYMODE
UINT code
Definition: winuser.h:3133
#define PBM_SETRANGE
Definition: commctrl.h:2155
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
NMHDR hdr
Definition: prsht.h:312
#define PS_SOLID
Definition: wingdi.h:585
valarray< _Tp > acos(const valarray< _Tp > &__x)
Definition: _valarray.h:901
#define DRIVE_REMOTE
Definition: winbase.h:250
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static BOOLEAN bChkdskSuccess
Definition: drvdefext.cpp:78
#define FIXME(fmt,...)
Definition: debug.h:110
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
unsigned char BOOLEAN
static GUID * Guid
Definition: apphelp.c:93
smooth NULL
Definition: ftsmooth.c:416
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
#define CF_HDROP
Definition: constants.h:410
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1900
EXTERN_C HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
#define SW_SHOW
Definition: winuser.h:769
VOID InitGeneralPage(HWND hwndDlg)
Definition: drvdefext.cpp:282
UINT m_FreeSpacePerc
Definition: drvdefext.h:40
_In_ int cchText
Definition: winuser.h:4366
VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem)
Definition: drvdefext.cpp:188
#define IDD_DRIVE_HARDWARE
Definition: shresdef.h:324
int64_t LONGLONG
Definition: typedefs.h:66
GLfloat f
Definition: glext.h:7540
#define IDI_SHELL_3_14_FLOPPY
Definition: shresdef.h:470
#define TRACE(s)
Definition: solgame.cpp:4
#define IDS_DRIVE_FIXED
Definition: shresdef.h:105
HWPAGE_DISPLAYMODE
Definition: drvdefext.cpp:31
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI Pie(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI SetVolumeLabelW(IN LPCWSTR lpRootPathName, IN LPCWSTR lpVolumeName OPTIONAL)
Definition: volume.c:503
#define MAX_PATH
Definition: compat.h:26
#define RGB(r, g, b)
Definition: wingdi.h:2935
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
UINT cchMax
#define IDD_DRIVE_TOOLS
Definition: shresdef.h:323
#define WM_PAINT
Definition: winuser.h:1602
#define PSNRET_NOERROR
Definition: prsht.h:129
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:115
char * PBOOLEAN
Definition: retypes.h:11
static VOID ChkDskNow(HWND hwndDlg, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:115
static const WCHAR L[]
Definition: oid.c:1250
LPARAM lParam
Definition: prsht.h:218
static VOID InitializeChkDskDialog(HWND hwndDlg, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:65
#define DWLP_USER
Definition: winuser.h:866
WCHAR m_wszDrive[MAX_PATH]
Definition: drvdefext.h:39
#define WM_COMMAND
Definition: winuser.h:1722
virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
Definition: drvdefext.cpp:630
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
static VOID GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive)
Definition: drvdefext.cpp:46
#define DRIVE_FIXED
Definition: winbase.h:249
#define IDS_DRIVE_NETWORK
Definition: shresdef.h:107
#define ERR(fmt,...)
Definition: debug.h:109
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
ULONG_PTR SIZE_T
Definition: typedefs.h:78
HWND WINAPI GetParent(_In_ HWND)
WINE_DEFAULT_DEBUG_CHANNEL(shell)
#define S_OK
Definition: intsafe.h:59
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:18
#define IDD_CHECK_DISK
Definition: shresdef.h:438
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
HICON hIcon
Definition: msconfig.c:44
static const GUID GUID_DEVCLASS_DISKDRIVE
Definition: drvdefext.cpp:29
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DRIVE_CDROM
Definition: winbase.h:251
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SetWindowText
Definition: winuser.h:5758
#define M_PI
Definition: macros.h:263
unsigned int UINT
Definition: ndis.h:50
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define IDI_SHELL_CDROM
Definition: shresdef.h:475
DWORD * PDWORD
Definition: pedump.c:68
virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite)
Definition: drvdefext.cpp:679
#define BST_CHECKED
Definition: winuser.h:197
static HWND hChkdskDrvDialog
Definition: drvdefext.cpp:77
#define WM_DRAWITEM
Definition: winuser.h:1627
_Out_opt_ int * cx
Definition: commctrl.h:570
#define SendMessage
Definition: winuser.h:5744
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: drvdefext.cpp:616
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2208
virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID)
Definition: drvdefext.cpp:574
#define HIWORD(l)
Definition: typedefs.h:246
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
LONG bottom
Definition: windef.h:294
#define IDI_SHELL_RAMDISK
Definition: shresdef.h:476
#define LoadImage
Definition: winuser.h:5716
#define IDI_SHELL_NETDRIVE
Definition: shresdef.h:473
#define DONE
Definition: rnr20lib.h:14
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
#define GetWindowLongPtr
Definition: treelist.c:73
HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define IDS_FS_UNKNOWN
Definition: shresdef.h:110
#define EXTERN_C
Definition: basetyps.h:12
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: drvdefext.cpp:609
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:627
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define WM_NOTIFY
Definition: richedit.h:61
static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:539
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define EN_CHANGE
Definition: winuser.h:2004