From d0f962adaf3f1b2aa8a578a61364d0462671e479 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 1 Aug 2004 11:26:13 +0000 Subject: [PATCH] display different drive icons depending on the drive type svn path=/trunk/; revision=10337 --- reactos/lib/shell32/folders.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/reactos/lib/shell32/folders.c b/reactos/lib/shell32/folders.c index 87bfa6c08bb..5651158ed82 100644 --- a/reactos/lib/shell32/folders.c +++ b/reactos/lib/shell32/folders.c @@ -210,16 +210,37 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( else if (_ILIsDrive (pSimplePidl)) { - static WCHAR drive[] = { 'D','r','i','v','e',0 }; + static const WCHAR drive[] = { 'D','r','i','v','e',0 }; - if (HCR_GetDefaultIconW(drive, szIconFile, cchMax, &dwNr)) + int icon_idx = -1; + + if (_ILGetDrive(pSimplePidl, sTemp, MAX_PATH)) { - *piIndex = dwNr; + switch(GetDriveTypeA(sTemp)) + { + case DRIVE_REMOVABLE: icon_idx = 5; break; + case DRIVE_CDROM: icon_idx = 11; break; + case DRIVE_REMOTE: icon_idx = 9; break; + case DRIVE_RAMDISK: icon_idx = 12; break; + } + } + + if (icon_idx != -1) + { + lstrcpynW(szIconFile, swShell32Name, cchMax); + *piIndex = icon_idx; } else { - lstrcpynW(szIconFile, swShell32Name, cchMax); - *piIndex = 8; + if (HCR_GetDefaultIconW(drive, szIconFile, cchMax, &dwNr)) + { + *piIndex = dwNr; + } + else + { + lstrcpynW(szIconFile, swShell32Name, cchMax); + *piIndex = 8; + } } }