From e327e4469ac2847615f7c847facd5879b5c2e5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 28 Aug 2022 04:02:24 +0200 Subject: Replace Managed with Unique. --- c/ext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'c/ext.cpp') diff --git a/c/ext.cpp b/c/ext.cpp index 272f4a3..398804e 100644 --- a/c/ext.cpp +++ b/c/ext.cpp @@ -78,8 +78,6 @@ static inline bool MatchFileName(wchar_t (&file)[MAX_PATH], const wchar_t* const static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const root, const wchar_t* const siEp, const int level = 0) { - using FindHandle = Managed; - /* Don't recurse too much. */ if (level > 3) return false; @@ -88,7 +86,9 @@ static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const roo Swprintf(pat, L"%s\\*", root); WIN32_FIND_DATA fdata; - FindHandle h = FindFirstFileW(pat, &fdata); + Unique h = FindFirstFileW(pat, &fdata); + if (!h.Not(INVALID_HANDLE_VALUE)) + throw Win32Error(); do if (fdata.cFileName[0] == L'.') @@ -103,7 +103,7 @@ static bool FindMatchingFile(wchar_t (&file)[MAX_PATH], const wchar_t* const roo Swprintf(file, L"%s\\%s", root, fdata.cFileName); return true; } - while (FindNextFileW(h, &fdata)); + while (FindNextFileW(h.v, &fdata)); if (GetLastError() != ERROR_NO_MORE_FILES) throw Win32Error(); -- cgit v1.2.3