MCPcopy Create free account
hub / github.com/ThirteenAG/Ultimate-ASI-Loader / FindFileCheckOverloadedPath

Function FindFileCheckOverloadedPath

source/dllmain.cpp:2806–2833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2804 #define value_orW(path1, path2) (path1.empty() ? path2 : path1.wstring().c_str())
2805
2806 void FindFileCheckOverloadedPath(auto dir, auto lpFindFileData, auto filename)
2807 {
2808 if (!filename || filename[0] == 0)
2809 return;
2810
2811 auto fullpath = std::filesystem::path(dir).remove_filename() / filename;
2812 auto name = fullpath.filename();
2813 if (name == "." || name == ".." || name == "*" || name == "?")
2814 return;
2815
2816 auto newPath = GetFilePathForOverload(fullpath);
2817
2818 std::error_code ec;
2819 if (!newPath.empty() && std::filesystem::is_regular_file(newPath, ec))
2820 {
2821 lpFindFileData->dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
2822 auto fileSize = std::filesystem::file_size(newPath, ec);
2823 lpFindFileData->nFileSizeHigh = static_cast<DWORD>(fileSize >> 32);
2824 lpFindFileData->nFileSizeLow = static_cast<DWORD>(fileSize & 0xFFFFFFFF);
2825 SYSTEMTIME st;
2826 FILETIME time;
2827 GetSystemTime(&st);
2828 SystemTimeToFileTime(&st, &time);
2829 lpFindFileData->ftCreationTime = time;
2830 lpFindFileData->ftLastAccessTime = time;
2831 lpFindFileData->ftLastWriteTime = time;
2832 }
2833 }
2834
2835 bool isRecursive(auto addr)
2836 {

Callers 6

shCustomFindFirstFileAFunction · 0.85
shCustomFindNextFileAFunction · 0.85
shCustomFindFirstFileWFunction · 0.85
shCustomFindNextFileWFunction · 0.85
shCustomFindFirstFileExAFunction · 0.85
shCustomFindFirstFileExWFunction · 0.85

Calls 1

GetFilePathForOverloadFunction · 0.85

Tested by

no test coverage detected