This commit is contained in:
Igor Pavlov
2022-06-23 11:43:16 +01:00
committed by Kornel
parent c3529a41f5
commit ec44a8a070
1248 changed files with 15242 additions and 2443 deletions

0
CPP/7zip/Archive/Wim/StdAfx.h Normal file → Executable file
View File

3
CPP/7zip/Archive/Wim/WimHandler.cpp Normal file → Executable file
View File

@@ -355,6 +355,7 @@ static void GetFileTime(const Byte *p, NCOM::CPropVariant &prop)
prop.vt = VT_FILETIME;
prop.filetime.dwLowDateTime = Get32(p);
prop.filetime.dwHighDateTime = Get32(p + 4);
prop.Set_FtPrec(k_PropVar_TimePrec_100ns);
}
@@ -842,7 +843,7 @@ public:
int dotPos = name.ReverseFind_Dot();
if (dotPos < 0)
dotPos = name.Len();
_before = name.Left(dotPos);
_before.SetFrom(name.Ptr(), dotPos);
_after = name.Ptr(dotPos);
}

0
CPP/7zip/Archive/Wim/WimHandler.h Normal file → Executable file
View File

14
CPP/7zip/Archive/Wim/WimHandlerOut.cpp Normal file → Executable file
View File

@@ -32,8 +32,8 @@ static int AddUniqHash(const CStreamInfo *streams, CUIntVector &sorted, const By
unsigned left = 0, right = sorted.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
unsigned index = sorted[mid];
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const unsigned index = sorted[mid];
const Byte *hash2 = streams[index].Hash;
unsigned i;
@@ -124,9 +124,9 @@ static int AddToHardLinkList(const CObjectVector<CMetaItem> &metaItems, unsigned
unsigned left = 0, right = indexes.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
unsigned index = indexes[mid];
int comp = Compare_HardLink_MetaItems(mi, metaItems[index]);
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const unsigned index = indexes[mid];
const int comp = Compare_HardLink_MetaItems(mi, metaItems[index]);
if (comp == 0)
return index;
if (comp < 0)
@@ -203,8 +203,8 @@ bool CDir::FindDir(const CObjectVector<CMetaItem> &items, const UString &name, u
unsigned left = 0, right = Dirs.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name);
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name);
if (comp == 0)
{
index = mid;

9
CPP/7zip/Archive/Wim/WimIn.cpp Normal file → Executable file
View File

@@ -567,9 +567,12 @@ void CDatabase::GetItemPath(unsigned index1, bool showImageNumber, NWindows::NCO
for (unsigned i = 0; i < len; i++)
{
wchar_t c = Get16(meta + i * 2);
// 18.06
if (c == CHAR_PATH_SEPARATOR || c == '/')
c = '_';
if (c == L'/')
c = L'_';
#if WCHAR_PATH_SEPARATOR != L'/'
else if (c == L'\\')
c = WCHAR_IN_FILE_NAME_BACKSLASH_REPLACEMENT; // 22.00 : WSL scheme
#endif
dest[i] = c;
}
}

0
CPP/7zip/Archive/Wim/WimIn.h Normal file → Executable file
View File

21
CPP/7zip/Archive/Wim/WimRegister.cpp Normal file → Executable file
View File

@@ -10,13 +10,20 @@ namespace NArchive {
namespace NWim {
REGISTER_ARC_IO(
"wim", "wim swm esd ppkg", 0, 0xE6,
kSignature,
0,
NArcInfoFlags::kAltStreams |
NArcInfoFlags::kNtSecure |
NArcInfoFlags::kSymLinks |
NArcInfoFlags::kHardLinks
"wim", "wim swm esd ppkg", NULL, 0xE6
, kSignature, 0
, NArcInfoFlags::kAltStreams
| NArcInfoFlags::kNtSecure
| NArcInfoFlags::kSymLinks
| NArcInfoFlags::kHardLinks
| NArcInfoFlags::kCTime
// | NArcInfoFlags::kCTime_Default
| NArcInfoFlags::kATime
// | NArcInfoFlags::kATime_Default
| NArcInfoFlags::kMTime
| NArcInfoFlags::kMTime_Default
, TIME_PREC_TO_ARC_FLAGS_MASK (NFileTimeType::kWindows)
| TIME_PREC_TO_ARC_FLAGS_TIME_DEFAULT (NFileTimeType::kWindows)
, NULL)
}}