This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions

View File

@@ -2,11 +2,9 @@
#include "StdAfx.h"
#include <initguid.h>
#include "Common/MyInitGuid.h"
#include "Common/ComTry.h"
#include "Windows/PropVariant.h"
#include "../../ICoder.h"
#include "../../IPassword.h"
#include "../Common/CodecsPath.h"
@@ -19,46 +17,6 @@ DEFINE_GUID(CLSID_CCrypto_AES128_Decoder,
HINSTANCE g_hInstance;
/*
static bool GetBaseFolderPrefix(TCHAR *path)
{
TCHAR fullPath[MAX_PATH + 1];
if (::GetModuleFileName(g_hInstance, fullPath, MAX_PATH) == 0)
return false;
// fullPath = "7-zip\Format\Rar.dll"
LPTSTR fileNamePointer;
TCHAR p[MAX_PATH + 1];
DWORD needLength = ::GetFullPathName(fullPath, MAX_PATH + 1,
p, &fileNamePointer);
if (needLength == 0 || needLength >= MAX_PATH)
return false;
*fileNamePointer = 0;
// p = "7-zip\Format\"
int len = lstrlen(p);
if (len == 0)
return false;
if (p[len - 1] != '\\')
return false;
p[len - 1] = 0;
// p = "7-zip\Format"
needLength = ::GetFullPathName(p, MAX_PATH + 1,
path, &fileNamePointer);
if (needLength == 0 || needLength >= MAX_PATH)
return false;
// fileNamePointer -> "7-zip\"+
*fileNamePointer = 0;
return true;
}
bool GetCompressFolderPrefix(TCHAR *path)
{
if (!GetBaseFolderPrefix(path))
return false;
lstrcat(path, TEXT("Codecs\\"));
return true;
}
*/
void GetCryptoFolderPrefix(TCHAR *path)
{
CSysString s = GetCodecsFolderPrefix();
@@ -154,6 +112,14 @@ STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value)
case NArchive::kKeepName:
propVariant = false;
break;
case NArchive::kStartSignature:
{
if ((value->bstrVal = ::SysAllocStringByteLen(
(const char *)NArchive::NRar::NHeader::kMarker,
NArchive::NRar::NHeader::kMarkerSize)) != 0)
value->vt = VT_BSTR;
return S_OK;
}
}
propVariant.Detach(value);
return S_OK;