MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / windowsStat

Function windowsStat

Libraries/FileSystem/FileSystem.cpp:837–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

835 return SC::FileSystemEntryType::File;
836}
837
838static SC::ResultFileSystem fillWindowsFileStat(HANDLE hFile, SC::FileSystemStat& fileStat)
839{
840 fileStat = {};
841
842 BY_HANDLE_FILE_INFORMATION handleInfo;
843 if (::GetFileInformationByHandle(hFile, &handleInfo) == FALSE)
844 return fileSystemResultFromNative(::GetLastError(), SC::FileSystemErrorDetail::QueryEntryMetadata);
845 FILE_STANDARD_INFO standardInfo = {};
846 const bool hasStandardInfo =
847 ::GetFileInformationByHandleEx(hFile, FileStandardInfo, &standardInfo, sizeof(standardInfo)) != FALSE;
848
849 FILE_ATTRIBUTE_TAG_INFO tagInfo = {};
850 if (::GetFileInformationByHandleEx(hFile, FileAttributeTagInfo, &tagInfo, sizeof(tagInfo)) == FALSE)
851 {
852 tagInfo.FileAttributes = handleInfo.dwFileAttributes;
853 tagInfo.ReparseTag = 0;
854 }
855
856 fileStat.entryType = windowsEntryTypeFromAttributes(handleInfo.dwFileAttributes, tagInfo.ReparseTag);
857 fileStat.creationTime = windowsFileTimeToTimeMs(handleInfo.ftCreationTime);

Callers 4

chownMethod · 0.85
lchownMethod · 0.85
statMethod · 0.85
lstatMethod · 0.85

Calls 3

MakeDeferredFunction · 0.85
fillWindowsFileStatFunction · 0.85
ErrorEnum · 0.50

Tested by

no test coverage detected