4.24 beta

This commit is contained in:
Igor Pavlov
2005-07-05 00:00:00 +00:00
committed by Kornel Lesiński
parent ac2b563958
commit 47f4915611
66 changed files with 757 additions and 366 deletions

View File

@@ -46,7 +46,7 @@ CEnumFormatEtc::CEnumFormatEtc(const FORMATETC *pFormatEtc, ULONG numFormats)
if(m_Formats)
{
m_NumFormats = numFormats;
for(int i = 0; i < numFormats; i++)
for(ULONG i = 0; i < numFormats; i++)
DeepCopyFormatEtc(&m_Formats[i], &pFormatEtc[i]);
}
}

View File

@@ -133,12 +133,12 @@ bool CFSFolder::LoadComments()
UInt64 length;
if (!file.GetLength(length))
return false;
if (length >= 0xFFFFFFF)
if (length >= (1 << 28))
return false;
AString s;
char *p = s.GetBuffer((size_t)length + 1);
UINT32 processedSize;
file.Read(p, length, processedSize);
file.Read(p, (UInt32)length, processedSize);
p[length] = 0;
s.ReleaseBuffer();
s.Replace("\r\n", "\n");

View File

@@ -38,5 +38,11 @@ STDMETHOD_(ULONG, Release)() { InterlockedDecrement((LONG *)&__m_RefCount); if (
MY_QUERYINTERFACE_ENTRY(i2) \
)
#define MY_UNKNOWN_IMP3_MT(i1, i2, i3) MY_UNKNOWN_IMP_SPEC_MT2( \
i1, \
MY_QUERYINTERFACE_ENTRY(i1) \
MY_QUERYINTERFACE_ENTRY(i2) \
MY_QUERYINTERFACE_ENTRY(i3) \
)
#endif

View File

@@ -321,7 +321,7 @@ public:
CItemProperties _properties;
CItemProperties _visibleProperties;
int _sortID;
PROPID _sortID;
// int _sortIndex;
bool _ascending;

View File

@@ -235,14 +235,10 @@ static bool CopyNamesToHGlobal(NMemory::CGlobal &hgDrop, const CSysStringVector
{
const CSysString &s = names[i];
int fullLength = s.Length() + 1;
if (fullLength > totalLength)
return false; // error: name was changed!
lstrcpy(p, s);
p += fullLength;
totalLength -= fullLength;
}
if (totalLength == 0)
return false;
*p = 0;
return true;
}

View File

@@ -7,6 +7,7 @@
#include "Common/StringConvert.h"
#include "Common/Random.h"
#include "Common/StringConvert.h"
#include "Common/AutoPtr.h"
#include "Windows/FileDir.h"
#include "Windows/FileFind.h"
@@ -315,8 +316,9 @@ public:
static DWORD WINAPI MyThreadFunction(void *param)
{
// CTmpProcessInfo *tmpProcessInfo = (CTmpProcessInfo *)param;
std::auto_ptr<CTmpProcessInfo> tmpProcessInfo((CTmpProcessInfo *)param);
CMyAutoPtr<CTmpProcessInfo> tmpProcessInfoPtr((CTmpProcessInfo *)param);
CTmpProcessInfo *tmpProcessInfo = tmpProcessInfoPtr.get();
HANDLE hProcess = tmpProcessInfo->ProcessHandle;
HANDLE events[2] = { g_ExitEventLauncher._exitEvent, hProcess};
DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
@@ -337,7 +339,7 @@ static DWORD WINAPI MyThreadFunction(void *param)
0x03020280, tmpProcessInfo->ItemName);
if (::MessageBoxW(g_HWND, message, L"7-Zip", MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
{
if (SendMessage(tmpProcessInfo->Window, kOpenItemChanged, 0, (LONG_PTR)tmpProcessInfo.get()) != 1)
if (SendMessage(tmpProcessInfo->Window, kOpenItemChanged, 0, (LONG_PTR)tmpProcessInfo) != 1)
{
::MessageBoxW(g_HWND, MyFormatNew(IDS_CANNOT_UPDATE_FILE,
0x03020281, GetUnicodeString(tmpProcessInfo->FilePath)), L"7-Zip", MB_OK | MB_ICONSTOP);
@@ -386,7 +388,8 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
UString tempFilePath = tempDirNorm + name;
std::auto_ptr<CTmpProcessInfo> tmpProcessInfo(new CTmpProcessInfo());
CMyAutoPtr<CTmpProcessInfo> tmpProcessInfoPtr(new CTmpProcessInfo());
CTmpProcessInfo *tmpProcessInfo = tmpProcessInfoPtr.get();
tmpProcessInfo->FolderPath = tempDir;
tmpProcessInfo->FilePath = tempFilePath;
if (!NFind::FindFile(tempFilePath, tmpProcessInfo->FileInfo))
@@ -422,10 +425,10 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
tmpProcessInfo->ProcessHandle = hProcess;
CThread thread;
if (!thread.Create(MyThreadFunction, tmpProcessInfo.get()))
if (!thread.Create(MyThreadFunction, tmpProcessInfo))
throw 271824;
tempDirectory.DisableDeleting();
tmpProcessInfo.release();
tmpProcessInfoPtr.release();
tmpProcessInfoRelease._needDelete = false;
}

View File

@@ -98,8 +98,8 @@ void CPanel::InitColumns()
UINT32 numProperties;
enumProperties->GetNumberOfProperties(&numProperties);
UINT32 i;
for (i = 0; i < numProperties; i++)
int i;
for (i = 0; i < (int)numProperties; i++)
{
CMyComBSTR name;
PROPID propID;
@@ -360,7 +360,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos,
// OutputDebugStringA("S1\n");
for(int i = 0; i < numItems; i++)
for(UInt32 i = 0; i < numItems; i++)
{
UString itemName = GetItemName(i);
if (itemName.CompareNoCase(focusedName) == 0)

View File

@@ -260,12 +260,12 @@ bool CPanel::OnNotifyList(LPNMHDR header, LRESULT &result)
case NM_CUSTOMDRAW:
return OnCustomDraw((LPNMLVCUSTOMDRAW)header, result);
case LVN_BEGINDRAG:
case LVN_BEGINRDRAG:
{
OnDrag((LPNMLISTVIEW)header);
RefreshStatusBar();
break;
}
// case LVN_BEGINRDRAG:
}
return false;
}

View File

@@ -63,7 +63,7 @@ void CPanel::CreateShellContextMenu(
CMyComPtr<IContextMenu> &systemContextMenu)
{
systemContextMenu.Release();
UString folderPath = GetUnicodeString(_currentFolderPrefix);
UString folderPath = _currentFolderPrefix;
CMyComPtr<IShellFolder> desktopFolder;
::SHGetDesktopFolder(&desktopFolder);
@@ -255,18 +255,14 @@ void CPanel::CreateSevenZipMenu(HMENU menuSpec,
// menu.CreatePopup();
bool sevenZipMenuCreated = false;
UString currentFolderUnicode;
UString folder = GetUnicodeString(_currentFolderPrefix);
CSysString currentFolderSys = GetSystemString(_currentFolderPrefix);
CMyComPtr<IContextMenu> contextMenu;
if (contextMenu.CoCreateInstance(CLSID_CZipContextMenu, IID_IContextMenu) == S_OK)
{
CMyComPtr<IInitContextMenu> initContextMenu;
if (contextMenu.QueryInterface(IID_IInitContextMenu,
&initContextMenu) != S_OK)
if (contextMenu.QueryInterface(IID_IInitContextMenu, &initContextMenu) != S_OK)
return;
currentFolderUnicode = GetUnicodeString(_currentFolderPrefix);;
UString currentFolderUnicode = _currentFolderPrefix;
UStringVector names;
for(int i = 0; i < operatedIndices.Size(); i++)
names.Add(currentFolderUnicode + GetItemName(operatedIndices[i]));
@@ -274,13 +270,12 @@ void CPanel::CreateSevenZipMenu(HMENU menuSpec,
for(i = 0; i < operatedIndices.Size(); i++)
namePointers.Add(names[i]);
::SetCurrentDirectory(::GetSystemString(_currentFolderPrefix));
if (initContextMenu->InitContextMenu(folder, &namePointers.Front(),
// NFile::NDirectory::MySetCurrentDirectory(currentFolderUnicode);
if (initContextMenu->InitContextMenu(currentFolderUnicode, &namePointers.Front(),
operatedIndices.Size()) == S_OK)
{
HRESULT res = contextMenu->QueryContextMenu(menu, 0,
kSevenZipStartMenuID,
kSystemStartMenuID - 1, 0);
HRESULT res = contextMenu->QueryContextMenu(menu, 0, kSevenZipStartMenuID,
kSystemStartMenuID - 1, 0);
sevenZipMenuCreated = (HRESULT_SEVERITY(res) == SEVERITY_SUCCESS);
if (sevenZipMenuCreated)
sevenZipContextMenu = contextMenu;
@@ -341,7 +336,7 @@ bool CPanel::InvokePluginCommand(int id,
commandInfo.lpTitle = "";
commandInfo.lpVerbW = LPCWSTR(offset);
commandInfo.lpParameters = NULL;
UString currentFolderUnicode = GetUnicodeString(_currentFolderPrefix);;
UString currentFolderUnicode = _currentFolderPrefix;
commandInfo.lpDirectoryW = currentFolderUnicode;
commandInfo.lpTitleW = L"";
// commandInfo.ptInvoke.x = xPos;

View File

@@ -144,7 +144,7 @@ void CPanel::SelectByType(bool selectMode)
UINT32 numItems;
_folder->GetNumberOfItems(&numItems);
if (_selectedStatusVector.Size() != numItems)
if ((UInt32)_selectedStatusVector.Size() != numItems)
throw 11111;
if (isItemFolder)

View File

@@ -83,7 +83,7 @@ BEGIN
PUSHBUTTON "Support",IDC_ABOUT_BUTTON_EMAIL,136,30,94,14
PUSHBUTTON "Register",IDC_ABOUT_BUTTON_REGISTER,136,53,94,14
ICON IDI_LOGO,IDC_STATIC,7,7,20,20,SS_REALSIZEIMAGE
LTEXT "7-Zip 4.23",IDC_STATIC,7,54,119,9
LTEXT "7-Zip 4.24 beta",IDC_STATIC,7,54,119,9
LTEXT "Copyright (c) 1999-2005 Igor Pavlov",IDC_STATIC,7,67,
119,17
LTEXT "7-Zip is free software. However, you can support development of 7-Zip by registering.",

View File

@@ -244,7 +244,7 @@ static UInt64 GetMemoryUsage(UInt32 dictionary)
UInt32 CBenchmarkDialog::OnChangeDictionary()
{
UInt64 dictionary = m_Dictionary.GetItemData(m_Dictionary.GetCurSel());
UInt32 dictionary = (UInt32)m_Dictionary.GetItemData(m_Dictionary.GetCurSel());
UInt64 memUsage = GetMemoryUsage(dictionary);
memUsage = (memUsage + (1 << 20) - 1) >> 20;
TCHAR s[40];

View File

@@ -16,26 +16,8 @@
#include <tchar.h>
#include <shlwapi.h>
/*
// #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <ComDef.h>
#include <stdio.h>
#include <windows.h>
#include <Commctrl.h>
#include <shellapi.h>
#include <mbstring.h>
#include <new.h>
#include <regstr.h>
*/
#include <memory>
#include "Common/NewHandler.h"
#endif

View File

@@ -82,8 +82,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,23,0,0
PRODUCTVERSION 4,23,0,0
FILEVERSION 4,24,0,0
PRODUCTVERSION 4,24,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -101,14 +101,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov\0"
VALUE "FileDescription", "7-Zip File Manager\0"
VALUE "FileVersion", "4, 23, 0, 0\0"
VALUE "FileVersion", "4, 24, 0, 0\0"
VALUE "InternalName", "7zFM\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2005 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "7zFM.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "4, 23, 0, 0\0"
VALUE "ProductVersion", "4, 24, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END