mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 17:15:00 -06:00
Remove ErrorOut function
- replace the ErrorOut function with a simple return E_FAIL - there is non reason to call some MessageBox()
This commit is contained in:
@@ -133,6 +133,7 @@ C_OBJS = \
|
||||
!include "../../LzmaDec.mak"
|
||||
|
||||
COMPRESS_OBJS = $(COMPRESS_OBJS) \
|
||||
$O\ZstdEncoder.obj \
|
||||
$O\ZstdDecoder.obj \
|
||||
$O\ZstdRegister.obj \
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ C_OBJS = \
|
||||
!include "../../LzmaDec.mak"
|
||||
|
||||
COMPRESS_OBJS = $(COMPRESS_OBJS) \
|
||||
$O\ZstdEncoder.obj \
|
||||
$O\ZstdDecoder.obj \
|
||||
$O\ZstdRegister.obj \
|
||||
|
||||
|
||||
@@ -83,18 +83,6 @@ CDecoder::~CDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = BROTLIMT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte * prop, UInt32 size)
|
||||
{
|
||||
DProps *pProps = (DProps *)prop;
|
||||
@@ -162,7 +150,7 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
|
||||
if (BROTLIMT_isError(result)) {
|
||||
if (result == (size_t)-BROTLIMT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 4) free resources */
|
||||
|
||||
@@ -58,7 +58,6 @@ class CDecoder:public ICompressCoder,
|
||||
UInt32 _inputSize;
|
||||
UInt32 _numThreads;
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code);
|
||||
HRESULT CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
HRESULT SetOutStreamSizeResume(const UInt64 *outSize);
|
||||
|
||||
|
||||
@@ -24,18 +24,6 @@ CEncoder::~CEncoder()
|
||||
BROTLIMT_freeCCtx(_ctx);
|
||||
}
|
||||
|
||||
HRESULT CEncoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = BROTLIMT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARIANT * coderProps, UInt32 numProps)
|
||||
{
|
||||
_props.clear();
|
||||
@@ -120,7 +108,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
if (BROTLIMT_isError(result)) {
|
||||
if (result == (size_t)-BROTLIMT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -46,7 +46,6 @@ class CEncoder:
|
||||
UInt32 _numThreads;
|
||||
|
||||
BROTLIMT_CCtx *_ctx;
|
||||
HRESULT CEncoder::ErrorOut(size_t code);
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
|
||||
|
||||
@@ -83,18 +83,6 @@ CDecoder::~CDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LIZARDMT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte * prop, UInt32 size)
|
||||
{
|
||||
DProps *pProps = (DProps *)prop;
|
||||
@@ -162,7 +150,7 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
|
||||
if (LIZARDMT_isError(result)) {
|
||||
if (result == (size_t)-LIZARDMT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 4) free resources */
|
||||
|
||||
@@ -60,7 +60,6 @@ class CDecoder:public ICompressCoder,
|
||||
UInt32 _inputSize;
|
||||
UInt32 _numThreads;
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code);
|
||||
HRESULT CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
HRESULT SetOutStreamSizeResume(const UInt64 *outSize);
|
||||
|
||||
|
||||
@@ -24,18 +24,6 @@ CEncoder::~CEncoder()
|
||||
LIZARDMT_freeCCtx(_ctx);
|
||||
}
|
||||
|
||||
HRESULT CEncoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LIZARDMT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARIANT * coderProps, UInt32 numProps)
|
||||
{
|
||||
_props.clear();
|
||||
@@ -121,7 +109,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
if (LIZARDMT_isError(result)) {
|
||||
if (result == (size_t)-LIZARDMT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -47,7 +47,6 @@ class CEncoder:
|
||||
UInt32 _numThreads;
|
||||
|
||||
LIZARDMT_CCtx *_ctx;
|
||||
HRESULT CEncoder::ErrorOut(size_t code);
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
|
||||
|
||||
@@ -83,18 +83,6 @@ CDecoder::~CDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LZ4MT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte * prop, UInt32 size)
|
||||
{
|
||||
DProps *pProps = (DProps *)prop;
|
||||
@@ -162,7 +150,7 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
|
||||
if (LZ4MT_isError(result)) {
|
||||
if (result == (size_t)-LZ4MT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 4) free resources */
|
||||
|
||||
@@ -59,7 +59,6 @@ class CDecoder:public ICompressCoder,
|
||||
UInt32 _inputSize;
|
||||
UInt32 _numThreads;
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code);
|
||||
HRESULT CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
HRESULT SetOutStreamSizeResume(const UInt64 *outSize);
|
||||
|
||||
|
||||
@@ -24,18 +24,6 @@ CEncoder::~CEncoder()
|
||||
LZ4MT_freeCCtx(_ctx);
|
||||
}
|
||||
|
||||
HRESULT CEncoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LZ4MT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARIANT * coderProps, UInt32 numProps)
|
||||
{
|
||||
_props.clear();
|
||||
@@ -121,7 +109,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
if (LZ4MT_isError(result)) {
|
||||
if (result == (size_t)-LZ4MT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -47,7 +47,6 @@ class CEncoder:
|
||||
UInt32 _numThreads;
|
||||
|
||||
LZ4MT_CCtx *_ctx;
|
||||
HRESULT CEncoder::ErrorOut(size_t code);
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
|
||||
|
||||
@@ -83,18 +83,6 @@ CDecoder::~CDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LZ5MT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte * prop, UInt32 size)
|
||||
{
|
||||
DProps *pProps = (DProps *)prop;
|
||||
@@ -162,7 +150,7 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
|
||||
if (LZ5MT_isError(result)) {
|
||||
if (result == (size_t)-LZ5MT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 4) free resources */
|
||||
|
||||
@@ -59,7 +59,6 @@ class CDecoder:public ICompressCoder,
|
||||
UInt32 _inputSize;
|
||||
UInt32 _numThreads;
|
||||
|
||||
HRESULT CDecoder::ErrorOut(size_t code);
|
||||
HRESULT CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
HRESULT SetOutStreamSizeResume(const UInt64 *outSize);
|
||||
|
||||
|
||||
@@ -24,18 +24,6 @@ CEncoder::~CEncoder()
|
||||
LZ5MT_freeCCtx(_ctx);
|
||||
}
|
||||
|
||||
HRESULT CEncoder::ErrorOut(size_t code)
|
||||
{
|
||||
const char *strError = LZ5MT_getErrorString(code);
|
||||
wchar_t wstrError[200+5]; /* no malloc here, /TR */
|
||||
|
||||
mbstowcs(wstrError, strError, 200);
|
||||
MessageBoxW(0, wstrError, L"7-Zip Zstandard", MB_ICONERROR | MB_OK);
|
||||
MyFree(wstrError);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID * propIDs, const PROPVARIANT * coderProps, UInt32 numProps)
|
||||
{
|
||||
_props.clear();
|
||||
@@ -121,7 +109,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
if (LZ5MT_isError(result)) {
|
||||
if (result == (size_t)-LZ5MT_error_canceled)
|
||||
return E_ABORT;
|
||||
return ErrorOut(result);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -47,7 +47,6 @@ class CEncoder:
|
||||
UInt32 _numThreads;
|
||||
|
||||
LZ5MT_CCtx *_ctx;
|
||||
HRESULT CEncoder::ErrorOut(size_t code);
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
|
||||
|
||||
Reference in New Issue
Block a user