mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 08:11:35 -06:00
4.45 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
d9666cf046
commit
a145bfc7cf
@@ -97,7 +97,11 @@ SOURCE=..\Codec.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DllExports.cpp
|
||||
SOURCE=..\CodecExports.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\DllExports.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -166,22 +170,6 @@ SOURCE=..\..\Common\OutBuffer.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Alloc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\CRC.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\CRC.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\NewHandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -230,6 +218,15 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Compress\Lz\LzHash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -299,6 +296,10 @@ SOURCE=..\..\..\..\C\Sort.h
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Deflate64Register.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DeflateConst.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -337,5 +338,13 @@ SOURCE=.\DeflateEncoder.cpp
|
||||
|
||||
SOURCE=.\DeflateEncoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DeflateNsisRegister.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DeflateRegister.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
||||
19
CPP/7zip/Compress/Deflate/Deflate64Register.cpp
Executable file
19
CPP/7zip/Compress/Deflate/Deflate64Register.cpp
Executable file
@@ -0,0 +1,19 @@
|
||||
// Deflate64Register.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../Common/RegisterCodec.h"
|
||||
|
||||
#include "DeflateDecoder.h"
|
||||
static void *CreateCodecDeflate64() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder64); }
|
||||
#if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
|
||||
#include "DeflateEncoder.h"
|
||||
static void *CreateCodecOutDeflate64() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NEncoder::CCOMCoder64); }
|
||||
#else
|
||||
#define CreateCodecOutDeflate64 0
|
||||
#endif
|
||||
|
||||
static CCodecInfo g_CodecInfo =
|
||||
{ CreateCodecDeflate64, CreateCodecOutDeflate64, 0x040109, L"Deflate64", 1, false };
|
||||
|
||||
REGISTER_CODEC(Deflate64)
|
||||
@@ -318,7 +318,7 @@ STDMETHODIMP CCoder::SetOutStreamSize(const UInt64 * /* outSize */)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _ST_MODE
|
||||
#ifndef NO_READ_FROM_CODER
|
||||
|
||||
STDMETHODIMP CCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace NDecoder {
|
||||
class CCoder:
|
||||
public ICompressCoder,
|
||||
public ICompressGetInStreamProcessedSize,
|
||||
#ifdef _ST_MODE
|
||||
#ifndef NO_READ_FROM_CODER
|
||||
public ICompressSetInStream,
|
||||
public ICompressSetOutStreamSize,
|
||||
public ISequentialInStream,
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
|
||||
ICompressProgressInfo *progress);
|
||||
|
||||
#ifdef _ST_MODE
|
||||
#ifndef NO_READ_FROM_CODER
|
||||
MY_UNKNOWN_IMP4(
|
||||
ICompressGetInStreamProcessedSize,
|
||||
ICompressSetInStream,
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
STDMETHOD(ReleaseInStream)();
|
||||
STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
|
||||
|
||||
#ifdef _ST_MODE
|
||||
#ifndef NO_READ_FROM_CODER
|
||||
STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
|
||||
#include "Windows/Defs.h"
|
||||
#include "Common/ComTry.h"
|
||||
#include "../../../Common/Alloc.h"
|
||||
extern "C"
|
||||
{
|
||||
#include "../../../../C/Alloc.h"
|
||||
}
|
||||
// #include "../LZ/BinTree/BinTree3Z.h"
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
|
||||
13
CPP/7zip/Compress/Deflate/DeflateNsisRegister.cpp
Executable file
13
CPP/7zip/Compress/Deflate/DeflateNsisRegister.cpp
Executable file
@@ -0,0 +1,13 @@
|
||||
// DeflateNsisRegister.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../Common/RegisterCodec.h"
|
||||
|
||||
#include "DeflateDecoder.h"
|
||||
static void *CreateCodecDeflateNsis() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CNsisCOMCoder); }
|
||||
|
||||
static CCodecInfo g_CodecInfo =
|
||||
{ CreateCodecDeflateNsis, 0, 0x040901, L"DeflateNSIS", 1, false };
|
||||
|
||||
REGISTER_CODEC(DeflateNsis)
|
||||
19
CPP/7zip/Compress/Deflate/DeflateRegister.cpp
Executable file
19
CPP/7zip/Compress/Deflate/DeflateRegister.cpp
Executable file
@@ -0,0 +1,19 @@
|
||||
// DeflateRegister.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../Common/RegisterCodec.h"
|
||||
|
||||
#include "DeflateDecoder.h"
|
||||
static void *CreateCodecDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder); }
|
||||
#if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
|
||||
#include "DeflateEncoder.h"
|
||||
static void *CreateCodecOutDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NEncoder::CCOMCoder); }
|
||||
#else
|
||||
#define CreateCodecOutDeflate 0
|
||||
#endif
|
||||
|
||||
static CCodecInfo g_CodecInfo =
|
||||
{ CreateCodecDeflate, CreateCodecOutDeflate, 0x040108, L"Deflate", 1, false };
|
||||
|
||||
REGISTER_CODEC(Deflate)
|
||||
@@ -1,157 +0,0 @@
|
||||
// DLLExports.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Common/MyInitGuid.h"
|
||||
#include "Common/ComTry.h"
|
||||
|
||||
#include "DeflateEncoder.h"
|
||||
#include "DeflateDecoder.h"
|
||||
|
||||
#ifdef CRC_GENERATE_TABLE
|
||||
extern "C"
|
||||
{
|
||||
#include "../../../../C/7zCrc.h"
|
||||
}
|
||||
#endif
|
||||
|
||||
// {23170F69-40C1-278B-0401-080000000000}
|
||||
DEFINE_GUID(CLSID_CCompressDeflateDecoder,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x04, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
// {23170F69-40C1-278B-0401-090000000000}
|
||||
DEFINE_GUID(CLSID_CCompressDeflate64Decoder,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x04, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
// {23170F69-40C1-278B-0401-080000000100}
|
||||
DEFINE_GUID(CLSID_CCompressDeflateEncoder,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x04, 0x01, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00);
|
||||
|
||||
// {23170F69-40C1-278B-0401-090000000100}
|
||||
DEFINE_GUID(CLSID_CCompressDeflate64Encoder,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x04, 0x01, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00);
|
||||
|
||||
|
||||
// {23170F69-40C1-278B-0409-010000000000}
|
||||
DEFINE_GUID(CLSID_CCompressDeflateNsisDecoder,
|
||||
0x23170F69, 0x40C1, 0x278B, 0x04, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE /* hInstance */, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
#ifdef CRC_GENERATE_TABLE
|
||||
CrcGenerateTable();
|
||||
#endif
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
*outObject = 0;
|
||||
int correctInterface = (*iid == IID_ICompressCoder);
|
||||
CMyComPtr<ICompressCoder> coder;
|
||||
if (*clsid == CLSID_CCompressDeflateDecoder)
|
||||
{
|
||||
if (!correctInterface)
|
||||
return E_NOINTERFACE;
|
||||
coder = (ICompressCoder *)new NCompress::NDeflate::NDecoder::CCOMCoder();
|
||||
}
|
||||
else if (*clsid == CLSID_CCompressDeflateNsisDecoder)
|
||||
{
|
||||
if (!correctInterface)
|
||||
return E_NOINTERFACE;
|
||||
coder = (ICompressCoder *)new NCompress::NDeflate::NDecoder::CNsisCOMCoder();
|
||||
}
|
||||
else if (*clsid == CLSID_CCompressDeflateEncoder)
|
||||
{
|
||||
if (!correctInterface)
|
||||
return E_NOINTERFACE;
|
||||
coder = (ICompressCoder *)new NCompress::NDeflate::NEncoder::CCOMCoder();
|
||||
}
|
||||
else if (*clsid == CLSID_CCompressDeflate64Decoder)
|
||||
{
|
||||
if (!correctInterface)
|
||||
return E_NOINTERFACE;
|
||||
coder = (ICompressCoder *)new NCompress::NDeflate::NDecoder::CCOMCoder64();
|
||||
}
|
||||
else if (*clsid == CLSID_CCompressDeflate64Encoder)
|
||||
{
|
||||
if (!correctInterface)
|
||||
return E_NOINTERFACE;
|
||||
coder = (ICompressCoder *)new NCompress::NDeflate::NEncoder::CCOMCoder64();
|
||||
}
|
||||
else
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
*outObject = coder.Detach();
|
||||
COM_TRY_END
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
struct CDeflateMethodItem
|
||||
{
|
||||
char ID[3];
|
||||
const wchar_t *UserName;
|
||||
const GUID *Decoder;
|
||||
const GUID *Encoder;
|
||||
};
|
||||
|
||||
#define METHOD_ITEM(Name, id, UserName) \
|
||||
{ { 0x04, 0x01, id }, UserName, \
|
||||
&CLSID_CCompress ## Name ## Decoder, \
|
||||
&CLSID_CCompress ## Name ## Encoder }
|
||||
|
||||
#define METHOD_ITEM_DE(Name, id1, id2, UserName) \
|
||||
{ { 0x04, id1, id2 }, UserName, \
|
||||
&CLSID_CCompress ## Name ## Decoder, NULL }
|
||||
|
||||
|
||||
static CDeflateMethodItem g_Methods[] =
|
||||
{
|
||||
METHOD_ITEM(Deflate, 0x08, L"Deflate"),
|
||||
METHOD_ITEM(Deflate64, 0x09, L"Deflate64"),
|
||||
METHOD_ITEM_DE(DeflateNsis, 0x09, 0x01, L"DeflateNSIS")
|
||||
};
|
||||
|
||||
STDAPI GetNumberOfMethods(UINT32 *numMethods)
|
||||
{
|
||||
*numMethods = sizeof(g_Methods) / sizeof(g_Methods[0]);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDAPI GetMethodProperty(UINT32 index, PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
if (index > sizeof(g_Methods) / sizeof(g_Methods[0]))
|
||||
return E_INVALIDARG;
|
||||
VariantClear((tagVARIANT *)value);
|
||||
const CDeflateMethodItem &method = g_Methods[index];
|
||||
switch(propID)
|
||||
{
|
||||
case NMethodPropID::kID:
|
||||
if ((value->bstrVal = ::SysAllocStringByteLen(method.ID,
|
||||
sizeof(method.ID))) != 0)
|
||||
value->vt = VT_BSTR;
|
||||
return S_OK;
|
||||
case NMethodPropID::kName:
|
||||
if ((value->bstrVal = ::SysAllocString(method.UserName)) != 0)
|
||||
value->vt = VT_BSTR;
|
||||
return S_OK;
|
||||
case NMethodPropID::kDecoder:
|
||||
if ((value->bstrVal = ::SysAllocStringByteLen(
|
||||
(const char *)method.Decoder, sizeof(GUID))) != 0)
|
||||
value->vt = VT_BSTR;
|
||||
return S_OK;
|
||||
case NMethodPropID::kEncoder:
|
||||
if (method.Encoder)
|
||||
{
|
||||
if ((value->bstrVal = ::SysAllocStringByteLen(
|
||||
(const char *)method.Encoder, sizeof(GUID))) != 0)
|
||||
value->vt = VT_BSTR;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
PROG = Deflate.dll
|
||||
DEF_FILE = ../Codec.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ -D_ST_MODE
|
||||
CFLAGS = $(CFLAGS) -I ../../../
|
||||
LIBS = $(LIBS) oleaut32.lib
|
||||
|
||||
DEFLATE_OBJS = \
|
||||
COMPRESS_OBJS = \
|
||||
$O\CodecExports.obj \
|
||||
$O\DllExports.obj \
|
||||
|
||||
DEFLATE_OPT_OBJS = \
|
||||
$O\DeflateDecoder.obj \
|
||||
$O\DeflateEncoder.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\Alloc.obj \
|
||||
$O\CRC.obj \
|
||||
$O\DeflateRegister.obj \
|
||||
$O\Deflate64Register.obj \
|
||||
$O\DeflateNsisRegister.obj \
|
||||
|
||||
7ZIP_COMMON_OBJS = \
|
||||
$O\InBuffer.obj \
|
||||
@@ -24,18 +24,19 @@ LZ_OBJS = \
|
||||
$O\LZOutWindow.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\Alloc.obj \
|
||||
$O\7zCrc.obj \
|
||||
$O\Sort.obj \
|
||||
|
||||
C_LZ_OBJS = \
|
||||
$O\MatchFinder.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
$(DEFLATE_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(DEFLATE_OPT_OBJS) \
|
||||
$(COMMON_OBJS) \
|
||||
$(7ZIP_COMMON_OBJS) \
|
||||
$(LZ_OBJS) \
|
||||
$(C_OBJS) \
|
||||
@@ -45,12 +46,10 @@ OBJS = \
|
||||
|
||||
!include "../../../Build.mak"
|
||||
|
||||
$(DEFLATE_OBJS): $(*B).cpp
|
||||
$(COMPRESS_OBJS): ../$(*B).cpp
|
||||
$(COMPL)
|
||||
$(DEFLATE_OPT_OBJS): $(*B).cpp
|
||||
$(COMPL_O2)
|
||||
$(COMMON_OBJS): ../../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(LZ_OBJS): ../LZ/$(*B).cpp
|
||||
@@ -61,3 +60,4 @@ $(C_LZ_OBJS): ../../../../C/Compress/Lz/$(*B).c
|
||||
$(COMPL_O2)
|
||||
$O\HuffmanEncode.obj: ../../../../C/Compress/Huffman/$(*B).c
|
||||
$(COMPL_O2)
|
||||
!include "../../Crc.mak"
|
||||
|
||||
Reference in New Issue
Block a user