mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
Maybe the last committed patch of year 2014!
[CMD] Enhance the "ver" command, specifying the OS on which cmd.exe runs (that can be different from ReactOS!) and the reported OS version when using the $V prompt format specifier. Patch by Lee Schroeder, with modifications by me, see the report for more details. CORE-8970 #resolve #comment Committed in revision 65924, thanks! svn path=/trunk/; revision=65924
This commit is contained in:
parent
8235a5df62
commit
12af51d23f
23 changed files with 150 additions and 71 deletions
|
@ -163,7 +163,6 @@ BOOL bUnicodeOutput = FALSE;
|
|||
BOOL bDisableBatchEcho = FALSE;
|
||||
BOOL bDelayedExpansion = FALSE;
|
||||
DWORD dwChildProcessId = 0;
|
||||
OSVERSIONINFO osvi;
|
||||
HANDLE hIn;
|
||||
HANDLE hOut;
|
||||
LPTSTR lpOriginalEnvironment;
|
||||
|
@ -1622,9 +1621,8 @@ Initialize()
|
|||
BOOL AlwaysStrip = FALSE;
|
||||
BOOL AutoRun = TRUE;
|
||||
|
||||
/* get version information */
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx (&osvi);
|
||||
/* Get version information */
|
||||
InitOSVersion();
|
||||
|
||||
/* Some people like to run ReactOS cmd.exe on Win98, it helps in the
|
||||
* build process. So don't link implicitly against ntdll.dll, load it
|
||||
|
|
|
@ -65,7 +65,6 @@ extern BOOL bDelayedExpansion;
|
|||
extern INT nErrorLevel;
|
||||
extern SHORT maxx;
|
||||
extern SHORT maxy;
|
||||
extern OSVERSIONINFO osvi;
|
||||
extern BOOL bUnicodeOutput;
|
||||
|
||||
|
||||
|
@ -472,7 +471,8 @@ INT cmd_type (LPTSTR);
|
|||
|
||||
|
||||
/* Prototypes for VER.C */
|
||||
VOID ShortVersion (VOID);
|
||||
VOID InitOSVersion(VOID);
|
||||
VOID PrintOSVersion(VOID);
|
||||
INT cmd_ver (LPTSTR);
|
||||
|
||||
|
||||
|
|
|
@ -522,7 +522,8 @@ title neuer Titel"
|
|||
STRING_REPLACE_ERROR7 "Erweiterter Fehler 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Betriebssystem [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS-Befehlszeileninterpreter\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " läuft in %s"
|
||||
STRING_VERSION_RUNNING_ON "Läuft in: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d Datei(en) kopiert\n"
|
||||
STRING_DELETE_WIPE "sicher gelöscht"
|
||||
STRING_FOR_ERROR "ungültige Variablenangabe."
|
||||
|
|
|
@ -527,7 +527,8 @@ title new title\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Command Line Interpreter\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " running on %s"
|
||||
STRING_VERSION_RUNNING_ON "Running on: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file(s) copied\n"
|
||||
STRING_DELETE_WIPE "wiped"
|
||||
STRING_FOR_ERROR "bad variable specification."
|
||||
|
|
|
@ -523,7 +523,8 @@ title new title\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Command Line Interpreter\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " running on %s"
|
||||
STRING_VERSION_RUNNING_ON "Running on: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file(s) copied\n"
|
||||
STRING_DELETE_WIPE "wiped"
|
||||
STRING_FOR_ERROR "bad variable specification."
|
||||
|
|
|
@ -525,7 +525,8 @@ title Nuevo título\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nIntérprete de comandos de ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " corriendo en %s"
|
||||
STRING_VERSION_RUNNING_ON "Corriendo en: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d archivo(s) copado(s)\n"
|
||||
STRING_DELETE_WIPE "Limpiado"
|
||||
STRING_FOR_ERROR "Especición de variable errónea."
|
||||
|
|
|
@ -537,7 +537,8 @@ titre titre de la fenêtre"
|
|||
STRING_REPLACE_ERROR7 "Erreur étendue 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterpréteur de ligne de commandes ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " tournant sur %s"
|
||||
STRING_VERSION_RUNNING_ON "Fonctionnant sous: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d fichier(s) copié(s)\n"
|
||||
STRING_DELETE_WIPE "effacé(s)"
|
||||
STRING_FOR_ERROR "mauvaise variable spécifiée."
|
||||
|
|
|
@ -507,7 +507,8 @@ title new title\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Parancssor értelmezõ\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " running on %s"
|
||||
STRING_VERSION_RUNNING_ON "Running on: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d állomány másolva\n"
|
||||
STRING_DELETE_WIPE "wiped"
|
||||
STRING_FOR_ERROR "Hibás változó."
|
||||
|
|
|
@ -522,7 +522,8 @@ title judul baru\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterpreter Baris Perintah ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " berjalan pada %s"
|
||||
STRING_VERSION_RUNNING_ON "Berjalan pada: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file di-copy\n"
|
||||
STRING_DELETE_WIPE "dihapus"
|
||||
STRING_FOR_ERROR "spesifikasi variabel tidak baik."
|
||||
|
|
|
@ -533,7 +533,8 @@ titolo il nuovo titolo\n"
|
|||
STRING_REPLACE_ERROR7 "Errore esteso 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterprete di linea di comando di ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " in esecuzione su %s"
|
||||
STRING_VERSION_RUNNING_ON "In esecuzione su: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file copiati\n"
|
||||
STRING_DELETE_WIPE "resi illeggibili"
|
||||
STRING_FOR_ERROR "variabile non valida."
|
||||
|
|
|
@ -530,7 +530,8 @@ RESTORE ウィンドウを元のサイズに戻します。\n\
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Command Line Interpreter\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " running on %s"
|
||||
STRING_VERSION_RUNNING_ON "Running on: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d 個のファイルがコピーされました\n"
|
||||
STRING_DELETE_WIPE "完全に消去されました。"
|
||||
STRING_FOR_ERROR "無効な変数が指定されました。"
|
||||
|
|
|
@ -521,7 +521,8 @@ tittel ny tittel\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operativsystem [Versjon %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Kommandotolk\nVersjon %s %s"
|
||||
STRING_VERSION_RUNVER " kjører på %s"
|
||||
STRING_VERSION_RUNNING_ON "Kjører på: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file(r) kopiert\n"
|
||||
STRING_DELETE_WIPE "slettet"
|
||||
STRING_FOR_ERROR "ugyldig variabel spesifikasjon."
|
||||
|
|
|
@ -527,7 +527,8 @@ title nowy tytuł okna\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32 - Błąd współdzielenia\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operating System [Version %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterpreter linii poleceń ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " działający na %s"
|
||||
STRING_VERSION_RUNNING_ON "Działający na: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d plik(ów) skopiowano\n"
|
||||
STRING_DELETE_WIPE "skasowano"
|
||||
STRING_FOR_ERROR "złe określenie zmiennej."
|
||||
|
|
|
@ -560,7 +560,8 @@ titlu Noul titlu.\n"
|
|||
STRING_REPLACE_ERROR7 "Eroare Extinsă 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS [Versiunea %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterpretorul de comenzi ReactOS\nVersiunea %s %s"
|
||||
STRING_VERSION_RUNVER " operând pe %s"
|
||||
STRING_VERSION_RUNNING_ON "Operând pe: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d fișier(e) copiat(e)\n"
|
||||
STRING_DELETE_WIPE "șters"
|
||||
STRING_FOR_ERROR "specificație de variabilă eronată."
|
||||
|
|
|
@ -532,7 +532,8 @@ RESTORE восстанавливает окно\n\
|
|||
STRING_REPLACE_ERROR7 "Расширенная ошибка 32\n"
|
||||
STRING_REACTOS_VERSION "Операционная система ReactOS [Версия %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nИнтерпретатор командной строки ReactOS\nВерсия %s %s"
|
||||
STRING_VERSION_RUNVER " запущен на %s"
|
||||
STRING_VERSION_RUNNING_ON "Запущен на: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d файл(ов) скопировано\n"
|
||||
STRING_DELETE_WIPE "очищено"
|
||||
STRING_FOR_ERROR "неправильное задание переменной."
|
||||
|
|
|
@ -529,7 +529,8 @@ title new title\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "Operačný systém ReactOS [Verzia %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nInterpréter príkazového riadku systému ReactOS\nVerzia %s %s"
|
||||
STRING_VERSION_RUNVER " running on %s"
|
||||
STRING_VERSION_RUNNING_ON "Running on: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d súbor(ov) skopírovaný(ch)\n"
|
||||
STRING_DELETE_WIPE "wiped"
|
||||
STRING_FOR_ERROR "bad variable specification."
|
||||
|
|
|
@ -527,7 +527,8 @@ title titull i ri\n"
|
|||
STRING_REPLACE_ERROR7 "Error i zgjatur 32\n"
|
||||
STRING_REACTOS_VERSION "Sistemi Operativ ReactOS [Versioni %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Interpretuesi i komandave\nVersioni %s %s"
|
||||
STRING_VERSION_RUNVER " funksionon në %s"
|
||||
STRING_VERSION_RUNNING_ON "Funksionon në: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file(s) copied\n"
|
||||
STRING_DELETE_WIPE "spastruar"
|
||||
STRING_FOR_ERROR "specifikimi i varibleve i keq."
|
||||
|
|
|
@ -521,7 +521,8 @@ tittel ny tittel\n"
|
|||
STRING_REPLACE_ERROR7 "Extended Error 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS Operativsystem [Versjon %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS Kommandotolk\nVersjon %s %s"
|
||||
STRING_VERSION_RUNVER " körs på %s"
|
||||
STRING_VERSION_RUNNING_ON "Körs på: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d file(r) kopiert\n"
|
||||
STRING_DELETE_WIPE "slettet"
|
||||
STRING_FOR_ERROR "ugyldig variabel spesifikasjon."
|
||||
|
|
|
@ -533,7 +533,8 @@ title новий заголовок\n"
|
|||
STRING_REPLACE_ERROR7 "Розширена помилка 32\n"
|
||||
STRING_REACTOS_VERSION "Операцiйна Система ReactOS [Версiя %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nIнтерпретатор командного рядка ReactOS\nVersion %s %s"
|
||||
STRING_VERSION_RUNVER " запущений на %s"
|
||||
STRING_VERSION_RUNNING_ON "Запущений на: "
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d файл(iв) скопiйовано\n"
|
||||
STRING_DELETE_WIPE "витерто"
|
||||
STRING_FOR_ERROR "невiрна специфiкацiя змiнної."
|
||||
|
|
|
@ -492,7 +492,8 @@ RESTORE 恢复窗口\n\
|
|||
STRING_REPLACE_ERROR7 "扩展错误 32\n"
|
||||
STRING_REACTOS_VERSION "ReactOS 操作系统 [版本 %s-%s]\n"
|
||||
STRING_CMD_SHELLINFO "\nReactOS 命令行解释器\n版本 %s %s"
|
||||
STRING_VERSION_RUNVER " 在 %s 上运行"
|
||||
STRING_VERSION_RUNNING_ON "在 上运行"
|
||||
STRING_VERSION_RUNVER "%s [Version %d.%d.%d] %s"
|
||||
STRING_COPY_FILE " %d 个文件已复制\n"
|
||||
STRING_DELETE_WIPE "已擦除"
|
||||
STRING_FOR_ERROR "无效的变量指定。"
|
||||
|
|
|
@ -198,22 +198,7 @@ VOID PrintPrompt(VOID)
|
|||
break;
|
||||
|
||||
case _T('V'):
|
||||
switch (osvi.dwPlatformId)
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS:
|
||||
if (osvi.dwMajorVersion == 4 &&
|
||||
osvi.dwMinorVersion == 1)
|
||||
ConOutPrintf(_T("Windows 98"));
|
||||
else
|
||||
ConOutPrintf(_T("Windows 95"));
|
||||
break;
|
||||
|
||||
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
ConOutPrintf(_T("Windows NT Version %lu.%lu"),
|
||||
osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||
break;
|
||||
}
|
||||
PrintOSVersion();
|
||||
break;
|
||||
|
||||
case _T('_'):
|
||||
|
|
|
@ -196,14 +196,15 @@
|
|||
#define STRING_VERIFY_HELP2 696
|
||||
#define STRING_VERIFY_HELP3 697
|
||||
|
||||
#define STRING_VERSION_HELP1 698
|
||||
#define STRING_VERSION_HELP2 699
|
||||
#define STRING_VERSION_HELP3 700
|
||||
#define STRING_VERSION_HELP4 701
|
||||
#define STRING_VERSION_HELP5 702
|
||||
#define STRING_VERSION_HELP6 703
|
||||
#define STRING_VERSION_HELP7 704
|
||||
#define STRING_VERSION_RUNVER 705
|
||||
#define STRING_VERSION_HELP1 698
|
||||
#define STRING_VERSION_HELP2 699
|
||||
#define STRING_VERSION_HELP3 700
|
||||
#define STRING_VERSION_HELP4 701
|
||||
#define STRING_VERSION_HELP5 702
|
||||
#define STRING_VERSION_HELP6 703
|
||||
#define STRING_VERSION_HELP7 704
|
||||
#define STRING_VERSION_RUNNING_ON 705
|
||||
#define STRING_VERSION_RUNVER 706
|
||||
|
||||
#define STRING_VOL_HELP1 706
|
||||
#define STRING_VOL_HELP2 707
|
||||
|
|
|
@ -25,30 +25,98 @@
|
|||
#include <reactos/buildno.h>
|
||||
#include <reactos/version.h>
|
||||
|
||||
VOID ShortVersion (VOID)
|
||||
OSVERSIONINFO osvi;
|
||||
TCHAR szOSName[50] = _T("");
|
||||
|
||||
|
||||
VOID InitOSVersion(VOID)
|
||||
{
|
||||
OSVERSIONINFO VersionInfo;
|
||||
LONG lResult;
|
||||
HKEY hKey;
|
||||
|
||||
ConOutResPrintf(STRING_CMD_SHELLINFO, _T(KERNEL_RELEASE_STR), _T(KERNEL_VERSION_BUILD_STR));
|
||||
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
/* Get version information */
|
||||
ZeroMemory(&osvi, sizeof(osvi));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osvi);
|
||||
|
||||
memset(VersionInfo.szCSDVersion, 0, sizeof(VersionInfo.szCSDVersion));
|
||||
if (GetVersionEx(&VersionInfo))
|
||||
/* Build OS version string */
|
||||
|
||||
/* Open registry key */
|
||||
lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (lResult == ERROR_SUCCESS)
|
||||
{
|
||||
LPTSTR RosVersion;
|
||||
SIZE_T RosVersionLen;
|
||||
DWORD dwSize, dwType;
|
||||
|
||||
RosVersion = VersionInfo.szCSDVersion + _tcslen(VersionInfo.szCSDVersion) + 1;
|
||||
RosVersionLen = sizeof(VersionInfo.szCSDVersion) / sizeof(VersionInfo.szCSDVersion[0]) -
|
||||
(RosVersion - VersionInfo.szCSDVersion);
|
||||
if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion, _T("ReactOS"), 7))
|
||||
/* Retrieve the ProductName value */
|
||||
dwSize = sizeof(szOSName);
|
||||
lResult = RegQueryValueEx(hKey,
|
||||
_T("ProductName"),
|
||||
NULL,
|
||||
&dwType,
|
||||
(LPBYTE)szOSName,
|
||||
&dwSize);
|
||||
|
||||
/* If we have failed or the data type is unsupported... */
|
||||
if (lResult != ERROR_SUCCESS || dwType != REG_SZ)
|
||||
{
|
||||
ConOutResPrintf(STRING_VERSION_RUNVER, RosVersion);
|
||||
/* ... reserve size for one NULL character only! */
|
||||
dwSize = sizeof(TCHAR);
|
||||
|
||||
/* Set an error code (anything != ERROR_SUCCESS) */
|
||||
lResult = ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* NULL-terminate the string */
|
||||
szOSName[(dwSize / sizeof(TCHAR)) - 1] = _T('\0');
|
||||
|
||||
/* Close the key */
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the registry key somehow doesn't exist or cannot be loaded, then
|
||||
* determine at least whether the version of Windows is either 9x or NT.
|
||||
*/
|
||||
if (lResult != ERROR_SUCCESS)
|
||||
{
|
||||
switch (osvi.dwPlatformId)
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS:
|
||||
{
|
||||
if (osvi.dwMajorVersion == 4)
|
||||
{
|
||||
if (osvi.dwMinorVersion == 0)
|
||||
_tcscpy(szOSName, _T("Windows 95"));
|
||||
else if (osvi.dwMinorVersion == 1)
|
||||
_tcscpy(szOSName, _T("Windows 98"));
|
||||
else if (osvi.dwMinorVersion == 9)
|
||||
_tcscpy(szOSName, _T("Windows ME"));
|
||||
else
|
||||
_tcscpy(szOSName, _T("Windows 9x"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
{
|
||||
_tcscpy(szOSName, _T("Windows NT"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ConOutChar(_T('\n'));
|
||||
}
|
||||
|
||||
/* Print the current OS version, suitable for VER command and PROMPT $V format */
|
||||
VOID PrintOSVersion(VOID)
|
||||
{
|
||||
ConOutResPrintf(STRING_VERSION_RUNVER, szOSName,
|
||||
osvi.dwMajorVersion, osvi.dwMinorVersion,
|
||||
osvi.dwBuildNumber, osvi.szCSDVersion);
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_CMD_VER
|
||||
|
||||
|
@ -61,48 +129,52 @@ INT cmd_ver (LPTSTR param)
|
|||
|
||||
nErrorLevel = 0;
|
||||
|
||||
if (_tcsstr (param, _T("/?")) != NULL)
|
||||
if (_tcsstr(param, _T("/?")) != NULL)
|
||||
{
|
||||
ConOutResPaging(TRUE,STRING_VERSION_HELP1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ShortVersion();
|
||||
ConOutResPrintf(STRING_CMD_SHELLINFO, _T(KERNEL_RELEASE_STR), _T(KERNEL_VERSION_BUILD_STR));
|
||||
ConOutChar(_T('\n'));
|
||||
ConOutResPuts(STRING_VERSION_RUNNING_ON);
|
||||
PrintOSVersion();
|
||||
|
||||
/* Basic copyright notice */
|
||||
if (param[0] != _T('\0'))
|
||||
{
|
||||
ConOutPuts(_T("\n\n"));
|
||||
ConOutPuts(_T("Copyright (C) 1994-1998 Tim Norman and others.\n"));
|
||||
ConOutPuts(_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team\n"));
|
||||
|
||||
for (i = 0; param[i]; i++)
|
||||
{
|
||||
/* skip spaces */
|
||||
/* Skip spaces */
|
||||
if (param[i] == _T(' '))
|
||||
continue;
|
||||
|
||||
if (param[i] == _T('/'))
|
||||
{
|
||||
/* is this a lone '/' ? */
|
||||
/* Is this a lone '/' ? */
|
||||
if (param[i + 1] == 0)
|
||||
{
|
||||
error_invalid_switch (_T(' '));
|
||||
error_invalid_switch(_T(' '));
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_totupper (param[i]) == _T('W'))
|
||||
if (_totupper(param[i]) == _T('W'))
|
||||
{
|
||||
/* Warranty notice */
|
||||
ConOutResPuts(STRING_VERSION_HELP3);
|
||||
}
|
||||
else if (_totupper (param[i]) == _T('R'))
|
||||
else if (_totupper(param[i]) == _T('R'))
|
||||
{
|
||||
/* Redistribution notice */
|
||||
ConOutResPuts(STRING_VERSION_HELP4);
|
||||
}
|
||||
else if (_totupper (param[i]) == _T('C'))
|
||||
else if (_totupper(param[i]) == _T('C'))
|
||||
{
|
||||
/* Developer listing */
|
||||
ConOutResPuts(STRING_VERSION_HELP6);
|
||||
|
@ -112,12 +184,17 @@ INT cmd_ver (LPTSTR param)
|
|||
}
|
||||
else
|
||||
{
|
||||
error_invalid_switch ((TCHAR)_totupper (param[i]));
|
||||
error_invalid_switch(_totupper(param[i]));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Bug report notice */
|
||||
ConOutResPuts(STRING_VERSION_HELP5);
|
||||
}
|
||||
|
||||
ConOutChar(_T('\n'));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue