[ui] enable setting of icon and extended label

* Creates an UTF-16 autoconf.inf with label, as well as autoconf.ico
* also fixed extended labels not displaying - closes #48
* also bumped version to rufus-next
* also factorized iso props analysis
* additional fixes
This commit is contained in:
Pete Batard 2012-02-21 19:46:28 +00:00
parent f5939d18ab
commit 7e7c75169c
17 changed files with 357 additions and 116 deletions

View file

@ -147,20 +147,22 @@ out:
BOOL GetDriveLabel(DWORD DriveIndex, char* letter, char** label)
{
HANDLE hDrive;
char DrivePath[] = "#:\\";
static char volume_label[MAX_PATH+1];
wchar_t wDrivePath[] = L"#:\\";
wchar_t wVolumeLabel[MAX_PATH+1];
static char VolumeLabel[MAX_PATH+1];
*label = STR_NO_LABEL;
hDrive = GetDriveHandle(DriveIndex, DrivePath, FALSE, FALSE);
hDrive = GetDriveHandle(DriveIndex, letter, FALSE, FALSE);
if (hDrive == INVALID_HANDLE_VALUE)
return FALSE;
safe_closehandle(hDrive);
*letter = DrivePath[0];
wDrivePath[0] = *letter;
if (GetVolumeInformationA(DrivePath, volume_label, sizeof(volume_label),
NULL, NULL, NULL, NULL, 0) && *volume_label) {
*label = volume_label;
if (GetVolumeInformationW(wDrivePath, wVolumeLabel, sizeof(wVolumeLabel),
NULL, NULL, NULL, NULL, 0) && *wVolumeLabel) {
wchar_to_utf8_no_alloc(wVolumeLabel, VolumeLabel, sizeof(VolumeLabel));
*label = VolumeLabel;
}
return TRUE;