This commit is contained in:
Igor Pavlov
2008-12-31 00:00:00 +00:00
committed by Kornel Lesiński
parent c1f1243a70
commit 3a524e5ba2
259 changed files with 2792 additions and 4855 deletions

View File

@@ -2,9 +2,12 @@
#include "StdAfx.h"
#include "MethodProps.h"
#include "../../Common/MyCom.h"
#include "../ICoder.h"
#include "MethodProps.h"
static UInt64 k_LZMA = 0x030101;
// static UInt64 k_LZMA2 = 0x030102;
@@ -35,24 +38,24 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
}
{
int numProperties = method.Properties.Size();
int numProps = method.Props.Size();
CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
if (setCoderProperties == NULL)
{
if (numProperties != 0)
if (numProps != 0)
return E_INVALIDARG;
}
else
{
CRecordVector<PROPID> propIDs;
NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProperties];
NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProps];
HRESULT res = S_OK;
try
{
for (int i = 0; i < numProperties; i++)
for (int i = 0; i < numProps; i++)
{
const CProp &prop = method.Properties[i];
const CProp &prop = method.Props[i];
propIDs.Add(prop.Id);
NWindows::NCOM::CPropVariant &value = values[i];
value = prop.Value;
@@ -65,7 +68,7 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
}
CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProperties);
res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProps);
}
catch(...)
{