This commit is contained in:
Igor Pavlov
2017-04-30 00:00:00 +00:00
committed by Kornel
parent 603abd5528
commit 2efa10565a
442 changed files with 15479 additions and 8525 deletions

View File

@@ -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 ?