mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 11:47:06 -04:00
[misc] add a cheat mode to disable file indexing after format
* New cheat mode is Alt-Q, and gets preserved between sessions * Only for file systems that support it (NTFS, UDF and ReFS)
This commit is contained in:
parent
d9a928f5bc
commit
5d3be6ca51
7 changed files with 50 additions and 9 deletions
10
src/format.c
10
src/format.c
|
@ -61,7 +61,7 @@ static int task_number = 0;
|
|||
extern const int nb_steps[FS_MAX];
|
||||
extern uint32_t dur_mins, dur_secs;
|
||||
static int fs_index = 0;
|
||||
extern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive;
|
||||
extern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive, disable_file_indexing;
|
||||
uint8_t *grub2_buf = NULL;
|
||||
long grub2_len;
|
||||
static BOOL WritePBR(HANDLE hLogicalDrive);
|
||||
|
@ -1811,6 +1811,14 @@ DWORD WINAPI FormatThread(void* param)
|
|||
}
|
||||
CHECK_FOR_USER_CANCEL;
|
||||
|
||||
// Disable file indexing if the option was selected by the user
|
||||
if ((disable_file_indexing) && ((fs == FS_NTFS) || (fs == FS_UDF) || (fs == FS_REFS))) {
|
||||
if (SetFileAttributesA(guid_volume, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
|
||||
uprintf("File indexing has been set to: Disabled");
|
||||
else
|
||||
uprintf("Could not disable file indexing: %s", WindowsErrorString());
|
||||
} else
|
||||
|
||||
// Refresh the drive label - This is needed as Windows may have altered it from
|
||||
// the name we proposed, and we require an exact label, to patch config files.
|
||||
if (!GetVolumeInformationU(drive_name, img_report.usb_label, ARRAYSIZE(img_report.usb_label),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue