From 636b026109ebee03572239ad8ac5d6711491b4ff Mon Sep 17 00:00:00 2001 From: kenan Date: Mon, 20 Jun 2022 11:38:59 +0200 Subject: [PATCH] enable UNC network paths (\\) --- AngelLoader/Common/Native/FastIO.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AngelLoader/Common/Native/FastIO.cs b/AngelLoader/Common/Native/FastIO.cs index 20d18ee30..cf774fae9 100644 --- a/AngelLoader/Common/Native/FastIO.cs +++ b/AngelLoader/Common/Native/FastIO.cs @@ -135,7 +135,9 @@ private static List GetFilesTopOnlyInternal( //const int ERROR_REM_NOT_LIST = 0x33; //const int ERROR_BAD_NETPATH = 0x35; - using var findHandle = FindFirstFileExW(@"\\?\" + path + "\\" + searchPattern, + string searchPath = (path.StartsWith(@"\\") ? @"\\?\UNC\" + path.Substring(2) : @"\\?\" + path) + "\\" + searchPattern; + + using var findHandle = FindFirstFileExW(searchPath, FINDEX_INFO_LEVELS.FindExInfoBasic, out WIN32_FIND_DATAW findData, FINDEX_SEARCH_OPS.FindExSearchNameMatch, IntPtr.Zero, FIND_FIRST_EX_LARGE_FETCH);