9.06 beta

This commit is contained in:
Igor Pavlov
2009-08-17 00:00:00 +00:00
committed by Kornel Lesiński
parent 829409452d
commit c99f3ebdd6
445 changed files with 15246 additions and 8133 deletions

View File

@@ -2,85 +2,54 @@
#include "StdAfx.h"
// #include <locale.h>
#include "Common/MyException.h"
#include "Common/StdOutStream.h"
#include "Windows/Error.h"
#include "Windows/NtCheck.h"
#include "Common/StdOutStream.h"
#include "Common/NewHandler.h"
#include "Common/MyException.h"
#include "Common/StringConvert.h"
#include "../Common/ExitCode.h"
#include "../Common/ArchiveCommandLine.h"
#include "../Common/ExitCode.h"
#include "ConsoleClose.h"
using namespace NWindows;
CStdOutStream *g_StdStream = 0;
#ifdef _WIN32
#ifndef _UNICODE
bool g_IsNT = false;
#endif
#if !defined(_UNICODE) || !defined(_WIN64)
static inline bool IsItWindowsNT()
{
OSVERSIONINFO versionInfo;
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
if (!::GetVersionEx(&versionInfo))
return false;
return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
}
#endif
#endif
extern int Main2(
#ifndef _WIN32
int numArguments, const char *arguments[]
int numArgs, const char *args[]
#endif
);
static const char *kExceptionErrorMessage = "\n\nError:\n";
static const char *kUserBreak = "\nBreak signaled\n";
static const char *kMemoryExceptionMessage = "\n\nERROR: Can't allocate required memory!\n";
static const char *kUnknownExceptionMessage = "\n\nUnknown Error\n";
static const char *kInternalExceptionMessage = "\n\nInternal Error #";
#define NT_CHECK_FAIL_ACTION (*g_StdStream) << "Unsupported Windows version"; return NExitCode::kFatalError;
int MY_CDECL main
(
#ifndef _WIN32
int numArguments, const char *arguments[]
#endif
#ifndef _WIN32
int numArgs, const char *args[]
#endif
)
{
g_StdStream = &g_StdOut;
#ifdef _WIN32
#ifdef _UNICODE
#ifndef _WIN64
if (!IsItWindowsNT())
{
(*g_StdStream) << "This program requires Windows NT/2000/2003/2008/XP/Vista";
return NExitCode::kFatalError;
}
#endif
#else
g_IsNT = IsItWindowsNT();
#endif
#endif
// setlocale(LC_COLLATE, ".OCP");
NT_CHECK
NConsoleClose::CCtrlHandlerSetter ctrlHandlerSetter;
int res = 0;
try
{
res = Main2(
#ifndef _WIN32
numArguments, arguments
#endif
#ifndef _WIN32
numArgs, args
#endif
);
}
catch(const CNewException &)
@@ -112,8 +81,7 @@ int numArguments, const char *arguments[]
}
UString message;
NError::MyFormatMessage(systemError.ErrorCode, message);
(*g_StdStream) << endl << endl << "System error:" << endl <<
message << endl;
(*g_StdStream) << endl << endl << "System error:" << endl << message << endl;
return (NExitCode::kFatalError);
}
catch(NExitCode::EEnum &exitCode)