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>2017-04-30 03:00:00 +0300
committerKornel <kornel@geekhood.net>2017-05-05 20:56:20 +0300
commit2efa10565ac395d2ce9a679ead46e70fb2f963eb (patch)
tree84c8df4deb69ec44ea15af9378f24347db55c357 /CPP/7zip/UI/FileManager/FM.cpp
parent603abd5528c97346e9448c0ff47949f818fe558c (diff)
17.0017.00
Diffstat (limited to 'CPP/7zip/UI/FileManager/FM.cpp')
-rw-r--r--CPP/7zip/UI/FileManager/FM.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/CPP/7zip/UI/FileManager/FM.cpp b/CPP/7zip/UI/FileManager/FM.cpp
index ce39011e..fe5ae671 100644
--- a/CPP/7zip/UI/FileManager/FM.cpp
+++ b/CPP/7zip/UI/FileManager/FM.cpp
@@ -8,7 +8,6 @@
#include "../../../../C/Alloc.h"
-#include "../../../Common/IntToString.h"
#include "../../../Common/StringConvert.h"
#include "../../../Common/StringToInt.h"
@@ -43,16 +42,21 @@ using namespace NFind;
#define MENU_HEIGHT 26
bool g_RAM_Size_Defined;
+bool g_LargePagesMode = false;
+bool g_OpenArchive = false;
+
+static bool g_Maximized = false;
+
UInt64 g_RAM_Size;
#ifdef _WIN32
HINSTANCE g_hInstance;
#endif
+
HWND g_HWND;
-bool g_OpenArchive = false;
+
static UString g_MainPath;
static UString g_ArcFormat;
-static bool g_Maximized = false;
// HRESULT LoadGlobalCodecs();
void FreeGlobalCodecs();
@@ -166,7 +170,7 @@ CApp g_App;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
-const wchar_t *kWindowClass = L"FM";
+static const wchar_t * const kWindowClass = L"FM";
#ifdef UNDER_CE
#define WS_OVERLAPPEDWINDOW ( \
@@ -185,7 +189,7 @@ static BOOL InitInstance(int nCmdShow)
// LoadString(hInstance, IDS_CLASS, windowClass, MAX_LOADSTRING);
- UString title = L"7-Zip"; // LangString(IDS_APP_TITLE, 0x03000000);
+ UString title ("7-Zip"); // LangString(IDS_APP_TITLE, 0x03000000);
/*
//If it is already running, then focus on the window
@@ -379,7 +383,7 @@ static void SetMemoryLock()
NSecurity::AddLockMemoryPrivilege();
if (ReadLockMemoryEnable())
- NSecurity::EnablePrivilege_LockMemory();
+ g_LargePagesMode = NSecurity::EnablePrivilege_LockMemory();
}
bool g_SymLink_Supported = false;
@@ -426,8 +430,13 @@ static void ErrorMessage(const wchar_t *s)
MessageBoxW(0, s, L"7-Zip", MB_ICONERROR);
}
+static void ErrorMessage(const char *s)
+{
+ ErrorMessage(GetUnicodeString(s));
+}
+
-#define NT_CHECK_FAIL_ACTION ErrorMessage(L"Unsupported Windows version"); return 1;
+#define NT_CHECK_FAIL_ACTION ErrorMessage("Unsupported Windows version"); return 1;
static int WINAPI WinMain2(int nCmdShow)
{
@@ -667,7 +676,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
}
catch(const AString &s)
{
- ErrorMessage(GetUnicodeString(s));
+ ErrorMessage(s.Ptr());
return 1;
}
catch(const wchar_t *s)
@@ -677,19 +686,19 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
}
catch(const char *s)
{
- ErrorMessage(GetUnicodeString(s));
+ ErrorMessage(s);
return 1;
}
catch(int v)
{
- wchar_t s[32];
- ConvertUInt32ToString(v, s);
- ErrorMessage(UString(L"Error: ") + s);
+ AString e ("Error: ");
+ e.Add_UInt32(v);
+ ErrorMessage(e);
return 1;
}
catch(...)
{
- ErrorMessage(L"Unknown error");
+ ErrorMessage("Unknown error");
return 1;
}
}
@@ -844,7 +853,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (needOpenFile && !archiveIsOpened || res != S_OK)
{
- UString m = L"Error";
+ UString m ("Error");
if (res == S_FALSE || res == S_OK)
{
m = MyFormatNew(encrypted ?