svn: /php/php-src/trunk/ext/standard/ info.c winver.h
| From: | Kalle Sommer Nielsen | Date: | Tue, 12 Oct 2010 17:34:25 +0000 |
| Subject: | svn: /php/php-src/trunk/ext/standard/ info.c winver.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-63675@lists.php.net to get a copy of this message | ||
kalle Tue, 12 Oct 2010 17:34:25 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304351
Log:
* Added version info for Windows XP Starter/Tablet PC/Media Center editions
* Fixed typo: "Unknow" -> "Unknown"
* Removed useless Win9x version info
# I will merge this to 5.3 once I have analyzed a possible bug
# (and hopefully fixed) why Server 2008 is reported as unknown
Changed paths:
U php/php-src/trunk/ext/standard/info.c
U php/php-src/trunk/ext/standard/winver.h
Modified: php/php-src/trunk/ext/standard/info.c
===================================================================
--- php/php-src/trunk/ext/standard/info.c 2010-10-12 12:16:09 UTC (rev 304350)
+++ php/php-src/trunk/ext/standard/info.c 2010-10-12 17:34:25 UTC (rev 304351)
@@ -348,7 +348,7 @@
major = "Windows Server 2008 R2";
}
} else {
- major = "Unknow Windows version";
+ major = "Unknown Windows version";
}
pGPI = (PGPI) GetProcAddress(GetModuleHandle("kernel32.dll"),
"GetProductInfo");
@@ -454,9 +454,17 @@
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) {
major = "Windows XP";
- if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
+ if( osvi.wSuiteMask & VER_SUITE_PERSONAL ) {
sub = "Home Edition";
- else sub = "Professional";
+ } else if (GetSystemMetrics(SM_MEDIACENTER)) {
+ sub = "Media Center Edition";
+ } else if (GetSystemMetrics(SM_STARTER)) {
+ sub = "Starter Edition";
+ } else if (GetSystemMetrics(SM_TABLETPC)) {
+ sub = "Tablet PC Edition";
+ } else {
+ sub = "Professional";
+ }
}
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) {
@@ -538,11 +546,7 @@
GetComputerName(ComputerName, &dwSize);
if (mode == 's') {
- if (dwVersion < 0x80000000) {
- php_uname = "Windows NT";
- } else {
- php_uname = "Windows 9x";
- }
+ php_uname = "Windows NT";
} else if (mode == 'r') {
snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d", dwWindowsMajorVersion,
dwWindowsMinorVersion);
php_uname = tmp_uname;
@@ -564,23 +568,16 @@
php_get_windows_cpu(tmp_uname, sizeof(tmp_uname));
php_uname = tmp_uname;
} else { /* assume mode == 'a' */
- /* Get build numbers for Windows NT or Win95 */
- if (dwVersion < 0x80000000){
- char *winver = php_get_windows_name();
- char wincpu[20];
+ char *winver = php_get_windows_name();
+ char wincpu[20];
- php_get_windows_cpu(wincpu, sizeof(wincpu));
- dwBuild = (DWORD)(HIWORD(dwVersion));
- snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
- "Windows NT", ComputerName,
- dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown",
wincpu);
- if(winver) {
- efree(winver);
- }
- } else {
- snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d",
- "Windows 9x", ComputerName,
- dwWindowsMajorVersion, dwWindowsMinorVersion);
+ php_get_windows_cpu(wincpu, sizeof(wincpu));
+ dwBuild = (DWORD)(HIWORD(dwVersion));
+ snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
+ "Windows NT", ComputerName,
+ dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown",
wincpu);
+ if(winver) {
+ efree(winver);
}
php_uname = tmp_uname;
}
Modified: php/php-src/trunk/ext/standard/winver.h
===================================================================
--- php/php-src/trunk/ext/standard/winver.h 2010-10-12 12:16:09 UTC (rev 304350)
+++ php/php-src/trunk/ext/standard/winver.h 2010-10-12 17:34:25 UTC (rev 304351)
@@ -1,6 +1,15 @@
#ifndef _PHP_WINVER_H
#define _PHP_WINVER_H
+#ifndef SM_TABLETPC
+#define SM_TABLETPC 86
+#endif
+#ifndef SM_MEDIACENTER
+#define SM_MEDIACENTER 87
+#endif
+#ifndef SM_STARTER
+#define SM_STARTER 88
+#endif
#ifndef SM_SERVERR2
#define SM_SERVERR2 89
#endif