From 92593be412dd5cea80ece1349cef050eea335de0 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sun, 10 Sep 2023 23:49:23 +0100 Subject: [PATCH] [*] FS path mitigation: begin to handle >= MAX_PATHs by enforcing UNC \\?\ prefixes across every single Win32/NT api we hit (if relevant. im sure some long paths may still break things.) --- Source/IO/FS/FS.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/IO/FS/FS.cpp b/Source/IO/FS/FS.cpp index f352101f..e26b9430 100644 --- a/Source/IO/FS/FS.cpp +++ b/Source/IO/FS/FS.cpp @@ -180,6 +180,16 @@ namespace Aurora::IO::FS result = path; } } + + #if defined(AURORA_IS_MODERNNT_DERIVED) + if (result.size() >= MAX_PATH) + { + if (!AuStartsWith(result, "\\\\")) + { + result = "\\\\?\\" + result; + } + } + #endif } void /* internal, local export */ _NormalizePath(AuString &str)