[Kernel] Added Support For: XFileRenameInformation
This commit is contained in:
@@ -39,62 +39,6 @@ struct CreateOptions {
|
||||
static const uint32_t FILE_RANDOM_ACCESS = 0x00000800;
|
||||
};
|
||||
|
||||
static bool IsValidPath(const std::string_view s, bool is_pattern) {
|
||||
// TODO(gibbed): validate path components individually
|
||||
bool got_asterisk = false;
|
||||
for (const auto& c : s) {
|
||||
if (c <= 31 || c >= 127) {
|
||||
return false;
|
||||
}
|
||||
if (got_asterisk) {
|
||||
// * must be followed by a . (*.)
|
||||
//
|
||||
// 4D530819 has a bug in its game code where it attempts to
|
||||
// FindFirstFile() with filters of "Game:\\*_X3.rkv", "Game:\\m*_X3.rkv",
|
||||
// and "Game:\\w*_X3.rkv" and will infinite loop if the path filter is
|
||||
// allowed.
|
||||
if (c != '.') {
|
||||
return false;
|
||||
}
|
||||
got_asterisk = false;
|
||||
}
|
||||
switch (c) {
|
||||
case '"':
|
||||
// case '*':
|
||||
case '+':
|
||||
case ',':
|
||||
// case ':':
|
||||
case ';':
|
||||
case '<':
|
||||
case '=':
|
||||
case '>':
|
||||
// case '?':
|
||||
case '|': {
|
||||
return false;
|
||||
}
|
||||
case '*': {
|
||||
// Pattern-specific (for NtQueryDirectoryFile)
|
||||
if (!is_pattern) {
|
||||
return false;
|
||||
}
|
||||
got_asterisk = true;
|
||||
break;
|
||||
}
|
||||
case '?': {
|
||||
// Pattern-specific (for NtQueryDirectoryFile)
|
||||
if (!is_pattern) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
dword_result_t NtCreateFile_entry(lpdword_t handle_out, dword_t desired_access,
|
||||
pointer_t<X_OBJECT_ATTRIBUTES> object_attrs,
|
||||
pointer_t<X_IO_STATUS_BLOCK> io_status_block,
|
||||
|
||||
Reference in New Issue
Block a user