mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-28 13:44:15 -04:00
[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:
parent
f5939d18ab
commit
7e7c75169c
17 changed files with 357 additions and 116 deletions
16
src/drive.c
16
src/drive.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue