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:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2007-05-25 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:51 +0300
commitc574fc0f4bba94e693b0e22f730d355b75d4f4ce (patch)
treeda4ebd90c776d508ac679d50492f29461db80be0 /CPP/7zip/FileManager
parenta145bfc7cf17f7bbcfae8f0064333c8ea75b455c (diff)
4.46 beta
Diffstat (limited to 'CPP/7zip/FileManager')
-rwxr-xr-xCPP/7zip/FileManager/FM.dsp9
-rwxr-xr-xCPP/7zip/FileManager/PanelCopy.cpp14
-rwxr-xr-xCPP/7zip/FileManager/PanelCrc.cpp8
-rwxr-xr-xCPP/7zip/FileManager/PanelItemOpen.cpp14
-rwxr-xr-xCPP/7zip/FileManager/PanelOperations.cpp6
-rwxr-xr-xCPP/7zip/FileManager/PanelSplitFile.cpp12
-rwxr-xr-xCPP/7zip/FileManager/RegistryUtils.cpp4
-rwxr-xr-xCPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h5
-rwxr-xr-xCPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h5
-rwxr-xr-xCPP/7zip/FileManager/makefile3
10 files changed, 49 insertions, 31 deletions
diff --git a/CPP/7zip/FileManager/FM.dsp b/CPP/7zip/FileManager/FM.dsp
index f84d19d1..5265a961 100755
--- a/CPP/7zip/FileManager/FM.dsp
+++ b/CPP/7zip/FileManager/FM.dsp
@@ -680,6 +680,15 @@ SOURCE=..\..\..\C\Sort.c
SOURCE=..\..\..\C\Sort.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\C\Threads.h
+# End Source File
# End Group
# Begin Group "Windows"
diff --git a/CPP/7zip/FileManager/PanelCopy.cpp b/CPP/7zip/FileManager/PanelCopy.cpp
index 4b62b878..88a6a669 100755
--- a/CPP/7zip/FileManager/PanelCopy.cpp
+++ b/CPP/7zip/FileManager/PanelCopy.cpp
@@ -41,7 +41,7 @@ struct CThreadExtractInArchive2
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadExtractInArchive2 *)param)->Extract();
}
@@ -84,9 +84,8 @@ HRESULT CPanel::CopyTo(const CRecordVector<UInt32> &indices, const UString &fold
extracter.FolderOperations = folderOperations;
extracter.MoveMode = moveMode;
- CThread extractThread;
- if (!extractThread.Create(CThreadExtractInArchive2::MyThreadFunction, &extracter))
- throw 271824;
+ NWindows::CThread extractThread;
+ RINOK(extractThread.Create(CThreadExtractInArchive2::MyThreadFunction, &extracter));
extracter.ExtractCallbackSpec->StartProgressDialog(title);
if (messages != 0)
@@ -118,7 +117,7 @@ struct CThreadUpdate
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadUpdate *)param)->Process();
}
@@ -161,9 +160,8 @@ HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &fileP
for(i = 0; i < updater.FileNames.Size(); i++)
updater.FileNamePointers.Add(updater.FileNames[i]);
- CThread thread;
- if (!thread.Create(CThreadUpdate::MyThreadFunction, &updater))
- throw 271824;
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadUpdate::MyThreadFunction, &updater));
updater.UpdateCallbackSpec->StartProgressDialog(title);
if (messages != 0)
diff --git a/CPP/7zip/FileManager/PanelCrc.cpp b/CPP/7zip/FileManager/PanelCrc.cpp
index 7a190840..5e49390f 100755
--- a/CPP/7zip/FileManager/PanelCrc.cpp
+++ b/CPP/7zip/FileManager/PanelCrc.cpp
@@ -253,7 +253,7 @@ struct CThreadCrc
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadCrc *)param)->Process();
}
@@ -303,9 +303,9 @@ void CApp::CalculateCrc()
progressDialog.MainTitle = progressWindowTitle;
progressDialog.MainAddTitle = title + UString(L" ");
- CThread thread;
- if (!thread.Create(CThreadCrc::MyThreadFunction, &combiner))
- throw 271824;
+ NWindows::CThread thread;
+ if (thread.Create(CThreadCrc::MyThreadFunction, &combiner) != S_OK)
+ return;
progressDialog.Create(title, _window);
if (combiner.Result != S_OK)
diff --git a/CPP/7zip/FileManager/PanelItemOpen.cpp b/CPP/7zip/FileManager/PanelItemOpen.cpp
index be2d9024..25de271a 100755
--- a/CPP/7zip/FileManager/PanelItemOpen.cpp
+++ b/CPP/7zip/FileManager/PanelItemOpen.cpp
@@ -380,12 +380,16 @@ public:
class CExitEventLauncher
{
public:
- CManualResetEvent _exitEvent;
- CExitEventLauncher(): _exitEvent(false) {};
+ NWindows::NSynchronization::CManualResetEvent _exitEvent;
+ CExitEventLauncher()
+ {
+ if (_exitEvent.Create(false) != S_OK)
+ throw 9387173;
+ };
~CExitEventLauncher() { _exitEvent.Set(); }
} g_ExitEventLauncher;
-static DWORD WINAPI MyThreadFunction(void *param)
+static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
CMyAutoPtr<CTmpProcessInfo> tmpProcessInfoPtr((CTmpProcessInfo *)param);
CTmpProcessInfo *tmpProcessInfo = tmpProcessInfoPtr.get();
@@ -502,8 +506,8 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
tmpProcessInfo->ItemName = name;
tmpProcessInfo->ProcessHandle = hProcess;
- CThread thread;
- if (!thread.Create(MyThreadFunction, tmpProcessInfo))
+ NWindows::CThread thread;
+ if (thread.Create(MyThreadFunction, tmpProcessInfo) != S_OK)
throw 271824;
tempDirectory.DisableDeleting();
tmpProcessInfoPtr.release();
diff --git a/CPP/7zip/FileManager/PanelOperations.cpp b/CPP/7zip/FileManager/PanelOperations.cpp
index 66993f39..40c03c13 100755
--- a/CPP/7zip/FileManager/PanelOperations.cpp
+++ b/CPP/7zip/FileManager/PanelOperations.cpp
@@ -45,7 +45,7 @@ struct CThreadDelete
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadDelete *)param)->Process();
}
@@ -211,8 +211,8 @@ void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices)
deleter.FolderOperations = folderOperations;
deleter.Indices = indices;
- CThread thread;
- if (!thread.Create(CThreadDelete::MyThreadFunction, &deleter))
+ NWindows::CThread thread;
+ if (thread.Create(CThreadDelete::MyThreadFunction, &deleter) != S_OK)
throw 271824;
deleter.UpdateCallbackSpec->StartProgressDialog(progressTitle);
diff --git a/CPP/7zip/FileManager/PanelSplitFile.cpp b/CPP/7zip/FileManager/PanelSplitFile.cpp
index 7d4309d8..ac06623b 100755
--- a/CPP/7zip/FileManager/PanelSplitFile.cpp
+++ b/CPP/7zip/FileManager/PanelSplitFile.cpp
@@ -181,7 +181,7 @@ struct CThreadSplit
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadSplit *)param)->Process();
}
@@ -280,8 +280,8 @@ void CApp::Split()
// CPanel::CDisableTimerProcessing disableTimerProcessing1(srcPanel);
// CPanel::CDisableTimerProcessing disableTimerProcessing2(destPanel);
- CThread thread;
- if (!thread.Create(CThreadSplit::MyThreadFunction, &spliter))
+ NWindows::CThread thread;
+ if (thread.Create(CThreadSplit::MyThreadFunction, &spliter) != S_OK)
throw 271824;
progressDialog.Create(title, _window);
@@ -395,7 +395,7 @@ struct CThreadCombine
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadCombine *)param)->Process();
}
@@ -467,8 +467,8 @@ void CApp::Combine()
// CPanel::CDisableTimerProcessing disableTimerProcessing1(srcPanel);
// CPanel::CDisableTimerProcessing disableTimerProcessing2(destPanel);
- CThread thread;
- if (!thread.Create(CThreadCombine::MyThreadFunction, &combiner))
+ NWindows::CThread thread;
+ if (thread.Create(CThreadCombine::MyThreadFunction, &combiner) != S_OK)
throw 271824;
progressDialog.Create(title, _window);
diff --git a/CPP/7zip/FileManager/RegistryUtils.cpp b/CPP/7zip/FileManager/RegistryUtils.cpp
index 22869c46..e9c13d19 100755
--- a/CPP/7zip/FileManager/RegistryUtils.cpp
+++ b/CPP/7zip/FileManager/RegistryUtils.cpp
@@ -10,7 +10,7 @@ using namespace NRegistry;
static const TCHAR *kCUBasePath = TEXT("Software\\7-ZIP");
static const TCHAR *kCU_FMPath = TEXT("Software\\7-ZIP\\FM");
-static const TCHAR *kLM_Path = TEXT("Software\\7-ZIP\\FM");
+// static const TCHAR *kLM_Path = TEXT("Software\\7-ZIP\\FM");
static const WCHAR *kLangValueName = L"Lang";
static const WCHAR *kEditor = L"Editor";
@@ -21,7 +21,7 @@ static const TCHAR *kShowSystemMenu = TEXT("ShowSystemMenu");
static const TCHAR *kFullRow = TEXT("FullRow");
static const TCHAR *kShowGrid = TEXT("ShowGrid");
static const TCHAR *kAlternativeSelection = TEXT("AlternativeSelection");
-static const TCHAR *kLockMemoryAdd = TEXT("LockMemoryAdd");
+// static const TCHAR *kLockMemoryAdd = TEXT("LockMemoryAdd");
static const TCHAR *kLargePagesEnable = TEXT("LargePages");
// static const TCHAR *kSingleClick = TEXT("SingleClick");
// static const TCHAR *kUnderline = TEXT("Underline");
diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h b/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h
index e11ffc51..07f0d859 100755
--- a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h
+++ b/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h
@@ -105,7 +105,10 @@ public:
#ifndef _SFX
,MainWindow(0)
#endif
- {}
+ {
+ if (_dialogCreatedEvent.Create() != S_OK)
+ throw 1334987;
+ }
void WaitCreating() { _dialogCreatedEvent.Lock(); }
diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h b/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h
index 0625eadd..cd53c76e 100755
--- a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h
+++ b/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h
@@ -163,7 +163,10 @@ public:
#ifndef _SFX
,MainWindow(0)
#endif
- {}
+ {
+ if (_dialogCreatedEvent.Create() != S_OK)
+ throw 1334987;
+ }
void WaitCreating() { _dialogCreatedEvent.Lock(); }
diff --git a/CPP/7zip/FileManager/makefile b/CPP/7zip/FileManager/makefile
index da745fe2..3a15cf2e 100755
--- a/CPP/7zip/FileManager/makefile
+++ b/CPP/7zip/FileManager/makefile
@@ -108,8 +108,9 @@ UI_COMMON_OBJS = \
$O\PropIDUtils.obj \
C_OBJS = \
- $O\Sort.obj \
$O\Alloc.obj \
+ $O\Sort.obj \
+ $O\Threads.obj \
!include "../Crc2.mak"