function CheckTcpip(tab)
	local Obj = XLGetObject("Xunlei.OSShell.Obj")
	if Obj:IsXP() then
		local path = Obj:GetSystemPath()
		local filePath = Obj:PathAppendLua(path, "ntoskrnl.exe")
		local ver = Obj:GetFileVerStr(filePath)
		if string.len(ver)==0 then
			return 0
		end
		
		if string.sub(ver,1,1)~="5" then
			return 0
		end
		
		local nNum = Obj:GetSelfHalfOpenNumber()
		if nNum<64 and nNum~=-1 then
			return 1
		end
	end
	
	if Obj:IsVista() then
		local ver, CSDVer = Obj:GetOsVersion()
		if CSDVer=="" or CSDVer=="Service Pack 1" then
			-- 判断是否已经修复过
			local config = XLGetObject("Xunlei.Doctor.Config.Obj")
			local repair = config:GetInt("normal", "repairtipip", 0)
			if repair~=0 then
				return 0
			end
			
			local nNum = Obj:GetSelfHalfOpenNumber()
			if nNum<64 and nNum~=-1 then
				return 1
			end		
		end
	end
	
	return 0
end


function RepairTcpip(tab)
	local Obj = XLGetObject("Xunlei.OSShell.Obj")
	local suc = Obj:SetSelfHalfOpenNumber(252)
	if Obj:IsVista() then
		local ver, CSDVer = Obj:GetOsVersion()
		if CSDVer=="" or CSDVer=="Service Pack 1" then
			local config = XLGetObject("Xunlei.Doctor.Config.Obj")
			config:SetInt("normal", "repairtipip", 1)
			
			return 0
		end
	end
	
	if suc then
		return 0
	end
	
	Obj:Sleep(1000)
	return 1
end