diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-01-04 10:18:42 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-01-04 10:18:42 +0000 |
commit | 62502d68f369a41d40da080c5674e29a59c40e7c (patch) | |
tree | 0f4a66bc966e4ab31e4aacd73a6a076c49348add | |
parent | 703b273472bdd92a604178918e6782c427cfda72 (diff) |
BUILD : 1.7.20 (1330) BUGS : 815 NOTES : Applied patch by Trystan to properly detect Windows Vista and Windows Server 2008
git-svn-id: svn://svn.anope.org/anope/trunk@1330 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1046 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | Config.bat | 3 | ||||
-rw-r--r-- | docs/WIN32.txt | 2 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/misc.c | 38 | ||||
-rw-r--r-- | version.log | 6 |
6 files changed, 47 insertions, 8 deletions
@@ -3,6 +3,8 @@ Anope Version S V N 12/30 F Grouped root nicks could result in loss of power when using MySQL.[#812] 01/01 F Databases not being saved on quit caused by connection error. [#811] +Provided by Trystan <trystan@nomadirc.net> - 2008 +01/04 F Detection of Windows Vista and Windows Server 2008. [#815] Anope Version 1.7.20 -------------------- diff --git a/Config.bat b/Config.bat new file mode 100644 index 000000000..96501a98c --- /dev/null +++ b/Config.bat @@ -0,0 +1,3 @@ +@echo off
+cscript /nologo install.js
+
diff --git a/docs/WIN32.txt b/docs/WIN32.txt index 828a4f056..fb88847d3 100644 --- a/docs/WIN32.txt +++ b/docs/WIN32.txt @@ -57,7 +57,7 @@ Anope for Windows 4) You now need to configure Anope to your requirements. At the prompt type: - cscript /nologo install.js + Config.bat NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may be unable to run this command due to the protection in place. Some Anti- diff --git a/src/main.c b/src/main.c index 5ae01aa3a..2000db34e 100644 --- a/src/main.c +++ b/src/main.c @@ -665,10 +665,10 @@ int main(int ac, char **av, char **envp) quitmsg = "Read error from server"; } quitting = 1; - + /* Save the databases */ if (!readonly) - save_databases(); + save_databases(); } waiting = -4; } diff --git a/src/misc.c b/src/misc.c index f9003833b..1666bc670 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1329,8 +1329,11 @@ char *GetWindowsVersion(void) BOOL bOsVersionInfoEx; char buf[BUFSIZE]; char *extra; + char *cputype; + SYSTEM_INFO si; ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + ZeroMemory(&si, sizeof(SYSTEM_INFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) & osvi))) { @@ -1339,22 +1342,43 @@ char *GetWindowsVersion(void) return sstrdup(""); } } + GetSystemInfo(&si); + + /* Determine CPU type 32 or 64 */ + if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) { + cputype = sstrdup(" 64-bit"); + } else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL ) { + cputype = sstrdup(" 32-bit"); + } else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 ) { + cputype = sstrdup(" Itanium 64-bit"); + } else { + cputype = sstrdup(" "); + } switch (osvi.dwPlatformId) { /* test for the Windows NT product family. */ case VER_PLATFORM_WIN32_NT: + /* Windows Vista or Windows Server 2008 */ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) { extra = sstrdup("Enterprise Edition"); } else if (osvi.wSuiteMask & VER_SUITE_DATACENTER) { extra = sstrdup("Datacenter Edition"); + } else if (osvi.wSuiteMask & VER_SUITE_PERSONAL) { + extra = sstrdup("Home Premium/Basic"); } else { extra = sstrdup(" "); } - snprintf(buf, sizeof(buf), "Microsoft Windows Vista %s", - extra); + if (osvi.wProductType & VER_NT_WORKSTATION) { + snprintf(buf, sizeof(buf), "Microsoft Windows Vista %s%s", + cputype, extra); + } else { + snprintf(buf, sizeof(buf), "Microsoft Windows Server 2008 %s%s", + cputype, extra); + } free(extra); } + /* Windows 2003 or Windows XP Pro 64 */ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { if (osvi.wSuiteMask & VER_SUITE_DATACENTER) { extra = sstrdup("Datacenter Edition"); @@ -1367,8 +1391,13 @@ char *GetWindowsVersion(void) } else { extra = sstrdup("Standard Edition"); } - snprintf(buf, sizeof(buf), - "Microsoft Windows Server 2003 Family %s", extra); + if ( osvi.wProductType & VER_NT_WORKSTATION && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { + snprintf(buf, sizeof(buf), "Windows XP Professional x64 Edition %s", + extra); + } else { + snprintf(buf, sizeof(buf), + "Microsoft Windows Server 2003 Family %s%s", cputype, extra); + } free(extra); } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) { @@ -1434,6 +1463,7 @@ char *GetWindowsVersion(void) "Microsoft Windows Millennium Edition"); } } + free(cputype); return sstrdup(buf); } diff --git a/version.log b/version.log index 6202ba576..9daff9379 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="20" VERSION_EXTRA="-svn" -VERSION_BUILD="1329" +VERSION_BUILD="1330" # $Log$ # +# BUILD : 1.7.20 (1330) +# BUGS : 815 +# NOTES : Applied patch by Trystan to properly detect Windows Vista and Windows Server 2008 +# # BUILD : 1.7.20 (1329) # BUGS : 811 # NOTES : Fixed databases not being saved when anope quit due to a connection error |