Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IISVersionInfo.cs « System.Web.Utils « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fce89988b12f1ba93831df7f38ae0498bf03789c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**

 * Namespace: System.Web.Utils
 * Class:     IISVersionInfo
 * 
 * Author:  Gaurav Vaish
 * Maintainer: gvaish@iitk.ac.in
 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
 * Implementation: yes
 * Status:  ??%

 *

 * (C) Gaurav Vaish (2001)

 */


using System;
using System.Diagnostics;
using System.Web;
using System.Web.Utils;

namespace System.Web.Utils
{
	//FIXME: This is highly Windows/IIS specific code. What about Apache related stuff?
	internal class IISVersionInfo
	{
		private static string isapiVersion;
		private static string mscoreeVersion;
		private static string systemWebVersion;

		private static readonly object lockObj = null;

		public IISVersionInfo()
		{
		}
		
		internal static string IsapiVersion
		{
			get
			{
				if(isapiVersion==null)
				{
					lock(lockObj)
					{
						// Recheck - another thread may have set the value
						// before entering lock / exiting previous lock
						if(isapiVersion==null)
						{
							//FIXME: What about Apache? What dll/shared-object to be loaded?
							isapiVersion = GetLoadedModuleVersion("aspnet_isapi.dll");
						}
					}
				}
				return isapiVersion;
			}
		}
		
		internal static string ClrVersion
		{
			get
			{
				if(mscoreeVersion==null)
				{
					lock(lockObj)
					{
						if(mscoreeVersion==null)
						{
							mscoreeVersion = GetLoadedModuleVersion("mscorlib.dll");
						}
					}
				}
				return mscoreeVersion;
			}
		}
		
		internal static string SystemWebVersion
		{
			get
			{
				if(systemWebVersion == null)
				{
					lock(lockObj)
					{
						if(systemWebVersion==null)
						{
							systemWebVersion = (FileVersionInfo.GetVersionInfo((typeof(HttpRuntime)).Module.FullyQualifiedName)).FileVersion;
						}
					}
				}
				return systemWebVersion;
			}
		}
				
		[MonoTODO]
		internal static string GetLoadedModuleVersion(string modulename)
		{
			//TODO: Load the version information from the module
			// Needs native calls - which ones, since the module will not be .Net aware
			throw new NotImplementedException();
		}
		
		[MonoTODO]
		internal static string GetLoadedModuleFilename(string modulename)
		{
			throw new NotImplementedException();
		}
	}
}