Bug 164181. Prevent multiple instances of CASA Manager on windows.
This commit is contained in:
		| @@ -1,3 +1,7 @@ | |||||||
|  | ------------------------------------------------------------------- | ||||||
|  | Thu Apr 13 07:01:10 MST 2006 - jnorman@novell.com | ||||||
|  | - Bug 164181.  Prevent multiple instances of CASA Manager on windows. | ||||||
|  |  | ||||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ||||||
| Wed Apr 12 09:13:10 MST 2006 - jnorman@novell.com | Wed Apr 12 09:13:10 MST 2006 - jnorman@novell.com | ||||||
| - Security Audit Report : Patch for Bug No. 5.2. | - Security Audit Report : Patch for Bug No. 5.2. | ||||||
|   | |||||||
| @@ -260,8 +260,21 @@ public class Common | |||||||
| 		} | 		} | ||||||
| 		else if( true == IS_WINDOWS ) | 		else if( true == IS_WINDOWS ) | ||||||
| 		{ | 		{ | ||||||
| 			bRet = false; |  | ||||||
| 			//return(false); |             Process current = Process.GetCurrentProcess(); | ||||||
|  |             Process[] p = System.Diagnostics.Process.GetProcessesByName("CASAManager"); | ||||||
|  |             int i = 0; | ||||||
|  |             foreach (Process proc in p) | ||||||
|  |             { | ||||||
|  |                 Console.WriteLine(proc.SessionId); | ||||||
|  |                 if (proc.SessionId == current.SessionId) | ||||||
|  |                     i++; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             if (i > 1) | ||||||
|  |                 bRet = true; | ||||||
|  |             else | ||||||
|  |     			bRet = false;			 | ||||||
| 		}	 | 		}	 | ||||||
| 		return bRet;	 | 		return bRet;	 | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user