Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Compress/Deflate/DllExports.cpp')
-rwxr-xr-x7zip/Compress/Deflate/DllExports.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/7zip/Compress/Deflate/DllExports.cpp b/7zip/Compress/Deflate/DllExports.cpp
index 9cac0523..cbfc8f44 100755
--- a/7zip/Compress/Deflate/DllExports.cpp
+++ b/7zip/Compress/Deflate/DllExports.cpp
@@ -25,6 +25,11 @@ DEFINE_GUID(CLSID_CCompressDeflateEncoder,
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*/)
{
@@ -43,6 +48,12 @@ STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
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)
@@ -81,11 +92,16 @@ struct CDeflateMethodItem
&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(Deflate, 0x08, L"Deflate"),
+ METHOD_ITEM(Deflate64, 0x09, L"Deflate64"),
+ METHOD_ITEM_DE(DeflateNsis, 0x09, 0x01, L"DeflateNSIS")
};
STDAPI GetNumberOfMethods(UINT32 *numMethods)
@@ -117,9 +133,12 @@ STDAPI GetMethodProperty(UINT32 index, PROPID propID, PROPVARIANT *value)
value->vt = VT_BSTR;
return S_OK;
case NMethodPropID::kEncoder:
- if ((value->bstrVal = ::SysAllocStringByteLen(
+ if (method.Encoder)
+ {
+ if ((value->bstrVal = ::SysAllocStringByteLen(
(const char *)method.Encoder, sizeof(GUID))) != 0)
value->vt = VT_BSTR;
+ }
return S_OK;
}
return S_OK;