mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
[SHELL32]
- Formatting. No code changes. svn path=/trunk/; revision=54702
This commit is contained in:
parent
13b53b78ab
commit
2c53cb44ab
1 changed files with 356 additions and 356 deletions
|
@ -91,7 +91,7 @@ typedef struct
|
||||||
ENABLEVOLUMECOMPRESSION EnableVolumeCompression;
|
ENABLEVOLUMECOMPRESSION EnableVolumeCompression;
|
||||||
CHKDSK Chkdsk;
|
CHKDSK Chkdsk;
|
||||||
UINT Result;
|
UINT Result;
|
||||||
}FORMAT_DRIVE_CONTEXT, *PFORMAT_DRIVE_CONTEXT;
|
} FORMAT_DRIVE_CONTEXT, *PFORMAT_DRIVE_CONTEXT;
|
||||||
|
|
||||||
BOOL InitializeFmifsLibrary(PFORMAT_DRIVE_CONTEXT pContext);
|
BOOL InitializeFmifsLibrary(PFORMAT_DRIVE_CONTEXT pContext);
|
||||||
BOOL GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes);
|
BOOL GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes);
|
||||||
|
@ -112,8 +112,8 @@ static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf,
|
||||||
VOID
|
VOID
|
||||||
GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive)
|
GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive)
|
||||||
{
|
{
|
||||||
WCHAR szDrive[] = {'C',':','\\', 0};
|
WCHAR szDrive[] = {'C', ':', '\\', 0};
|
||||||
DWORD dwMaxComp, dwFileSys, TempLength = 0;
|
DWORD dwMaxComp, dwFileSys, TempLength = 0;
|
||||||
|
|
||||||
szDrive[0] = Drive;
|
szDrive[0] = Drive;
|
||||||
if (GetVolumeInformationW(szDrive, szText, Length, NULL, &dwMaxComp, &dwFileSys, NULL, 0))
|
if (GetVolumeInformationW(szDrive, szText, Length, NULL, &dwMaxComp, &dwFileSys, NULL, 0))
|
||||||
|
@ -123,7 +123,7 @@ GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive)
|
||||||
if (!TempLength)
|
if (!TempLength)
|
||||||
{
|
{
|
||||||
/* load default volume label */
|
/* load default volume label */
|
||||||
TempLength = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[Length+1], (sizeof(szText)/sizeof(WCHAR))- Length - 2);
|
TempLength = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[Length+1], (sizeof(szText) / sizeof(WCHAR)) - Length - 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TempLength + 4 < Length)
|
if (TempLength + 4 < Length)
|
||||||
|
@ -132,7 +132,7 @@ GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive)
|
||||||
szText[TempLength+1] = L'(';
|
szText[TempLength+1] = L'(';
|
||||||
szText[TempLength+2] = szDrive[0];
|
szText[TempLength+2] = szDrive[0];
|
||||||
szText[TempLength+3] = L')';
|
szText[TempLength+3] = L')';
|
||||||
TempLength +=4;
|
TempLength += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TempLength < Length)
|
if (TempLength < Length)
|
||||||
|
@ -149,9 +149,9 @@ InitializeChkDskDialog(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
UINT Length;
|
UINT Length;
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pContext);
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pContext);
|
||||||
|
|
||||||
Length = GetWindowTextW(hwndDlg, szText, sizeof(szText)/sizeof(WCHAR));
|
Length = GetWindowTextW(hwndDlg, szText, sizeof(szText) / sizeof(WCHAR));
|
||||||
|
|
||||||
GetDriveNameWithLetter(&szText[Length +1], (sizeof(szText)/sizeof(WCHAR))-Length-1, pContext->Drive);
|
GetDriveNameWithLetter(&szText[Length +1], (sizeof(szText) / sizeof(WCHAR)) - Length - 1, pContext->Drive);
|
||||||
szText[Length] = L' ';
|
szText[Length] = L' ';
|
||||||
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
||||||
SetWindowText(hwndDlg, szText);
|
SetWindowText(hwndDlg, szText);
|
||||||
|
@ -200,13 +200,13 @@ ChkDskNow(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
{
|
{
|
||||||
DWORD ClusterSize = 0, dwMaxComponentLength, FileSystemFlags;
|
DWORD ClusterSize = 0, dwMaxComponentLength, FileSystemFlags;
|
||||||
WCHAR szFs[30];
|
WCHAR szFs[30];
|
||||||
WCHAR szDrive[] = {'C',':','\\', 0};
|
WCHAR szDrive[] = {'C', ':', '\\', 0};
|
||||||
WCHAR szVolumeLabel[40];
|
WCHAR szVolumeLabel[40];
|
||||||
ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser;
|
ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser;
|
||||||
BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE;
|
BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE;
|
||||||
|
|
||||||
szDrive[0] = pContext->Drive;
|
szDrive[0] = pContext->Drive;
|
||||||
if(!GetVolumeInformationW(szDrive, szVolumeLabel, sizeof(szVolumeLabel)/sizeof(WCHAR), NULL, &dwMaxComponentLength, &FileSystemFlags, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if(!GetVolumeInformationW(szDrive, szVolumeLabel, sizeof(szVolumeLabel) / sizeof(WCHAR), NULL, &dwMaxComponentLength, &FileSystemFlags, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
FIXME("failed to get drive fs type\n");
|
FIXME("failed to get drive fs type\n");
|
||||||
return;
|
return;
|
||||||
|
@ -257,7 +257,7 @@ ChkDskDlg(
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
|
||||||
InitializeChkDskDialog(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam);
|
InitializeChkDskDialog(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
|
@ -279,158 +279,158 @@ static
|
||||||
ULONG
|
ULONG
|
||||||
GetFreeBytesShare(ULONGLONG TotalNumberOfFreeBytes, ULONGLONG TotalNumberOfBytes)
|
GetFreeBytesShare(ULONGLONG TotalNumberOfFreeBytes, ULONGLONG TotalNumberOfBytes)
|
||||||
{
|
{
|
||||||
ULONGLONG Temp;
|
ULONGLONG Temp;
|
||||||
|
|
||||||
if (TotalNumberOfFreeBytes == 0LL)
|
if (TotalNumberOfFreeBytes == 0LL)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Temp = TotalNumberOfBytes / 100;
|
Temp = TotalNumberOfBytes / 100;
|
||||||
if (Temp >= TotalNumberOfFreeBytes)
|
if (Temp >= TotalNumberOfFreeBytes)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (ULONG)(TotalNumberOfFreeBytes / Temp);
|
return (ULONG)(TotalNumberOfFreeBytes / Temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT drawItem)
|
PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT drawItem)
|
||||||
{
|
{
|
||||||
HBRUSH hBrush;
|
HBRUSH hBrush;
|
||||||
|
|
||||||
if (drawItem->CtlID == 14013)
|
if (drawItem->CtlID == 14013)
|
||||||
{
|
{
|
||||||
hBrush = CreateSolidBrush(RGB(0, 0, 255));
|
hBrush = CreateSolidBrush(RGB(0, 0, 255));
|
||||||
if (hBrush)
|
if (hBrush)
|
||||||
{
|
{
|
||||||
FillRect(drawItem->hDC, &drawItem->rcItem, hBrush);
|
FillRect(drawItem->hDC, &drawItem->rcItem, hBrush);
|
||||||
DeleteObject((HGDIOBJ)hBrush);
|
DeleteObject((HGDIOBJ)hBrush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (drawItem->CtlID == 14014)
|
else if (drawItem->CtlID == 14014)
|
||||||
{
|
{
|
||||||
hBrush = CreateSolidBrush(RGB(255, 0, 255));
|
hBrush = CreateSolidBrush(RGB(255, 0, 255));
|
||||||
if (hBrush)
|
if (hBrush)
|
||||||
{
|
{
|
||||||
FillRect(drawItem->hDC, &drawItem->rcItem, hBrush);
|
FillRect(drawItem->hDC, &drawItem->rcItem, hBrush);
|
||||||
DeleteObject((HGDIOBJ)hBrush);
|
DeleteObject((HGDIOBJ)hBrush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (drawItem->CtlID == 14015)
|
else if (drawItem->CtlID == 14015)
|
||||||
{
|
{
|
||||||
HBRUSH hBlueBrush;
|
HBRUSH hBlueBrush;
|
||||||
HBRUSH hMagBrush;
|
HBRUSH hMagBrush;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
LONG horzsize;
|
LONG horzsize;
|
||||||
LONGLONG Result;
|
LONGLONG Result;
|
||||||
WCHAR szBuffer[20];
|
WCHAR szBuffer[20];
|
||||||
|
|
||||||
hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
|
hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
|
||||||
hMagBrush = CreateSolidBrush(RGB(255, 0, 255));
|
hMagBrush = CreateSolidBrush(RGB(255, 0, 255));
|
||||||
|
|
||||||
GetDlgItemTextW(hwndDlg, 14006, szBuffer, 20);
|
GetDlgItemTextW(hwndDlg, 14006, szBuffer, 20);
|
||||||
Result = _wtoi(szBuffer);
|
Result = _wtoi(szBuffer);
|
||||||
|
|
||||||
CopyRect(&rect, &drawItem->rcItem);
|
CopyRect(&rect, &drawItem->rcItem);
|
||||||
horzsize = rect.right - rect.left;
|
horzsize = rect.right - rect.left;
|
||||||
Result = (Result * horzsize) / 100;
|
Result = (Result * horzsize) / 100;
|
||||||
|
|
||||||
rect.right = drawItem->rcItem.right - Result;
|
rect.right = drawItem->rcItem.right - Result;
|
||||||
FillRect(drawItem->hDC, &rect, hBlueBrush);
|
FillRect(drawItem->hDC, &rect, hBlueBrush);
|
||||||
rect.left = rect.right;
|
rect.left = rect.right;
|
||||||
rect.right = drawItem->rcItem.right;
|
rect.right = drawItem->rcItem.right;
|
||||||
FillRect(drawItem->hDC, &rect, hMagBrush);
|
FillRect(drawItem->hDC, &rect, hMagBrush);
|
||||||
DeleteObject(hBlueBrush);
|
DeleteObject(hBlueBrush);
|
||||||
DeleteObject(hMagBrush);
|
DeleteObject(hMagBrush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive)
|
InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive)
|
||||||
{
|
{
|
||||||
WCHAR szVolumeName[MAX_PATH+1] = {0};
|
WCHAR szVolumeName[MAX_PATH+1] = {0};
|
||||||
DWORD MaxComponentLength = 0;
|
DWORD MaxComponentLength = 0;
|
||||||
DWORD FileSystemFlags = 0;
|
DWORD FileSystemFlags = 0;
|
||||||
WCHAR FileSystemName[MAX_PATH+1] = {0};
|
WCHAR FileSystemName[MAX_PATH+1] = {0};
|
||||||
WCHAR szFormat[50];
|
WCHAR szFormat[50];
|
||||||
WCHAR szBuffer[128];
|
WCHAR szBuffer[128];
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
UINT DriveType;
|
UINT DriveType;
|
||||||
ULARGE_INTEGER FreeBytesAvailable;
|
ULARGE_INTEGER FreeBytesAvailable;
|
||||||
ULARGE_INTEGER TotalNumberOfFreeBytes;
|
ULARGE_INTEGER TotalNumberOfFreeBytes;
|
||||||
ULARGE_INTEGER TotalNumberOfBytes;
|
ULARGE_INTEGER TotalNumberOfBytes;
|
||||||
|
|
||||||
ret = GetVolumeInformationW(szDrive, szVolumeName, MAX_PATH+1, NULL, &MaxComponentLength, &FileSystemFlags, FileSystemName, MAX_PATH+1);
|
ret = GetVolumeInformationW(szDrive, szVolumeName, MAX_PATH + 1, NULL, &MaxComponentLength, &FileSystemFlags, FileSystemName, MAX_PATH + 1);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
/* set volume label */
|
/* set volume label */
|
||||||
SetDlgItemTextW(hwndDlg, 14000, szVolumeName);
|
SetDlgItemTextW(hwndDlg, 14000, szVolumeName);
|
||||||
|
|
||||||
/* set filesystem type */
|
/* set filesystem type */
|
||||||
SetDlgItemTextW(hwndDlg, 14002, FileSystemName);
|
SetDlgItemTextW(hwndDlg, 14002, FileSystemName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DriveType = GetDriveTypeW(szDrive);
|
DriveType = GetDriveTypeW(szDrive);
|
||||||
if (DriveType == DRIVE_FIXED || DriveType == DRIVE_CDROM)
|
if (DriveType == DRIVE_FIXED || DriveType == DRIVE_CDROM)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
|
if(GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
|
||||||
{
|
{
|
||||||
WCHAR szResult[128];
|
WCHAR szResult[128];
|
||||||
ULONG Result;
|
ULONG Result;
|
||||||
HANDLE hVolume;
|
HANDLE hVolume;
|
||||||
DWORD BytesReturned = 0;
|
DWORD BytesReturned = 0;
|
||||||
|
|
||||||
swprintf(szResult, L"\\\\.\\%c:", towupper(szDrive[0]));
|
swprintf(szResult, L"\\\\.\\%c:", towupper(szDrive[0]));
|
||||||
hVolume = CreateFileW(szResult, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
hVolume = CreateFileW(szResult, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if (hVolume != INVALID_HANDLE_VALUE)
|
if (hVolume != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
ret = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (LPVOID)&TotalNumberOfBytes, sizeof(ULARGE_INTEGER), &BytesReturned, NULL);
|
ret = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (LPVOID)&TotalNumberOfBytes, sizeof(ULARGE_INTEGER), &BytesReturned, NULL);
|
||||||
if (ret && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
if (ret && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
||||||
SetDlgItemTextW(hwndDlg, 14007, szResult);
|
SetDlgItemTextW(hwndDlg, 14007, szResult);
|
||||||
|
|
||||||
CloseHandle(hVolume);
|
CloseHandle(hVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("szResult %s hVOlume %p ret %d LengthInformation %ul Bytesreturned %d\n", debugstr_w(szResult), hVolume, ret, TotalNumberOfBytes.QuadPart, BytesReturned);
|
TRACE("szResult %s hVOlume %p ret %d LengthInformation %ul Bytesreturned %d\n", debugstr_w(szResult), hVolume, ret, TotalNumberOfBytes.QuadPart, BytesReturned);
|
||||||
|
|
||||||
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
||||||
SetDlgItemTextW(hwndDlg, 14003, szResult);
|
SetDlgItemTextW(hwndDlg, 14003, szResult);
|
||||||
|
|
||||||
if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
|
||||||
SetDlgItemTextW(hwndDlg, 14005, szResult);
|
SetDlgItemTextW(hwndDlg, 14005, szResult);
|
||||||
|
|
||||||
Result = GetFreeBytesShare(TotalNumberOfFreeBytes.QuadPart, TotalNumberOfBytes.QuadPart);
|
Result = GetFreeBytesShare(TotalNumberOfFreeBytes.QuadPart, TotalNumberOfBytes.QuadPart);
|
||||||
/* set free bytes percentage */
|
/* set free bytes percentage */
|
||||||
swprintf(szResult, L"%02u%%", Result);
|
swprintf(szResult, L"%02u%%", Result);
|
||||||
SetDlgItemTextW(hwndDlg, 14006, szResult);
|
SetDlgItemTextW(hwndDlg, 14006, szResult);
|
||||||
/* store used share amount */
|
/* store used share amount */
|
||||||
Result = 100 - Result;
|
Result = 100 - Result;
|
||||||
swprintf(szResult, L"%02u%%", Result);
|
swprintf(szResult, L"%02u%%", Result);
|
||||||
SetDlgItemTextW(hwndDlg, 14004, szResult);
|
SetDlgItemTextW(hwndDlg, 14004, szResult);
|
||||||
if (DriveType == DRIVE_FIXED)
|
if (DriveType == DRIVE_FIXED)
|
||||||
{
|
{
|
||||||
if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))
|
if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))
|
||||||
SetDlgItemTextW(hwndDlg, 14001, szBuffer);
|
SetDlgItemTextW(hwndDlg, 14001, szBuffer);
|
||||||
}
|
}
|
||||||
else /* DriveType == DRIVE_CDROM) */
|
else /* DriveType == DRIVE_CDROM) */
|
||||||
{
|
{
|
||||||
if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))
|
if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)))
|
||||||
SetDlgItemTextW(hwndDlg, 14001, szBuffer);
|
SetDlgItemTextW(hwndDlg, 14001, szBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* set drive description */
|
/* set drive description */
|
||||||
GetDlgItemTextW(hwndDlg, 14009, szFormat, 50);
|
GetDlgItemTextW(hwndDlg, 14009, szFormat, 50);
|
||||||
swprintf(szBuffer, szFormat, szDrive);
|
swprintf(szBuffer, szFormat, szDrive);
|
||||||
SetDlgItemTextW(hwndDlg, 14009, szBuffer);
|
SetDlgItemTextW(hwndDlg, 14009, szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -454,71 +454,71 @@ DriveGeneralDlg(
|
||||||
|
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
ppsp = (LPPROPSHEETPAGEW)lParam;
|
ppsp = (LPPROPSHEETPAGEW)lParam;
|
||||||
if (ppsp == NULL)
|
if (ppsp == NULL)
|
||||||
break;
|
break;
|
||||||
lpstr = (WCHAR *)ppsp->lParam;
|
lpstr = (WCHAR *)ppsp->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr);
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr);
|
||||||
InitializeGeneralDriveDialog(hwndDlg, lpstr);
|
InitializeGeneralDriveDialog(hwndDlg, lpstr);
|
||||||
return TRUE;
|
|
||||||
case WM_DRAWITEM:
|
|
||||||
drawItem = (LPDRAWITEMSTRUCT)lParam;
|
|
||||||
if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)
|
|
||||||
{
|
|
||||||
PaintStaticControls(hwndDlg, drawItem);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
case WM_DRAWITEM:
|
||||||
break;
|
drawItem = (LPDRAWITEMSTRUCT)lParam;
|
||||||
case WM_COMMAND:
|
if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)
|
||||||
if (LOWORD(wParam) == 14010) /* Disk Cleanup */
|
{
|
||||||
{
|
PaintStaticControls(hwndDlg, drawItem);
|
||||||
lpstr = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
return TRUE;
|
||||||
ZeroMemory( &si, sizeof(si) );
|
}
|
||||||
si.cb = sizeof(si);
|
break;
|
||||||
ZeroMemory( &pi, sizeof(pi) );
|
case WM_COMMAND:
|
||||||
if (!GetSystemDirectoryW(szPath, MAX_PATH))
|
if (LOWORD(wParam) == 14010) /* Disk Cleanup */
|
||||||
break;
|
{
|
||||||
wcscat(szPath, L"\\cleanmgr.exe /D ");
|
lpstr = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
length = wcslen(szPath);
|
ZeroMemory( &si, sizeof(si) );
|
||||||
szPath[length] = lpstr[0];
|
si.cb = sizeof(si);
|
||||||
szPath[length+1] = L'\0';
|
ZeroMemory( &pi, sizeof(pi) );
|
||||||
if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
if (!GetSystemDirectoryW(szPath, MAX_PATH))
|
||||||
{
|
break;
|
||||||
CloseHandle(pi.hProcess);
|
wcscat(szPath, L"\\cleanmgr.exe /D ");
|
||||||
CloseHandle(pi.hThread);
|
length = wcslen(szPath);
|
||||||
}
|
szPath[length] = lpstr[0];
|
||||||
break;
|
szPath[length+1] = L'\0';
|
||||||
}
|
if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||||
case WM_NOTIFY:
|
{
|
||||||
lppsn = (LPPSHNOTIFY) lParam;
|
CloseHandle(pi.hProcess);
|
||||||
if (LOWORD(wParam) == 14000)
|
CloseHandle(pi.hThread);
|
||||||
{
|
}
|
||||||
if (HIWORD(wParam) == EN_CHANGE)
|
break;
|
||||||
{
|
}
|
||||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
case WM_NOTIFY:
|
||||||
}
|
lppsn = (LPPSHNOTIFY) lParam;
|
||||||
break;
|
if (LOWORD(wParam) == 14000)
|
||||||
}
|
{
|
||||||
if (lppsn->hdr.code == PSN_APPLY)
|
if (HIWORD(wParam) == EN_CHANGE)
|
||||||
{
|
{
|
||||||
lpstr = (LPWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||||
if (lpstr && GetDlgItemTextW(hwndDlg, 14000, szPath, sizeof(szPath)/sizeof(WCHAR)))
|
}
|
||||||
{
|
break;
|
||||||
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
|
}
|
||||||
SetVolumeLabelW(lpstr, szPath);
|
if (lppsn->hdr.code == PSN_APPLY)
|
||||||
}
|
{
|
||||||
SetWindowLongPtr( hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR );
|
lpstr = (LPWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
return TRUE;
|
if (lpstr && GetDlgItemTextW(hwndDlg, 14000, szPath, sizeof(szPath) / sizeof(WCHAR)))
|
||||||
}
|
{
|
||||||
break;
|
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
SetVolumeLabelW(lpstr, szPath);
|
||||||
|
}
|
||||||
|
SetWindowLongPtr( hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT_PTR
|
INT_PTR
|
||||||
|
@ -530,82 +530,82 @@ DriveExtraDlg(
|
||||||
LPARAM lParam
|
LPARAM lParam
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
WCHAR szPath[MAX_PATH + 10];
|
WCHAR szPath[MAX_PATH + 10];
|
||||||
WCHAR szArg[MAX_PATH];
|
WCHAR szArg[MAX_PATH];
|
||||||
WCHAR * szDrive;
|
WCHAR * szDrive;
|
||||||
LPPROPSHEETPAGEW ppsp;
|
LPPROPSHEETPAGEW ppsp;
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
FORMAT_DRIVE_CONTEXT Context;
|
FORMAT_DRIVE_CONTEXT Context;
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
ppsp = (LPPROPSHEETPAGEW)lParam;
|
ppsp = (LPPROPSHEETPAGEW)lParam;
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam);
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
ZeroMemory( &si, sizeof(si) );
|
ZeroMemory( &si, sizeof(si) );
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
ZeroMemory( &pi, sizeof(pi) );
|
ZeroMemory( &pi, sizeof(pi) );
|
||||||
|
|
||||||
szDrive = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
szDrive = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
|
||||||
case 14000:
|
|
||||||
if (InitializeFmifsLibrary(&Context))
|
|
||||||
{
|
{
|
||||||
Context.Drive = szDrive[0];
|
case 14000:
|
||||||
DialogBoxParamW(shell32_hInstance, L"CHKDSK_DLG", hwndDlg, ChkDskDlg, (LPARAM)&Context);
|
if (InitializeFmifsLibrary(&Context))
|
||||||
FreeLibrary(Context.hLibrary);
|
{
|
||||||
|
Context.Drive = szDrive[0];
|
||||||
|
DialogBoxParamW(shell32_hInstance, L"CHKDSK_DLG", hwndDlg, ChkDskDlg, (LPARAM)&Context);
|
||||||
|
FreeLibrary(Context.hLibrary);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14001:
|
||||||
|
dwSize = sizeof(szPath);
|
||||||
|
if (RegGetValueW(HKEY_LOCAL_MACHINE,
|
||||||
|
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath",
|
||||||
|
NULL,
|
||||||
|
RRF_RT_REG_EXPAND_SZ,
|
||||||
|
NULL,
|
||||||
|
(PVOID)szPath,
|
||||||
|
&dwSize) == S_OK)
|
||||||
|
{
|
||||||
|
swprintf(szArg, szPath, szDrive[0]);
|
||||||
|
if (!GetSystemDirectoryW(szPath, MAX_PATH))
|
||||||
|
break;
|
||||||
|
szDrive = PathAddBackslashW(szPath);
|
||||||
|
if (!szDrive)
|
||||||
|
break;
|
||||||
|
|
||||||
|
wcscat(szDrive, L"mmc.exe");
|
||||||
|
if (CreateProcessW(szPath, szArg, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||||
|
{
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14002:
|
||||||
|
dwSize = sizeof(szPath);
|
||||||
|
if (RegGetValueW(HKEY_LOCAL_MACHINE,
|
||||||
|
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath",
|
||||||
|
NULL,
|
||||||
|
RRF_RT_REG_EXPAND_SZ,
|
||||||
|
NULL,
|
||||||
|
(PVOID)szPath,
|
||||||
|
&dwSize) == S_OK)
|
||||||
|
{
|
||||||
|
if (CreateProcessW(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||||
|
{
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 14001:
|
}
|
||||||
dwSize = sizeof(szPath);
|
return FALSE;
|
||||||
if (RegGetValueW(HKEY_LOCAL_MACHINE,
|
|
||||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath",
|
|
||||||
NULL,
|
|
||||||
RRF_RT_REG_EXPAND_SZ,
|
|
||||||
NULL,
|
|
||||||
(PVOID)szPath,
|
|
||||||
&dwSize) == S_OK)
|
|
||||||
{
|
|
||||||
swprintf(szArg, szPath, szDrive[0]);
|
|
||||||
if (!GetSystemDirectoryW(szPath, MAX_PATH))
|
|
||||||
break;
|
|
||||||
szDrive = PathAddBackslashW(szPath);
|
|
||||||
if (!szDrive)
|
|
||||||
break;
|
|
||||||
|
|
||||||
wcscat(szDrive, L"mmc.exe");
|
|
||||||
if (CreateProcessW(szPath, szArg, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
|
||||||
{
|
|
||||||
CloseHandle(pi.hProcess);
|
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 14002:
|
|
||||||
dwSize = sizeof(szPath);
|
|
||||||
if (RegGetValueW(HKEY_LOCAL_MACHINE,
|
|
||||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath",
|
|
||||||
NULL,
|
|
||||||
RRF_RT_REG_EXPAND_SZ,
|
|
||||||
NULL,
|
|
||||||
(PVOID)szPath,
|
|
||||||
&dwSize) == S_OK)
|
|
||||||
{
|
|
||||||
if (CreateProcessW(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
|
||||||
{
|
|
||||||
CloseHandle(pi.hProcess);
|
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INT_PTR
|
INT_PTR
|
||||||
|
@ -641,9 +641,9 @@ static
|
||||||
const
|
const
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
LPCSTR resname;
|
LPCSTR resname;
|
||||||
DLGPROC dlgproc;
|
DLGPROC dlgproc;
|
||||||
UINT DriveType;
|
UINT DriveType;
|
||||||
} PropPages[] =
|
} PropPages[] =
|
||||||
{
|
{
|
||||||
{ "DRIVE_GENERAL_DLG", DriveGeneralDlg, -1},
|
{ "DRIVE_GENERAL_DLG", DriveGeneralDlg, -1},
|
||||||
|
@ -667,77 +667,77 @@ AddPropSheetPageProc(HPROPSHEETPAGE hpage, LPARAM lParam)
|
||||||
BOOL
|
BOOL
|
||||||
SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl)
|
SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl)
|
||||||
{
|
{
|
||||||
HPSXA hpsx = NULL;
|
HPSXA hpsx = NULL;
|
||||||
HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE];
|
HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE];
|
||||||
PROPSHEETHEADERW psh;
|
PROPSHEETHEADERW psh;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
UINT i;
|
UINT i;
|
||||||
WCHAR szName[MAX_PATH+6];
|
WCHAR szName[MAX_PATH+6];
|
||||||
DWORD dwMaxComponent, dwFileSysFlags;
|
DWORD dwMaxComponent, dwFileSysFlags;
|
||||||
CComPtr<IDataObject> pDataObj;
|
CComPtr<IDataObject> pDataObj;
|
||||||
UINT DriveType;
|
UINT DriveType;
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
||||||
//psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE;
|
//psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE;
|
||||||
psh.hwndParent = NULL;
|
psh.hwndParent = NULL;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
|
|
||||||
if (GetVolumeInformationW(drive, szName, sizeof(szName)/sizeof(WCHAR), NULL, &dwMaxComponent,
|
if (GetVolumeInformationW(drive, szName, sizeof(szName) / sizeof(WCHAR), NULL, &dwMaxComponent,
|
||||||
&dwFileSysFlags, NULL, 0))
|
&dwFileSysFlags, NULL, 0))
|
||||||
{
|
{
|
||||||
psh.pszCaption = szName;
|
psh.pszCaption = szName;
|
||||||
psh.dwFlags |= PSH_PROPTITLE;
|
psh.dwFlags |= PSH_PROPTITLE;
|
||||||
if (!wcslen(szName))
|
if (!wcslen(szName))
|
||||||
{
|
{
|
||||||
/* FIXME
|
/* FIXME
|
||||||
* check if disk is a really a local hdd
|
* check if disk is a really a local hdd
|
||||||
*/
|
*/
|
||||||
i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szName, sizeof(szName)/sizeof(WCHAR)-6);
|
i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szName, sizeof(szName) / sizeof(WCHAR) - 6);
|
||||||
if (i > 0 && i < (sizeof(szName)/sizeof(WCHAR)) - 6)
|
if (i > 0 && i < (sizeof(szName) / sizeof(WCHAR)) - 6)
|
||||||
{
|
{
|
||||||
szName[i] = L' ';
|
szName[i] = L' ';
|
||||||
szName[i+1] = L'(';
|
szName[i+1] = L'(';
|
||||||
wcscpy(&szName[i+2], drive);
|
wcscpy(&szName[i+2], drive);
|
||||||
szName[i+4] = L')';
|
szName[i+4] = L')';
|
||||||
szName[i+5] = L'\0';
|
szName[i+5] = L'\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DriveType = GetDriveTypeW(drive);
|
DriveType = GetDriveTypeW(drive);
|
||||||
for (i = 0; i < DRIVE_PROPERTY_PAGES; i++)
|
for (i = 0; i < DRIVE_PROPERTY_PAGES; i++)
|
||||||
{
|
{
|
||||||
if (PropPages[i].DriveType == (UINT)-1 || (PropPages[i].DriveType != (UINT)-1 && PropPages[i].DriveType == DriveType))
|
if (PropPages[i].DriveType == (UINT) - 1 || (PropPages[i].DriveType != (UINT) - 1 && PropPages[i].DriveType == DriveType))
|
||||||
{
|
{
|
||||||
HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)drive, NULL);
|
HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)drive, NULL);
|
||||||
if (hprop)
|
if (hprop)
|
||||||
{
|
{
|
||||||
hpsp[psh.nPages] = hprop;
|
hpsp[psh.nPages] = hprop;
|
||||||
psh.nPages++;
|
psh.nPages++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (void **)&pDataObj) == S_OK)
|
if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (void **)&pDataObj) == S_OK)
|
||||||
{
|
{
|
||||||
hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE-DRIVE_PROPERTY_PAGES, pDataObj);
|
hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE - DRIVE_PROPERTY_PAGES, pDataObj);
|
||||||
if (hpsx)
|
if (hpsx)
|
||||||
{
|
{
|
||||||
SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageProc, (LPARAM)&psh);
|
SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageProc, (LPARAM)&psh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = PropertySheetW(&psh);
|
ret = PropertySheetW(&psh);
|
||||||
|
|
||||||
if (hpsx)
|
if (hpsx)
|
||||||
SHDestroyPropSheetExtArray(hpsx);
|
SHDestroyPropSheetExtArray(hpsx);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -746,7 +746,7 @@ GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNum
|
||||||
DWORD ClusterSize;
|
DWORD ClusterSize;
|
||||||
|
|
||||||
if (!wcsicmp(szFs, L"FAT16") ||
|
if (!wcsicmp(szFs, L"FAT16") ||
|
||||||
!wcsicmp(szFs, L"FAT")) //REACTOS HACK
|
!wcsicmp(szFs, L"FAT")) //REACTOS HACK
|
||||||
{
|
{
|
||||||
if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024))
|
if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024))
|
||||||
ClusterSize = 2048;
|
ClusterSize = 2048;
|
||||||
|
@ -771,7 +771,7 @@ GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNum
|
||||||
}
|
}
|
||||||
else if (!wcsicmp(szFs, L"FAT32"))
|
else if (!wcsicmp(szFs, L"FAT32"))
|
||||||
{
|
{
|
||||||
if (TotalNumberOfBytes->QuadPart <=(64 * 1024 * 1024))
|
if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024))
|
||||||
ClusterSize = 512;
|
ClusterSize = 512;
|
||||||
else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
|
else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024))
|
||||||
ClusterSize = 1024;
|
ClusterSize = 1024;
|
||||||
|
@ -785,10 +785,10 @@ GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNum
|
||||||
ClusterSize = 16384;
|
ClusterSize = 16384;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else if (!wcsicmp(szFs, L"NTFS"))
|
else if (!wcsicmp(szFs, L"NTFS"))
|
||||||
{
|
{
|
||||||
if (TotalNumberOfBytes->QuadPart <=(512 * 1024 * 1024))
|
if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024))
|
||||||
ClusterSize = 512;
|
ClusterSize = 512;
|
||||||
else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
|
else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024))
|
||||||
ClusterSize = 1024;
|
ClusterSize = 1024;
|
||||||
|
@ -796,12 +796,12 @@ GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNum
|
||||||
ClusterSize = 2048;
|
ClusterSize = 2048;
|
||||||
else
|
else
|
||||||
ClusterSize = 2048;
|
ClusterSize = 2048;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*pClusterSize = ClusterSize;
|
*pClusterSize = ClusterSize;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!wcsicmp(szFs, L"FAT16") ||
|
if (!wcsicmp(szFs, L"FAT16") ||
|
||||||
!wcsicmp(szFs, L"FAT")) //REACTOS HACK
|
!wcsicmp(szFs, L"FAT")) //REACTOS HACK
|
||||||
{
|
{
|
||||||
if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfBytes))
|
if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfBytes))
|
||||||
{
|
{
|
||||||
|
@ -840,7 +840,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
||||||
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
@ -860,7 +860,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
||||||
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
@ -881,7 +881,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
hDlgCtrl = GetDlgItem(hwndDlg, 28680);
|
||||||
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
szFs[(sizeof(szFs)/sizeof(WCHAR))-1] = L'\0';
|
||||||
SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
|
SendMessageW(hDlgCtrl, CB_RESETCONTENT, 0, 0);
|
||||||
|
@ -894,7 +894,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
for (lIndex = 0; lIndex < 4; lIndex++)
|
for (lIndex = 0; lIndex < 4; lIndex++)
|
||||||
{
|
{
|
||||||
TotalNumberOfBytes.QuadPart = ClusterSize;
|
TotalNumberOfBytes.QuadPart = ClusterSize;
|
||||||
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szFs);
|
lIndex = SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szFs);
|
||||||
if (lIndex != CB_ERR)
|
if (lIndex != CB_ERR)
|
||||||
|
@ -925,11 +925,11 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
BOOLEAN Latest;
|
BOOLEAN Latest;
|
||||||
HWND hDlgCtrl;
|
HWND hDlgCtrl;
|
||||||
|
|
||||||
Length = GetWindowTextW(hwndDlg, szText, sizeof(szText)/sizeof(WCHAR));
|
Length = GetWindowTextW(hwndDlg, szText, sizeof(szText) / sizeof(WCHAR));
|
||||||
if (Length < 0)
|
if (Length < 0)
|
||||||
Length = 0;
|
Length = 0;
|
||||||
szDrive[0] = pContext->Drive + L'A';
|
szDrive[0] = pContext->Drive + L'A';
|
||||||
if (GetVolumeInformationW(szDrive, &szText[Length+1], (sizeof(szText)/sizeof(WCHAR))- Length - 2, &dwSerial, &dwMaxComp, &dwFileSys, szFs, sizeof(szFs)/sizeof(WCHAR)))
|
if (GetVolumeInformationW(szDrive, &szText[Length+1], (sizeof(szText) / sizeof(WCHAR)) - Length - 2, &dwSerial, &dwMaxComp, &dwFileSys, szFs, sizeof(szFs) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
szText[Length] = L' ';
|
szText[Length] = L' ';
|
||||||
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
@ -937,7 +937,7 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
if (!TempLength)
|
if (!TempLength)
|
||||||
{
|
{
|
||||||
/* load default volume label */
|
/* load default volume label */
|
||||||
TempLength = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[Length+1], (sizeof(szText)/sizeof(WCHAR))- Length - 2);
|
TempLength = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[Length+1], (sizeof(szText) / sizeof(WCHAR)) - Length - 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -948,16 +948,16 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
Length += TempLength + 1;
|
Length += TempLength + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DWORD)Length + 4 < (sizeof(szText)/sizeof(WCHAR)))
|
if ((DWORD)Length + 4 < (sizeof(szText) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
szText[Length] = L' ';
|
szText[Length] = L' ';
|
||||||
szText[Length+1] = L'(';
|
szText[Length+1] = L'(';
|
||||||
szText[Length+2] = szDrive[0];
|
szText[Length+2] = szDrive[0];
|
||||||
szText[Length+3] = L')';
|
szText[Length+3] = L')';
|
||||||
Length +=4;
|
Length += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DWORD)Length < (sizeof(szText)/sizeof(WCHAR)))
|
if ((DWORD)Length < (sizeof(szText) / sizeof(WCHAR)))
|
||||||
szText[Length] = L'\0';
|
szText[Length] = L'\0';
|
||||||
else
|
else
|
||||||
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
@ -967,7 +967,7 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
|
|
||||||
if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
|
if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfBytes, NULL))
|
||||||
{
|
{
|
||||||
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, sizeof(szText)/sizeof(WCHAR)))
|
if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szText, sizeof(szText) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
/* add drive capacity */
|
/* add drive capacity */
|
||||||
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
@ -993,8 +993,8 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
if (!wcsicmp(szText, szFs))
|
if (!wcsicmp(szText, szFs))
|
||||||
dwDefault = dwIndex;
|
dwDefault = dwIndex;
|
||||||
|
|
||||||
SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szText);
|
SendMessageW(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szText);
|
||||||
dwIndex++;
|
dwIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dwIndex)
|
if (!dwIndex)
|
||||||
|
@ -1078,7 +1078,7 @@ FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
|
Length = SendMessageW(hDlgCtrl, CB_GETLBTEXTLEN, iSelIndex, 0);
|
||||||
if ((int)Length == CB_ERR || Length + 1> sizeof(szFileSys)/sizeof(WCHAR))
|
if ((int)Length == CB_ERR || Length + 1 > sizeof(szFileSys) / sizeof(WCHAR))
|
||||||
{
|
{
|
||||||
FIXME("\n");
|
FIXME("\n");
|
||||||
return;
|
return;
|
||||||
|
@ -1091,12 +1091,12 @@ FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
|
||||||
/* retrieve the volume label */
|
/* retrieve the volume label */
|
||||||
hDlgCtrl = GetWindow(hwndDlg, 28679);
|
hDlgCtrl = GetWindow(hwndDlg, 28679);
|
||||||
Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
|
Length = SendMessageW(hDlgCtrl, WM_GETTEXTLENGTH, 0, 0);
|
||||||
if (Length + 1 > sizeof(szLabel)/sizeof(WCHAR))
|
if (Length + 1 > sizeof(szLabel) / sizeof(WCHAR))
|
||||||
{
|
{
|
||||||
FIXME("\n");
|
FIXME("\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SendMessageW(hDlgCtrl, WM_GETTEXT, sizeof(szLabel)/sizeof(WCHAR), (LPARAM)szLabel);
|
SendMessageW(hDlgCtrl, WM_GETTEXT, sizeof(szLabel) / sizeof(WCHAR), (LPARAM)szLabel);
|
||||||
szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
|
szLabel[(sizeof(szLabel)/sizeof(WCHAR))-1] = L'\0';
|
||||||
|
|
||||||
/* check for quickformat */
|
/* check for quickformat */
|
||||||
|
|
Loading…
Reference in a new issue