//version 版本信息
namespace win

GetVersionEx = ::Kernel32.api("GetVersionEx","int(struct &lpVersionInformation)")  
var OSVERSIONINFO = class{  
	INT osVersionInfoSize = 148; 
	INT majorVersion; 
	INT minorVersion; 
	INT buildNumber; 
	INT platformId; 
	BYTE csdVersion[128] 
}

version = OSVERSIONINFO();  
GetVersionEx( version );

namespace version{
	if(csdVersion)
		csdVersion = ..string.str(csdVersion);
		
	if( platformId == 2 ){
        if(majorVersion == 5 && minorVersion == 1)  {  
           isXp = true;
        }  
        else if(majorVersion == 5 && minorVersion == 2)  {  
           isWin2003 = true;
        }  
        else if(majorVersion ==  6 && minorVersion == 0)  {  
        	isVista = true; 
        	isWin2008 = true; 
        }  
        else if(majorVersion ==  6 && minorVersion == 1)  {  
        	isWin7=true; 
        }   
	} 
}

try {
	IsWow64Process = ::Kernel32.api( "IsWow64Process", "bool(pointer hProcess,bool &Wow64Process)") 
	var ok,p64 = isWow64Process( process.getHandle() );
	isWow64 = ok && p64;
} 

/**intellisense(win.version)
majorVersion = 操作系统的主版本号
minorVersion = 操作系统的副版本号
buildNumber = 操作系统的构建版本号
platformId = 平台ID
csdVersion = 关于该操作系统的附加信息
isXp = 是否 WinXP
isWin2003 = 是否 Win2003
isVista = 是否 Vista
isWin2008 = 是否 win2008
isWin7 = 是否 win7
isWow64 = 是否64位系统
end intellisense**/

