diff options
Diffstat (limited to '7zip/Compress/LZMA/DllExports.cpp')
-rwxr-xr-x | 7zip/Compress/LZMA/DllExports.cpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/7zip/Compress/LZMA/DllExports.cpp b/7zip/Compress/LZMA/DllExports.cpp deleted file mode 100755 index 92260f9b..00000000 --- a/7zip/Compress/LZMA/DllExports.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// DLLExports.cpp - -#include "StdAfx.h" - -#include "../../../Common/MyInitGuid.h" -#include "../../../Common/ComTry.h" -#ifdef _WIN32 -#include "../../../Common/Alloc.h" -#endif - -#include "LZMAEncoder.h" -#include "LZMADecoder.h" -// #include "../../../Common/CRC.h" - -// {23170F69-40C1-278B-0301-010000000000} -DEFINE_GUID(CLSID_CLZMADecoder, -0x23170F69, 0x40C1, 0x278B, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00); - -// {23170F69-40C1-278B-0301-010000000100} -DEFINE_GUID(CLSID_CLZMAEncoder, -0x23170F69, 0x40C1, 0x278B, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00); - -extern "C" -BOOL WINAPI DllMain(HINSTANCE /* hInstance */, DWORD dwReason, LPVOID /*lpReserved*/) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - // NCompress::NRangeCoder::g_PriceTables.Init(); - // CCRC::InitTable(); - #ifdef _WIN32 - SetLargePageSize(); - #endif - } - return TRUE; -} - -STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject) -{ - // NCompress::NRangeCoder::g_PriceTables.Init(); - // CCRC::InitTable(); - COM_TRY_BEGIN - *outObject = 0; - int correctInterface = (*iid == IID_ICompressCoder); - CMyComPtr<ICompressCoder> coder; - if (*clsid == CLSID_CLZMADecoder) - { - if (!correctInterface) - return E_NOINTERFACE; - coder = (ICompressCoder *)new NCompress::NLZMA::CDecoder(); - } - else if (*clsid == CLSID_CLZMAEncoder) - { - if (!correctInterface) - return E_NOINTERFACE; - coder = (ICompressCoder *)new NCompress::NLZMA::CEncoder(); - } - else - return CLASS_E_CLASSNOTAVAILABLE; - *outObject = coder.Detach(); - COM_TRY_END - return S_OK; -} - -STDAPI GetNumberOfMethods(UINT32 *numMethods) -{ - *numMethods = 1; - return S_OK; -} - -STDAPI GetMethodProperty(UINT32 index, PROPID propID, PROPVARIANT *value) -{ - if (index != 0) - return E_INVALIDARG; - // ::VariantClear((tagVARIANT *)value); - switch(propID) - { - case NMethodPropID::kID: - { - const char id[] = { 0x03, 0x01, 0x01 }; - if ((value->bstrVal = ::SysAllocStringByteLen(id, sizeof(id))) != 0) - value->vt = VT_BSTR; - return S_OK; - } - case NMethodPropID::kName: - if ((value->bstrVal = ::SysAllocString(L"LZMA")) != 0) - value->vt = VT_BSTR; - return S_OK; - case NMethodPropID::kDecoder: - if ((value->bstrVal = ::SysAllocStringByteLen( - (const char *)&CLSID_CLZMADecoder, sizeof(GUID))) != 0) - value->vt = VT_BSTR; - return S_OK; - case NMethodPropID::kEncoder: - if ((value->bstrVal = ::SysAllocStringByteLen( - (const char *)&CLSID_CLZMAEncoder, sizeof(GUID))) != 0) - value->vt = VT_BSTR; - return S_OK; - } - return S_OK; -} - |