build_win32_extraction_path(dentry, ctx);
- randomize_char_array_with_alnum(subkeyname, 20);
+ get_random_alnum_chars(subkeyname, 20);
subkeyname[20] = L'\0';
res = RegLoadKey(HKEY_LOCAL_MACHINE, subkeyname, ctx->pathbuf.Buffer);
FileShortNameInformation);
if (status == STATUS_INVALID_PARAMETER && !retried) {
-
/* Microsoft forgot to make it possible to remove short names
* until Windows 7. Oops. Use a random short name instead. */
-
+ get_random_alnum_chars(info->FileName, 8);
+ wcscpy(&info->FileName[8], L".WLB");
info->FileNameLength = 12 * sizeof(wchar_t);
- for (int i = 0; i < 8; i++)
- info->FileName[i] = 'A' + (rand() % 26);
- info->FileName[8] = L'.';
- info->FileName[9] = L'W';
- info->FileName[10] = L'L';
- info->FileName[11] = L'B';
- info->FileName[12] = L'\0';
retried = true;
goto retry;
}
/* Hard-coded list of files which the Windows bootloader may need to access
* before the WOF driver has been loaded. */
-static wchar_t *bootloader_pattern_strings[] = {
+static const wchar_t * const bootloader_pattern_strings[] = {
L"*winload.*",
L"*winresume.*",
L"\\Windows\\AppPatch\\drvmain.sdb",
};
static const struct string_list bootloader_patterns = {
- .strings = bootloader_pattern_strings,
+ .strings = (wchar_t **)bootloader_pattern_strings,
.num_strings = ARRAY_LEN(bootloader_pattern_strings),
};