mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 10:24:13 -06:00
4.27 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
31e7b924e8
commit
d66cf2fcf3
@@ -38,7 +38,7 @@ public:
|
||||
int GetItemCount() const
|
||||
{ return ListView_GetItemCount(_window); }
|
||||
|
||||
INT GetSelectionMark()
|
||||
INT GetSelectionMark() const
|
||||
{ return ListView_GetSelectionMark(_window); }
|
||||
|
||||
void SetItemCount(int numItems)
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
void SetItemState(int index, UINT state, UINT mask)
|
||||
{ ListView_SetItemState(_window, index, state, mask); }
|
||||
UINT GetItemState(int index, UINT mask)
|
||||
UINT GetItemState(int index, UINT mask) const
|
||||
{ return ListView_GetItemState(_window, index, mask); }
|
||||
|
||||
bool GetColumn(int columnIndex, LVCOLUMN* columnInfo) const
|
||||
|
||||
+57
-4
@@ -146,10 +146,40 @@ bool CInFile::Open(LPCWSTR fileName)
|
||||
}
|
||||
#endif
|
||||
|
||||
// ReadFile and WriteFile functions in Windows have BUG:
|
||||
// If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
|
||||
// from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
|
||||
// (Insufficient system resources exist to complete the requested service).
|
||||
|
||||
static UINT32 kChunkSizeMax = (1 << 24);
|
||||
|
||||
bool CInFile::ReadPart(void *data, UINT32 size, UINT32 &processedSize)
|
||||
{
|
||||
if (size > kChunkSizeMax)
|
||||
size = kChunkSizeMax;
|
||||
DWORD processedLoc = 0;
|
||||
bool res = BOOLToBool(::ReadFile(_handle, data, size, &processedLoc, NULL));
|
||||
processedSize = (UINT32)processedLoc;
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CInFile::Read(void *data, UINT32 size, UINT32 &processedSize)
|
||||
{
|
||||
return BOOLToBool(::ReadFile(_handle, data, size,
|
||||
(DWORD *)&processedSize, NULL));
|
||||
processedSize = 0;
|
||||
do
|
||||
{
|
||||
UINT32 processedLoc = 0;
|
||||
bool res = ReadPart(data, size, processedLoc);
|
||||
processedSize += processedLoc;
|
||||
if (!res)
|
||||
return false;
|
||||
if (processedLoc == 0)
|
||||
return true;
|
||||
data = (void *)((unsigned char *)data + processedLoc);
|
||||
size -= processedLoc;
|
||||
}
|
||||
while (size > 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
@@ -210,10 +240,33 @@ bool COutFile::SetLastWriteTime(const FILETIME *lastWriteTime)
|
||||
return SetTime(NULL, NULL, lastWriteTime);
|
||||
}
|
||||
|
||||
bool COutFile::WritePart(const void *data, UINT32 size, UINT32 &processedSize)
|
||||
{
|
||||
if (size > kChunkSizeMax)
|
||||
size = kChunkSizeMax;
|
||||
DWORD processedLoc = 0;
|
||||
bool res = BOOLToBool(::WriteFile(_handle, data, size, &processedLoc, NULL));
|
||||
processedSize = (UINT32)processedLoc;
|
||||
return res;
|
||||
}
|
||||
|
||||
bool COutFile::Write(const void *data, UINT32 size, UINT32 &processedSize)
|
||||
{
|
||||
return BOOLToBool(::WriteFile(_handle, data, size,
|
||||
(DWORD *)&processedSize, NULL));
|
||||
processedSize = 0;
|
||||
do
|
||||
{
|
||||
UINT32 processedLoc = 0;
|
||||
bool res = WritePart(data, size, processedLoc);
|
||||
processedSize += processedLoc;
|
||||
if (!res)
|
||||
return false;
|
||||
if (processedLoc == 0)
|
||||
return true;
|
||||
data = (const void *)((const unsigned char *)data + processedLoc);
|
||||
size -= processedLoc;
|
||||
}
|
||||
while (size > 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COutFile::SetEndOfFile()
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
DWORD creationDisposition, DWORD flagsAndAttributes);
|
||||
bool Open(LPCWSTR fileName);
|
||||
#endif
|
||||
bool ReadPart(void *data, UINT32 size, UINT32 &processedSize);
|
||||
bool Read(void *data, UINT32 size, UINT32 &processedSize);
|
||||
};
|
||||
|
||||
@@ -90,6 +91,7 @@ public:
|
||||
bool SetTime(const FILETIME *creationTime,
|
||||
const FILETIME *lastAccessTime, const FILETIME *lastWriteTime);
|
||||
bool SetLastWriteTime(const FILETIME *lastWriteTime);
|
||||
bool WritePart(const void *data, UINT32 size, UINT32 &processedSize);
|
||||
bool Write(const void *data, UINT32 size, UINT32 &processedSize);
|
||||
bool SetEndOfFile();
|
||||
bool SetLength(UINT64 length);
|
||||
|
||||
@@ -142,7 +142,8 @@ CPropVariant& CPropVariant::operator=(Int16 value)
|
||||
return *this;
|
||||
}
|
||||
|
||||
CPropVariant& CPropVariant::operator=(long value)
|
||||
/*
|
||||
CPropVariant& CPropVariant::operator=(LONG value)
|
||||
{
|
||||
if (vt != VT_I4)
|
||||
{
|
||||
@@ -152,6 +153,7 @@ CPropVariant& CPropVariant::operator=(long value)
|
||||
lVal = value;
|
||||
return *this;
|
||||
}
|
||||
*/
|
||||
|
||||
static HRESULT MyPropVariantClear(PROPVARIANT *propVariant)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
CPropVariant(Int32 value) { vt = VT_I4; lVal = value; }
|
||||
CPropVariant(Byte value) { vt = VT_UI1; bVal = value; }
|
||||
CPropVariant(Int16 value) { vt = VT_I2; iVal = value; }
|
||||
CPropVariant(long value, VARTYPE vtSrc = VT_I4) { vt = vtSrc; lVal = value; }
|
||||
// CPropVariant(LONG value, VARTYPE vtSrc = VT_I4) { vt = vtSrc; lVal = value; }
|
||||
|
||||
CPropVariant& operator=(const CPropVariant& varSrc);
|
||||
CPropVariant& operator=(const PROPVARIANT& varSrc);
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
CPropVariant& operator=(Int32 value);
|
||||
CPropVariant& operator=(Byte value);
|
||||
CPropVariant& operator=(Int16 value);
|
||||
CPropVariant& operator=(long value);
|
||||
// CPropVariant& operator=(LONG value);
|
||||
|
||||
HRESULT Clear();
|
||||
HRESULT Copy(const PROPVARIANT* pSrc);
|
||||
|
||||
@@ -6,14 +6,11 @@
|
||||
|
||||
#include "PropVariantConversions.h"
|
||||
|
||||
#include "Windows/NationalTime.h"
|
||||
#include "Windows/Defs.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Common/IntToString.h"
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
static UString ConvertUInt64ToString(UInt64 value)
|
||||
{
|
||||
wchar_t buffer[32];
|
||||
|
||||
Reference in New Issue
Block a user