Advertisement
mcstuffins

start/stop processes, list all properties, save to database

Nov 27th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 227.79 KB | None | 0 0
  1. // C:\Users\xxx\Documents\cs_code\Win32_Process.cs  [11/27/2016 6:18:16 AM]  ./
  2. using Hydra.Types;  
  3. using System;  
  4. using System.Collections;  
  5. using System.Collections.Generic;  
  6. using System.Data;  
  7. using System.Data.SqlClient;  
  8. using System.Diagnostics;  
  9. using System.Management;  
  10. using System.Text;  
  11. namespace Hydra.Objects  
  12. {  
  13.  
  14.    //|=-=<OO>=-==-=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=-|
  15.    //|                                                                                                                                 |
  16.    //|  This C# and MSSQL Code was generated by -=<( HydraCodeGen, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null )>=-          |
  17.    //|                                                                                                                                 |
  18.    //|  Version 2.0.0.0on 11-27-2016 06:18:16.951                                                                                      |
  19.    //|                                                                                                                                 |
  20.    //|  Code Generation Complete! (5,179.00) lines of code generated in 155.1 milliseconds.                                            |
  21.    //|                                                                                                                                 |
  22.    //|=-=<OO>=-==-=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=-|
  23.  
  24.  
  25.     ///<summary>  
  26.     /// The Win32_Process class represents a sequence of events on a Win32 system.  
  27.     /// Any sequence consisting of the interaction of one or more processors or  
  28.     /// interpreters, some executable code, and a set of inputs, is a descendent  
  29.     /// (or member) of this class.  
  30.     /// Example: A client application running on a Win32  
  31.     /// system.  
  32.     ///</summary>  
  33.  
  34.     public partial class Win32_Process  
  35.     {  
  36.  
  37.         #region (Constructor)  public Win32_Process() {}  
  38.         ///  <summary>  
  39.         ///  Default constructor  
  40.         ///  </summary>  
  41.         public Win32_Process( )  
  42.         {  
  43.             _load_Key_Properties();  
  44.         }  
  45.         #endregion  
  46.  
  47.         #region (constructor) public Win32_Process(string hostname, string namespace, bool preload)  
  48.         /// <summary>  
  49.         /// Creates an instance of the (Win32_Process) class and  
  50.         /// collects all instances immediately  
  51.         /// </summary>  
  52.         /// <param name-"preload">Set to true if you want the wmi data loaded immediately</param>  
  53.         public Win32_Process( bool preload, string p_hostname, string p_namespace, string p_wmiquery )  
  54.         {    
  55.             _load_Key_Properties();  
  56.             this.HostName = p_hostname;  
  57.             this.NameSpace = p_namespace;  
  58.             this._wmiquery = p_wmiquery;  
  59.             if (preload)  
  60.             {  
  61.                 this.ALLInstances = Get_All_Win32_Process_Objects();  
  62.             }  
  63.         }  
  64.            
  65.         #endregion  
  66.  
  67.         #region (constructor) public Win32_Process(string p_hostname, string p_username, string p_password, long p_KnownHostID )  
  68.         /// <summary>  
  69.         /// Creates an instance of the Win32_Process class, connects to wmi, scans the object(s) and stores the data in the database (otional)  
  70.         /// </summary>    
  71.         /// <param name="p_host">Hostname to scan. if "" or null localhoist is assumed</param>  
  72.         /// <param name="p_user">Username to scan with. only used on remote connections</param>  
  73.         /// <param name="p_pas">password to scan with. only used on remote connections</param>  
  74.         /// <param name="customquery">Custom wmi query to use (if so desired) if null or "" then SELECT * FROM [CLASSNAME] is assumed</param>  
  75.         /// <param name="pKHID">Known Host ID from the ___HydraKnownHost table</param>  
  76.         /// <param name="p_isLocal">set to true for local connections</param>  
  77.         /// <param name="p_UpdateDB">Update the database with all instances returned</param>  
  78.         /// <param name="deleteoldrecordsfirst">Delete all instances of classname before uploading all new instances (disable this for perf classes)</param>  
  79.         public Win32_Process(string p_host, string p_user, string p_pas, string customquery, long pKHID, bool p_isLocal, bool p_UpdateDB, bool deleteoldrecordsfirst)  
  80.         {                                                                                                        
  81.             try                                                                                                      
  82.             {                                                                                                        
  83.                 this._knownhostid = pKHID;                                                                      
  84.                 this._hostname = p_host;                                                                        
  85.                 if (!p_isLocal)                                                                                  
  86.                 {                                                                                                
  87.                     this._hostname = p_host;                                                                    
  88.                     this._username = p_user;                                                                    
  89.                     this._password = p_pas;                                                                      
  90.                     this._islocalconnection = p_isLocal;                                                        
  91.                 }                                                                                                
  92.                 if (customquery != null)                                                                        
  93.                 {                                                                                                
  94.                     if (customquery != "" )                                                                    
  95.                     {                                                                                            
  96.                         this._wmiquery = customquery;                                                            
  97.                     }                                                                                            
  98.                 }                                                                                                
  99.                 int instanceindex = 0;                                                                          
  100.                 this.ALLInstances = Get_All_Win32_Process_Objects();                                
  101.                 if (p_UpdateDB)                                                                                  
  102.                 {                                                                                                
  103.                     foreach (Win32_Process o in this.ALLInstances)                                  
  104.                     {                                                                                            
  105.                         if(instanceindex == 0 && deleteoldrecordsfirst)                                          
  106.                         {                                                                                        
  107.                             Win32_Process_DELETE_BY_KNOWN_HOST_ID(pKHID, Config.DBCONN_HYDRA_DB);    
  108.                         }                                                                                        
  109.                         o._hostname = this._hostname;                                                            
  110.                         o._username = this._username;                                                            
  111.                         o._password = this._password;                                                            
  112.                         o.InsertIntoDatabase(Config.DBCONN_HYDRA_DB);                                            
  113.                         instanceindex++;                                                                        
  114.                         System.Threading.Thread.Sleep(3);    //rest                                                                      
  115.                     }                                                                                            
  116.                 }                                                                                                
  117.                 else                                                                                            
  118.                 {                                                                                                
  119.                     Logging.LogEventlogException(new ApplicationException("HydraB is Offline!!!!"),"Win32_Process", 911);  
  120.                 }                                                                                                
  121.             }                                                                                                    
  122.             catch(Exception xxl)                                                                                    
  123.             {                                                                                                        
  124.                 Logging.LogEventlogException(xxl, "Win32_Process", 911);                              
  125.             }                                                                                                        
  126.         }                                                                                                        
  127.         #endregion  
  128.  
  129.  
  130.  
  131.         #region Properties  
  132.  
  133.  
  134.         #region Property: Key Properties  
  135.         /// <summary>  
  136.         /// ArrayList to hold property names that uniquely identify the instances in the collection  
  137.         /// </summary>  
  138.         private ArrayList _key_properties = new ArrayList();  
  139.         public ArrayList KeyProperties  
  140.         {  
  141.             get  
  142.             {  
  143.                 return _key_properties;  
  144.             }  
  145.             set  
  146.             {  
  147.                 _key_properties = value;  
  148.             }  
  149.          }  
  150.         #endregion    
  151.  
  152.  
  153.  
  154.         #region Property: ALLInstances  
  155.         /// <summary>  
  156.         /// ArrayList to hold objects  
  157.         /// </summary>  
  158.         private ArrayList _ALLinstances;  
  159.         public ArrayList ALLInstances  
  160.         {  
  161.             get  
  162.             {  
  163.                 return _ALLinstances;  
  164.             }  
  165.             set  
  166.             {  
  167.                 _ALLinstances = value;  
  168.             }  
  169.          }  
  170.         #endregion Property: ALLInstances  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.         #region Property: List<Property_Data> Properties  
  177.  
  178.  
  179.         /// <summary>  
  180.         /// Holds the collective properties of this class or instance  
  181.         ///    
  182.         /// </summary>  
  183.         private List<Property_Data> _properties = new List<Property_Data>();  
  184.         /// <summary>  
  185.         /// Holds the collective properties of this class or instance  
  186.         ///    
  187.         /// </summary>  
  188.         public List<Property_Data> Properties  
  189.         {  
  190.             get  
  191.             {  
  192.                 return _properties;  
  193.             }  
  194.             set  
  195.             {  
  196.                 _properties = value;  
  197.             }  
  198.          }  
  199.         #endregion Property: List<Property_Data>  
  200.  
  201.  
  202.  
  203.         #region Property: ISLocalConnection  
  204.  
  205.  
  206.         /// <summary>  
  207.         /// KnownHostID is the value that uniquely identifies a host in the hydra database  
  208.         /// </summary>  
  209.         private bool _islocalconnection = true;  
  210.         public bool ISLocalConnection  
  211.         {  
  212.             get  
  213.             {  
  214.                 return _islocalconnection;  
  215.             }  
  216.             set  
  217.             {  
  218.                 _islocalconnection = value;  
  219.             }  
  220.          }  
  221.         #endregion Property: HydraID  
  222.  
  223.  
  224.  
  225.         #region Property: KnownHostID  
  226.  
  227.  
  228.         /// <summary>  
  229.         /// KnownHostID is the value that uniquely identifies a host in the hydra database  
  230.         /// </summary>  
  231.         private Int64 _knownhostid = -9;  
  232.         public Int64 KnownHostID  
  233.         {  
  234.             get  
  235.             {  
  236.                 return _knownhostid;  
  237.             }  
  238.             set  
  239.             {  
  240.                 _knownhostid = value;  
  241.             }  
  242.          }  
  243.         #endregion Property: HydraID  
  244.  
  245.  
  246.  
  247.         #region Property: HydraID  
  248.  
  249.  
  250.         /// <summary>  
  251.         /// HydraID is a value that is created in the sql database when you add a record to a table  
  252.         /// it is extremely helpful when trying to create relationships between tables in the database server  
  253.         /// </summary>  
  254.         private Int64 _hydraid;  
  255.         public Int64 HydraID  
  256.         {  
  257.             get  
  258.             {  
  259.                 return _hydraid;  
  260.             }  
  261.             set  
  262.             {  
  263.                 _hydraid = value;  
  264.             }  
  265.          }  
  266.         #endregion Property: HydraID  
  267.  
  268.  
  269.  
  270.         #region Property: WMIQuery                                                            
  271.         /// <summary>                                                                  
  272.         /// The WMI Query that was run against the WMI Provider                                
  273.         /// Example: "SELECT * FROM WIN32_PROCESS"                                          
  274.         /// </summary>                                                                      
  275.         private string _wmiquery = "SELECT * FROM Win32_Process";                
  276.         public string WMIQuery  
  277.         {                                                  
  278.             get                                                  
  279.             {                                                  
  280.                 return _wmiquery;                                                  
  281.             }                                                  
  282.             set                                                  
  283.             {                                                  
  284.                 _wmiquery = value;                                                  
  285.             }                                                  
  286.          }                                                                                    
  287.         #endregion Property: WMIQuery                                                  
  288.  
  289.  
  290.  
  291.         #region Property: HostName  
  292.         /// <summary>  
  293.         /// Hostname is the host you want to run the query against.  
  294.         /// Example: dns_server.mycompany.com or 10.10.220.18  
  295.         /// </summary>  
  296.         private string _hostname = Environment.MachineName;  
  297.         public string HostName  
  298.         {  
  299.             get  
  300.             {  
  301.                 return _hostname;  
  302.             }  
  303.             set  
  304.             {  
  305.                 _hostname = value;  
  306.             }  
  307.         }  
  308.         #endregion Property: HostName  
  309.  
  310.  
  311.  
  312.         #region Property: UserName  
  313.  
  314.         /// <summary>  
  315.         /// UserName is the username you want to use to run the query  
  316.         /// </summary>  
  317.         private string _username = "";  
  318.         public string UserName  
  319.         {  
  320.             get  
  321.             {  
  322.                 return _username;  
  323.             }  
  324.             set  
  325.             {  
  326.                 _username = value;  
  327.             }  
  328.         }  
  329.  
  330.         #endregion  
  331.  
  332.  
  333.  
  334.         #region Property: Password  
  335.  
  336.         /// <summary>  
  337.         /// password to use when connecting to remote hosts  
  338.         /// leave blank to use integrated security  
  339.         /// </summary>  
  340.         private string _password = "";  
  341.         public string Password  
  342.         {  
  343.             get  
  344.             {  
  345.                 return _password;  
  346.             }  
  347.             set  
  348.             {  
  349.                 _password = value;  
  350.             }  
  351.         }  
  352.  
  353.         #endregion  
  354.  
  355.  
  356.  
  357.         #region Property: NameSpace  
  358.         /// <summary>        
  359.         /// WMI Namespace    
  360.         /// </summary>      
  361.         private string _namespace = "ROOT\\CIMV2";  
  362.         public string NameSpace  
  363.         {  
  364.             get  
  365.             {  
  366.                 return _namespace;  
  367.             }  
  368.             set  
  369.             {  
  370.                 _namespace = value;  
  371.             }  
  372.         }  
  373.         #endregion Property: NameSpace  
  374.  
  375.  
  376.  
  377.         #region Property: WMICLASS  
  378.         /// <summary>        
  379.         /// WMICLASS    
  380.         /// </summary>      
  381.         private string _wmiclass = "Win32_Process";  
  382.         public string WMIClass  
  383.         {  
  384.             get  
  385.             {  
  386.                 return _wmiclass;  
  387.             }  
  388.             set  
  389.             {  
  390.                 _wmiclass = value;  
  391.             }  
  392.         }  
  393.         #endregion Property: WMICLASS  
  394.  
  395.  
  396.  
  397.         #region Property: RelPath  
  398.         /// <summary>        
  399.         /// Relative Path    
  400.         /// </summary>      
  401.         private string _relpath = "Win32_Process";  
  402.         public string RelPath  
  403.         {  
  404.             get  
  405.             {  
  406.                 return _relpath;  
  407.             }  
  408.             set  
  409.             {  
  410.                 _relpath = value;  
  411.             }  
  412.         }  
  413.         #endregion Property: NameSpace  
  414.  
  415.  
  416.  
  417.         #region Property: InstancePath  
  418.         /// <summary>        
  419.         /// This.InstancePath    
  420.         /// </summary>      
  421.         private string _instancepath = "";  
  422.         public string InstancePath  
  423.         {  
  424.             get  
  425.             {  
  426.                 return _instancepath;  
  427.             }  
  428.             set  
  429.             {  
  430.                 _instancepath = value;  
  431.             }  
  432.         }  
  433.         #endregion Property: NameSpace  
  434.  
  435.  
  436.  
  437.         #region Property: DatabaseConnectionString  
  438.         /// <summary>  
  439.         /// this field holds the  DatabaseConnectionString for saving WMI Data to a mssql database  
  440.         /// </summary>  
  441.         private string _databaseconnectionstring;  
  442.         public string DatabaseConnectionString  
  443.         {  
  444.             get  
  445.             {  
  446.                 return _databaseconnectionstring;  
  447.             }  
  448.             set  
  449.             {  
  450.                 _databaseconnectionstring = value;  
  451.             }  
  452.         }  
  453.         #endregion Property: DatabaseConnectionString  
  454.  
  455.  
  456.  
  457.         #region Property: Caption    
  458.  
  459.         ///|----------------------------------------------------------------------------------------------------|  
  460.         ///|                                                                                                    |  
  461.         ///|   -=( Property: "Caption"  CimType:String  )=-                                                     |  
  462.         ///|                                                                                                    |  
  463.         ///|----------------------------------------------------------------------------------------------------|  
  464.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  465.         ///|----------------------------------------------------------------------------------------------------|  
  466.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  No  |  No   |   3   |   No     |  
  467.         ///|----------------------------------------------------------------------------------------------------|  
  468.         /// <summary>    
  469.         ///  'varCaption': No Summary Available in WMI  
  470.         ///  https://www.google.com?q=root\CIMV2:Win32_Process.varCaption Try Googling it lol  
  471.         /// </summary>  
  472.         public string varCaption  
  473.  
  474.         {  
  475.             set  
  476.             {  
  477.                _varcaption = value;  
  478.             }  
  479.             get  
  480.             {  
  481.                 return _varcaption;  
  482.             }  
  483.         }  
  484.         private string _varcaption =  "";    
  485.  
  486.         public bool CaptionIsReadable = true;  
  487.         public double CaptionMaxLength = 64;    
  488.         #endregion Property: varCaption    
  489.  
  490.  
  491.         #region Property: CommandLine    
  492.  
  493.         ///|----------------------------------------------------------------------------------------------------|  
  494.         ///|                                                                                                    |  
  495.         ///|   -=( Property: "CommandLine"  CimType:String  )=-                                                 |  
  496.         ///|                                                                                                    |  
  497.         ///|----------------------------------------------------------------------------------------------------|  
  498.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  499.         ///|----------------------------------------------------------------------------------------------------|  
  500.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   4   |   Yes    |  
  501.         ///|----------------------------------------------------------------------------------------------------|  
  502.         /// <summary>  
  503.         ///  The CommandLine property specifies the command line used to start a particular process, if  
  504.         ///  applicable.    
  505.         /// </summary>  
  506.         public string varCommandLine  
  507.  
  508.         {  
  509.             set  
  510.             {  
  511.                _varcommandline = value;  
  512.             }  
  513.             get  
  514.             {  
  515.                 return _varcommandline;  
  516.             }  
  517.         }  
  518.         private string _varcommandline =  "";    
  519.  
  520.         public bool CommandLineIsReadable = true;  
  521.         #endregion Property: varCommandLine    
  522.  
  523.  
  524.         #region Property: CreationClassName    
  525.  
  526.         ///|----------------------------------------------------------------------------------------------------|  
  527.         ///|                                                                                                    |  
  528.         ///|   -=( Property: "CreationClassName"  CimType:String  )=-                                           |  
  529.         ///|                                                                                                    |  
  530.         ///|----------------------------------------------------------------------------------------------------|  
  531.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  532.         ///|----------------------------------------------------------------------------------------------------|  
  533.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   5   |   No     |  
  534.         ///|----------------------------------------------------------------------------------------------------|  
  535.         /// <summary>  
  536.         ///  CreationClassName indicates the name of the class or the subclass used in the creation of an  
  537.         ///  instance. When used with the other key properties of this class, this property allows all instances  
  538.         ///  of this class and its subclasses to be uniquely identified.    
  539.         /// </summary>  
  540.         public string varCreationClassName  
  541.  
  542.         {  
  543.             set  
  544.             {  
  545.                _varcreationclassname = value;  
  546.             }  
  547.             get  
  548.             {  
  549.                 return _varcreationclassname;  
  550.             }  
  551.         }  
  552.         private string _varcreationclassname =  "";    
  553.  
  554.         public bool CreationClassNameIsReadable = true;  
  555.         public double CreationClassNameMaxLength = 256;    
  556.         #endregion Property: varCreationClassName    
  557.  
  558.  
  559.         #region Property: CreationDate    
  560.  
  561.         ///|----------------------------------------------------------------------------------------------------|  
  562.         ///|                                                                                                    |  
  563.         ///|   -=( Property: "CreationDate"  CimType:DateTime  )=-                                              |  
  564.         ///|                                                                                                    |  
  565.         ///|----------------------------------------------------------------------------------------------------|  
  566.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  567.         ///|----------------------------------------------------------------------------------------------------|  
  568.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   4   |   No     |  
  569.         ///|----------------------------------------------------------------------------------------------------|  
  570.         /// <summary>  
  571.         ///  Time that the process began executing.    
  572.         /// </summary>  
  573.         public DateTime varCreationDate  
  574.  
  575.         {  
  576.             set  
  577.             {  
  578.                _varcreationdate = value;  
  579.             }  
  580.             get  
  581.             {  
  582.                 return _varcreationdate;  
  583.             }  
  584.         }  
  585.         private DateTime _varcreationdate = new DateTime();    
  586.  
  587.         public bool CreationDateIsReadable = true;  
  588.         #endregion Property: varCreationDate    
  589.  
  590.  
  591.         #region Property: CSCreationClassName    
  592.  
  593.         ///|----------------------------------------------------------------------------------------------------|  
  594.         ///|                                                                                                    |  
  595.         ///|   -=( Property: "CSCreationClassName"  CimType:String  )=-                                         |  
  596.         ///|                                                                                                    |  
  597.         ///|----------------------------------------------------------------------------------------------------|  
  598.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  599.         ///|----------------------------------------------------------------------------------------------------|  
  600.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   6   |   No     |  
  601.         ///|----------------------------------------------------------------------------------------------------|  
  602.         /// <summary>  
  603.         ///  CSCreationClassName contains the scoping computer system's creation class name.    
  604.         /// </summary>  
  605.         public string varCSCreationClassName  
  606.  
  607.         {  
  608.             set  
  609.             {  
  610.                _varcscreationclassname = value;  
  611.             }  
  612.             get  
  613.             {  
  614.                 return _varcscreationclassname;  
  615.             }  
  616.         }  
  617.         private string _varcscreationclassname =  "";    
  618.  
  619.         public bool CSCreationClassNameIsReadable = true;  
  620.         public double CSCreationClassNameMaxLength = 256;    
  621.         #endregion Property: varCSCreationClassName    
  622.  
  623.  
  624.         #region Property: CSName    
  625.  
  626.         ///|----------------------------------------------------------------------------------------------------|  
  627.         ///|                                                                                                    |  
  628.         ///|   -=( Property: "CSName"  CimType:String  )=-                                                      |  
  629.         ///|                                                                                                    |  
  630.         ///|----------------------------------------------------------------------------------------------------|  
  631.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  632.         ///|----------------------------------------------------------------------------------------------------|  
  633.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   6   |   No     |  
  634.         ///|----------------------------------------------------------------------------------------------------|  
  635.         /// <summary>  
  636.         ///  The scoping computer system's name.    
  637.         /// </summary>  
  638.         public string varCSName  
  639.  
  640.         {  
  641.             set  
  642.             {  
  643.                _varcsname = value;  
  644.             }  
  645.             get  
  646.             {  
  647.                 return _varcsname;  
  648.             }  
  649.         }  
  650.         private string _varcsname =  "";    
  651.  
  652.         public bool CSNameIsReadable = true;  
  653.         public double CSNameMaxLength = 256;    
  654.         #endregion Property: varCSName    
  655.  
  656.  
  657.         #region Property: Description    
  658.  
  659.         ///|----------------------------------------------------------------------------------------------------|  
  660.         ///|                                                                                                    |  
  661.         ///|   -=( Property: "Description"  CimType:String  )=-                                                 |  
  662.         ///|                                                                                                    |  
  663.         ///|----------------------------------------------------------------------------------------------------|  
  664.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  665.         ///|----------------------------------------------------------------------------------------------------|  
  666.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  No  |  No   |   2   |   No     |  
  667.         ///|----------------------------------------------------------------------------------------------------|  
  668.         /// <summary>    
  669.         ///  'varDescription': No Summary Available in WMI  
  670.         ///  https://www.google.com?q=root\CIMV2:Win32_Process.varDescription Try Googling it lol  
  671.         /// </summary>  
  672.         public string varDescription  
  673.  
  674.         {  
  675.             set  
  676.             {  
  677.                _vardescription = value;  
  678.             }  
  679.             get  
  680.             {  
  681.                 return _vardescription;  
  682.             }  
  683.         }  
  684.         private string _vardescription =  "";    
  685.  
  686.         public bool DescriptionIsReadable = true;  
  687.         #endregion Property: varDescription    
  688.  
  689.  
  690.         #region Property: ExecutablePath    
  691.  
  692.         ///|----------------------------------------------------------------------------------------------------|  
  693.         ///|                                                                                                    |  
  694.         ///|   -=( Property: "ExecutablePath"  CimType:String  )=-                                              |  
  695.         ///|                                                                                                    |  
  696.         ///|----------------------------------------------------------------------------------------------------|  
  697.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  698.         ///|----------------------------------------------------------------------------------------------------|  
  699.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   6   |   Yes    |  
  700.         ///|----------------------------------------------------------------------------------------------------|  
  701.         /// <summary>  
  702.         ///  The ExecutablePath property indicates the path to the executable file of the process.  
  703.         ///  Example:  
  704.         ///  C:\WINDOWS\EXPLORER.EXE    
  705.         /// </summary>  
  706.         public string varExecutablePath  
  707.  
  708.         {  
  709.             set  
  710.             {  
  711.                _varexecutablepath = value;  
  712.             }  
  713.             get  
  714.             {  
  715.                 return _varexecutablepath;  
  716.             }  
  717.         }  
  718.         private string _varexecutablepath =  "";    
  719.  
  720.         public bool ExecutablePathIsReadable = true;  
  721.         #endregion Property: varExecutablePath    
  722.  
  723.  
  724.         #region Property: ExecutionState    
  725.  
  726.         ///|----------------------------------------------------------------------------------------------------|  
  727.         ///|                                                                                                    |  
  728.         ///|   -=( Property: "ExecutionState"  CimType:UInt16  )=-                                              |  
  729.         ///|                                                                                                    |  
  730.         ///|----------------------------------------------------------------------------------------------------|  
  731.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  732.         ///|----------------------------------------------------------------------------------------------------|  
  733.         ///| No  |  No    |  Yes   |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   4   |   No     |  
  734.         ///|----------------------------------------------------------------------------------------------------|  
  735.         /// <summary>  
  736.         ///  Indicates the current operating condition of the process. Values include ready (2), running  
  737.         ///  (3), and blocked (4), among others.    
  738.         /// </summary>  
  739.         public ushort varExecutionState  
  740.  
  741.         {  
  742.             set  
  743.             {  
  744.                _varexecutionstate = value;  
  745.             }  
  746.             get  
  747.             {  
  748.                 return _varexecutionstate;  
  749.             }  
  750.         }  
  751.         private ushort _varexecutionstate = new ushort();    
  752.  
  753.         public bool ExecutionStateIsReadable = true;  
  754.         #endregion Property: varExecutionState    
  755.  
  756.  
  757.         #region Property: Handle    
  758.  
  759.         ///|----------------------------------------------------------------------------------------------------|  
  760.         ///|                                                                                                    |  
  761.         ///|   -=( Property: "Handle"  CimType:String  )=-                                                      |  
  762.         ///|                                                                                                    |  
  763.         ///|----------------------------------------------------------------------------------------------------|  
  764.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  765.         ///|----------------------------------------------------------------------------------------------------|  
  766.         ///| Yes |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   5   |   No     |  
  767.         ///|----------------------------------------------------------------------------------------------------|  
  768.         /// <summary>  
  769.         ///  A string used to identify the process. A process ID is a kind of process handle.    
  770.         /// </summary>  
  771.         public string varHandle  
  772.  
  773.         {  
  774.             set  
  775.             {  
  776.                _varhandle = value;  
  777.             }  
  778.             get  
  779.             {  
  780.                 return _varhandle;  
  781.             }  
  782.         }  
  783.         private string _varhandle =  "";    
  784.  
  785.         public bool HandleIsReadable = true;  
  786.         public double HandleMaxLength = 256;    
  787.         #endregion Property: varHandle    
  788.  
  789.  
  790.         #region Property: HandleCount    
  791.  
  792.         ///|----------------------------------------------------------------------------------------------------|  
  793.         ///|                                                                                                    |  
  794.         ///|   -=( Property: "HandleCount"  CimType:UInt32  )=-                                                 |  
  795.         ///|                                                                                                    |  
  796.         ///|----------------------------------------------------------------------------------------------------|  
  797.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  798.         ///|----------------------------------------------------------------------------------------------------|  
  799.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  800.         ///|----------------------------------------------------------------------------------------------------|  
  801.         /// <summary>  
  802.         ///  The HandleCount property specifies the total number of handles currently open by this process.  
  803.         ///  This number is the sum of the handles currently open by each thread in this process. A handle  
  804.         ///  is used to examine or modify the system resources. Each handle has an entry in an internally  
  805.         ///  maintained table. These entries contain the addresses of the resources and the means to identify  
  806.         ///  the resource type.    
  807.         /// </summary>  
  808.         public uint varHandleCount  
  809.  
  810.         {  
  811.             set  
  812.             {  
  813.                _varhandlecount = value;  
  814.             }  
  815.             get  
  816.             {  
  817.                 return _varhandlecount;  
  818.             }  
  819.         }  
  820.         private uint _varhandlecount = new uint();    
  821.  
  822.         public bool HandleCountIsReadable = true;  
  823.         #endregion Property: varHandleCount    
  824.  
  825.  
  826.         #region Property: InstallDate    
  827.  
  828.         ///|----------------------------------------------------------------------------------------------------|  
  829.         ///|                                                                                                    |  
  830.         ///|   -=( Property: "InstallDate"  CimType:DateTime  )=-                                               |  
  831.         ///|                                                                                                    |  
  832.         ///|----------------------------------------------------------------------------------------------------|  
  833.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  834.         ///|----------------------------------------------------------------------------------------------------|  
  835.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  No  |  No   |   3   |   No     |  
  836.         ///|----------------------------------------------------------------------------------------------------|  
  837.         /// <summary>    
  838.         ///  'varInstallDate': No Summary Available in WMI  
  839.         ///  https://www.google.com?q=root\CIMV2:Win32_Process.varInstallDate Try Googling it lol  
  840.         /// </summary>  
  841.         public DateTime varInstallDate  
  842.  
  843.         {  
  844.             set  
  845.             {  
  846.                _varinstalldate = value;  
  847.             }  
  848.             get  
  849.             {  
  850.                 return _varinstalldate;  
  851.             }  
  852.         }  
  853.         private DateTime _varinstalldate = new DateTime();    
  854.  
  855.         public bool InstallDateIsReadable = true;  
  856.         #endregion Property: varInstallDate    
  857.  
  858.  
  859.         #region Property: KernelModeTime    
  860.  
  861.         ///|----------------------------------------------------------------------------------------------------|  
  862.         ///|                                                                                                    |  
  863.         ///|   -=( Property: "KernelModeTime"  CimType:UInt64  )=-                                              |  
  864.         ///|                                                                                                    |  
  865.         ///|----------------------------------------------------------------------------------------------------|  
  866.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  867.         ///|----------------------------------------------------------------------------------------------------|  
  868.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   5   |   No     |  
  869.         ///|----------------------------------------------------------------------------------------------------|  
  870.         /// <summary>  
  871.         ///  Time in kernel mode, in 100 nanoseconds. If this information is not available, a value of 0  
  872.         ///  should be used.    
  873.         /// </summary>  
  874.         public ulong varKernelModeTime  
  875.  
  876.         {  
  877.             set  
  878.             {  
  879.                _varkernelmodetime = value;  
  880.             }  
  881.             get  
  882.             {  
  883.                 return _varkernelmodetime;  
  884.             }  
  885.         }  
  886.         private ulong _varkernelmodetime = new ulong();    
  887.  
  888.         public bool KernelModeTimeIsReadable = true;  
  889.         /// <summary>  
  890.         /// KernelModeTime is measured in 100 nanoseconds  
  891.         /// </summary>  
  892.         public readonly string KernelModeTime_units = "100 nanoseconds";  
  893.         #endregion Property: varKernelModeTime    
  894.  
  895.  
  896.         #region Property: MaximumWorkingSetSize    
  897.  
  898.         ///|----------------------------------------------------------------------------------------------------|  
  899.         ///|                                                                                                    |  
  900.         ///|   -=( Property: "MaximumWorkingSetSize"  CimType:UInt32  )=-                                       |  
  901.         ///|                                                                                                    |  
  902.         ///|----------------------------------------------------------------------------------------------------|  
  903.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  904.         ///|----------------------------------------------------------------------------------------------------|  
  905.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   7   |   Yes    |  
  906.         ///|----------------------------------------------------------------------------------------------------|  
  907.         /// <summary>  
  908.         ///  The MaximumWorkingSetSize property indicates the maximum working set size of the process. The  
  909.         ///  working set of a process is the set of memory pages currently visible to the process in physical  
  910.         ///  RAM. These pages are resident and available for an application to use without triggering a  
  911.         ///  page fault.  
  912.         ///  Example: 1413120.    
  913.         /// </summary>  
  914.         public uint varMaximumWorkingSetSize  
  915.  
  916.         {  
  917.             set  
  918.             {  
  919.                _varmaximumworkingsetsize = value;  
  920.             }  
  921.             get  
  922.             {  
  923.                 return _varmaximumworkingsetsize;  
  924.             }  
  925.         }  
  926.         private uint _varmaximumworkingsetsize = new uint();    
  927.  
  928.         public bool MaximumWorkingSetSizeIsReadable = true;  
  929.         /// <summary>  
  930.         /// MaximumWorkingSetSize is measured in kilobytes  
  931.         /// </summary>  
  932.         public readonly string MaximumWorkingSetSize_units = "kilobytes";  
  933.         #endregion Property: varMaximumWorkingSetSize    
  934.  
  935.  
  936.         #region Property: MinimumWorkingSetSize    
  937.  
  938.         ///|----------------------------------------------------------------------------------------------------|  
  939.         ///|                                                                                                    |  
  940.         ///|   -=( Property: "MinimumWorkingSetSize"  CimType:UInt32  )=-                                       |  
  941.         ///|                                                                                                    |  
  942.         ///|----------------------------------------------------------------------------------------------------|  
  943.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  944.         ///|----------------------------------------------------------------------------------------------------|  
  945.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   7   |   Yes    |  
  946.         ///|----------------------------------------------------------------------------------------------------|  
  947.         /// <summary>  
  948.         ///  The MinimumWorkingSetSize property indicates the minimum working set size of the process. The  
  949.         ///  working set of a process is the set of memory pages currently visible to the process in physical  
  950.         ///  RAM. These pages are resident and available for an application to use without triggering a  
  951.         ///  page fault.  
  952.         ///  Example: 20480.    
  953.         /// </summary>  
  954.         public uint varMinimumWorkingSetSize  
  955.  
  956.         {  
  957.             set  
  958.             {  
  959.                _varminimumworkingsetsize = value;  
  960.             }  
  961.             get  
  962.             {  
  963.                 return _varminimumworkingsetsize;  
  964.             }  
  965.         }  
  966.         private uint _varminimumworkingsetsize = new uint();    
  967.  
  968.         public bool MinimumWorkingSetSizeIsReadable = true;  
  969.         /// <summary>  
  970.         /// MinimumWorkingSetSize is measured in kilobytes  
  971.         /// </summary>  
  972.         public readonly string MinimumWorkingSetSize_units = "kilobytes";  
  973.         #endregion Property: varMinimumWorkingSetSize    
  974.  
  975.  
  976.         #region Property: Name    
  977.  
  978.         ///|----------------------------------------------------------------------------------------------------|  
  979.         ///|                                                                                                    |  
  980.         ///|   -=( Property: "Name"  CimType:String  )=-                                                        |  
  981.         ///|                                                                                                    |  
  982.         ///|----------------------------------------------------------------------------------------------------|  
  983.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  984.         ///|----------------------------------------------------------------------------------------------------|  
  985.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  No  |  No   |   2   |   No     |  
  986.         ///|----------------------------------------------------------------------------------------------------|  
  987.         /// <summary>    
  988.         ///  'varName': No Summary Available in WMI  
  989.         ///  https://www.google.com?q=root\CIMV2:Win32_Process.varName Try Googling it lol  
  990.         /// </summary>  
  991.         public string varName  
  992.  
  993.         {  
  994.             set  
  995.             {  
  996.                _varname = value;  
  997.             }  
  998.             get  
  999.             {  
  1000.                 return _varname;  
  1001.             }  
  1002.         }  
  1003.         private string _varname =  "";    
  1004.  
  1005.         public bool NameIsReadable = true;  
  1006.         #endregion Property: varName    
  1007.  
  1008.  
  1009.         #region Property: OSCreationClassName    
  1010.  
  1011.         ///|----------------------------------------------------------------------------------------------------|  
  1012.         ///|                                                                                                    |  
  1013.         ///|   -=( Property: "OSCreationClassName"  CimType:String  )=-                                         |  
  1014.         ///|                                                                                                    |  
  1015.         ///|----------------------------------------------------------------------------------------------------|  
  1016.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1017.         ///|----------------------------------------------------------------------------------------------------|  
  1018.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   6   |   No     |  
  1019.         ///|----------------------------------------------------------------------------------------------------|  
  1020.         /// <summary>  
  1021.         ///  The scoping operating system's creation class name.    
  1022.         /// </summary>  
  1023.         public string varOSCreationClassName  
  1024.  
  1025.         {  
  1026.             set  
  1027.             {  
  1028.                _varoscreationclassname = value;  
  1029.             }  
  1030.             get  
  1031.             {  
  1032.                 return _varoscreationclassname;  
  1033.             }  
  1034.         }  
  1035.         private string _varoscreationclassname =  "";    
  1036.  
  1037.         public bool OSCreationClassNameIsReadable = true;  
  1038.         public double OSCreationClassNameMaxLength = 256;    
  1039.         #endregion Property: varOSCreationClassName    
  1040.  
  1041.  
  1042.         #region Property: OSName    
  1043.  
  1044.         ///|----------------------------------------------------------------------------------------------------|  
  1045.         ///|                                                                                                    |  
  1046.         ///|   -=( Property: "OSName"  CimType:String  )=-                                                      |  
  1047.         ///|                                                                                                    |  
  1048.         ///|----------------------------------------------------------------------------------------------------|  
  1049.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1050.         ///|----------------------------------------------------------------------------------------------------|  
  1051.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  Yes   |  Yes |  No   |   6   |   No     |  
  1052.         ///|----------------------------------------------------------------------------------------------------|  
  1053.         /// <summary>  
  1054.         ///  The scoping operating system's name.    
  1055.         /// </summary>  
  1056.         public string varOSName  
  1057.  
  1058.         {  
  1059.             set  
  1060.             {  
  1061.                _varosname = value;  
  1062.             }  
  1063.             get  
  1064.             {  
  1065.                 return _varosname;  
  1066.             }  
  1067.         }  
  1068.         private string _varosname =  "";    
  1069.  
  1070.         public bool OSNameIsReadable = true;  
  1071.         public double OSNameMaxLength = 256;    
  1072.         #endregion Property: varOSName    
  1073.  
  1074.  
  1075.         #region Property: OtherOperationCount    
  1076.  
  1077.         ///|----------------------------------------------------------------------------------------------------|  
  1078.         ///|                                                                                                    |  
  1079.         ///|   -=( Property: "OtherOperationCount"  CimType:UInt64  )=-                                         |  
  1080.         ///|                                                                                                    |  
  1081.         ///|----------------------------------------------------------------------------------------------------|  
  1082.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1083.         ///|----------------------------------------------------------------------------------------------------|  
  1084.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1085.         ///|----------------------------------------------------------------------------------------------------|  
  1086.         /// <summary>  
  1087.         ///  The OtherOperationCount property specifies the number of I/O operations performed, other than  
  1088.         ///  read and write operations.    
  1089.         /// </summary>  
  1090.         public ulong varOtherOperationCount  
  1091.  
  1092.         {  
  1093.             set  
  1094.             {  
  1095.                _varotheroperationcount = value;  
  1096.             }  
  1097.             get  
  1098.             {  
  1099.                 return _varotheroperationcount;  
  1100.             }  
  1101.         }  
  1102.         private ulong _varotheroperationcount = new ulong();    
  1103.  
  1104.         public bool OtherOperationCountIsReadable = true;  
  1105.         #endregion Property: varOtherOperationCount    
  1106.  
  1107.  
  1108.         #region Property: OtherTransferCount    
  1109.  
  1110.         ///|----------------------------------------------------------------------------------------------------|  
  1111.         ///|                                                                                                    |  
  1112.         ///|   -=( Property: "OtherTransferCount"  CimType:UInt64  )=-                                          |  
  1113.         ///|                                                                                                    |  
  1114.         ///|----------------------------------------------------------------------------------------------------|  
  1115.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1116.         ///|----------------------------------------------------------------------------------------------------|  
  1117.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1118.         ///|----------------------------------------------------------------------------------------------------|  
  1119.         /// <summary>  
  1120.         ///  The OtherTransferCount property specifies the amount of data transferred during operations  
  1121.         ///  other than read and write operations.    
  1122.         /// </summary>  
  1123.         public ulong varOtherTransferCount  
  1124.  
  1125.         {  
  1126.             set  
  1127.             {  
  1128.                _varothertransfercount = value;  
  1129.             }  
  1130.             get  
  1131.             {  
  1132.                 return _varothertransfercount;  
  1133.             }  
  1134.         }  
  1135.         private ulong _varothertransfercount = new ulong();    
  1136.  
  1137.         public bool OtherTransferCountIsReadable = true;  
  1138.         /// <summary>  
  1139.         /// convert the value to a nice, human-readable format:  
  1140.         /// </summary>  
  1141.         public string Convert_OtherTransferCountTo_MB()  
  1142.         {  
  1143.             long xxxxxxxxxl = 0;  
  1144.             try  
  1145.             {  
  1146.                 xxxxxxxxxl = Convert.ToInt64( this.varOtherTransferCount);  
  1147.             }  
  1148.             catch(Exception ex)  
  1149.             {  
  1150.                 LogError(ex);  
  1151.             }  
  1152.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1153.         }  
  1154.         /// <summary>  
  1155.         /// convert the value to a nice, human-readable format:  
  1156.         /// </summary>  
  1157.         public string Convert_OtherTransferCountTo_GB()  
  1158.         {  
  1159.            long xxxxxxxxxl = 0;  
  1160.            try  
  1161.            {  
  1162.                xxxxxxxxxl = Convert.ToInt64( this.varOtherTransferCount);  
  1163.            }  
  1164.            catch(Exception ex)  
  1165.            {  
  1166.                LogError(ex);  
  1167.            }  
  1168.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1169.         }  
  1170.         #endregion Property: varOtherTransferCount    
  1171.  
  1172.  
  1173.         #region Property: PageFaults    
  1174.  
  1175.         ///|----------------------------------------------------------------------------------------------------|  
  1176.         ///|                                                                                                    |  
  1177.         ///|   -=( Property: "PageFaults"  CimType:UInt32  )=-                                                  |  
  1178.         ///|                                                                                                    |  
  1179.         ///|----------------------------------------------------------------------------------------------------|  
  1180.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1181.         ///|----------------------------------------------------------------------------------------------------|  
  1182.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1183.         ///|----------------------------------------------------------------------------------------------------|  
  1184.         /// <summary>  
  1185.         ///  The PageFaults property indicates the number of page faults generated by the process.  
  1186.         ///  Example:  
  1187.         ///  10    
  1188.         /// </summary>  
  1189.         public uint varPageFaults  
  1190.  
  1191.         {  
  1192.             set  
  1193.             {  
  1194.                _varpagefaults = value;  
  1195.             }  
  1196.             get  
  1197.             {  
  1198.                 return _varpagefaults;  
  1199.             }  
  1200.         }  
  1201.         private uint _varpagefaults = new uint();    
  1202.  
  1203.         public bool PageFaultsIsReadable = true;  
  1204.         #endregion Property: varPageFaults    
  1205.  
  1206.  
  1207.         #region Property: PageFileUsage    
  1208.  
  1209.         ///|----------------------------------------------------------------------------------------------------|  
  1210.         ///|                                                                                                    |  
  1211.         ///|   -=( Property: "PageFileUsage"  CimType:UInt32  )=-                                               |  
  1212.         ///|                                                                                                    |  
  1213.         ///|----------------------------------------------------------------------------------------------------|  
  1214.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1215.         ///|----------------------------------------------------------------------------------------------------|  
  1216.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1217.         ///|----------------------------------------------------------------------------------------------------|  
  1218.         /// <summary>  
  1219.         ///  The PageFileUsage property indicates the amountof page file space currently being used by the  
  1220.         ///  process.  
  1221.         ///  Example: 102435    
  1222.         /// </summary>  
  1223.         public uint varPageFileUsage  
  1224.  
  1225.         {  
  1226.             set  
  1227.             {  
  1228.                _varpagefileusage = value;  
  1229.             }  
  1230.             get  
  1231.             {  
  1232.                 return _varpagefileusage;  
  1233.             }  
  1234.         }  
  1235.         private uint _varpagefileusage = new uint();    
  1236.  
  1237.         public bool PageFileUsageIsReadable = true;  
  1238.         /// <summary>  
  1239.         /// PageFileUsage is measured in kilobytes  
  1240.         /// </summary>  
  1241.         public readonly string PageFileUsage_units = "kilobytes";  
  1242.         #endregion Property: varPageFileUsage    
  1243.  
  1244.  
  1245.         #region Property: ParentProcessId    
  1246.  
  1247.         ///|----------------------------------------------------------------------------------------------------|  
  1248.         ///|                                                                                                    |  
  1249.         ///|   -=( Property: "ParentProcessId"  CimType:UInt32  )=-                                             |  
  1250.         ///|                                                                                                    |  
  1251.         ///|----------------------------------------------------------------------------------------------------|  
  1252.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1253.         ///|----------------------------------------------------------------------------------------------------|  
  1254.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1255.         ///|----------------------------------------------------------------------------------------------------|  
  1256.         /// <summary>  
  1257.         ///  The ParentProcessId property specifies the unique identifier of the process that created this  
  1258.         ///  process. Process identifier numbers are reused, so they only identify a process for the lifetime  
  1259.         ///  of that process. It is possible that the process identified by ParentProcessId has terminated,  
  1260.         ///  so ParentProcessId may not refer to an running process. It is also possible that ParentProcessId  
  1261.         ///  incorrectly refers to a process which re-used that process identifier. The CreationDate property  
  1262.         ///  can be used to determine whether the specified parent was created after this process was created.  
  1263.         /// </summary>  
  1264.         public uint varParentProcessId  
  1265.  
  1266.         {  
  1267.             set  
  1268.             {  
  1269.                _varparentprocessid = value;  
  1270.             }  
  1271.             get  
  1272.             {  
  1273.                 return _varparentprocessid;  
  1274.             }  
  1275.         }  
  1276.         private uint _varparentprocessid = new uint();    
  1277.  
  1278.         public bool ParentProcessIdIsReadable = true;  
  1279.         #endregion Property: varParentProcessId    
  1280.  
  1281.  
  1282.         #region Property: PeakPageFileUsage    
  1283.  
  1284.         ///|----------------------------------------------------------------------------------------------------|  
  1285.         ///|                                                                                                    |  
  1286.         ///|   -=( Property: "PeakPageFileUsage"  CimType:UInt32  )=-                                           |  
  1287.         ///|                                                                                                    |  
  1288.         ///|----------------------------------------------------------------------------------------------------|  
  1289.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1290.         ///|----------------------------------------------------------------------------------------------------|  
  1291.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1292.         ///|----------------------------------------------------------------------------------------------------|  
  1293.         /// <summary>  
  1294.         ///  The PeakPageFileUsage property indicates the maximum amount of page file space  used during  
  1295.         ///  the life of the process.  
  1296.         ///  Example: 102367    
  1297.         /// </summary>  
  1298.         public uint varPeakPageFileUsage  
  1299.  
  1300.         {  
  1301.             set  
  1302.             {  
  1303.                _varpeakpagefileusage = value;  
  1304.             }  
  1305.             get  
  1306.             {  
  1307.                 return _varpeakpagefileusage;  
  1308.             }  
  1309.         }  
  1310.         private uint _varpeakpagefileusage = new uint();    
  1311.  
  1312.         public bool PeakPageFileUsageIsReadable = true;  
  1313.         /// <summary>  
  1314.         /// PeakPageFileUsage is measured in kilobytes  
  1315.         /// </summary>  
  1316.         public readonly string PeakPageFileUsage_units = "kilobytes";  
  1317.         #endregion Property: varPeakPageFileUsage    
  1318.  
  1319.  
  1320.         #region Property: PeakVirtualSize    
  1321.  
  1322.         ///|----------------------------------------------------------------------------------------------------|  
  1323.         ///|                                                                                                    |  
  1324.         ///|   -=( Property: "PeakVirtualSize"  CimType:UInt64  )=-                                             |  
  1325.         ///|                                                                                                    |  
  1326.         ///|----------------------------------------------------------------------------------------------------|  
  1327.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1328.         ///|----------------------------------------------------------------------------------------------------|  
  1329.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1330.         ///|----------------------------------------------------------------------------------------------------|  
  1331.         /// <summary>  
  1332.         ///  The PeakVirtualSize property specifies the maximum virtual address space the process has used  
  1333.         ///  at any one time. Use of virtual address space does not necessarily imply corresponding use  
  1334.         ///  of either disk or main memory pages. However, virtual space is finite, and by using too much,  
  1335.         ///  the process might limit its ability to load libraries.    
  1336.         /// </summary>  
  1337.         public ulong varPeakVirtualSize  
  1338.  
  1339.         {  
  1340.             set  
  1341.             {  
  1342.                _varpeakvirtualsize = value;  
  1343.             }  
  1344.             get  
  1345.             {  
  1346.                 return _varpeakvirtualsize;  
  1347.             }  
  1348.         }  
  1349.         private ulong _varpeakvirtualsize = new ulong();    
  1350.  
  1351.         public bool PeakVirtualSizeIsReadable = true;  
  1352.         /// <summary>  
  1353.         /// convert the value to a nice, human-readable format:  
  1354.         /// </summary>  
  1355.         public string Convert_PeakVirtualSizeTo_MB()  
  1356.         {  
  1357.             long xxxxxxxxxl = 0;  
  1358.             try  
  1359.             {  
  1360.                 xxxxxxxxxl = Convert.ToInt64( this.varPeakVirtualSize);  
  1361.             }  
  1362.             catch(Exception ex)  
  1363.             {  
  1364.                 LogError(ex);  
  1365.             }  
  1366.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1367.         }  
  1368.         /// <summary>  
  1369.         /// convert the value to a nice, human-readable format:  
  1370.         /// </summary>  
  1371.         public string Convert_PeakVirtualSizeTo_GB()  
  1372.         {  
  1373.            long xxxxxxxxxl = 0;  
  1374.            try  
  1375.            {  
  1376.                xxxxxxxxxl = Convert.ToInt64( this.varPeakVirtualSize);  
  1377.            }  
  1378.            catch(Exception ex)  
  1379.            {  
  1380.                LogError(ex);  
  1381.            }  
  1382.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1383.         }  
  1384.         #endregion Property: varPeakVirtualSize    
  1385.  
  1386.  
  1387.         #region Property: PeakWorkingSetSize    
  1388.  
  1389.         ///|----------------------------------------------------------------------------------------------------|  
  1390.         ///|                                                                                                    |  
  1391.         ///|   -=( Property: "PeakWorkingSetSize"  CimType:UInt32  )=-                                          |  
  1392.         ///|                                                                                                    |  
  1393.         ///|----------------------------------------------------------------------------------------------------|  
  1394.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1395.         ///|----------------------------------------------------------------------------------------------------|  
  1396.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1397.         ///|----------------------------------------------------------------------------------------------------|  
  1398.         /// <summary>  
  1399.         ///  The PeakWorkingSetSize property indicates the peak working set size of the process.  
  1400.         ///  Example:  
  1401.         ///  1413120    
  1402.         /// </summary>  
  1403.         public uint varPeakWorkingSetSize  
  1404.  
  1405.         {  
  1406.             set  
  1407.             {  
  1408.                _varpeakworkingsetsize = value;  
  1409.             }  
  1410.             get  
  1411.             {  
  1412.                 return _varpeakworkingsetsize;  
  1413.             }  
  1414.         }  
  1415.         private uint _varpeakworkingsetsize = new uint();    
  1416.  
  1417.         public bool PeakWorkingSetSizeIsReadable = true;  
  1418.         /// <summary>  
  1419.         /// PeakWorkingSetSize is measured in kilobytes  
  1420.         /// </summary>  
  1421.         public readonly string PeakWorkingSetSize_units = "kilobytes";  
  1422.         #endregion Property: varPeakWorkingSetSize    
  1423.  
  1424.  
  1425.         #region Property: Priority    
  1426.  
  1427.         ///|----------------------------------------------------------------------------------------------------|  
  1428.         ///|                                                                                                    |  
  1429.         ///|   -=( Property: "Priority"  CimType:UInt32  )=-                                                    |  
  1430.         ///|                                                                                                    |  
  1431.         ///|----------------------------------------------------------------------------------------------------|  
  1432.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1433.         ///|----------------------------------------------------------------------------------------------------|  
  1434.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   6   |   No     |  
  1435.         ///|----------------------------------------------------------------------------------------------------|  
  1436.         /// <summary>  
  1437.         ///  The Priority property indicates the scheduling priority of the process within the operating  
  1438.         ///  system. The higher the value, the higher priority the process receives. Priority values can  
  1439.         ///  range from 0 (lowest priority) to 31 (highest priority).  
  1440.         ///  Example: 7.    
  1441.         /// </summary>  
  1442.         public uint varPriority  
  1443.  
  1444.         {  
  1445.             set  
  1446.             {  
  1447.                _varpriority = value;  
  1448.             }  
  1449.             get  
  1450.             {  
  1451.                 return _varpriority;  
  1452.             }  
  1453.         }  
  1454.         private uint _varpriority = new uint();    
  1455.  
  1456.         public bool PriorityIsReadable = true;  
  1457.         #endregion Property: varPriority    
  1458.  
  1459.  
  1460.         #region Property: PrivatePageCount    
  1461.  
  1462.         ///|----------------------------------------------------------------------------------------------------|  
  1463.         ///|                                                                                                    |  
  1464.         ///|   -=( Property: "PrivatePageCount"  CimType:UInt64  )=-                                            |  
  1465.         ///|                                                                                                    |  
  1466.         ///|----------------------------------------------------------------------------------------------------|  
  1467.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1468.         ///|----------------------------------------------------------------------------------------------------|  
  1469.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1470.         ///|----------------------------------------------------------------------------------------------------|  
  1471.         /// <summary>  
  1472.         ///  The PrivatePageCount property specifies the current number of pages allocated that are accessible  
  1473.         ///  only to this process    
  1474.         /// </summary>  
  1475.         public ulong varPrivatePageCount  
  1476.  
  1477.         {  
  1478.             set  
  1479.             {  
  1480.                _varprivatepagecount = value;  
  1481.             }  
  1482.             get  
  1483.             {  
  1484.                 return _varprivatepagecount;  
  1485.             }  
  1486.         }  
  1487.         private ulong _varprivatepagecount = new ulong();    
  1488.  
  1489.         public bool PrivatePageCountIsReadable = true;  
  1490.         #endregion Property: varPrivatePageCount    
  1491.  
  1492.  
  1493.         #region Property: ProcessId    
  1494.  
  1495.         ///|----------------------------------------------------------------------------------------------------|  
  1496.         ///|                                                                                                    |  
  1497.         ///|   -=( Property: "ProcessId"  CimType:UInt32  )=-                                                   |  
  1498.         ///|                                                                                                    |  
  1499.         ///|----------------------------------------------------------------------------------------------------|  
  1500.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1501.         ///|----------------------------------------------------------------------------------------------------|  
  1502.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1503.         ///|----------------------------------------------------------------------------------------------------|  
  1504.         /// <summary>  
  1505.         ///  The ProcessId property contains the global process identifier that can be used to identify  
  1506.         ///  a process. The value is valid from the creation of the process until the process is terminated.  
  1507.         /// </summary>  
  1508.         public uint varProcessId  
  1509.  
  1510.         {  
  1511.             set  
  1512.             {  
  1513.                _varprocessid = value;  
  1514.             }  
  1515.             get  
  1516.             {  
  1517.                 return _varprocessid;  
  1518.             }  
  1519.         }  
  1520.         private uint _varprocessid = new uint();    
  1521.  
  1522.         public bool ProcessIdIsReadable = true;  
  1523.         #endregion Property: varProcessId    
  1524.  
  1525.  
  1526.         #region Property: QuotaNonPagedPoolUsage    
  1527.  
  1528.         ///|----------------------------------------------------------------------------------------------------|  
  1529.         ///|                                                                                                    |  
  1530.         ///|   -=( Property: "QuotaNonPagedPoolUsage"  CimType:UInt32  )=-                                      |  
  1531.         ///|                                                                                                    |  
  1532.         ///|----------------------------------------------------------------------------------------------------|  
  1533.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1534.         ///|----------------------------------------------------------------------------------------------------|  
  1535.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1536.         ///|----------------------------------------------------------------------------------------------------|  
  1537.         /// <summary>  
  1538.         ///  The QuotaNonPagedPoolUsage property indicates the quota amount of non-paged pool usage for  
  1539.         ///  the process.  
  1540.         ///  Example: 15    
  1541.         /// </summary>  
  1542.         public uint varQuotaNonPagedPoolUsage  
  1543.  
  1544.         {  
  1545.             set  
  1546.             {  
  1547.                _varquotanonpagedpoolusage = value;  
  1548.             }  
  1549.             get  
  1550.             {  
  1551.                 return _varquotanonpagedpoolusage;  
  1552.             }  
  1553.         }  
  1554.         private uint _varquotanonpagedpoolusage = new uint();    
  1555.  
  1556.         public bool QuotaNonPagedPoolUsageIsReadable = true;  
  1557.         #endregion Property: varQuotaNonPagedPoolUsage    
  1558.  
  1559.  
  1560.         #region Property: QuotaPagedPoolUsage    
  1561.  
  1562.         ///|----------------------------------------------------------------------------------------------------|  
  1563.         ///|                                                                                                    |  
  1564.         ///|   -=( Property: "QuotaPagedPoolUsage"  CimType:UInt32  )=-                                         |  
  1565.         ///|                                                                                                    |  
  1566.         ///|----------------------------------------------------------------------------------------------------|  
  1567.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1568.         ///|----------------------------------------------------------------------------------------------------|  
  1569.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1570.         ///|----------------------------------------------------------------------------------------------------|  
  1571.         /// <summary>  
  1572.         ///  The QuotaPagedPoolUsage property indicates the quota amount of paged pool usage for the process.  
  1573.         ///  Example:  
  1574.         ///  22    
  1575.         /// </summary>  
  1576.         public uint varQuotaPagedPoolUsage  
  1577.  
  1578.         {  
  1579.             set  
  1580.             {  
  1581.                _varquotapagedpoolusage = value;  
  1582.             }  
  1583.             get  
  1584.             {  
  1585.                 return _varquotapagedpoolusage;  
  1586.             }  
  1587.         }  
  1588.         private uint _varquotapagedpoolusage = new uint();    
  1589.  
  1590.         public bool QuotaPagedPoolUsageIsReadable = true;  
  1591.         #endregion Property: varQuotaPagedPoolUsage    
  1592.  
  1593.  
  1594.         #region Property: QuotaPeakNonPagedPoolUsage    
  1595.  
  1596.         ///|----------------------------------------------------------------------------------------------------|  
  1597.         ///|                                                                                                    |  
  1598.         ///|   -=( Property: "QuotaPeakNonPagedPoolUsage"  CimType:UInt32  )=-                                  |  
  1599.         ///|                                                                                                    |  
  1600.         ///|----------------------------------------------------------------------------------------------------|  
  1601.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1602.         ///|----------------------------------------------------------------------------------------------------|  
  1603.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1604.         ///|----------------------------------------------------------------------------------------------------|  
  1605.         /// <summary>  
  1606.         ///  The QuotaPeakNonPagedPoolUsage property indicates the peak quota amount of non-paged pool usage  
  1607.         ///  for the process.  
  1608.         ///  Example: 31    
  1609.         /// </summary>  
  1610.         public uint varQuotaPeakNonPagedPoolUsage  
  1611.  
  1612.         {  
  1613.             set  
  1614.             {  
  1615.                _varquotapeaknonpagedpoolusage = value;  
  1616.             }  
  1617.             get  
  1618.             {  
  1619.                 return _varquotapeaknonpagedpoolusage;  
  1620.             }  
  1621.         }  
  1622.         private uint _varquotapeaknonpagedpoolusage = new uint();    
  1623.  
  1624.         public bool QuotaPeakNonPagedPoolUsageIsReadable = true;  
  1625.         #endregion Property: varQuotaPeakNonPagedPoolUsage    
  1626.  
  1627.  
  1628.         #region Property: QuotaPeakPagedPoolUsage    
  1629.  
  1630.         ///|----------------------------------------------------------------------------------------------------|  
  1631.         ///|                                                                                                    |  
  1632.         ///|   -=( Property: "QuotaPeakPagedPoolUsage"  CimType:UInt32  )=-                                     |  
  1633.         ///|                                                                                                    |  
  1634.         ///|----------------------------------------------------------------------------------------------------|  
  1635.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1636.         ///|----------------------------------------------------------------------------------------------------|  
  1637.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1638.         ///|----------------------------------------------------------------------------------------------------|  
  1639.         /// <summary>  
  1640.         ///  The QuotaPeakPagedPoolUsage property indicates the peak quota amount of paged pool usage for  
  1641.         ///  the process. Example: 31    
  1642.         /// </summary>  
  1643.         public uint varQuotaPeakPagedPoolUsage  
  1644.  
  1645.         {  
  1646.             set  
  1647.             {  
  1648.                _varquotapeakpagedpoolusage = value;  
  1649.             }  
  1650.             get  
  1651.             {  
  1652.                 return _varquotapeakpagedpoolusage;  
  1653.             }  
  1654.         }  
  1655.         private uint _varquotapeakpagedpoolusage = new uint();    
  1656.  
  1657.         public bool QuotaPeakPagedPoolUsageIsReadable = true;  
  1658.         #endregion Property: varQuotaPeakPagedPoolUsage    
  1659.  
  1660.  
  1661.         #region Property: ReadOperationCount    
  1662.  
  1663.         ///|----------------------------------------------------------------------------------------------------|  
  1664.         ///|                                                                                                    |  
  1665.         ///|   -=( Property: "ReadOperationCount"  CimType:UInt64  )=-                                          |  
  1666.         ///|                                                                                                    |  
  1667.         ///|----------------------------------------------------------------------------------------------------|  
  1668.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1669.         ///|----------------------------------------------------------------------------------------------------|  
  1670.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1671.         ///|----------------------------------------------------------------------------------------------------|  
  1672.         /// <summary>  
  1673.         ///  The ReadOperationCount property specifies the number of read operations performed.    
  1674.         /// </summary>  
  1675.         public ulong varReadOperationCount  
  1676.  
  1677.         {  
  1678.             set  
  1679.             {  
  1680.                _varreadoperationcount = value;  
  1681.             }  
  1682.             get  
  1683.             {  
  1684.                 return _varreadoperationcount;  
  1685.             }  
  1686.         }  
  1687.         private ulong _varreadoperationcount = new ulong();    
  1688.  
  1689.         public bool ReadOperationCountIsReadable = true;  
  1690.         #endregion Property: varReadOperationCount    
  1691.  
  1692.  
  1693.         #region Property: ReadTransferCount    
  1694.  
  1695.         ///|----------------------------------------------------------------------------------------------------|  
  1696.         ///|                                                                                                    |  
  1697.         ///|   -=( Property: "ReadTransferCount"  CimType:UInt64  )=-                                           |  
  1698.         ///|                                                                                                    |  
  1699.         ///|----------------------------------------------------------------------------------------------------|  
  1700.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1701.         ///|----------------------------------------------------------------------------------------------------|  
  1702.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1703.         ///|----------------------------------------------------------------------------------------------------|  
  1704.         /// <summary>  
  1705.         ///  The ReadTransferCount property specifies the amount of data read.    
  1706.         /// </summary>  
  1707.         public ulong varReadTransferCount  
  1708.  
  1709.         {  
  1710.             set  
  1711.             {  
  1712.                _varreadtransfercount = value;  
  1713.             }  
  1714.             get  
  1715.             {  
  1716.                 return _varreadtransfercount;  
  1717.             }  
  1718.         }  
  1719.         private ulong _varreadtransfercount = new ulong();    
  1720.  
  1721.         public bool ReadTransferCountIsReadable = true;  
  1722.         /// <summary>  
  1723.         /// convert the value to a nice, human-readable format:  
  1724.         /// </summary>  
  1725.         public string Convert_ReadTransferCountTo_MB()  
  1726.         {  
  1727.             long xxxxxxxxxl = 0;  
  1728.             try  
  1729.             {  
  1730.                 xxxxxxxxxl = Convert.ToInt64( this.varReadTransferCount);  
  1731.             }  
  1732.             catch(Exception ex)  
  1733.             {  
  1734.                 LogError(ex);  
  1735.             }  
  1736.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1737.         }  
  1738.         /// <summary>  
  1739.         /// convert the value to a nice, human-readable format:  
  1740.         /// </summary>  
  1741.         public string Convert_ReadTransferCountTo_GB()  
  1742.         {  
  1743.            long xxxxxxxxxl = 0;  
  1744.            try  
  1745.            {  
  1746.                xxxxxxxxxl = Convert.ToInt64( this.varReadTransferCount);  
  1747.            }  
  1748.            catch(Exception ex)  
  1749.            {  
  1750.                LogError(ex);  
  1751.            }  
  1752.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1753.         }  
  1754.         #endregion Property: varReadTransferCount    
  1755.  
  1756.  
  1757.         #region Property: SessionId    
  1758.  
  1759.         ///|----------------------------------------------------------------------------------------------------|  
  1760.         ///|                                                                                                    |  
  1761.         ///|   -=( Property: "SessionId"  CimType:UInt32  )=-                                                   |  
  1762.         ///|                                                                                                    |  
  1763.         ///|----------------------------------------------------------------------------------------------------|  
  1764.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1765.         ///|----------------------------------------------------------------------------------------------------|  
  1766.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1767.         ///|----------------------------------------------------------------------------------------------------|  
  1768.         /// <summary>  
  1769.         ///  The SessionId property specifies the unique identifier that is generated by the operating system  
  1770.         ///  when the session is created. A session spans a period of time from log in to log out on a particular  
  1771.         ///  system.    
  1772.         /// </summary>  
  1773.         public uint varSessionId  
  1774.  
  1775.         {  
  1776.             set  
  1777.             {  
  1778.                _varsessionid = value;  
  1779.             }  
  1780.             get  
  1781.             {  
  1782.                 return _varsessionid;  
  1783.             }  
  1784.         }  
  1785.         private uint _varsessionid = new uint();    
  1786.  
  1787.         public bool SessionIdIsReadable = true;  
  1788.         #endregion Property: varSessionId    
  1789.  
  1790.  
  1791.         #region Property: Status    
  1792.  
  1793.         ///|----------------------------------------------------------------------------------------------------|  
  1794.         ///|                                                                                                    |  
  1795.         ///|   -=( Property: "Status"  CimType:String  )=-                                                      |  
  1796.         ///|                                                                                                    |  
  1797.         ///|----------------------------------------------------------------------------------------------------|  
  1798.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1799.         ///|----------------------------------------------------------------------------------------------------|  
  1800.         ///| No  |  No    |  No    |    Yes   |  Yes |  No   |  No   |  Yes   |  No  |  No   |   4   |   No     |  
  1801.         ///|----------------------------------------------------------------------------------------------------|  
  1802.         /// <summary>    
  1803.         ///  'varStatus': No Summary Available in WMI  
  1804.         ///  https://www.google.com?q=root\CIMV2:Win32_Process.varStatus Try Googling it lol  
  1805.         /// </summary>  
  1806.         public string varStatus  
  1807.  
  1808.         {  
  1809.             set  
  1810.             {  
  1811.                _varstatus = value;  
  1812.             }  
  1813.             get  
  1814.             {  
  1815.                 return _varstatus;  
  1816.             }  
  1817.         }  
  1818.         private string _varstatus =  "";    
  1819.  
  1820.         public bool StatusIsReadable = true;  
  1821.         public double StatusMaxLength = 10;    
  1822.         #endregion Property: varStatus    
  1823.  
  1824.  
  1825.         #region Property: TerminationDate    
  1826.  
  1827.         ///|----------------------------------------------------------------------------------------------------|  
  1828.         ///|                                                                                                    |  
  1829.         ///|   -=( Property: "TerminationDate"  CimType:DateTime  )=-                                           |  
  1830.         ///|                                                                                                    |  
  1831.         ///|----------------------------------------------------------------------------------------------------|  
  1832.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1833.         ///|----------------------------------------------------------------------------------------------------|  
  1834.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   3   |   No     |  
  1835.         ///|----------------------------------------------------------------------------------------------------|  
  1836.         /// <summary>  
  1837.         ///  Time that the process was stopped or terminated.    
  1838.         /// </summary>  
  1839.         public DateTime varTerminationDate  
  1840.  
  1841.         {  
  1842.             set  
  1843.             {  
  1844.                _varterminationdate = value;  
  1845.             }  
  1846.             get  
  1847.             {  
  1848.                 return _varterminationdate;  
  1849.             }  
  1850.         }  
  1851.         private DateTime _varterminationdate = new DateTime();    
  1852.  
  1853.         public bool TerminationDateIsReadable = true;  
  1854.         #endregion Property: varTerminationDate    
  1855.  
  1856.  
  1857.         #region Property: ThreadCount    
  1858.  
  1859.         ///|----------------------------------------------------------------------------------------------------|  
  1860.         ///|                                                                                                    |  
  1861.         ///|   -=( Property: "ThreadCount"  CimType:UInt32  )=-                                                 |  
  1862.         ///|                                                                                                    |  
  1863.         ///|----------------------------------------------------------------------------------------------------|  
  1864.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1865.         ///|----------------------------------------------------------------------------------------------------|  
  1866.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  1867.         ///|----------------------------------------------------------------------------------------------------|  
  1868.         /// <summary>  
  1869.         ///  The ThreadCount property specifies the number of active threads in this process. An instruction  
  1870.         ///  is the basic unit of execution in a processor, and a thread is the object that executes instructions.  
  1871.         ///  Every running process has at least one thread. This property is for computers running Windows  
  1872.         ///  NT only.    
  1873.         /// </summary>  
  1874.         public uint varThreadCount  
  1875.  
  1876.         {  
  1877.             set  
  1878.             {  
  1879.                _varthreadcount = value;  
  1880.             }  
  1881.             get  
  1882.             {  
  1883.                 return _varthreadcount;  
  1884.             }  
  1885.         }  
  1886.         private uint _varthreadcount = new uint();    
  1887.  
  1888.         public bool ThreadCountIsReadable = true;  
  1889.         #endregion Property: varThreadCount    
  1890.  
  1891.  
  1892.         #region Property: UserModeTime    
  1893.  
  1894.         ///|----------------------------------------------------------------------------------------------------|  
  1895.         ///|                                                                                                    |  
  1896.         ///|   -=( Property: "UserModeTime"  CimType:UInt64  )=-                                                |  
  1897.         ///|                                                                                                    |  
  1898.         ///|----------------------------------------------------------------------------------------------------|  
  1899.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1900.         ///|----------------------------------------------------------------------------------------------------|  
  1901.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   5   |   No     |  
  1902.         ///|----------------------------------------------------------------------------------------------------|  
  1903.         /// <summary>  
  1904.         ///  Time in user mode, in 100 nanoseconds. If this information is not available, a value of 0 should  
  1905.         ///  be used.    
  1906.         /// </summary>  
  1907.         public ulong varUserModeTime  
  1908.  
  1909.         {  
  1910.             set  
  1911.             {  
  1912.                _varusermodetime = value;  
  1913.             }  
  1914.             get  
  1915.             {  
  1916.                 return _varusermodetime;  
  1917.             }  
  1918.         }  
  1919.         private ulong _varusermodetime = new ulong();    
  1920.  
  1921.         public bool UserModeTimeIsReadable = true;  
  1922.         /// <summary>  
  1923.         /// UserModeTime is measured in 100 nanoseconds  
  1924.         /// </summary>  
  1925.         public readonly string UserModeTime_units = "100 nanoseconds";  
  1926.         #endregion Property: varUserModeTime    
  1927.  
  1928.  
  1929.         #region Property: VirtualSize    
  1930.  
  1931.         ///|----------------------------------------------------------------------------------------------------|  
  1932.         ///|                                                                                                    |  
  1933.         ///|   -=( Property: "VirtualSize"  CimType:UInt64  )=-                                                 |  
  1934.         ///|                                                                                                    |  
  1935.         ///|----------------------------------------------------------------------------------------------------|  
  1936.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  1937.         ///|----------------------------------------------------------------------------------------------------|  
  1938.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  1939.         ///|----------------------------------------------------------------------------------------------------|  
  1940.         /// <summary>  
  1941.         ///  The VirtualSize property specifies the current size in bytes of the virtual address space the  
  1942.         ///  process is using. Use of virtual address space does not necessarily imply corresponding use  
  1943.         ///  of either disk or main memory pages. Virtual space is finite, and by using too much, the process  
  1944.         ///  can limit its ability to load libraries.    
  1945.         /// </summary>  
  1946.         public ulong varVirtualSize  
  1947.  
  1948.         {  
  1949.             set  
  1950.             {  
  1951.                _varvirtualsize = value;  
  1952.             }  
  1953.             get  
  1954.             {  
  1955.                 return _varvirtualsize;  
  1956.             }  
  1957.         }  
  1958.         private ulong _varvirtualsize = new ulong();    
  1959.  
  1960.         public bool VirtualSizeIsReadable = true;  
  1961.         /// <summary>  
  1962.         /// convert the value to a nice, human-readable format:  
  1963.         /// </summary>  
  1964.         public string Convert_VirtualSizeTo_MB()  
  1965.         {  
  1966.             long xxxxxxxxxl = 0;  
  1967.             try  
  1968.             {  
  1969.                 xxxxxxxxxl = Convert.ToInt64( this.varVirtualSize);  
  1970.             }  
  1971.             catch(Exception ex)  
  1972.             {  
  1973.                 LogError(ex);  
  1974.             }  
  1975.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1976.         }  
  1977.         /// <summary>  
  1978.         /// convert the value to a nice, human-readable format:  
  1979.         /// </summary>  
  1980.         public string Convert_VirtualSizeTo_GB()  
  1981.         {  
  1982.            long xxxxxxxxxl = 0;  
  1983.            try  
  1984.            {  
  1985.                xxxxxxxxxl = Convert.ToInt64( this.varVirtualSize);  
  1986.            }  
  1987.            catch(Exception ex)  
  1988.            {  
  1989.                LogError(ex);  
  1990.            }  
  1991.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  1992.         }  
  1993.         #endregion Property: varVirtualSize    
  1994.  
  1995.  
  1996.         #region Property: WindowsVersion    
  1997.  
  1998.         ///|----------------------------------------------------------------------------------------------------|  
  1999.         ///|                                                                                                    |  
  2000.         ///|   -=( Property: "WindowsVersion"  CimType:String  )=-                                              |  
  2001.         ///|                                                                                                    |  
  2002.         ///|----------------------------------------------------------------------------------------------------|  
  2003.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  2004.         ///|----------------------------------------------------------------------------------------------------|  
  2005.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  2006.         ///|----------------------------------------------------------------------------------------------------|  
  2007.         /// <summary>  
  2008.         ///  The WindowsVersion property indicates the version of Windows in which the process is running.  
  2009.         ///  Example:  
  2010.         ///  4.0    
  2011.         /// </summary>  
  2012.         public string varWindowsVersion  
  2013.  
  2014.         {  
  2015.             set  
  2016.             {  
  2017.                _varwindowsversion = value;  
  2018.             }  
  2019.             get  
  2020.             {  
  2021.                 return _varwindowsversion;  
  2022.             }  
  2023.         }  
  2024.         private string _varwindowsversion =  "";    
  2025.  
  2026.         public bool WindowsVersionIsReadable = true;  
  2027.         #endregion Property: varWindowsVersion    
  2028.  
  2029.  
  2030.         #region Property: WorkingSetSize    
  2031.  
  2032.         ///|----------------------------------------------------------------------------------------------------|  
  2033.         ///|                                                                                                    |  
  2034.         ///|   -=( Property: "WorkingSetSize"  CimType:UInt64  )=-                                              |  
  2035.         ///|                                                                                                    |  
  2036.         ///|----------------------------------------------------------------------------------------------------|  
  2037.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  2038.         ///|----------------------------------------------------------------------------------------------------|  
  2039.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   4   |   No     |  
  2040.         ///|----------------------------------------------------------------------------------------------------|  
  2041.         /// <summary>  
  2042.         ///  The amount of memory in bytes that a process needs to execute efficiently, for an operating  
  2043.         ///  system that uses page-based memory management. If an insufficient amount of memory is available  
  2044.         ///  (< working set size), thrashing will occur. If this information is not known, NULL or 0 should  
  2045.         ///  be entered.  If this data is provided, it could be monitored to understand a process' changing  
  2046.         ///  memory requirements as execution proceeds.    
  2047.         /// </summary>  
  2048.         public ulong varWorkingSetSize  
  2049.  
  2050.         {  
  2051.             set  
  2052.             {  
  2053.                _varworkingsetsize = value;  
  2054.             }  
  2055.             get  
  2056.             {  
  2057.                 return _varworkingsetsize;  
  2058.             }  
  2059.         }  
  2060.         private ulong _varworkingsetsize = new ulong();    
  2061.  
  2062.         public bool WorkingSetSizeIsReadable = true;  
  2063.         /// <summary>  
  2064.         /// convert the value to a nice, human-readable format:  
  2065.         /// </summary>  
  2066.         public string Convert_WorkingSetSizeTo_MB()  
  2067.         {  
  2068.             long xxxxxxxxxl = 0;  
  2069.             try  
  2070.             {  
  2071.                 xxxxxxxxxl = Convert.ToInt64( this.varWorkingSetSize);  
  2072.             }  
  2073.             catch(Exception ex)  
  2074.             {  
  2075.                 LogError(ex);  
  2076.             }  
  2077.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  2078.         }  
  2079.         /// <summary>  
  2080.         /// convert the value to a nice, human-readable format:  
  2081.         /// </summary>  
  2082.         public string Convert_WorkingSetSizeTo_GB()  
  2083.         {  
  2084.            long xxxxxxxxxl = 0;  
  2085.            try  
  2086.            {  
  2087.                xxxxxxxxxl = Convert.ToInt64( this.varWorkingSetSize);  
  2088.            }  
  2089.            catch(Exception ex)  
  2090.            {  
  2091.                LogError(ex);  
  2092.            }  
  2093.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  2094.         }  
  2095.         #endregion Property: varWorkingSetSize    
  2096.  
  2097.  
  2098.         #region Property: WriteOperationCount    
  2099.  
  2100.         ///|----------------------------------------------------------------------------------------------------|  
  2101.         ///|                                                                                                    |  
  2102.         ///|   -=( Property: "WriteOperationCount"  CimType:UInt64  )=-                                         |  
  2103.         ///|                                                                                                    |  
  2104.         ///|----------------------------------------------------------------------------------------------------|  
  2105.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  2106.         ///|----------------------------------------------------------------------------------------------------|  
  2107.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  No   |  No    |  Yes |  No   |   5   |   Yes    |  
  2108.         ///|----------------------------------------------------------------------------------------------------|  
  2109.         /// <summary>  
  2110.         ///  The WriteOperationCount property specifies the number of write operations performed.    
  2111.         /// </summary>  
  2112.         public ulong varWriteOperationCount  
  2113.  
  2114.         {  
  2115.             set  
  2116.             {  
  2117.                _varwriteoperationcount = value;  
  2118.             }  
  2119.             get  
  2120.             {  
  2121.                 return _varwriteoperationcount;  
  2122.             }  
  2123.         }  
  2124.         private ulong _varwriteoperationcount = new ulong();    
  2125.  
  2126.         public bool WriteOperationCountIsReadable = true;  
  2127.         #endregion Property: varWriteOperationCount    
  2128.  
  2129.  
  2130.         #region Property: WriteTransferCount    
  2131.  
  2132.         ///|----------------------------------------------------------------------------------------------------|  
  2133.         ///|                                                                                                    |  
  2134.         ///|   -=( Property: "WriteTransferCount"  CimType:UInt64  )=-                                          |  
  2135.         ///|                                                                                                    |  
  2136.         ///|----------------------------------------------------------------------------------------------------|  
  2137.         ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local    |  
  2138.         ///|----------------------------------------------------------------------------------------------------|  
  2139.         ///| No  |  No    |  No    |    No    |  Yes |  No   |  Yes  |  No    |  Yes |  No   |   6   |   Yes    |  
  2140.         ///|----------------------------------------------------------------------------------------------------|  
  2141.         /// <summary>  
  2142.         ///  The WriteTransferCount property specifies the amount of data written.    
  2143.         /// </summary>  
  2144.         public ulong varWriteTransferCount  
  2145.  
  2146.         {  
  2147.             set  
  2148.             {  
  2149.                _varwritetransfercount = value;  
  2150.             }  
  2151.             get  
  2152.             {  
  2153.                 return _varwritetransfercount;  
  2154.             }  
  2155.         }  
  2156.         private ulong _varwritetransfercount = new ulong();    
  2157.  
  2158.         public bool WriteTransferCountIsReadable = true;  
  2159.         /// <summary>  
  2160.         /// convert the value to a nice, human-readable format:  
  2161.         /// </summary>  
  2162.         public string Convert_WriteTransferCountTo_MB()  
  2163.         {  
  2164.             long xxxxxxxxxl = 0;  
  2165.             try  
  2166.             {  
  2167.                 xxxxxxxxxl = Convert.ToInt64( this.varWriteTransferCount);  
  2168.             }  
  2169.             catch(Exception ex)  
  2170.             {  
  2171.                 LogError(ex);  
  2172.             }  
  2173.             return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  2174.         }  
  2175.         /// <summary>  
  2176.         /// convert the value to a nice, human-readable format:  
  2177.         /// </summary>  
  2178.         public string Convert_WriteTransferCountTo_GB()  
  2179.         {  
  2180.            long xxxxxxxxxl = 0;  
  2181.            try  
  2182.            {  
  2183.                xxxxxxxxxl = Convert.ToInt64( this.varWriteTransferCount);  
  2184.            }  
  2185.            catch(Exception ex)  
  2186.            {  
  2187.                LogError(ex);  
  2188.            }  
  2189.            return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);  
  2190.         }  
  2191.         #endregion Property: varWriteTransferCount    
  2192.  
  2193.  
  2194.         #region Load Key Properties  
  2195.         private void _load_Key_Properties()  
  2196.         {  
  2197.                     /// varHandle is a Key Property                    
  2198.                     _key_properties.Add("varHandle");                
  2199.              
  2200.         }  
  2201.         #endregion  
  2202.         #endregion  
  2203.         #region public int Execute_Create_Method()  
  2204.  
  2205.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2206.         ///                                                                                                                  
  2207.         ///  Execute_Create_Method(string instancepath, String _commandline, String _currentdirectory, Object _processstart  
  2208.         ///                                                                                                                  
  2209.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2210.         ///<summary>                                                                                                                      
  2211.         ///   Execute_Create_Method( string instancepath, String _commandline, String _currentdirectory, Object _processstartupinformation  )                                                                                      
  2212.         ///</summary>                                                                                                                    
  2213.         ///<returns>int ReturnValue</returns>                                                                                            
  2214.         public int Execute_Create_Method( string instancepath, String _commandline, String _currentdirectory, Object _processstartupinformation  )                                                              
  2215.         {                                                                                              
  2216.             int i = -1;                                            
  2217.             try {                                                                                                                          
  2218.                 string ip = instancepath;                                                                                                                          
  2219.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                          
  2220.                 else { ip = "=@"; }                                                                                                                          
  2221.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2222.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2223.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2224.                 mo.Scope.Connect();    
  2225.                 ManagementBaseObject inparams = mo.GetMethodParameters(  "Create" );      
  2226.                 inparams["CommandLine"] = (String)_commandline;      
  2227.                 inparams["CurrentDirectory"] = (String)_currentdirectory;      
  2228.                 inparams["ProcessStartupInformation"] = (Object)_processstartupinformation;      
  2229.                 ManagementBaseObject param = mo.InvokeMethod( "Create" , inparams , null );                                            
  2230.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2231.                 mo.Dispose();                                                                                                                
  2232.             } catch (Exception ex) { LogError(ex); }                                                      
  2233.             return i;                                                                                                                    
  2234.         }                                                                                                                                
  2235.  
  2236.         #endregion public int Execute_Create_Method()  
  2237.  
  2238.  
  2239.         #region public int Execute_Terminate_Method()  
  2240.  
  2241.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2242.         ///                                                                                                                  
  2243.         ///  Execute_Terminate_Method(string instancepath, UInt32 _reason )                                                  
  2244.         ///                                                                                                                  
  2245.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2246.         ///<summary>                                                                                                                      
  2247.         ///   Execute_Terminate_Method( string instancepath, UInt32 _reason  )                                                                                      
  2248.         ///</summary>                                                                                                                    
  2249.         ///<returns>int ReturnValue</returns>                                                                                            
  2250.         public int Execute_Terminate_Method( string instancepath, UInt32 _reason  )                                                              
  2251.         {                                                                                              
  2252.             int i = -1;                                            
  2253.             try {                                                                                                                          
  2254.                 string ip = instancepath;                                                                                                                          
  2255.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                          
  2256.                 else { ip = "=@"; }                                                                                                                          
  2257.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2258.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2259.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2260.                 mo.Scope.Connect();    
  2261.                 ManagementBaseObject inparams = mo.GetMethodParameters(  "Terminate" );      
  2262.                 inparams["Reason"] = (UInt32)_reason;      
  2263.                 ManagementBaseObject param = mo.InvokeMethod( "Terminate" , inparams , null );                                            
  2264.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2265.                 mo.Dispose();                                                                                                                
  2266.             } catch (Exception ex) { LogError(ex); }                                                      
  2267.             return i;                                                                                                                    
  2268.         }                                                                                                                                
  2269.  
  2270.         #endregion public int Execute_Terminate_Method()  
  2271.  
  2272.  
  2273.         #region public int Execute_GetOwner_Method()  
  2274.  
  2275.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2276.         ///                                                                                                                  
  2277.         ///  public int Execute_GetOwner_Method()                                                                            
  2278.         ///                                                                                                                  
  2279.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2280.         ///<summary>                                                                                                                      
  2281.         ///   Execute_GetOwner_Method()                                                                                        
  2282.         ///</summary>                                                                                                                    
  2283.         ///<returns>int ReturnValue</returns>                                                                                            
  2284.         public int Execute_GetOwner_Method( string instancepath )                                                              
  2285.         {                                                                                              
  2286.             int i = -1;                                            
  2287.             try{                                                                                                                          
  2288.                 string ip = instancepath;                                                                                                                          
  2289.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                        
  2290.                 else { ip = "Win32_Process=@"; }                                                                                                                          
  2291.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2292.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2293.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2294.                 ManagementBaseObject param = mo.InvokeMethod( "GetOwner" , null , null );                                            
  2295.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2296.                 mo.Dispose();                                                                                                                
  2297.             } catch (Exception ex) { LogError(ex); }                                                      
  2298.             return i;                                                                                                                    
  2299.         }                                                                                                                                
  2300.  
  2301.         #endregion public int Execute_GetOwner_Method()  
  2302.  
  2303.         #region public int Execute_GetOwnerSid_Method()  
  2304.  
  2305.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2306.         ///                                                                                                                  
  2307.         ///  public int Execute_GetOwnerSid_Method()                                                                        
  2308.         ///                                                                                                                  
  2309.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2310.         ///<summary>                                                                                                                      
  2311.         ///   Execute_GetOwnerSid_Method()                                                                                        
  2312.         ///</summary>                                                                                                                    
  2313.         ///<returns>int ReturnValue</returns>                                                                                            
  2314.         public int Execute_GetOwnerSid_Method( string instancepath )                                                              
  2315.         {                                                                                              
  2316.             int i = -1;                                            
  2317.             try{                                                                                                                          
  2318.                 string ip = instancepath;                                                                                                                          
  2319.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                        
  2320.                 else { ip = "Win32_Process=@"; }                                                                                                                          
  2321.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2322.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2323.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2324.                 ManagementBaseObject param = mo.InvokeMethod( "GetOwnerSid" , null , null );                                            
  2325.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2326.                 mo.Dispose();                                                                                                                
  2327.             } catch (Exception ex) { LogError(ex); }                                                      
  2328.             return i;                                                                                                                    
  2329.         }                                                                                                                                
  2330.  
  2331.         #endregion public int Execute_GetOwnerSid_Method()  
  2332.  
  2333.         #region public int Execute_SetPriority_Method()  
  2334.  
  2335.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2336.         ///                                                                                                                  
  2337.         ///  Execute_SetPriority_Method(string instancepath, Int32 _priority )                                              
  2338.         ///                                                                                                                  
  2339.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2340.         ///<summary>                                                                                                                      
  2341.         ///   Execute_SetPriority_Method( string instancepath, Int32 _priority  )                                                                                      
  2342.         ///</summary>                                                                                                                    
  2343.         ///<returns>int ReturnValue</returns>                                                                                            
  2344.         public int Execute_SetPriority_Method( string instancepath, Int32 _priority  )                                                              
  2345.         {                                                                                              
  2346.             int i = -1;                                            
  2347.             try {                                                                                                                          
  2348.                 string ip = instancepath;                                                                                                                          
  2349.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                          
  2350.                 else { ip = "=@"; }                                                                                                                          
  2351.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2352.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2353.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2354.                 mo.Scope.Connect();    
  2355.                 ManagementBaseObject inparams = mo.GetMethodParameters(  "SetPriority" );      
  2356.                 inparams["Priority"] = (Int32)_priority;      
  2357.                 ManagementBaseObject param = mo.InvokeMethod( "SetPriority" , inparams , null );                                            
  2358.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2359.                 mo.Dispose();                                                                                                                
  2360.             } catch (Exception ex) { LogError(ex); }                                                      
  2361.             return i;                                                                                                                    
  2362.         }                                                                                                                                
  2363.  
  2364.         #endregion public int Execute_SetPriority_Method()  
  2365.  
  2366.  
  2367.         #region public int Execute_AttachDebugger_Method()  
  2368.  
  2369.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2370.         ///                                                                                                                  
  2371.         ///  public int Execute_AttachDebugger_Method()                                                                      
  2372.         ///                                                                                                                  
  2373.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2374.         ///<summary>                                                                                                                      
  2375.         ///   Execute_AttachDebugger_Method()                                                                                        
  2376.         ///</summary>                                                                                                                    
  2377.         ///<returns>int ReturnValue</returns>                                                                                            
  2378.         public int Execute_AttachDebugger_Method( string instancepath )                                                              
  2379.         {                                                                                              
  2380.             int i = -1;                                            
  2381.             try{                                                                                                                          
  2382.                 string ip = instancepath;                                                                                                                          
  2383.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                        
  2384.                 else { ip = "Win32_Process=@"; }                                                                                                                          
  2385.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2386.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2387.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2388.                 ManagementBaseObject param = mo.InvokeMethod( "AttachDebugger" , null , null );                                            
  2389.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2390.                 mo.Dispose();                                                                                                                
  2391.             } catch (Exception ex) { LogError(ex); }                                                      
  2392.             return i;                                                                                                                    
  2393.         }                                                                                                                                
  2394.  
  2395.         #endregion public int Execute_AttachDebugger_Method()  
  2396.  
  2397.         #region public int Execute_GetAvailableVirtualSize_Method()  
  2398.  
  2399.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2400.         ///                                                                                                                  
  2401.         ///  public int Execute_GetAvailableVirtualSize_Method()                                                            
  2402.         ///                                                                                                                  
  2403.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  2404.         ///<summary>                                                                                                                      
  2405.         ///   Execute_GetAvailableVirtualSize_Method()                                                                                        
  2406.         ///</summary>                                                                                                                    
  2407.         ///<returns>int ReturnValue</returns>                                                                                            
  2408.         public int Execute_GetAvailableVirtualSize_Method( string instancepath )                                                              
  2409.         {                                                                                              
  2410.             int i = -1;                                            
  2411.             try{                                                                                                                          
  2412.                 string ip = instancepath;                                                                                                                          
  2413.                 if (this.InstancePath != "") { ip = this.InstancePath; }                                                                                                                        
  2414.                 else { ip = "Win32_Process=@"; }                                                                                                                          
  2415.                 ManagementScope scope = new ManagementScope("ROOT\\CIMV2");  
  2416.                 ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());  
  2417.                 mo.Scope.Options.EnablePrivileges = true;                                                  
  2418.                 ManagementBaseObject param = mo.InvokeMethod( "GetAvailableVirtualSize" , null , null );                                            
  2419.                 i = Convert.ToInt32(param[ "ReturnValue" ].ToString());                                                                      
  2420.                 mo.Dispose();                                                                                                                
  2421.             } catch (Exception ex) { LogError(ex); }                                                      
  2422.             return i;                                                                                                                    
  2423.         }                                                                                                                                
  2424.  
  2425.         #endregion public int Execute_GetAvailableVirtualSize_Method()  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.         #region Get_All_Win32_Process_Objects()  
  2431.         ///===================================================================================================  
  2432.         ///                                                                                                    
  2433.         ///    Get_All_Win32_Process_Objects()                                                
  2434.         ///                                                                                                    
  2435.         ///===================================================================================================  
  2436.         ///  <summary>  
  2437.         ///    Returns an ArrayList of 'Win32_Process' objects with all fields filled  
  2438.         ///  </summary>  
  2439.         /// <returns>ArrayList of 'Win32_Process' objects</returns>  
  2440.         public ArrayList Get_All_Win32_Process_Objects()  
  2441.         {  
  2442.  
  2443.             ArrayList the_ArrayList = new ArrayList();  
  2444.  
  2445.             ConnectionOptions co = new ConnectionOptions();  
  2446.  
  2447.             co.EnablePrivileges = true;  
  2448.             co.Impersonation = ImpersonationLevel.Impersonate;  
  2449.             co.Authentication = AuthenticationLevel.PacketPrivacy;  
  2450.             co.Timeout = new TimeSpan(0, 0, 10);                          
  2451.  
  2452.             if(!this._islocalconnection)  
  2453.             {  
  2454.                 co.Username = this._username;    
  2455.                 co.Password = this._password;    
  2456.                 co.Authority = "ntlmdomain:" + this._hostname;  
  2457.             }  
  2458.  
  2459.             ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);  
  2460.  
  2461.             ms.Connect();                                                              
  2462.  
  2463.             while (!ms.IsConnected)  
  2464.             {  
  2465.                 System.Threading.Thread.Sleep(1);    
  2466.             }    
  2467.             if( !ms.IsConnected )                                                    
  2468.             {                                                                        
  2469.                 LogWarning( "Could not connect to management scope!" + ms.Path );  
  2470.             }                                                                        
  2471.             else                                                                        
  2472.             {                                                                        
  2473.                 ObjectQuery oQuery = new ObjectQuery(this._wmiquery);  
  2474.                 ManagementObjectSearcher searcher = new ManagementObjectSearcher(ms, oQuery);  
  2475.                 searcher.Options.UseAmendedQualifiers = false;  
  2476.                 ManagementObjectCollection moc = searcher.Get();  
  2477.                 foreach (ManagementObject mo in moc)  
  2478.                 {  
  2479.                     Win32_Process x = new Win32_Process();  
  2480.                     x._instancepath =  mo.Path.RelativePath;  
  2481.                     x._knownhostid = this.KnownHostID;    
  2482.                     x._hostname = this._hostname;  
  2483.  
  2484.  
  2485.                     try  
  2486.                     {  
  2487.                         x.varCaption = Convert.ToString(mo.GetPropertyValue("Caption")); //todo: 4779  Type:String Array?:False  
  2488.                     }  
  2489.                     catch(Exception ex)  
  2490.                     {  
  2491.                         LogError(ex);  
  2492.                     }  
  2493.                     try  
  2494.                     {  
  2495.                         x.varCommandLine = Convert.ToString(mo.GetPropertyValue("CommandLine")); //todo: 4779  Type:String Array?:False  
  2496.                     }  
  2497.                     catch(Exception ex)  
  2498.                     {  
  2499.                         LogError(ex);  
  2500.                     }  
  2501.                     try  
  2502.                     {  
  2503.                         x.varCreationClassName = Convert.ToString(mo.GetPropertyValue("CreationClassName")); //todo: 4779  Type:String Array?:False  
  2504.                     }  
  2505.                     catch(Exception ex)  
  2506.                     {  
  2507.                         LogError(ex);  
  2508.                     }  
  2509.                     try  
  2510.                     {  
  2511.                         x.varCreationDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("CreationDate"))); //4733 Type:DateTime Array?:False  
  2512.                     }  
  2513.                     catch(Exception ex)  
  2514.                    {  
  2515.                         LogError(ex);  
  2516.                     }  
  2517.                     try  
  2518.                     {  
  2519.                         x.varCSCreationClassName = Convert.ToString(mo.GetPropertyValue("CSCreationClassName")); //todo: 4779  Type:String Array?:False  
  2520.                     }  
  2521.                     catch(Exception ex)  
  2522.                     {  
  2523.                         LogError(ex);  
  2524.                     }  
  2525.                     try  
  2526.                     {  
  2527.                         x.varCSName = Convert.ToString(mo.GetPropertyValue("CSName")); //todo: 4779  Type:String Array?:False  
  2528.                     }  
  2529.                     catch(Exception ex)  
  2530.                     {  
  2531.                         LogError(ex);  
  2532.                     }  
  2533.                     try  
  2534.                     {  
  2535.                         x.varDescription = Convert.ToString(mo.GetPropertyValue("Description")); //todo: 4779  Type:String Array?:False  
  2536.                     }  
  2537.                     catch(Exception ex)  
  2538.                     {  
  2539.                         LogError(ex);  
  2540.                     }  
  2541.                     try  
  2542.                     {  
  2543.                         x.varExecutablePath = Convert.ToString(mo.GetPropertyValue("ExecutablePath")); //todo: 4779  Type:String Array?:False  
  2544.                     }  
  2545.                     catch(Exception ex)  
  2546.                     {  
  2547.                         LogError(ex);  
  2548.                     }  
  2549.                     try  
  2550.                     {  
  2551.                         x.varExecutionState = Convert.ToUInt16(mo.GetPropertyValue("ExecutionState")); //todo: 4779  Type:UInt16 Array?:False  
  2552.                     }  
  2553.                     catch(Exception ex)  
  2554.                     {  
  2555.                         LogError(ex);  
  2556.                     }  
  2557.                     try  
  2558.                     {  
  2559.                         x.varHandle = Convert.ToString(mo.GetPropertyValue("Handle")); //todo: 4779  Type:String Array?:False  
  2560.                     }  
  2561.                     catch(Exception ex)  
  2562.                     {  
  2563.                         LogError(ex);  
  2564.                     }  
  2565.                     try  
  2566.                     {  
  2567.                         x.varHandleCount = Convert.ToUInt32(mo.GetPropertyValue("HandleCount")); //todo: 4779  Type:UInt32 Array?:False  
  2568.                     }  
  2569.                     catch(Exception ex)  
  2570.                     {  
  2571.                         LogError(ex);  
  2572.                     }  
  2573.                     try  
  2574.                     {  
  2575.                         x.varInstallDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("InstallDate"))); //4733 Type:DateTime Array?:False  
  2576.                     }  
  2577.                     catch(Exception ex)  
  2578.                    {  
  2579.                         LogError(ex);  
  2580.                     }  
  2581.                     try  
  2582.                     {  
  2583.                         x.varKernelModeTime = Convert.ToUInt64(mo.GetPropertyValue("KernelModeTime")); //todo: 4779  Type:UInt64 Array?:False  
  2584.                     }  
  2585.                     catch(Exception ex)  
  2586.                     {  
  2587.                         LogError(ex);  
  2588.                     }  
  2589.                     try  
  2590.                     {  
  2591.                         x.varMaximumWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("MaximumWorkingSetSize")); //todo: 4779  Type:UInt32 Array?:False  
  2592.                     }  
  2593.                     catch(Exception ex)  
  2594.                     {  
  2595.                         LogError(ex);  
  2596.                     }  
  2597.                     try  
  2598.                     {  
  2599.                         x.varMinimumWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("MinimumWorkingSetSize")); //todo: 4779  Type:UInt32 Array?:False  
  2600.                     }  
  2601.                     catch(Exception ex)  
  2602.                     {  
  2603.                         LogError(ex);  
  2604.                     }  
  2605.                     try  
  2606.                     {  
  2607.                         x.varName = Convert.ToString(mo.GetPropertyValue("Name")); //todo: 4779  Type:String Array?:False  
  2608.                     }  
  2609.                     catch(Exception ex)  
  2610.                     {  
  2611.                         LogError(ex);  
  2612.                     }  
  2613.                     try  
  2614.                     {  
  2615.                         x.varOSCreationClassName = Convert.ToString(mo.GetPropertyValue("OSCreationClassName")); //todo: 4779  Type:String Array?:False  
  2616.                     }  
  2617.                     catch(Exception ex)  
  2618.                     {  
  2619.                         LogError(ex);  
  2620.                     }  
  2621.                     try  
  2622.                     {  
  2623.                         x.varOSName = Convert.ToString(mo.GetPropertyValue("OSName")); //todo: 4779  Type:String Array?:False  
  2624.                     }  
  2625.                     catch(Exception ex)  
  2626.                     {  
  2627.                         LogError(ex);  
  2628.                     }  
  2629.                     try  
  2630.                     {  
  2631.                         x.varOtherOperationCount = Convert.ToUInt64(mo.GetPropertyValue("OtherOperationCount")); //todo: 4779  Type:UInt64 Array?:False  
  2632.                     }  
  2633.                     catch(Exception ex)  
  2634.                     {  
  2635.                         LogError(ex);  
  2636.                     }  
  2637.                     try  
  2638.                     {  
  2639.                         x.varOtherTransferCount = Convert.ToUInt64(mo.GetPropertyValue("OtherTransferCount")); //todo: 4779  Type:UInt64 Array?:False  
  2640.                     }  
  2641.                     catch(Exception ex)  
  2642.                     {  
  2643.                         LogError(ex);  
  2644.                     }  
  2645.                     try  
  2646.                     {  
  2647.                         x.varPageFaults = Convert.ToUInt32(mo.GetPropertyValue("PageFaults")); //todo: 4779  Type:UInt32 Array?:False  
  2648.                     }  
  2649.                     catch(Exception ex)  
  2650.                     {  
  2651.                         LogError(ex);  
  2652.                     }  
  2653.                     try  
  2654.                     {  
  2655.                         x.varPageFileUsage = Convert.ToUInt32(mo.GetPropertyValue("PageFileUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2656.                     }  
  2657.                     catch(Exception ex)  
  2658.                     {  
  2659.                         LogError(ex);  
  2660.                     }  
  2661.                     try  
  2662.                     {  
  2663.                         x.varParentProcessId = Convert.ToUInt32(mo.GetPropertyValue("ParentProcessId")); //todo: 4779  Type:UInt32 Array?:False  
  2664.                     }  
  2665.                     catch(Exception ex)  
  2666.                     {  
  2667.                         LogError(ex);  
  2668.                     }  
  2669.                     try  
  2670.                     {  
  2671.                         x.varPeakPageFileUsage = Convert.ToUInt32(mo.GetPropertyValue("PeakPageFileUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2672.                     }  
  2673.                     catch(Exception ex)  
  2674.                     {  
  2675.                         LogError(ex);  
  2676.                     }  
  2677.                     try  
  2678.                     {  
  2679.                         x.varPeakVirtualSize = Convert.ToUInt64(mo.GetPropertyValue("PeakVirtualSize")); //todo: 4779  Type:UInt64 Array?:False  
  2680.                     }  
  2681.                     catch(Exception ex)  
  2682.                     {  
  2683.                         LogError(ex);  
  2684.                     }  
  2685.                     try  
  2686.                     {  
  2687.                         x.varPeakWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("PeakWorkingSetSize")); //todo: 4779  Type:UInt32 Array?:False  
  2688.                     }  
  2689.                     catch(Exception ex)  
  2690.                     {  
  2691.                         LogError(ex);  
  2692.                     }  
  2693.                     try  
  2694.                     {  
  2695.                         x.varPriority = Convert.ToUInt32(mo.GetPropertyValue("Priority")); //todo: 4779  Type:UInt32 Array?:False  
  2696.                     }  
  2697.                     catch(Exception ex)  
  2698.                     {  
  2699.                         LogError(ex);  
  2700.                     }  
  2701.                     try  
  2702.                     {  
  2703.                         x.varPrivatePageCount = Convert.ToUInt64(mo.GetPropertyValue("PrivatePageCount")); //todo: 4779  Type:UInt64 Array?:False  
  2704.                     }  
  2705.                     catch(Exception ex)  
  2706.                     {  
  2707.                         LogError(ex);  
  2708.                     }  
  2709.                     try  
  2710.                     {  
  2711.                         x.varProcessId = Convert.ToUInt32(mo.GetPropertyValue("ProcessId")); //todo: 4779  Type:UInt32 Array?:False  
  2712.                     }  
  2713.                     catch(Exception ex)  
  2714.                     {  
  2715.                         LogError(ex);  
  2716.                     }  
  2717.                     try  
  2718.                     {  
  2719.                         x.varQuotaNonPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaNonPagedPoolUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2720.                     }  
  2721.                     catch(Exception ex)  
  2722.                     {  
  2723.                         LogError(ex);  
  2724.                     }  
  2725.                     try  
  2726.                     {  
  2727.                         x.varQuotaPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPagedPoolUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2728.                     }  
  2729.                     catch(Exception ex)  
  2730.                     {  
  2731.                         LogError(ex);  
  2732.                     }  
  2733.                     try  
  2734.                     {  
  2735.                         x.varQuotaPeakNonPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPeakNonPagedPoolUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2736.                     }  
  2737.                     catch(Exception ex)  
  2738.                     {  
  2739.                         LogError(ex);  
  2740.                     }  
  2741.                     try  
  2742.                     {  
  2743.                         x.varQuotaPeakPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPeakPagedPoolUsage")); //todo: 4779  Type:UInt32 Array?:False  
  2744.                     }  
  2745.                     catch(Exception ex)  
  2746.                     {  
  2747.                         LogError(ex);  
  2748.                     }  
  2749.                     try  
  2750.                     {  
  2751.                         x.varReadOperationCount = Convert.ToUInt64(mo.GetPropertyValue("ReadOperationCount")); //todo: 4779  Type:UInt64 Array?:False  
  2752.                     }  
  2753.                     catch(Exception ex)  
  2754.                     {  
  2755.                         LogError(ex);  
  2756.                     }  
  2757.                     try  
  2758.                     {  
  2759.                         x.varReadTransferCount = Convert.ToUInt64(mo.GetPropertyValue("ReadTransferCount")); //todo: 4779  Type:UInt64 Array?:False  
  2760.                     }  
  2761.                     catch(Exception ex)  
  2762.                     {  
  2763.                         LogError(ex);  
  2764.                     }  
  2765.                     try  
  2766.                     {  
  2767.                         x.varSessionId = Convert.ToUInt32(mo.GetPropertyValue("SessionId")); //todo: 4779  Type:UInt32 Array?:False  
  2768.                     }  
  2769.                     catch(Exception ex)  
  2770.                     {  
  2771.                         LogError(ex);  
  2772.                     }  
  2773.                     try  
  2774.                     {  
  2775.                         x.varStatus = Convert.ToString(mo.GetPropertyValue("Status")); //todo: 4779  Type:String Array?:False  
  2776.                     }  
  2777.                     catch(Exception ex)  
  2778.                     {  
  2779.                         LogError(ex);  
  2780.                     }  
  2781.                     try  
  2782.                     {  
  2783.                         x.varTerminationDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("TerminationDate"))); //4733 Type:DateTime Array?:False  
  2784.                     }  
  2785.                     catch(Exception ex)  
  2786.                    {  
  2787.                         LogError(ex);  
  2788.                     }  
  2789.                     try  
  2790.                     {  
  2791.                         x.varThreadCount = Convert.ToUInt32(mo.GetPropertyValue("ThreadCount")); //todo: 4779  Type:UInt32 Array?:False  
  2792.                     }  
  2793.                     catch(Exception ex)  
  2794.                     {  
  2795.                         LogError(ex);  
  2796.                     }  
  2797.                     try  
  2798.                     {  
  2799.                         x.varUserModeTime = Convert.ToUInt64(mo.GetPropertyValue("UserModeTime")); //todo: 4779  Type:UInt64 Array?:False  
  2800.                     }  
  2801.                     catch(Exception ex)  
  2802.                     {  
  2803.                         LogError(ex);  
  2804.                     }  
  2805.                     try  
  2806.                     {  
  2807.                         x.varVirtualSize = Convert.ToUInt64(mo.GetPropertyValue("VirtualSize")); //todo: 4779  Type:UInt64 Array?:False  
  2808.                     }  
  2809.                     catch(Exception ex)  
  2810.                     {  
  2811.                         LogError(ex);  
  2812.                     }  
  2813.                     try  
  2814.                     {  
  2815.                         x.varWindowsVersion = Convert.ToString(mo.GetPropertyValue("WindowsVersion")); //todo: 4779  Type:String Array?:False  
  2816.                     }  
  2817.                     catch(Exception ex)  
  2818.                     {  
  2819.                         LogError(ex);  
  2820.                     }  
  2821.                     try  
  2822.                     {  
  2823.                         x.varWorkingSetSize = Convert.ToUInt64(mo.GetPropertyValue("WorkingSetSize")); //todo: 4779  Type:UInt64 Array?:False  
  2824.                     }  
  2825.                     catch(Exception ex)  
  2826.                     {  
  2827.                         LogError(ex);  
  2828.                     }  
  2829.                     try  
  2830.                     {  
  2831.                         x.varWriteOperationCount = Convert.ToUInt64(mo.GetPropertyValue("WriteOperationCount")); //todo: 4779  Type:UInt64 Array?:False  
  2832.                     }  
  2833.                     catch(Exception ex)  
  2834.                     {  
  2835.                         LogError(ex);  
  2836.                     }  
  2837.                     try  
  2838.                     {  
  2839.                         x.varWriteTransferCount = Convert.ToUInt64(mo.GetPropertyValue("WriteTransferCount")); //todo: 4779  Type:UInt64 Array?:False  
  2840.                     }  
  2841.                     catch(Exception ex)  
  2842.                     {  
  2843.                         LogError(ex);  
  2844.                     }  
  2845.                     the_ArrayList.Add(x);  
  2846.                 }  
  2847.  
  2848.                 searcher.Dispose();  
  2849.                 moc.Dispose();  
  2850.             }  
  2851.  
  2852.         return the_ArrayList;  
  2853.  
  2854.         }  
  2855.  
  2856.         #endregion  
  2857.  
  2858.  
  2859.  
  2860.         ///====================================================================================================  
  2861.         ///                                                                                                      
  2862.         ///     public ManagementObjectCollection GetInstances( ManagementClass m )                              
  2863.         ///                                                                                                      
  2864.         ///====================================================================================================  
  2865.         ///<summary>                                                                                            
  2866.         ///  Get a managementobjectcollection from the selected class                                          
  2867.         ///</summary>                                                                                          
  2868.         ///<param name="m">ManagementClass</param>                                                            
  2869.         ///<returns>ManagementObjectCollection</returns>                                                        
  2870.         public ManagementObjectCollection GetInstances( ManagementClass m )                                    
  2871.         {                                                                                                      
  2872.             ManagementPath mgtPath = new ManagementPath(m.Path.Path);                                          
  2873.             ConnectionOptions co = new ConnectionOptions();                                              
  2874.             co.Authentication = AuthenticationLevel.Packet;                                              
  2875.             co.EnablePrivileges = true;                                                                  
  2876.             co.Timeout = TimeSpan.MaxValue;                                                              
  2877.             if(this._username != ""){ co.Username = this._username;  }  
  2878.             if(this._password != ""){ co.Password = this._password;  }  
  2879.             ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);  
  2880.             ms.Options.Timeout = TimeSpan.MaxValue;                                                        
  2881.             ms.Options.Impersonation = ImpersonationLevel.Impersonate;                                      
  2882.             ms.Options.EnablePrivileges = true;                                                            
  2883.             ms.Connect();                                                            
  2884.             if( !ms.IsConnected )                                                    
  2885.             {                                                                        
  2886.                 LogWarning( "Could not connect to management scope!" + ms.Path );  
  2887.             }                                                                        
  2888.             SelectQuery selQuery = new SelectQuery( m.Path.ClassName );                                        
  2889.             ManagementObjectSearcher s = new ManagementObjectSearcher( ms , selQuery );                    
  2890.             s.Options.UseAmendedQualifiers = true;                                                              
  2891.             s.Options.DirectRead = true;                                                                        
  2892.             s.Options.EnumerateDeep = true;                                                                    
  2893.             return s.Get();                                                                                    
  2894.         }                                                                                                      
  2895.         ///====================================================================================================  
  2896.         ///===================================================================================================  
  2897.         ///                                                                                                    
  2898.         ///    public ManagementObject GetFirstInstance( string p_classname,  string p_SysRelPath )            
  2899.         ///                                                                                                    
  2900.         ///===================================================================================================  
  2901.         ///<summary>                                                                                            
  2902.         ///  Get a ManagementObject by its key property value                                                  
  2903.         ///</summary>                                                                                          
  2904.         ///  Win32_DiskDrive, DeviceID="\\.\PHYSICALDRIVE0"                                                
  2905.         ///  Win32_NetworkAdapter, DeviceID="0"                                                              
  2906.         ///  <param name="p_ClassName">WMI Class Name</param>                                                
  2907.         ///  <param name="p_RelPath">DeviceID="CPU0" (Example)</param>                                      
  2908.         ///<returns>ManagementObject</returns>                                                                  
  2909.         public ManagementObject GetFirstInstance( string p_classname,  string p_SysRelPath )                    
  2910.         {                                                                                                      
  2911.             ManagementPath mgtPath = new ManagementPath(p_classname);                                          
  2912.             ConnectionOptions co = new ConnectionOptions();                                              
  2913.             co.Authentication = AuthenticationLevel.Packet;                                              
  2914.             co.EnablePrivileges = true;                                                                  
  2915.             co.Timeout = TimeSpan.MaxValue;                                                              
  2916.             if(this._username != ""){ co.Username = this._username;  }  
  2917.             if(this._password != ""){ co.Password = this._password;  }  
  2918.             ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);  
  2919.             ms.Options.Timeout = TimeSpan.MaxValue;                                                        
  2920.             ms.Options.Impersonation = ImpersonationLevel.Impersonate;                                      
  2921.             ms.Options.EnablePrivileges = true;                                                            
  2922.             ms.Connect();                                                            
  2923.             if( !ms.IsConnected )                                                    
  2924.             {                                                                        
  2925.                 LogWarning( "Could not connect to management scope!" + ms.Path );  
  2926.             }                                                                        
  2927.             SelectQuery selQuery = new SelectQuery( p_classname , p_SysRelPath  );                              
  2928.             ManagementObjectSearcher moSearcher = new ManagementObjectSearcher( ms , selQuery );            
  2929.             moSearcher.Options.UseAmendedQualifiers = false;                                                    
  2930.             ManagementObject mo = new ManagementObject();                                                      
  2931.             foreach( ManagementObject mob in moSearcher.Get() )                                                
  2932.             {                                                                                                  
  2933.                 mo = mob;                                                                                      
  2934.                 break;                                                                                          
  2935.             }                                                                                                  
  2936.             return mo;                                                                                          
  2937.         }                                                                                                      
  2938.         ///===================================================================================================  
  2939.         ///                                                                                                    
  2940.         ///    public ManagementObject GetByPath( string p_SysFullPath )                                        
  2941.         ///                                                                                                    
  2942.         ///===================================================================================================  
  2943.         ///<summary>                                                                                            
  2944.         ///  Get a ManagementObject by its key property value                                                  
  2945.         ///</summary>                                                                                          
  2946.         ///  Win32_DiskDrive, DeviceID="\\.\PHYSICALDRIVE0"                                                
  2947.         ///  Win32_NetworkAdapter, DeviceID="0"                                                              
  2948.         ///  etc...                                                                                            
  2949.         ///  <param name="p_ClassName">WMI Class Name</param>                                                
  2950.         ///  <param name="p_SysRelPath">DeviceID="CPU0" (Example)</param>                                      
  2951.         ///<returns>ManagementObject</returns>                                                                  
  2952.         public ManagementObject GetInstanceByPath(string p_classname, string p_SysRelPath )                    
  2953.         {                                                                                                      
  2954.             ManagementPath mgtPath = new ManagementPath(p_classname);                                          
  2955.             ConnectionOptions co = new ConnectionOptions();                                              
  2956.             co.Authentication = AuthenticationLevel.Packet;                                              
  2957.             co.EnablePrivileges = true;                                                                  
  2958.             co.Timeout = TimeSpan.MaxValue;                                                              
  2959.             if(this._username != ""){ co.Username = this._username;  }  
  2960.             if(this._password != ""){ co.Password = this._password;  }  
  2961.             ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);  
  2962.             ms.Options.Timeout = TimeSpan.MaxValue;                                                        
  2963.             ms.Options.Impersonation = ImpersonationLevel.Impersonate;                                      
  2964.             ms.Options.EnablePrivileges = true;                                                            
  2965.             ms.Connect();                                                            
  2966.             if( !ms.IsConnected )                                                    
  2967.             {                                                                        
  2968.                 LogWarning( "Could not connect to management scope!" + ms.Path );  
  2969.             }                                                                        
  2970.             SelectQuery selQuery = new SelectQuery( p_classname , p_SysRelPath  );                              
  2971.             ManagementObjectSearcher moSearcher = new ManagementObjectSearcher( ms , selQuery );            
  2972.             moSearcher.Options.UseAmendedQualifiers = true;                                                              
  2973.             ManagementObject mob = new ManagementObject();                                                      
  2974.             foreach( ManagementObject mo in moSearcher.Get() )                                                  
  2975.             {                                                                                                  
  2976.                 mob = mo;                                                                                      
  2977.             }                                                                                                  
  2978.             return mob;                                                                                        
  2979.         }                                                                                                      
  2980.         ///====================================================================================================  
  2981.         #region InstancesToHTML()    
  2982.         ///===================================================================================================  
  2983.         ///                                                                                                    
  2984.         ///    public static string InstancesToHTML()                                                          
  2985.         ///                                                                                                    
  2986.         ///===================================================================================================  
  2987.         ///  <summary>  
  2988.         ///    Returns a html string of all instances of this class  
  2989.         ///  </summary>  
  2990.         /// <returns>string html</returns>  
  2991.         public static string InstancesToHtml()  
  2992.         {                                                                            
  2993.  
  2994.         ConnectionOptions co = new ConnectionOptions();  
  2995.             co.EnablePrivileges = true;  
  2996.             co.Impersonation = ImpersonationLevel.Impersonate;  
  2997.             co.Authentication = AuthenticationLevel.PacketPrivacy;  
  2998.         ManagementScope ms = new ManagementScope( "\\\\.\\\\root\\CIMV2", co );  
  2999.         ObjectQuery oQuery = new ObjectQuery( "select * from Win32_Process" );  
  3000.         ManagementObjectSearcher searcher = new ManagementObjectSearcher( ms , oQuery );  
  3001.         ManagementObjectCollection moc = searcher.Get();  
  3002.  
  3003.          System.Text.StringBuilder sb = new System.Text.StringBuilder();  
  3004.          sb.AppendLine();  
  3005.          sb.AppendLine( "<!-- generated by hydra-->" );  
  3006.          sb.AppendLine( " < table border=1 cellpadding=5 cellspacing=0>" );  
  3007.          sb.AppendLine( " < tr><td colspan=2><strong>" + searcher.Scope.Path.Path + "</strong></td></tr>" );  
  3008.  
  3009.         foreach( ManagementObject mo in moc )  
  3010.         {  
  3011.             sb.AppendLine( "" );  
  3012.             sb.AppendLine( " < tr><td colspan=2><strong>" + mo.Path.Path.ToString() + "</strong></td></tr>" );  
  3013.             sb.AppendLine( " < tr><td>Caption</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Caption") ) + "</td></tr>" );    
  3014.             sb.AppendLine( " < tr><td>CommandLine</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CommandLine") ) + "</td></tr>" );    
  3015.             sb.AppendLine( " < tr><td>CreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CreationClassName") ) + "</td></tr>" );    
  3016.             sb.AppendLine( " < tr><td>CreationDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CreationDate") ) + "</td></tr>" );    
  3017.             sb.AppendLine( " < tr><td>CSCreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CSCreationClassName") ) + "</td></tr>" );    
  3018.             sb.AppendLine( " < tr><td>CSName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CSName") ) + "</td></tr>" );    
  3019.             sb.AppendLine( " < tr><td>Description</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Description") ) + "</td></tr>" );    
  3020.             sb.AppendLine( " < tr><td>ExecutablePath</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ExecutablePath") ) + "</td></tr>" );    
  3021.             sb.AppendLine( " < tr><td>ExecutionState</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ExecutionState") ) + "</td></tr>" );    
  3022.             sb.AppendLine( " < tr><td>Handle</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Handle") ) + "</td></tr>" );    
  3023.             sb.AppendLine( " < tr><td>HandleCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("HandleCount") ) + "</td></tr>" );    
  3024.             sb.AppendLine( " < tr><td>InstallDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("InstallDate") ) + "</td></tr>" );    
  3025.             sb.AppendLine( " < tr><td>KernelModeTime</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("KernelModeTime") ) + "</td></tr>" );    
  3026.             sb.AppendLine( " < tr><td>MaximumWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("MaximumWorkingSetSize") ) + "</td></tr>" );    
  3027.             sb.AppendLine( " < tr><td>MinimumWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("MinimumWorkingSetSize") ) + "</td></tr>" );    
  3028.             sb.AppendLine( " < tr><td>Name</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Name") ) + "</td></tr>" );    
  3029.             sb.AppendLine( " < tr><td>OSCreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OSCreationClassName") ) + "</td></tr>" );    
  3030.             sb.AppendLine( " < tr><td>OSName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OSName") ) + "</td></tr>" );    
  3031.             sb.AppendLine( " < tr><td>OtherOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OtherOperationCount") ) + "</td></tr>" );    
  3032.             sb.AppendLine( " < tr><td>OtherTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OtherTransferCount") ) + "</td></tr>" );    
  3033.             sb.AppendLine( " < tr><td>PageFaults</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PageFaults") ) + "</td></tr>" );    
  3034.             sb.AppendLine( " < tr><td>PageFileUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PageFileUsage") ) + "</td></tr>" );    
  3035.             sb.AppendLine( " < tr><td>ParentProcessId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ParentProcessId") ) + "</td></tr>" );    
  3036.             sb.AppendLine( " < tr><td>PeakPageFileUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakPageFileUsage") ) + "</td></tr>" );    
  3037.             sb.AppendLine( " < tr><td>PeakVirtualSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakVirtualSize") ) + "</td></tr>" );    
  3038.             sb.AppendLine( " < tr><td>PeakWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakWorkingSetSize") ) + "</td></tr>" );    
  3039.             sb.AppendLine( " < tr><td>Priority</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Priority") ) + "</td></tr>" );    
  3040.             sb.AppendLine( " < tr><td>PrivatePageCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PrivatePageCount") ) + "</td></tr>" );    
  3041.             sb.AppendLine( " < tr><td>ProcessId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ProcessId") ) + "</td></tr>" );    
  3042.             sb.AppendLine( " < tr><td>QuotaNonPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaNonPagedPoolUsage") ) + "</td></tr>" );    
  3043.             sb.AppendLine( " < tr><td>QuotaPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPagedPoolUsage") ) + "</td></tr>" );    
  3044.             sb.AppendLine( " < tr><td>QuotaPeakNonPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPeakNonPagedPoolUsage") ) + "</td></tr>" );    
  3045.             sb.AppendLine( " < tr><td>QuotaPeakPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPeakPagedPoolUsage") ) + "</td></tr>" );    
  3046.             sb.AppendLine( " < tr><td>ReadOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ReadOperationCount") ) + "</td></tr>" );    
  3047.             sb.AppendLine( " < tr><td>ReadTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ReadTransferCount") ) + "</td></tr>" );    
  3048.             sb.AppendLine( " < tr><td>SessionId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("SessionId") ) + "</td></tr>" );    
  3049.             sb.AppendLine( " < tr><td>Status</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Status") ) + "</td></tr>" );    
  3050.             sb.AppendLine( " < tr><td>TerminationDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("TerminationDate") ) + "</td></tr>" );    
  3051.             sb.AppendLine( " < tr><td>ThreadCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ThreadCount") ) + "</td></tr>" );    
  3052.             sb.AppendLine( " < tr><td>UserModeTime</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("UserModeTime") ) + "</td></tr>" );    
  3053.             sb.AppendLine( " < tr><td>VirtualSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("VirtualSize") ) + "</td></tr>" );    
  3054.             sb.AppendLine( " < tr><td>WindowsVersion</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WindowsVersion") ) + "</td></tr>" );    
  3055.             sb.AppendLine( " < tr><td>WorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WorkingSetSize") ) + "</td></tr>" );    
  3056.             sb.AppendLine( " < tr><td>WriteOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WriteOperationCount") ) + "</td></tr>" );    
  3057.             sb.AppendLine( " < tr><td>WriteTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WriteTransferCount") ) + "</td></tr>" );    
  3058.             sb.AppendLine( " < tr><td colspan=2>&nbsp;</td></tr>" );    
  3059.         }  
  3060.         sb.AppendLine("</table>" );  
  3061.         sb.AppendLine();  
  3062.         searcher.Dispose();  
  3063.         moc.Dispose();  
  3064.         return sb.ToString();  
  3065.         }  
  3066.         #endregion    
  3067.  
  3068.  
  3069.         #region LogError( Exception ex)  
  3070.  
  3071.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3072.         ///                                                                                                                  
  3073.         ///  public static void LogError(Exception ex)                                                                      
  3074.         ///                                                                                                                  
  3075.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3076.         /// <summary>                                                                                                                              
  3077.         /// Log Errors                                                                                                                            
  3078.         /// </summary>                                                                                                                            
  3079.         public static void LogError(Exception ex)                                                                                                  
  3080.         {                                                                                                                                          
  3081.             EventLog Log = new EventLog( "Hydra" , ".", "Win32_Process");  
  3082.             if (!EventLog.SourceExists("Win32_Process"))    
  3083.             {  
  3084.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3085.             }  
  3086.             Log.Source = "Win32_Process";  
  3087.             Log.WriteEntry(ex.ToString(), EventLogEntryType.Error, 420 );  
  3088.         }  
  3089.  
  3090.         #endregion  
  3091.  
  3092.  
  3093.         #region LogError(Exception ex, int evt_id )  
  3094.  
  3095.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3096.         ///                                                                                                                  
  3097.         ///  public static void LogError(Exception ex, int evt_id)                                                          
  3098.         ///                                                                                                                  
  3099.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3100.         public static void LogError(Exception ex, int evt_id)  
  3101.         {  
  3102.             EventLog Log = new EventLog( "Hydra" , ".", "Win32_Process");  
  3103.             if (!EventLog.SourceExists("Win32_Process"))    
  3104.             {  
  3105.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3106.             }  
  3107.             Log.Source = "Win32_Process";  
  3108.             Log.WriteEntry(ex.ToString(), EventLogEntryType.Error, evt_id );  
  3109.         }  
  3110.  
  3111.         #endregion  
  3112.  
  3113.  
  3114.         #region LogWarning(string info)  
  3115.  
  3116.  
  3117.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3118.         ///                                                                                                                  
  3119.         ///  public static void LogWarning(string info)                                                                      
  3120.         ///                                                                                                                  
  3121.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3122.         /// <summary>                                                                                                                              
  3123.         /// Log Warning                                                                                                                            
  3124.         /// </summary>                                                                                                                            
  3125.         public static void LogWarning(string info)  
  3126.         {  
  3127.             EventLog Log = new EventLog("Hydra",".", "Hydra");  
  3128.             if (!EventLog.SourceExists("Win32_Process"))    
  3129.             {      
  3130.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3131.             }      
  3132.             Log.Source = "Win32_Process";  
  3133.             Log.WriteEntry(info, EventLogEntryType.Warning, 420 );  
  3134.         }  
  3135.  
  3136.         #endregion  
  3137.  
  3138.  
  3139.         #region LogWarning(string info, int evt_id)  
  3140.  
  3141.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3142.         ///                                                                                                                  
  3143.         ///  public static void LogWarning(string info, int evt_id)                                                          
  3144.         ///                                                                                                                  
  3145.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3146.         /// <summary>                                                                                                                              
  3147.         /// Log Warning                                                                                                                            
  3148.         /// </summary>                                                                                                                            
  3149.         public static void LogWarning(string info, int evt_id)  
  3150.         {  
  3151.             EventLog Log = new EventLog("Hydra",".", "Hydra");  
  3152.             if (!EventLog.SourceExists("Win32_Process"))    
  3153.             {      
  3154.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3155.             }      
  3156.             Log.Source = "Win32_Process";  
  3157.             Log.WriteEntry(info, EventLogEntryType.Warning, evt_id );  
  3158.         }  
  3159.  
  3160.         #endregion  
  3161.  
  3162.  
  3163.         #region LogInfo(string info)  
  3164.  
  3165.  
  3166.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3167.         ///                                                                                                                  
  3168.         ///  public static void LogInfo(string info)                                                                        
  3169.         ///                                                                                                                  
  3170.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3171.         /// <summary>                                                                                                                              
  3172.         /// Log Information                                                                                                                        
  3173.         /// </summary>                                                                                                                            
  3174.         public static void LogInfo(string info)  
  3175.         {  
  3176.             EventLog Log = new EventLog("Hydra",".", "Hydra");  
  3177.             if (!EventLog.SourceExists("Win32_Process"))    
  3178.             {      
  3179.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3180.             }      
  3181.             Log.Source = "Win32_Process";  
  3182.             Log.WriteEntry(info, EventLogEntryType.Information, 420 );  
  3183.         }  
  3184.  
  3185.         #endregion  
  3186.  
  3187.  
  3188.         #region LogInfo(string info, int evt_id)  
  3189.  
  3190.  
  3191.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3192.         ///                                                                                                                  
  3193.         ///  public static void LogInfo(string info, int evt_id)                                                            
  3194.         ///                                                                                                                  
  3195.         ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-  
  3196.         /// <summary>                                                                                                                              
  3197.         /// Log Information                                                                                                                        
  3198.         /// </summary>                                                                                                                            
  3199.         public static void LogInfo(string info, int evt_id)  
  3200.         {  
  3201.             EventLog Log = new EventLog("Hydra",".", "Hydra");  
  3202.             if (!EventLog.SourceExists("Win32_Process"))    
  3203.             {      
  3204.                 EventLog.CreateEventSource("Win32_Process", "Hydra");  
  3205.             }      
  3206.             Log.Source = "Win32_Process";  
  3207.             Log.WriteEntry(info, EventLogEntryType.Information, evt_id );  
  3208.         }  
  3209.  
  3210.         #endregion  
  3211.  
  3212.  
  3213.         #region Database Helper Methods  
  3214.         ///====================================================================================================  
  3215.         ///                                                                                                      
  3216.         ///  public void InsertIntoDatabase(string  DatabaseConnectionString )                                  
  3217.         ///                                                                                                      
  3218.         ///====================================================================================================  
  3219.         ///<summary>  
  3220.         /// insert this "Win32_Process" into the database  
  3221.         ///</summary>  
  3222.         public void InsertIntoDatabase(string  DatabaseConnectionString )  
  3223.         {  
  3224.         System.Data.SqlClient.SqlParameter[] p = new SqlParameter[47];  
  3225.         p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);    
  3226.         try    
  3227.         {      
  3228.             p[0].Value = this.HostName;    
  3229.         }      
  3230.         catch(Exception exp)    
  3231.         {    
  3232.             LogError(exp);    
  3233.         }    
  3234.         p[1] = new SqlParameter("@KnownHostID", SqlDbType.BigInt);    
  3235.         if(this.KnownHostID == -9 )  
  3236.         { throw new ApplicationException("Known Host ID was not set when trying to insert into the database");  }  
  3237.         try    
  3238.         {      
  3239.             p[1].Value = this.KnownHostID;    
  3240.         }      
  3241.         catch(Exception exp)    
  3242.         {    
  3243.             LogError(exp);    
  3244.         }    
  3245.         p[2] = new SqlParameter("@Caption", SqlDbType.NVarChar, 255 );    
  3246.         try    
  3247.         {      
  3248.             p[2].Value =  this.varCaption;    
  3249.         }      
  3250.         catch(Exception exp)    
  3251.         {    
  3252.             LogError(exp);    
  3253.             p[2].Value =  "";    
  3254.         }    
  3255.         p[3] = new SqlParameter("@CommandLine", SqlDbType.NVarChar, 255 );    
  3256.         try    
  3257.         {      
  3258.             p[3].Value =  this.varCommandLine;    
  3259.         }      
  3260.         catch(Exception exp)    
  3261.         {    
  3262.             LogError(exp);    
  3263.             p[3].Value =  "";    
  3264.         }    
  3265.         p[4] = new SqlParameter("@CreationClassName", SqlDbType.NVarChar, 255 );    
  3266.         try    
  3267.         {      
  3268.             p[4].Value =  this.varCreationClassName;    
  3269.         }      
  3270.         catch(Exception exp)    
  3271.         {    
  3272.             LogError(exp);    
  3273.             p[4].Value =  "";    
  3274.         }    
  3275.         p[5] = new SqlParameter("@CreationDate", SqlDbType.DateTime);    
  3276.         try    
  3277.         {      
  3278.             p[5].Value = Convert.ToDateTime(this.varCreationDate);    
  3279.         }      
  3280.         catch(Exception exp)    
  3281.         {    
  3282.             LogError(exp);    
  3283.             p[5].Value = DateTime.Now;    
  3284.         }    
  3285.         p[6] = new SqlParameter("@CSCreationClassName", SqlDbType.NVarChar, 255 );    
  3286.         try    
  3287.         {      
  3288.             p[6].Value =  this.varCSCreationClassName;    
  3289.         }      
  3290.         catch(Exception exp)    
  3291.         {    
  3292.             LogError(exp);    
  3293.             p[6].Value =  "";    
  3294.         }    
  3295.         p[7] = new SqlParameter("@CSName", SqlDbType.NVarChar, 255 );    
  3296.         try    
  3297.         {      
  3298.             p[7].Value =  this.varCSName;    
  3299.         }      
  3300.         catch(Exception exp)    
  3301.         {    
  3302.             LogError(exp);    
  3303.             p[7].Value =  "";    
  3304.         }    
  3305.         p[8] = new SqlParameter("@Description", SqlDbType.NVarChar, 255 );    
  3306.         try    
  3307.         {      
  3308.             p[8].Value =  this.varDescription;    
  3309.         }      
  3310.         catch(Exception exp)    
  3311.         {    
  3312.             LogError(exp);    
  3313.             p[8].Value =  "";    
  3314.         }    
  3315.         p[9] = new SqlParameter("@ExecutablePath", SqlDbType.NVarChar, 255 );    
  3316.         try    
  3317.         {      
  3318.             p[9].Value =  this.varExecutablePath;    
  3319.         }      
  3320.         catch(Exception exp)    
  3321.         {    
  3322.             LogError(exp);    
  3323.             p[9].Value =  "";    
  3324.         }    
  3325.         p[10] = new SqlParameter("@ExecutionState", SqlDbType.BigInt);    
  3326.         try    
  3327.         {      
  3328.             p[10].Value = Convert.ToInt64(this.varExecutionState);    
  3329.         }      
  3330.         catch(Exception exp)    
  3331.         {    
  3332.             LogError(exp);    
  3333.             p[10].Value = 0;    
  3334.         }    
  3335.         p[11] = new SqlParameter("@Handle", SqlDbType.NVarChar, 255 );    
  3336.         try    
  3337.         {      
  3338.             p[11].Value =  this.varHandle;    
  3339.         }      
  3340.         catch(Exception exp)    
  3341.         {    
  3342.             LogError(exp);    
  3343.             p[11].Value =  "";    
  3344.         }    
  3345.         p[12] = new SqlParameter("@HandleCount", SqlDbType.BigInt);    
  3346.         try    
  3347.         {      
  3348.             p[12].Value = Convert.ToInt64(this.varHandleCount);    
  3349.         }      
  3350.         catch(Exception exp)    
  3351.         {    
  3352.             LogError(exp);    
  3353.             p[12].Value = 0;    
  3354.         }    
  3355.         p[13] = new SqlParameter("@InstallDate", SqlDbType.DateTime);    
  3356.         try    
  3357.         {      
  3358.             p[13].Value = Convert.ToDateTime(this.varInstallDate);    
  3359.         }      
  3360.         catch(Exception exp)    
  3361.         {    
  3362.             LogError(exp);    
  3363.             p[13].Value = DateTime.Now;    
  3364.         }    
  3365.         p[14] = new SqlParameter("@KernelModeTime", SqlDbType.BigInt);    
  3366.         try    
  3367.         {      
  3368.             p[14].Value = Convert.ToInt64(this.varKernelModeTime);    
  3369.         }      
  3370.         catch(Exception exp)    
  3371.         {    
  3372.             LogError(exp);    
  3373.             p[14].Value = 0;    
  3374.         }    
  3375.         p[15] = new SqlParameter("@MaximumWorkingSetSize", SqlDbType.BigInt);    
  3376.         try    
  3377.         {      
  3378.             p[15].Value = Convert.ToInt64(this.varMaximumWorkingSetSize);    
  3379.         }      
  3380.         catch(Exception exp)    
  3381.         {    
  3382.             LogError(exp);    
  3383.             p[15].Value = 0;    
  3384.         }    
  3385.         p[16] = new SqlParameter("@MinimumWorkingSetSize", SqlDbType.BigInt);    
  3386.         try    
  3387.         {      
  3388.             p[16].Value = Convert.ToInt64(this.varMinimumWorkingSetSize);    
  3389.         }      
  3390.         catch(Exception exp)    
  3391.         {    
  3392.             LogError(exp);    
  3393.             p[16].Value = 0;    
  3394.         }    
  3395.         p[17] = new SqlParameter("@Name", SqlDbType.NVarChar, 255 );    
  3396.         try    
  3397.         {      
  3398.             p[17].Value =  this.varName;    
  3399.         }      
  3400.         catch(Exception exp)    
  3401.         {    
  3402.             LogError(exp);    
  3403.             p[17].Value =  "";    
  3404.         }    
  3405.         p[18] = new SqlParameter("@OSCreationClassName", SqlDbType.NVarChar, 255 );    
  3406.         try    
  3407.         {      
  3408.             p[18].Value =  this.varOSCreationClassName;    
  3409.         }      
  3410.         catch(Exception exp)    
  3411.         {    
  3412.             LogError(exp);    
  3413.             p[18].Value =  "";    
  3414.         }    
  3415.         p[19] = new SqlParameter("@OSName", SqlDbType.NVarChar, 255 );    
  3416.         try    
  3417.         {      
  3418.             p[19].Value =  this.varOSName;    
  3419.         }      
  3420.         catch(Exception exp)    
  3421.         {    
  3422.             LogError(exp);    
  3423.             p[19].Value =  "";    
  3424.         }    
  3425.         p[20] = new SqlParameter("@OtherOperationCount", SqlDbType.BigInt);    
  3426.         try    
  3427.         {      
  3428.             p[20].Value = Convert.ToInt64(this.varOtherOperationCount);    
  3429.         }      
  3430.         catch(Exception exp)    
  3431.         {    
  3432.             LogError(exp);    
  3433.             p[20].Value = 0;    
  3434.         }    
  3435.         p[21] = new SqlParameter("@OtherTransferCount", SqlDbType.BigInt);    
  3436.         try    
  3437.         {      
  3438.             p[21].Value = Convert.ToInt64(this.varOtherTransferCount);    
  3439.         }      
  3440.         catch(Exception exp)    
  3441.         {    
  3442.             LogError(exp);    
  3443.             p[21].Value = 0;    
  3444.         }    
  3445.         p[22] = new SqlParameter("@PageFaults", SqlDbType.BigInt);    
  3446.         try    
  3447.         {      
  3448.             p[22].Value = Convert.ToInt64(this.varPageFaults);    
  3449.         }      
  3450.         catch(Exception exp)    
  3451.         {    
  3452.             LogError(exp);    
  3453.             p[22].Value = 0;    
  3454.         }    
  3455.         p[23] = new SqlParameter("@PageFileUsage", SqlDbType.BigInt);    
  3456.         try    
  3457.         {      
  3458.             p[23].Value = Convert.ToInt64(this.varPageFileUsage);    
  3459.         }      
  3460.         catch(Exception exp)    
  3461.         {    
  3462.             LogError(exp);    
  3463.             p[23].Value = 0;    
  3464.         }    
  3465.         p[24] = new SqlParameter("@ParentProcessId", SqlDbType.BigInt);    
  3466.         try    
  3467.         {      
  3468.             p[24].Value = Convert.ToInt64(this.varParentProcessId);    
  3469.         }      
  3470.         catch(Exception exp)    
  3471.         {    
  3472.             LogError(exp);    
  3473.             p[24].Value = 0;    
  3474.         }    
  3475.         p[25] = new SqlParameter("@PeakPageFileUsage", SqlDbType.BigInt);    
  3476.         try    
  3477.         {      
  3478.             p[25].Value = Convert.ToInt64(this.varPeakPageFileUsage);    
  3479.         }      
  3480.         catch(Exception exp)    
  3481.         {    
  3482.             LogError(exp);    
  3483.             p[25].Value = 0;    
  3484.         }    
  3485.         p[26] = new SqlParameter("@PeakVirtualSize", SqlDbType.BigInt);    
  3486.         try    
  3487.         {      
  3488.             p[26].Value = Convert.ToInt64(this.varPeakVirtualSize);    
  3489.         }      
  3490.         catch(Exception exp)    
  3491.         {    
  3492.             LogError(exp);    
  3493.             p[26].Value = 0;    
  3494.         }    
  3495.         p[27] = new SqlParameter("@PeakWorkingSetSize", SqlDbType.BigInt);    
  3496.         try    
  3497.         {      
  3498.             p[27].Value = Convert.ToInt64(this.varPeakWorkingSetSize);    
  3499.         }      
  3500.         catch(Exception exp)    
  3501.         {    
  3502.             LogError(exp);    
  3503.             p[27].Value = 0;    
  3504.         }    
  3505.         p[28] = new SqlParameter("@Priority", SqlDbType.BigInt);    
  3506.         try    
  3507.         {      
  3508.             p[28].Value = Convert.ToInt64(this.varPriority);    
  3509.         }      
  3510.         catch(Exception exp)    
  3511.         {    
  3512.             LogError(exp);    
  3513.             p[28].Value = 0;    
  3514.         }    
  3515.         p[29] = new SqlParameter("@PrivatePageCount", SqlDbType.BigInt);    
  3516.         try    
  3517.         {      
  3518.             p[29].Value = Convert.ToInt64(this.varPrivatePageCount);    
  3519.         }      
  3520.         catch(Exception exp)    
  3521.         {    
  3522.             LogError(exp);    
  3523.             p[29].Value = 0;    
  3524.         }    
  3525.         p[30] = new SqlParameter("@ProcessId", SqlDbType.BigInt);    
  3526.         try    
  3527.         {      
  3528.             p[30].Value = Convert.ToInt64(this.varProcessId);    
  3529.         }      
  3530.         catch(Exception exp)    
  3531.         {    
  3532.             LogError(exp);    
  3533.             p[30].Value = 0;    
  3534.         }    
  3535.         p[31] = new SqlParameter("@QuotaNonPagedPoolUsage", SqlDbType.BigInt);    
  3536.         try    
  3537.         {      
  3538.             p[31].Value = Convert.ToInt64(this.varQuotaNonPagedPoolUsage);    
  3539.         }      
  3540.         catch(Exception exp)    
  3541.         {    
  3542.             LogError(exp);    
  3543.             p[31].Value = 0;    
  3544.         }    
  3545.         p[32] = new SqlParameter("@QuotaPagedPoolUsage", SqlDbType.BigInt);    
  3546.         try    
  3547.         {      
  3548.             p[32].Value = Convert.ToInt64(this.varQuotaPagedPoolUsage);    
  3549.         }      
  3550.         catch(Exception exp)    
  3551.         {    
  3552.             LogError(exp);    
  3553.             p[32].Value = 0;    
  3554.         }    
  3555.         p[33] = new SqlParameter("@QuotaPeakNonPagedPoolUsage", SqlDbType.BigInt);    
  3556.         try    
  3557.         {      
  3558.             p[33].Value = Convert.ToInt64(this.varQuotaPeakNonPagedPoolUsage);    
  3559.         }      
  3560.         catch(Exception exp)    
  3561.         {    
  3562.             LogError(exp);    
  3563.             p[33].Value = 0;    
  3564.         }    
  3565.         p[34] = new SqlParameter("@QuotaPeakPagedPoolUsage", SqlDbType.BigInt);    
  3566.         try    
  3567.         {      
  3568.             p[34].Value = Convert.ToInt64(this.varQuotaPeakPagedPoolUsage);    
  3569.         }      
  3570.         catch(Exception exp)    
  3571.         {    
  3572.             LogError(exp);    
  3573.             p[34].Value = 0;    
  3574.         }    
  3575.         p[35] = new SqlParameter("@ReadOperationCount", SqlDbType.BigInt);    
  3576.         try    
  3577.         {      
  3578.             p[35].Value = Convert.ToInt64(this.varReadOperationCount);    
  3579.         }      
  3580.         catch(Exception exp)    
  3581.         {    
  3582.             LogError(exp);    
  3583.             p[35].Value = 0;    
  3584.         }    
  3585.         p[36] = new SqlParameter("@ReadTransferCount", SqlDbType.BigInt);    
  3586.         try    
  3587.         {      
  3588.             p[36].Value = Convert.ToInt64(this.varReadTransferCount);    
  3589.         }      
  3590.         catch(Exception exp)    
  3591.         {    
  3592.             LogError(exp);    
  3593.             p[36].Value = 0;    
  3594.         }    
  3595.         p[37] = new SqlParameter("@SessionId", SqlDbType.BigInt);    
  3596.         try    
  3597.         {      
  3598.             p[37].Value = Convert.ToInt64(this.varSessionId);    
  3599.         }      
  3600.         catch(Exception exp)    
  3601.         {    
  3602.             LogError(exp);    
  3603.             p[37].Value = 0;    
  3604.         }    
  3605.         p[38] = new SqlParameter("@Status", SqlDbType.NVarChar, 255 );    
  3606.         try    
  3607.         {      
  3608.             p[38].Value =  this.varStatus;    
  3609.         }      
  3610.         catch(Exception exp)    
  3611.         {    
  3612.             LogError(exp);    
  3613.             p[38].Value =  "";    
  3614.         }    
  3615.         p[39] = new SqlParameter("@TerminationDate", SqlDbType.DateTime);    
  3616.         try    
  3617.         {      
  3618.             p[39].Value = Convert.ToDateTime(this.varTerminationDate);    
  3619.         }      
  3620.         catch(Exception exp)    
  3621.         {    
  3622.             LogError(exp);    
  3623.             p[39].Value = DateTime.Now;    
  3624.         }    
  3625.         p[40] = new SqlParameter("@ThreadCount", SqlDbType.BigInt);    
  3626.         try    
  3627.         {      
  3628.             p[40].Value = Convert.ToInt64(this.varThreadCount);    
  3629.         }      
  3630.         catch(Exception exp)    
  3631.         {    
  3632.             LogError(exp);    
  3633.             p[40].Value = 0;    
  3634.         }    
  3635.         p[41] = new SqlParameter("@UserModeTime", SqlDbType.BigInt);    
  3636.         try    
  3637.         {      
  3638.             p[41].Value = Convert.ToInt64(this.varUserModeTime);    
  3639.         }      
  3640.         catch(Exception exp)    
  3641.         {    
  3642.             LogError(exp);    
  3643.             p[41].Value = 0;    
  3644.         }    
  3645.         p[42] = new SqlParameter("@VirtualSize", SqlDbType.BigInt);    
  3646.         try    
  3647.         {      
  3648.             p[42].Value = Convert.ToInt64(this.varVirtualSize);    
  3649.         }      
  3650.         catch(Exception exp)    
  3651.         {    
  3652.             LogError(exp);    
  3653.             p[42].Value = 0;    
  3654.         }    
  3655.         p[43] = new SqlParameter("@WindowsVersion", SqlDbType.NVarChar, 255 );    
  3656.         try    
  3657.         {      
  3658.             p[43].Value =  this.varWindowsVersion;    
  3659.         }      
  3660.         catch(Exception exp)    
  3661.         {    
  3662.             LogError(exp);    
  3663.             p[43].Value =  "";    
  3664.         }    
  3665.         p[44] = new SqlParameter("@WorkingSetSize", SqlDbType.BigInt);    
  3666.         try    
  3667.         {      
  3668.             p[44].Value = Convert.ToInt64(this.varWorkingSetSize);    
  3669.         }      
  3670.         catch(Exception exp)    
  3671.         {    
  3672.             LogError(exp);    
  3673.             p[44].Value = 0;    
  3674.         }    
  3675.         p[45] = new SqlParameter("@WriteOperationCount", SqlDbType.BigInt);    
  3676.         try    
  3677.         {      
  3678.             p[45].Value = Convert.ToInt64(this.varWriteOperationCount);    
  3679.         }      
  3680.         catch(Exception exp)    
  3681.         {    
  3682.             LogError(exp);    
  3683.             p[45].Value = 0;    
  3684.         }    
  3685.         p[46] = new SqlParameter("@WriteTransferCount", SqlDbType.BigInt);    
  3686.         try    
  3687.         {      
  3688.             p[46].Value = Convert.ToInt64(this.varWriteTransferCount);    
  3689.         }      
  3690.         catch(Exception exp)    
  3691.         {    
  3692.             LogError(exp);    
  3693.             p[46].Value = 0;    
  3694.         }    
  3695.         if(!Data.HydraDatabase.DatabaseIsOnline())  
  3696.         {  
  3697.             Logging.LogWarning("Hydra Database is Offline!!!", 911);  
  3698.         }  
  3699.         else  
  3700.         {  
  3701.             Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"Win32_Process_INSERT", p);  
  3702.         }  
  3703.     }  
  3704.  
  3705.  
  3706.  
  3707.         ///====================================================================================================  
  3708.         ///                                                                                                      
  3709.         ///    public void UpdateToDatabase( string DatabaseConnectionString )                                  
  3710.         ///                                                                                                      
  3711.         ///====================================================================================================  
  3712.         ///<summary>  
  3713.         /// update this instance in the database  
  3714.         ///</summary>  
  3715.         public void UpdateToDatabase( string DatabaseConnectionString )  
  3716.         {  
  3717.         System.Data.SqlClient.SqlParameter[] p = new SqlParameter[47];  
  3718.         p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);  
  3719.         p[0].Value = this.HydraID;  
  3720.         p[1] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);  
  3721.         p[1].Value = this.HostName;  
  3722.         p[2] = new SqlParameter("@Caption", SqlDbType.NVarChar, 255 );    
  3723.         try    
  3724.         {      
  3725.             p[2].Value = this.varCaption;    
  3726.         }      
  3727.         catch(Exception exp)    
  3728.         {    
  3729.             LogError(exp);    
  3730.         }    
  3731.  
  3732.         p[3] = new SqlParameter("@CommandLine", SqlDbType.NVarChar, 255 );    
  3733.         try    
  3734.         {      
  3735.             p[3].Value = this.varCommandLine;    
  3736.         }      
  3737.         catch(Exception exp)    
  3738.         {    
  3739.             LogError(exp);    
  3740.         }    
  3741.  
  3742.         p[4] = new SqlParameter("@CreationClassName", SqlDbType.NVarChar, 255 );    
  3743.         try    
  3744.         {      
  3745.             p[4].Value = this.varCreationClassName;    
  3746.         }      
  3747.         catch(Exception exp)    
  3748.         {    
  3749.             LogError(exp);    
  3750.         }    
  3751.  
  3752.         p[5] = new SqlParameter("@CreationDate", SqlDbType.DateTime);    
  3753.         try    
  3754.         {      
  3755.             p[5].Value = Convert.ToDateTime(this.varCreationDate);    
  3756.         }      
  3757.         catch(Exception exp)    
  3758.         {    
  3759.             LogError(exp);    
  3760.         }    
  3761.  
  3762.         p[6] = new SqlParameter("@CSCreationClassName", SqlDbType.NVarChar, 255 );    
  3763.         try    
  3764.         {      
  3765.             p[6].Value = this.varCSCreationClassName;    
  3766.         }      
  3767.         catch(Exception exp)    
  3768.         {    
  3769.             LogError(exp);    
  3770.         }    
  3771.  
  3772.         p[7] = new SqlParameter("@CSName", SqlDbType.NVarChar, 255 );    
  3773.         try    
  3774.         {      
  3775.             p[7].Value = this.varCSName;    
  3776.         }      
  3777.         catch(Exception exp)    
  3778.         {    
  3779.             LogError(exp);    
  3780.         }    
  3781.  
  3782.         p[8] = new SqlParameter("@Description", SqlDbType.NVarChar, 255 );    
  3783.         try    
  3784.         {      
  3785.             p[8].Value = this.varDescription;    
  3786.         }      
  3787.         catch(Exception exp)    
  3788.         {    
  3789.             LogError(exp);    
  3790.         }    
  3791.  
  3792.         p[9] = new SqlParameter("@ExecutablePath", SqlDbType.NVarChar, 255 );    
  3793.         try    
  3794.         {      
  3795.             p[9].Value = this.varExecutablePath;    
  3796.         }      
  3797.         catch(Exception exp)    
  3798.         {    
  3799.             LogError(exp);    
  3800.         }    
  3801.  
  3802.         p[10] = new SqlParameter("@ExecutionState", SqlDbType.BigInt);    
  3803.         try    
  3804.         {      
  3805.             p[10].Value = Convert.ToInt64(this.varExecutionState);    
  3806.         }      
  3807.         catch(Exception exp)    
  3808.         {    
  3809.             LogError(exp);    
  3810.         }    
  3811.  
  3812.         p[11] = new SqlParameter("@Handle", SqlDbType.NVarChar, 255 );    
  3813.         try    
  3814.         {      
  3815.             p[11].Value = this.varHandle;    
  3816.         }      
  3817.         catch(Exception exp)    
  3818.         {    
  3819.             LogError(exp);    
  3820.         }    
  3821.  
  3822.         p[12] = new SqlParameter("@HandleCount", SqlDbType.BigInt);    
  3823.         try    
  3824.         {      
  3825.             p[12].Value = Convert.ToInt64(this.varHandleCount);    
  3826.         }      
  3827.         catch(Exception exp)    
  3828.         {    
  3829.             LogError(exp);    
  3830.         }    
  3831.  
  3832.         p[13] = new SqlParameter("@InstallDate", SqlDbType.DateTime);    
  3833.         try    
  3834.         {      
  3835.             p[13].Value = Convert.ToDateTime(this.varInstallDate);    
  3836.         }      
  3837.         catch(Exception exp)    
  3838.         {    
  3839.             LogError(exp);    
  3840.         }    
  3841.  
  3842.         p[14] = new SqlParameter("@KernelModeTime", SqlDbType.BigInt);    
  3843.         try    
  3844.         {      
  3845.             p[14].Value = Convert.ToInt64(this.varKernelModeTime);    
  3846.         }      
  3847.         catch(Exception exp)    
  3848.         {    
  3849.             LogError(exp);    
  3850.         }    
  3851.  
  3852.         p[15] = new SqlParameter("@MaximumWorkingSetSize", SqlDbType.BigInt);    
  3853.         try    
  3854.         {      
  3855.             p[15].Value = Convert.ToInt64(this.varMaximumWorkingSetSize);    
  3856.         }      
  3857.         catch(Exception exp)    
  3858.         {    
  3859.             LogError(exp);    
  3860.         }    
  3861.  
  3862.         p[16] = new SqlParameter("@MinimumWorkingSetSize", SqlDbType.BigInt);    
  3863.         try    
  3864.         {      
  3865.             p[16].Value = Convert.ToInt64(this.varMinimumWorkingSetSize);    
  3866.         }      
  3867.         catch(Exception exp)    
  3868.         {    
  3869.             LogError(exp);    
  3870.         }    
  3871.  
  3872.         p[17] = new SqlParameter("@Name", SqlDbType.NVarChar, 255 );    
  3873.         try    
  3874.         {      
  3875.             p[17].Value = this.varName;    
  3876.         }      
  3877.         catch(Exception exp)    
  3878.         {    
  3879.             LogError(exp);    
  3880.         }    
  3881.  
  3882.         p[18] = new SqlParameter("@OSCreationClassName", SqlDbType.NVarChar, 255 );    
  3883.         try    
  3884.         {      
  3885.             p[18].Value = this.varOSCreationClassName;    
  3886.         }      
  3887.         catch(Exception exp)    
  3888.         {    
  3889.             LogError(exp);    
  3890.         }    
  3891.  
  3892.         p[19] = new SqlParameter("@OSName", SqlDbType.NVarChar, 255 );    
  3893.         try    
  3894.         {      
  3895.             p[19].Value = this.varOSName;    
  3896.         }      
  3897.         catch(Exception exp)    
  3898.         {    
  3899.             LogError(exp);    
  3900.         }    
  3901.  
  3902.         p[20] = new SqlParameter("@OtherOperationCount", SqlDbType.BigInt);    
  3903.         try    
  3904.         {      
  3905.             p[20].Value = Convert.ToInt64(this.varOtherOperationCount);    
  3906.         }      
  3907.         catch(Exception exp)    
  3908.         {    
  3909.             LogError(exp);    
  3910.         }    
  3911.  
  3912.         p[21] = new SqlParameter("@OtherTransferCount", SqlDbType.BigInt);    
  3913.         try    
  3914.         {      
  3915.             p[21].Value = Convert.ToInt64(this.varOtherTransferCount);    
  3916.         }      
  3917.         catch(Exception exp)    
  3918.         {    
  3919.             LogError(exp);    
  3920.         }    
  3921.  
  3922.         p[22] = new SqlParameter("@PageFaults", SqlDbType.BigInt);    
  3923.         try    
  3924.         {      
  3925.             p[22].Value = Convert.ToInt64(this.varPageFaults);    
  3926.         }      
  3927.         catch(Exception exp)    
  3928.         {    
  3929.             LogError(exp);    
  3930.         }    
  3931.  
  3932.         p[23] = new SqlParameter("@PageFileUsage", SqlDbType.BigInt);    
  3933.         try    
  3934.         {      
  3935.             p[23].Value = Convert.ToInt64(this.varPageFileUsage);    
  3936.         }      
  3937.         catch(Exception exp)    
  3938.         {    
  3939.             LogError(exp);    
  3940.         }    
  3941.  
  3942.         p[24] = new SqlParameter("@ParentProcessId", SqlDbType.BigInt);    
  3943.         try    
  3944.         {      
  3945.             p[24].Value = Convert.ToInt64(this.varParentProcessId);    
  3946.         }      
  3947.         catch(Exception exp)    
  3948.         {    
  3949.             LogError(exp);    
  3950.         }    
  3951.  
  3952.         p[25] = new SqlParameter("@PeakPageFileUsage", SqlDbType.BigInt);    
  3953.         try    
  3954.         {      
  3955.             p[25].Value = Convert.ToInt64(this.varPeakPageFileUsage);    
  3956.         }      
  3957.         catch(Exception exp)    
  3958.         {    
  3959.             LogError(exp);    
  3960.         }    
  3961.  
  3962.         p[26] = new SqlParameter("@PeakVirtualSize", SqlDbType.BigInt);    
  3963.         try    
  3964.         {      
  3965.             p[26].Value = Convert.ToInt64(this.varPeakVirtualSize);    
  3966.         }      
  3967.         catch(Exception exp)    
  3968.         {    
  3969.             LogError(exp);    
  3970.         }    
  3971.  
  3972.         p[27] = new SqlParameter("@PeakWorkingSetSize", SqlDbType.BigInt);    
  3973.         try    
  3974.         {      
  3975.             p[27].Value = Convert.ToInt64(this.varPeakWorkingSetSize);    
  3976.         }      
  3977.         catch(Exception exp)    
  3978.         {    
  3979.             LogError(exp);    
  3980.         }    
  3981.  
  3982.         p[28] = new SqlParameter("@Priority", SqlDbType.BigInt);    
  3983.         try    
  3984.         {      
  3985.             p[28].Value = Convert.ToInt64(this.varPriority);    
  3986.         }      
  3987.         catch(Exception exp)    
  3988.         {    
  3989.             LogError(exp);    
  3990.         }    
  3991.  
  3992.         p[29] = new SqlParameter("@PrivatePageCount", SqlDbType.BigInt);    
  3993.         try    
  3994.         {      
  3995.             p[29].Value = Convert.ToInt64(this.varPrivatePageCount);    
  3996.         }      
  3997.         catch(Exception exp)    
  3998.         {    
  3999.             LogError(exp);    
  4000.         }    
  4001.  
  4002.         p[30] = new SqlParameter("@ProcessId", SqlDbType.BigInt);    
  4003.         try    
  4004.         {      
  4005.             p[30].Value = Convert.ToInt64(this.varProcessId);    
  4006.         }      
  4007.         catch(Exception exp)    
  4008.         {    
  4009.             LogError(exp);    
  4010.         }    
  4011.  
  4012.         p[31] = new SqlParameter("@QuotaNonPagedPoolUsage", SqlDbType.BigInt);    
  4013.         try    
  4014.         {      
  4015.             p[31].Value = Convert.ToInt64(this.varQuotaNonPagedPoolUsage);    
  4016.         }      
  4017.         catch(Exception exp)    
  4018.         {    
  4019.             LogError(exp);    
  4020.         }    
  4021.  
  4022.         p[32] = new SqlParameter("@QuotaPagedPoolUsage", SqlDbType.BigInt);    
  4023.         try    
  4024.         {      
  4025.             p[32].Value = Convert.ToInt64(this.varQuotaPagedPoolUsage);    
  4026.         }      
  4027.         catch(Exception exp)    
  4028.         {    
  4029.             LogError(exp);    
  4030.         }    
  4031.  
  4032.         p[33] = new SqlParameter("@QuotaPeakNonPagedPoolUsage", SqlDbType.BigInt);    
  4033.         try    
  4034.         {      
  4035.             p[33].Value = Convert.ToInt64(this.varQuotaPeakNonPagedPoolUsage);    
  4036.         }      
  4037.         catch(Exception exp)    
  4038.         {    
  4039.             LogError(exp);    
  4040.         }    
  4041.  
  4042.         p[34] = new SqlParameter("@QuotaPeakPagedPoolUsage", SqlDbType.BigInt);    
  4043.         try    
  4044.         {      
  4045.             p[34].Value = Convert.ToInt64(this.varQuotaPeakPagedPoolUsage);    
  4046.         }      
  4047.         catch(Exception exp)    
  4048.         {    
  4049.             LogError(exp);    
  4050.         }    
  4051.  
  4052.         p[35] = new SqlParameter("@ReadOperationCount", SqlDbType.BigInt);    
  4053.         try    
  4054.         {      
  4055.             p[35].Value = Convert.ToInt64(this.varReadOperationCount);    
  4056.         }      
  4057.         catch(Exception exp)    
  4058.         {    
  4059.             LogError(exp);    
  4060.         }    
  4061.  
  4062.         p[36] = new SqlParameter("@ReadTransferCount", SqlDbType.BigInt);    
  4063.         try    
  4064.         {      
  4065.             p[36].Value = Convert.ToInt64(this.varReadTransferCount);    
  4066.         }      
  4067.         catch(Exception exp)    
  4068.         {    
  4069.             LogError(exp);    
  4070.         }    
  4071.  
  4072.         p[37] = new SqlParameter("@SessionId", SqlDbType.BigInt);    
  4073.         try    
  4074.         {      
  4075.             p[37].Value = Convert.ToInt64(this.varSessionId);    
  4076.         }      
  4077.         catch(Exception exp)    
  4078.         {    
  4079.             LogError(exp);    
  4080.         }    
  4081.  
  4082.         p[38] = new SqlParameter("@Status", SqlDbType.NVarChar, 255 );    
  4083.         try    
  4084.         {      
  4085.             p[38].Value = this.varStatus;    
  4086.         }      
  4087.         catch(Exception exp)    
  4088.         {    
  4089.             LogError(exp);    
  4090.         }    
  4091.  
  4092.         p[39] = new SqlParameter("@TerminationDate", SqlDbType.DateTime);    
  4093.         try    
  4094.         {      
  4095.             p[39].Value = Convert.ToDateTime(this.varTerminationDate);    
  4096.         }      
  4097.         catch(Exception exp)    
  4098.         {    
  4099.             LogError(exp);    
  4100.         }    
  4101.  
  4102.         p[40] = new SqlParameter("@ThreadCount", SqlDbType.BigInt);    
  4103.         try    
  4104.         {      
  4105.             p[40].Value = Convert.ToInt64(this.varThreadCount);    
  4106.         }      
  4107.         catch(Exception exp)    
  4108.         {    
  4109.             LogError(exp);    
  4110.         }    
  4111.  
  4112.         p[41] = new SqlParameter("@UserModeTime", SqlDbType.BigInt);    
  4113.         try    
  4114.         {      
  4115.             p[41].Value = Convert.ToInt64(this.varUserModeTime);    
  4116.         }      
  4117.         catch(Exception exp)    
  4118.         {    
  4119.             LogError(exp);    
  4120.         }    
  4121.  
  4122.         p[42] = new SqlParameter("@VirtualSize", SqlDbType.BigInt);    
  4123.         try    
  4124.         {      
  4125.             p[42].Value = Convert.ToInt64(this.varVirtualSize);    
  4126.         }      
  4127.         catch(Exception exp)    
  4128.         {    
  4129.             LogError(exp);    
  4130.         }    
  4131.  
  4132.         p[43] = new SqlParameter("@WindowsVersion", SqlDbType.NVarChar, 255 );    
  4133.         try    
  4134.         {      
  4135.             p[43].Value = this.varWindowsVersion;    
  4136.         }      
  4137.         catch(Exception exp)    
  4138.         {    
  4139.             LogError(exp);    
  4140.         }    
  4141.  
  4142.         p[44] = new SqlParameter("@WorkingSetSize", SqlDbType.BigInt);    
  4143.         try    
  4144.         {      
  4145.             p[44].Value = Convert.ToInt64(this.varWorkingSetSize);    
  4146.         }      
  4147.         catch(Exception exp)    
  4148.         {    
  4149.             LogError(exp);    
  4150.         }    
  4151.  
  4152.         p[45] = new SqlParameter("@WriteOperationCount", SqlDbType.BigInt);    
  4153.         try    
  4154.         {      
  4155.             p[45].Value = Convert.ToInt64(this.varWriteOperationCount);    
  4156.         }      
  4157.         catch(Exception exp)    
  4158.         {    
  4159.             LogError(exp);    
  4160.         }    
  4161.  
  4162.         p[46] = new SqlParameter("@WriteTransferCount", SqlDbType.BigInt);    
  4163.         try    
  4164.         {      
  4165.             p[46].Value = Convert.ToInt64(this.varWriteTransferCount);    
  4166.         }      
  4167.         catch(Exception exp)    
  4168.         {    
  4169.             LogError(exp);    
  4170.         }    
  4171.  
  4172.  
  4173.        Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure, "Win32_Process_UPDATE", p);  
  4174.  
  4175.         }  
  4176.  
  4177.  
  4178.  
  4179.         ///====================================================================================================  
  4180.         ///                                                                                                      
  4181.         ///     public static void DELETE_BY_HYDRA_ID( string DatabaseConnectionString, Int64 HydraID )        
  4182.         ///                                                                                                      
  4183.         ///====================================================================================================  
  4184.         ///<summary>  
  4185.         /// Delete this instance from the database  
  4186.         ///</summary>  
  4187.         public static void DELETE_BY_HYDRA_ID( string DatabaseConnectionString, Int64 HydraID )  
  4188.         {  
  4189.             SqlParameter[] p = new SqlParameter[1];  
  4190.             p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);  
  4191.             try    
  4192.             {      
  4193.                 p[0].Value = HydraID;    
  4194.             }      
  4195.             catch(Exception exp)    
  4196.             {    
  4197.                 LogError(exp);    
  4198.             }    
  4199.             try    
  4200.             {      
  4201.                Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_BY_HYDRA_ID", p);  
  4202.             }      
  4203.             catch(Exception exp)    
  4204.             {    
  4205.                 LogError(exp);    
  4206.             }    
  4207.         }  
  4208.          
  4209.          
  4210.  
  4211.  
  4212.         ///====================================================================================================  
  4213.         ///                                                                                                      
  4214.         ///     public static void Win32_Process_DELETE_BY_KNOWN_HOST_ID( double HostID, string DatabaseConnectionString )        
  4215.         ///                                                                                                      
  4216.         ///====================================================================================================  
  4217.         ///<summary>  
  4218.         /// Delete this instance from the database  
  4219.         ///</summary>  
  4220.         public static void Win32_Process_DELETE_BY_KNOWN_HOST_ID( double HostID, string DatabaseConnectionString )  
  4221.         {  
  4222.             SqlParameter[] p = new SqlParameter[1];  
  4223.             p[0] = new SqlParameter("@KnownHostID", SqlDbType.BigInt);  
  4224.             try    
  4225.             {      
  4226.                 p[0].Value = HostID;    
  4227.             }      
  4228.             catch(Exception exp)    
  4229.             {    
  4230.                 LogError(exp);    
  4231.             }    
  4232.             try    
  4233.             {      
  4234.                Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"Win32_Process_DELETE_BY_KNOWN_HOST_ID", p);  
  4235.             }      
  4236.             catch(Exception exp)    
  4237.             {    
  4238.                 LogError(exp);    
  4239.             }    
  4240.         }  
  4241.          
  4242.          
  4243.  
  4244.  
  4245.         ///====================================================================================================  
  4246.         ///                                                                                                      
  4247.         ///   public static void Delete_From_Database_By_HostName( string DatabaseConnectionString, string HostName )  
  4248.         ///                                                                                                      
  4249.         ///====================================================================================================  
  4250.         ///<summary>  
  4251.         /// Delete this instance from the database  
  4252.         ///</summary>  
  4253.         public static void Delete_From_Database_By_HostName( string DatabaseConnectionString, string HostName )  
  4254.         {  
  4255.             SqlParameter[] p = new SqlParameter[1];  
  4256.             p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);  
  4257.             try    
  4258.             {    
  4259.                 p[0].Value = HostName;    
  4260.             }    
  4261.             catch(Exception exp)    
  4262.             {    
  4263.                 LogError(exp);    
  4264.             }    
  4265.             try    
  4266.             {    
  4267.                Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_BY_HOSTNAME", p);  
  4268.             }    
  4269.             catch(Exception exp)    
  4270.             {    
  4271.                 LogError(exp);    
  4272.             }    
  4273.         }  
  4274.  
  4275.  
  4276.  
  4277.         ///====================================================================================================  
  4278.         ///                                                                                                      
  4279.         ///     public static void DELETE_ALL( string DatabaseConnectionString )        
  4280.         ///                                                                                                      
  4281.         ///====================================================================================================  
  4282.         ///<summary>  
  4283.         /// Delete this instance from the database  
  4284.         ///</summary>  
  4285.         public static void DELETE_ALL_FROM_DATABASE( string DatabaseConnectionString )  
  4286.         {  
  4287.             try    
  4288.             {      
  4289.                Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_ALL");  
  4290.             }      
  4291.             catch(Exception exp)    
  4292.             {    
  4293.                 LogError(exp);    
  4294.             }    
  4295.         }  
  4296.          
  4297.          
  4298.  
  4299.  
  4300.         ///====================================================================================================  
  4301.         ///                                                                                                      
  4302.         ///    public static DataSet Get_DataSet_By_HydraID( int HydraID, string DatabaseConnectionString )            
  4303.         ///                                                                                                      
  4304.         ///====================================================================================================  
  4305.         ///<summary>  
  4306.         /// Get a DataSet representing this instance from the database  
  4307.         ///</summary>  
  4308.         public static DataSet Get_DataSet_By_Hydra_ID(int HydraID, string  DatabaseConnectionString )  
  4309.         {  
  4310.             DataSet ds = new DataSet();  
  4311.             SqlParameter[] p = new SqlParameter[1];  
  4312.             p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);  
  4313.             try    
  4314.             {      
  4315.                 p[0].Value = HydraID;  
  4316.             }      
  4317.             catch(Exception exp)    
  4318.             {    
  4319.                 LogError(exp);    
  4320.             }    
  4321.             try    
  4322.             {      
  4323.                 ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECTBYID", p);  
  4324.             }    
  4325.             catch(Exception exp)    
  4326.             {    
  4327.                 LogError(exp);    
  4328.             }    
  4329.             return ds;    
  4330.         }  
  4331.          
  4332.          
  4333.  
  4334.  
  4335.        ///====================================================================================================  
  4336.        ///                                                                                                      
  4337.        ///    public static DataSet Get_DataSet_By_HOST_ID( double HostID, string DatabaseConnectionString )            
  4338.        ///                                                                                                      
  4339.        ///====================================================================================================  
  4340.        ///<summary>  
  4341.        /// Get a DataSet representing this instance from the database  
  4342.        ///</summary>  
  4343.        public static DataSet Get_DataSet_By_Host_ID(double HostID, string  DatabaseConnectionString )  
  4344.        {  
  4345.            DataSet ds = new DataSet();  
  4346.            SqlParameter[] p = new SqlParameter[1];  
  4347.            p[0] = new SqlParameter("@HostID", SqlDbType.BigInt);  
  4348.            try    
  4349.            {      
  4350.                p[0].Value = HostID;  
  4351.            }      
  4352.            catch(Exception exp)    
  4353.            {    
  4354.                LogError(exp);    
  4355.            }    
  4356.            try    
  4357.            {      
  4358.                ds = Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_BY_HOST_ID", p);  
  4359.            }    
  4360.            catch(Exception exp)    
  4361.            {    
  4362.                LogError(exp);    
  4363.            }    
  4364.            return ds;    
  4365.        }  
  4366.          
  4367.          
  4368.  
  4369.  
  4370.         ///====================================================================================================  
  4371.         ///                                                                                                      
  4372.         ///    public static DataSet Get_DataSet_ALL( string  DatabaseConnectionString )                                
  4373.         ///                                                                                                      
  4374.         ///====================================================================================================  
  4375.         ///<summary>  
  4376.         /// Get a static DataSet representing all instances from the database  
  4377.         ///</summary>  
  4378.         public static DataSet Get_DataSet_ALL( string  DatabaseConnectionString )  
  4379.         {  
  4380.             DataSet ds = new DataSet();  
  4381.             try    
  4382.             {      
  4383.                 ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_ALL" );  
  4384.             }    
  4385.             catch(Exception exp)    
  4386.             {    
  4387.                 LogError(exp);    
  4388.             }    
  4389.             return ds;    
  4390.         }  
  4391.  
  4392.  
  4393.         ///====================================================================================================  
  4394.         ///                                                                                                      
  4395.         ///    public static  DataSet Get_DataSet_By_HostName( string phostname, string DatabaseConnectionString )        
  4396.         ///                                                                                                      
  4397.         ///====================================================================================================  
  4398.         ///<summary>  
  4399.         /// Get a DataSet representing this instance from the database  
  4400.         ///</summary>  
  4401.         public static DataSet Get_DataSet_By_HostName( string phostname, string DatabaseConnectionString )  
  4402.         {  
  4403.             DataSet ds = new DataSet();  
  4404.             SqlParameter[] p = new SqlParameter[1];  
  4405.             p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);  
  4406.             try    
  4407.             {      
  4408.                 p[0].Value = phostname;  
  4409.             }      
  4410.             catch(Exception exp)    
  4411.             {    
  4412.                 LogError(exp);    
  4413.             }    
  4414.             try    
  4415.             {      
  4416.                 ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_BY_HOSTNAME", p);  
  4417.             }    
  4418.             catch(Exception exp)    
  4419.             {    
  4420.                 LogError(exp);    
  4421.             }    
  4422.             return ds;    
  4423.         }  
  4424.  
  4425.  
  4426.         ///====================================================================================================  
  4427.         ///                                                                                                      
  4428.         ///    public double Get_Count_By_KNOWN_Host_ID( double hostid, string DatabaseConnectionString )        
  4429.         ///                                                                                                      
  4430.         ///====================================================================================================  
  4431.         ///<summary>  
  4432.         /// Get a double representing the number of instances in the database  
  4433.         ///</summary>  
  4434.         public static double Get_Count_By_KNOWN_Host_ID( double hostid, string DatabaseConnectionString )  
  4435.         {  
  4436.             double i = 0;  
  4437.             SqlParameter[] p = new SqlParameter[1];  
  4438.             p[0] = new SqlParameter("@HostID", SqlDbType.BigInt);  
  4439.             try    
  4440.             {      
  4441.                 p[0].Value = hostid;  
  4442.             }      
  4443.             catch(Exception exp)    
  4444.             {    
  4445.                 LogError(exp);    
  4446.             }    
  4447.             try    
  4448.             {      
  4449.                 i = Convert.ToInt64(Hydra.Data.SqlHelper.ExecuteScalar( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_COUNT_BY_KNOWN_HOST_ID", p) ) ;  
  4450.             }    
  4451.             catch(Exception exp)    
  4452.             {    
  4453.                 LogError(exp);    
  4454.             }    
  4455.             return i;    
  4456.         }  
  4457.  
  4458.  
  4459.         ///====================================================================================================  
  4460.         ///                                                                                                      
  4461.         ///    public static double GetCount( string DatabaseConnectionString )        
  4462.         ///                                                                                                      
  4463.         ///====================================================================================================  
  4464.         ///<summary>  
  4465.         /// Get a int representing the number of rec in the table  
  4466.         ///</summary>  
  4467.         public static long GetCount( string DatabaseConnectionString )  
  4468.         {  
  4469.             Int64 i = 0;  
  4470.             try    
  4471.             {      
  4472.                 i = Convert.ToInt64(Hydra.Data.SqlHelper.ExecuteScalar( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_COUNT") ) ;  
  4473.             }    
  4474.             catch(Exception exp)    
  4475.             {    
  4476.                 LogError(exp);    
  4477.             }    
  4478.             return i;    
  4479.         }  
  4480.  
  4481.  
  4482.  
  4483.         #endregion  
  4484.  
  4485.         #region Generate SQL Strings  
  4486.         #endregion  
  4487.     }    
  4488.  
  4489. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement