PsGetVersion
if (majorVersion == 5 && minorVersion == 2)
{
DbgPrint("win2003");
}
else if (majorVersion == 5 && minorVersion == 1)
{
DbgPrint("winXP");
}
else if (majorVersion == 5 && minorVersion == 0)
{
DbgPrint("win2000");
}
else if(majorVersion == 6 && minorVersion ==0) //VISTA
从vista开始取NtBuildNumber就可以知道是什么系统和sp了
vista 6000 sp1 6001 sp2 6002 win7 7600
OsMajorVersion = 6 OsMinorVersion =0 VISTA
OsMajorVersion = 6 OsMinorVersion =1 win7