Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C:\Users\xxx\Documents\cs_code\Win32_Process.cs [11/27/2016 6:18:16 AM] ./
- using Hydra.Types;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Diagnostics;
- using System.Management;
- using System.Text;
- namespace Hydra.Objects
- {
- //|=-=<OO>=-==-=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=-|
- //| |
- //| This C# and MSSQL Code was generated by -=<( HydraCodeGen, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null )>=- |
- //| |
- //| Version 2.0.0.0on 11-27-2016 06:18:16.951 |
- //| |
- //| Code Generation Complete! (5,179.00) lines of code generated in 155.1 milliseconds. |
- //| |
- //|=-=<OO>=-==-=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=----=<OO>=-|
- ///<summary>
- /// The Win32_Process class represents a sequence of events on a Win32 system.
- /// Any sequence consisting of the interaction of one or more processors or
- /// interpreters, some executable code, and a set of inputs, is a descendent
- /// (or member) of this class.
- /// Example: A client application running on a Win32
- /// system.
- ///</summary>
- public partial class Win32_Process
- {
- #region (Constructor) public Win32_Process() {}
- /// <summary>
- /// Default constructor
- /// </summary>
- public Win32_Process( )
- {
- _load_Key_Properties();
- }
- #endregion
- #region (constructor) public Win32_Process(string hostname, string namespace, bool preload)
- /// <summary>
- /// Creates an instance of the (Win32_Process) class and
- /// collects all instances immediately
- /// </summary>
- /// <param name-"preload">Set to true if you want the wmi data loaded immediately</param>
- public Win32_Process( bool preload, string p_hostname, string p_namespace, string p_wmiquery )
- {
- _load_Key_Properties();
- this.HostName = p_hostname;
- this.NameSpace = p_namespace;
- this._wmiquery = p_wmiquery;
- if (preload)
- {
- this.ALLInstances = Get_All_Win32_Process_Objects();
- }
- }
- #endregion
- #region (constructor) public Win32_Process(string p_hostname, string p_username, string p_password, long p_KnownHostID )
- /// <summary>
- /// Creates an instance of the Win32_Process class, connects to wmi, scans the object(s) and stores the data in the database (otional)
- /// </summary>
- /// <param name="p_host">Hostname to scan. if "" or null localhoist is assumed</param>
- /// <param name="p_user">Username to scan with. only used on remote connections</param>
- /// <param name="p_pas">password to scan with. only used on remote connections</param>
- /// <param name="customquery">Custom wmi query to use (if so desired) if null or "" then SELECT * FROM [CLASSNAME] is assumed</param>
- /// <param name="pKHID">Known Host ID from the ___HydraKnownHost table</param>
- /// <param name="p_isLocal">set to true for local connections</param>
- /// <param name="p_UpdateDB">Update the database with all instances returned</param>
- /// <param name="deleteoldrecordsfirst">Delete all instances of classname before uploading all new instances (disable this for perf classes)</param>
- public Win32_Process(string p_host, string p_user, string p_pas, string customquery, long pKHID, bool p_isLocal, bool p_UpdateDB, bool deleteoldrecordsfirst)
- {
- try
- {
- this._knownhostid = pKHID;
- this._hostname = p_host;
- if (!p_isLocal)
- {
- this._hostname = p_host;
- this._username = p_user;
- this._password = p_pas;
- this._islocalconnection = p_isLocal;
- }
- if (customquery != null)
- {
- if (customquery != "" )
- {
- this._wmiquery = customquery;
- }
- }
- int instanceindex = 0;
- this.ALLInstances = Get_All_Win32_Process_Objects();
- if (p_UpdateDB)
- {
- foreach (Win32_Process o in this.ALLInstances)
- {
- if(instanceindex == 0 && deleteoldrecordsfirst)
- {
- Win32_Process_DELETE_BY_KNOWN_HOST_ID(pKHID, Config.DBCONN_HYDRA_DB);
- }
- o._hostname = this._hostname;
- o._username = this._username;
- o._password = this._password;
- o.InsertIntoDatabase(Config.DBCONN_HYDRA_DB);
- instanceindex++;
- System.Threading.Thread.Sleep(3); //rest
- }
- }
- else
- {
- Logging.LogEventlogException(new ApplicationException("HydraB is Offline!!!!"),"Win32_Process", 911);
- }
- }
- catch(Exception xxl)
- {
- Logging.LogEventlogException(xxl, "Win32_Process", 911);
- }
- }
- #endregion
- #region Properties
- #region Property: Key Properties
- /// <summary>
- /// ArrayList to hold property names that uniquely identify the instances in the collection
- /// </summary>
- private ArrayList _key_properties = new ArrayList();
- public ArrayList KeyProperties
- {
- get
- {
- return _key_properties;
- }
- set
- {
- _key_properties = value;
- }
- }
- #endregion
- #region Property: ALLInstances
- /// <summary>
- /// ArrayList to hold objects
- /// </summary>
- private ArrayList _ALLinstances;
- public ArrayList ALLInstances
- {
- get
- {
- return _ALLinstances;
- }
- set
- {
- _ALLinstances = value;
- }
- }
- #endregion Property: ALLInstances
- #region Property: List<Property_Data> Properties
- /// <summary>
- /// Holds the collective properties of this class or instance
- ///
- /// </summary>
- private List<Property_Data> _properties = new List<Property_Data>();
- /// <summary>
- /// Holds the collective properties of this class or instance
- ///
- /// </summary>
- public List<Property_Data> Properties
- {
- get
- {
- return _properties;
- }
- set
- {
- _properties = value;
- }
- }
- #endregion Property: List<Property_Data>
- #region Property: ISLocalConnection
- /// <summary>
- /// KnownHostID is the value that uniquely identifies a host in the hydra database
- /// </summary>
- private bool _islocalconnection = true;
- public bool ISLocalConnection
- {
- get
- {
- return _islocalconnection;
- }
- set
- {
- _islocalconnection = value;
- }
- }
- #endregion Property: HydraID
- #region Property: KnownHostID
- /// <summary>
- /// KnownHostID is the value that uniquely identifies a host in the hydra database
- /// </summary>
- private Int64 _knownhostid = -9;
- public Int64 KnownHostID
- {
- get
- {
- return _knownhostid;
- }
- set
- {
- _knownhostid = value;
- }
- }
- #endregion Property: HydraID
- #region Property: HydraID
- /// <summary>
- /// HydraID is a value that is created in the sql database when you add a record to a table
- /// it is extremely helpful when trying to create relationships between tables in the database server
- /// </summary>
- private Int64 _hydraid;
- public Int64 HydraID
- {
- get
- {
- return _hydraid;
- }
- set
- {
- _hydraid = value;
- }
- }
- #endregion Property: HydraID
- #region Property: WMIQuery
- /// <summary>
- /// The WMI Query that was run against the WMI Provider
- /// Example: "SELECT * FROM WIN32_PROCESS"
- /// </summary>
- private string _wmiquery = "SELECT * FROM Win32_Process";
- public string WMIQuery
- {
- get
- {
- return _wmiquery;
- }
- set
- {
- _wmiquery = value;
- }
- }
- #endregion Property: WMIQuery
- #region Property: HostName
- /// <summary>
- /// Hostname is the host you want to run the query against.
- /// Example: dns_server.mycompany.com or 10.10.220.18
- /// </summary>
- private string _hostname = Environment.MachineName;
- public string HostName
- {
- get
- {
- return _hostname;
- }
- set
- {
- _hostname = value;
- }
- }
- #endregion Property: HostName
- #region Property: UserName
- /// <summary>
- /// UserName is the username you want to use to run the query
- /// </summary>
- private string _username = "";
- public string UserName
- {
- get
- {
- return _username;
- }
- set
- {
- _username = value;
- }
- }
- #endregion
- #region Property: Password
- /// <summary>
- /// password to use when connecting to remote hosts
- /// leave blank to use integrated security
- /// </summary>
- private string _password = "";
- public string Password
- {
- get
- {
- return _password;
- }
- set
- {
- _password = value;
- }
- }
- #endregion
- #region Property: NameSpace
- /// <summary>
- /// WMI Namespace
- /// </summary>
- private string _namespace = "ROOT\\CIMV2";
- public string NameSpace
- {
- get
- {
- return _namespace;
- }
- set
- {
- _namespace = value;
- }
- }
- #endregion Property: NameSpace
- #region Property: WMICLASS
- /// <summary>
- /// WMICLASS
- /// </summary>
- private string _wmiclass = "Win32_Process";
- public string WMIClass
- {
- get
- {
- return _wmiclass;
- }
- set
- {
- _wmiclass = value;
- }
- }
- #endregion Property: WMICLASS
- #region Property: RelPath
- /// <summary>
- /// Relative Path
- /// </summary>
- private string _relpath = "Win32_Process";
- public string RelPath
- {
- get
- {
- return _relpath;
- }
- set
- {
- _relpath = value;
- }
- }
- #endregion Property: NameSpace
- #region Property: InstancePath
- /// <summary>
- /// This.InstancePath
- /// </summary>
- private string _instancepath = "";
- public string InstancePath
- {
- get
- {
- return _instancepath;
- }
- set
- {
- _instancepath = value;
- }
- }
- #endregion Property: NameSpace
- #region Property: DatabaseConnectionString
- /// <summary>
- /// this field holds the DatabaseConnectionString for saving WMI Data to a mssql database
- /// </summary>
- private string _databaseconnectionstring;
- public string DatabaseConnectionString
- {
- get
- {
- return _databaseconnectionstring;
- }
- set
- {
- _databaseconnectionstring = value;
- }
- }
- #endregion Property: DatabaseConnectionString
- #region Property: Caption
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Caption" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | No | No | 3 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// 'varCaption': No Summary Available in WMI
- /// https://www.google.com?q=root\CIMV2:Win32_Process.varCaption Try Googling it lol
- /// </summary>
- public string varCaption
- {
- set
- {
- _varcaption = value;
- }
- get
- {
- return _varcaption;
- }
- }
- private string _varcaption = "";
- public bool CaptionIsReadable = true;
- public double CaptionMaxLength = 64;
- #endregion Property: varCaption
- #region Property: CommandLine
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "CommandLine" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 4 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The CommandLine property specifies the command line used to start a particular process, if
- /// applicable.
- /// </summary>
- public string varCommandLine
- {
- set
- {
- _varcommandline = value;
- }
- get
- {
- return _varcommandline;
- }
- }
- private string _varcommandline = "";
- public bool CommandLineIsReadable = true;
- #endregion Property: varCommandLine
- #region Property: CreationClassName
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "CreationClassName" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | Yes | No | 5 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// CreationClassName indicates the name of the class or the subclass used in the creation of an
- /// instance. When used with the other key properties of this class, this property allows all instances
- /// of this class and its subclasses to be uniquely identified.
- /// </summary>
- public string varCreationClassName
- {
- set
- {
- _varcreationclassname = value;
- }
- get
- {
- return _varcreationclassname;
- }
- }
- private string _varcreationclassname = "";
- public bool CreationClassNameIsReadable = true;
- public double CreationClassNameMaxLength = 256;
- #endregion Property: varCreationClassName
- #region Property: CreationDate
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "CreationDate" CimType:DateTime )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 4 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// Time that the process began executing.
- /// </summary>
- public DateTime varCreationDate
- {
- set
- {
- _varcreationdate = value;
- }
- get
- {
- return _varcreationdate;
- }
- }
- private DateTime _varcreationdate = new DateTime();
- public bool CreationDateIsReadable = true;
- #endregion Property: varCreationDate
- #region Property: CSCreationClassName
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "CSCreationClassName" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | Yes | No | 6 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// CSCreationClassName contains the scoping computer system's creation class name.
- /// </summary>
- public string varCSCreationClassName
- {
- set
- {
- _varcscreationclassname = value;
- }
- get
- {
- return _varcscreationclassname;
- }
- }
- private string _varcscreationclassname = "";
- public bool CSCreationClassNameIsReadable = true;
- public double CSCreationClassNameMaxLength = 256;
- #endregion Property: varCSCreationClassName
- #region Property: CSName
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "CSName" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | Yes | No | 6 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The scoping computer system's name.
- /// </summary>
- public string varCSName
- {
- set
- {
- _varcsname = value;
- }
- get
- {
- return _varcsname;
- }
- }
- private string _varcsname = "";
- public bool CSNameIsReadable = true;
- public double CSNameMaxLength = 256;
- #endregion Property: varCSName
- #region Property: Description
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Description" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | No | No | 2 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// 'varDescription': No Summary Available in WMI
- /// https://www.google.com?q=root\CIMV2:Win32_Process.varDescription Try Googling it lol
- /// </summary>
- public string varDescription
- {
- set
- {
- _vardescription = value;
- }
- get
- {
- return _vardescription;
- }
- }
- private string _vardescription = "";
- public bool DescriptionIsReadable = true;
- #endregion Property: varDescription
- #region Property: ExecutablePath
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ExecutablePath" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ExecutablePath property indicates the path to the executable file of the process.
- /// Example:
- /// C:\WINDOWS\EXPLORER.EXE
- /// </summary>
- public string varExecutablePath
- {
- set
- {
- _varexecutablepath = value;
- }
- get
- {
- return _varexecutablepath;
- }
- }
- private string _varexecutablepath = "";
- public bool ExecutablePathIsReadable = true;
- #endregion Property: varExecutablePath
- #region Property: ExecutionState
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ExecutionState" CimType:UInt16 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | Yes | No | Yes | No | No | No | Yes | No | 4 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// Indicates the current operating condition of the process. Values include ready (2), running
- /// (3), and blocked (4), among others.
- /// </summary>
- public ushort varExecutionState
- {
- set
- {
- _varexecutionstate = value;
- }
- get
- {
- return _varexecutionstate;
- }
- }
- private ushort _varexecutionstate = new ushort();
- public bool ExecutionStateIsReadable = true;
- #endregion Property: varExecutionState
- #region Property: Handle
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Handle" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Yes | No | No | No | Yes | No | No | Yes | Yes | No | 5 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// A string used to identify the process. A process ID is a kind of process handle.
- /// </summary>
- public string varHandle
- {
- set
- {
- _varhandle = value;
- }
- get
- {
- return _varhandle;
- }
- }
- private string _varhandle = "";
- public bool HandleIsReadable = true;
- public double HandleMaxLength = 256;
- #endregion Property: varHandle
- #region Property: HandleCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "HandleCount" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The HandleCount property specifies the total number of handles currently open by this process.
- /// This number is the sum of the handles currently open by each thread in this process. A handle
- /// is used to examine or modify the system resources. Each handle has an entry in an internally
- /// maintained table. These entries contain the addresses of the resources and the means to identify
- /// the resource type.
- /// </summary>
- public uint varHandleCount
- {
- set
- {
- _varhandlecount = value;
- }
- get
- {
- return _varhandlecount;
- }
- }
- private uint _varhandlecount = new uint();
- public bool HandleCountIsReadable = true;
- #endregion Property: varHandleCount
- #region Property: InstallDate
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "InstallDate" CimType:DateTime )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | No | No | 3 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// 'varInstallDate': No Summary Available in WMI
- /// https://www.google.com?q=root\CIMV2:Win32_Process.varInstallDate Try Googling it lol
- /// </summary>
- public DateTime varInstallDate
- {
- set
- {
- _varinstalldate = value;
- }
- get
- {
- return _varinstalldate;
- }
- }
- private DateTime _varinstalldate = new DateTime();
- public bool InstallDateIsReadable = true;
- #endregion Property: varInstallDate
- #region Property: KernelModeTime
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "KernelModeTime" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 5 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// Time in kernel mode, in 100 nanoseconds. If this information is not available, a value of 0
- /// should be used.
- /// </summary>
- public ulong varKernelModeTime
- {
- set
- {
- _varkernelmodetime = value;
- }
- get
- {
- return _varkernelmodetime;
- }
- }
- private ulong _varkernelmodetime = new ulong();
- public bool KernelModeTimeIsReadable = true;
- /// <summary>
- /// KernelModeTime is measured in 100 nanoseconds
- /// </summary>
- public readonly string KernelModeTime_units = "100 nanoseconds";
- #endregion Property: varKernelModeTime
- #region Property: MaximumWorkingSetSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "MaximumWorkingSetSize" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 7 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The MaximumWorkingSetSize property indicates the maximum working set size of the process. The
- /// working set of a process is the set of memory pages currently visible to the process in physical
- /// RAM. These pages are resident and available for an application to use without triggering a
- /// page fault.
- /// Example: 1413120.
- /// </summary>
- public uint varMaximumWorkingSetSize
- {
- set
- {
- _varmaximumworkingsetsize = value;
- }
- get
- {
- return _varmaximumworkingsetsize;
- }
- }
- private uint _varmaximumworkingsetsize = new uint();
- public bool MaximumWorkingSetSizeIsReadable = true;
- /// <summary>
- /// MaximumWorkingSetSize is measured in kilobytes
- /// </summary>
- public readonly string MaximumWorkingSetSize_units = "kilobytes";
- #endregion Property: varMaximumWorkingSetSize
- #region Property: MinimumWorkingSetSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "MinimumWorkingSetSize" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 7 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The MinimumWorkingSetSize property indicates the minimum working set size of the process. The
- /// working set of a process is the set of memory pages currently visible to the process in physical
- /// RAM. These pages are resident and available for an application to use without triggering a
- /// page fault.
- /// Example: 20480.
- /// </summary>
- public uint varMinimumWorkingSetSize
- {
- set
- {
- _varminimumworkingsetsize = value;
- }
- get
- {
- return _varminimumworkingsetsize;
- }
- }
- private uint _varminimumworkingsetsize = new uint();
- public bool MinimumWorkingSetSizeIsReadable = true;
- /// <summary>
- /// MinimumWorkingSetSize is measured in kilobytes
- /// </summary>
- public readonly string MinimumWorkingSetSize_units = "kilobytes";
- #endregion Property: varMinimumWorkingSetSize
- #region Property: Name
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Name" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | No | No | 2 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// 'varName': No Summary Available in WMI
- /// https://www.google.com?q=root\CIMV2:Win32_Process.varName Try Googling it lol
- /// </summary>
- public string varName
- {
- set
- {
- _varname = value;
- }
- get
- {
- return _varname;
- }
- }
- private string _varname = "";
- public bool NameIsReadable = true;
- #endregion Property: varName
- #region Property: OSCreationClassName
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "OSCreationClassName" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | Yes | No | 6 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The scoping operating system's creation class name.
- /// </summary>
- public string varOSCreationClassName
- {
- set
- {
- _varoscreationclassname = value;
- }
- get
- {
- return _varoscreationclassname;
- }
- }
- private string _varoscreationclassname = "";
- public bool OSCreationClassNameIsReadable = true;
- public double OSCreationClassNameMaxLength = 256;
- #endregion Property: varOSCreationClassName
- #region Property: OSName
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "OSName" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | Yes | Yes | No | 6 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The scoping operating system's name.
- /// </summary>
- public string varOSName
- {
- set
- {
- _varosname = value;
- }
- get
- {
- return _varosname;
- }
- }
- private string _varosname = "";
- public bool OSNameIsReadable = true;
- public double OSNameMaxLength = 256;
- #endregion Property: varOSName
- #region Property: OtherOperationCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "OtherOperationCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The OtherOperationCount property specifies the number of I/O operations performed, other than
- /// read and write operations.
- /// </summary>
- public ulong varOtherOperationCount
- {
- set
- {
- _varotheroperationcount = value;
- }
- get
- {
- return _varotheroperationcount;
- }
- }
- private ulong _varotheroperationcount = new ulong();
- public bool OtherOperationCountIsReadable = true;
- #endregion Property: varOtherOperationCount
- #region Property: OtherTransferCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "OtherTransferCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The OtherTransferCount property specifies the amount of data transferred during operations
- /// other than read and write operations.
- /// </summary>
- public ulong varOtherTransferCount
- {
- set
- {
- _varothertransfercount = value;
- }
- get
- {
- return _varothertransfercount;
- }
- }
- private ulong _varothertransfercount = new ulong();
- public bool OtherTransferCountIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_OtherTransferCountTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varOtherTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_OtherTransferCountTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varOtherTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varOtherTransferCount
- #region Property: PageFaults
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PageFaults" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PageFaults property indicates the number of page faults generated by the process.
- /// Example:
- /// 10
- /// </summary>
- public uint varPageFaults
- {
- set
- {
- _varpagefaults = value;
- }
- get
- {
- return _varpagefaults;
- }
- }
- private uint _varpagefaults = new uint();
- public bool PageFaultsIsReadable = true;
- #endregion Property: varPageFaults
- #region Property: PageFileUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PageFileUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PageFileUsage property indicates the amountof page file space currently being used by the
- /// process.
- /// Example: 102435
- /// </summary>
- public uint varPageFileUsage
- {
- set
- {
- _varpagefileusage = value;
- }
- get
- {
- return _varpagefileusage;
- }
- }
- private uint _varpagefileusage = new uint();
- public bool PageFileUsageIsReadable = true;
- /// <summary>
- /// PageFileUsage is measured in kilobytes
- /// </summary>
- public readonly string PageFileUsage_units = "kilobytes";
- #endregion Property: varPageFileUsage
- #region Property: ParentProcessId
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ParentProcessId" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ParentProcessId property specifies the unique identifier of the process that created this
- /// process. Process identifier numbers are reused, so they only identify a process for the lifetime
- /// of that process. It is possible that the process identified by ParentProcessId has terminated,
- /// so ParentProcessId may not refer to an running process. It is also possible that ParentProcessId
- /// incorrectly refers to a process which re-used that process identifier. The CreationDate property
- /// can be used to determine whether the specified parent was created after this process was created.
- /// </summary>
- public uint varParentProcessId
- {
- set
- {
- _varparentprocessid = value;
- }
- get
- {
- return _varparentprocessid;
- }
- }
- private uint _varparentprocessid = new uint();
- public bool ParentProcessIdIsReadable = true;
- #endregion Property: varParentProcessId
- #region Property: PeakPageFileUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PeakPageFileUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PeakPageFileUsage property indicates the maximum amount of page file space used during
- /// the life of the process.
- /// Example: 102367
- /// </summary>
- public uint varPeakPageFileUsage
- {
- set
- {
- _varpeakpagefileusage = value;
- }
- get
- {
- return _varpeakpagefileusage;
- }
- }
- private uint _varpeakpagefileusage = new uint();
- public bool PeakPageFileUsageIsReadable = true;
- /// <summary>
- /// PeakPageFileUsage is measured in kilobytes
- /// </summary>
- public readonly string PeakPageFileUsage_units = "kilobytes";
- #endregion Property: varPeakPageFileUsage
- #region Property: PeakVirtualSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PeakVirtualSize" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PeakVirtualSize property specifies the maximum virtual address space the process has used
- /// at any one time. Use of virtual address space does not necessarily imply corresponding use
- /// of either disk or main memory pages. However, virtual space is finite, and by using too much,
- /// the process might limit its ability to load libraries.
- /// </summary>
- public ulong varPeakVirtualSize
- {
- set
- {
- _varpeakvirtualsize = value;
- }
- get
- {
- return _varpeakvirtualsize;
- }
- }
- private ulong _varpeakvirtualsize = new ulong();
- public bool PeakVirtualSizeIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_PeakVirtualSizeTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varPeakVirtualSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_PeakVirtualSizeTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varPeakVirtualSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varPeakVirtualSize
- #region Property: PeakWorkingSetSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PeakWorkingSetSize" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PeakWorkingSetSize property indicates the peak working set size of the process.
- /// Example:
- /// 1413120
- /// </summary>
- public uint varPeakWorkingSetSize
- {
- set
- {
- _varpeakworkingsetsize = value;
- }
- get
- {
- return _varpeakworkingsetsize;
- }
- }
- private uint _varpeakworkingsetsize = new uint();
- public bool PeakWorkingSetSizeIsReadable = true;
- /// <summary>
- /// PeakWorkingSetSize is measured in kilobytes
- /// </summary>
- public readonly string PeakWorkingSetSize_units = "kilobytes";
- #endregion Property: varPeakWorkingSetSize
- #region Property: Priority
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Priority" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 6 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The Priority property indicates the scheduling priority of the process within the operating
- /// system. The higher the value, the higher priority the process receives. Priority values can
- /// range from 0 (lowest priority) to 31 (highest priority).
- /// Example: 7.
- /// </summary>
- public uint varPriority
- {
- set
- {
- _varpriority = value;
- }
- get
- {
- return _varpriority;
- }
- }
- private uint _varpriority = new uint();
- public bool PriorityIsReadable = true;
- #endregion Property: varPriority
- #region Property: PrivatePageCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "PrivatePageCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The PrivatePageCount property specifies the current number of pages allocated that are accessible
- /// only to this process
- /// </summary>
- public ulong varPrivatePageCount
- {
- set
- {
- _varprivatepagecount = value;
- }
- get
- {
- return _varprivatepagecount;
- }
- }
- private ulong _varprivatepagecount = new ulong();
- public bool PrivatePageCountIsReadable = true;
- #endregion Property: varPrivatePageCount
- #region Property: ProcessId
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ProcessId" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ProcessId property contains the global process identifier that can be used to identify
- /// a process. The value is valid from the creation of the process until the process is terminated.
- /// </summary>
- public uint varProcessId
- {
- set
- {
- _varprocessid = value;
- }
- get
- {
- return _varprocessid;
- }
- }
- private uint _varprocessid = new uint();
- public bool ProcessIdIsReadable = true;
- #endregion Property: varProcessId
- #region Property: QuotaNonPagedPoolUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "QuotaNonPagedPoolUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The QuotaNonPagedPoolUsage property indicates the quota amount of non-paged pool usage for
- /// the process.
- /// Example: 15
- /// </summary>
- public uint varQuotaNonPagedPoolUsage
- {
- set
- {
- _varquotanonpagedpoolusage = value;
- }
- get
- {
- return _varquotanonpagedpoolusage;
- }
- }
- private uint _varquotanonpagedpoolusage = new uint();
- public bool QuotaNonPagedPoolUsageIsReadable = true;
- #endregion Property: varQuotaNonPagedPoolUsage
- #region Property: QuotaPagedPoolUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "QuotaPagedPoolUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The QuotaPagedPoolUsage property indicates the quota amount of paged pool usage for the process.
- /// Example:
- /// 22
- /// </summary>
- public uint varQuotaPagedPoolUsage
- {
- set
- {
- _varquotapagedpoolusage = value;
- }
- get
- {
- return _varquotapagedpoolusage;
- }
- }
- private uint _varquotapagedpoolusage = new uint();
- public bool QuotaPagedPoolUsageIsReadable = true;
- #endregion Property: varQuotaPagedPoolUsage
- #region Property: QuotaPeakNonPagedPoolUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "QuotaPeakNonPagedPoolUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The QuotaPeakNonPagedPoolUsage property indicates the peak quota amount of non-paged pool usage
- /// for the process.
- /// Example: 31
- /// </summary>
- public uint varQuotaPeakNonPagedPoolUsage
- {
- set
- {
- _varquotapeaknonpagedpoolusage = value;
- }
- get
- {
- return _varquotapeaknonpagedpoolusage;
- }
- }
- private uint _varquotapeaknonpagedpoolusage = new uint();
- public bool QuotaPeakNonPagedPoolUsageIsReadable = true;
- #endregion Property: varQuotaPeakNonPagedPoolUsage
- #region Property: QuotaPeakPagedPoolUsage
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "QuotaPeakPagedPoolUsage" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The QuotaPeakPagedPoolUsage property indicates the peak quota amount of paged pool usage for
- /// the process. Example: 31
- /// </summary>
- public uint varQuotaPeakPagedPoolUsage
- {
- set
- {
- _varquotapeakpagedpoolusage = value;
- }
- get
- {
- return _varquotapeakpagedpoolusage;
- }
- }
- private uint _varquotapeakpagedpoolusage = new uint();
- public bool QuotaPeakPagedPoolUsageIsReadable = true;
- #endregion Property: varQuotaPeakPagedPoolUsage
- #region Property: ReadOperationCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ReadOperationCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ReadOperationCount property specifies the number of read operations performed.
- /// </summary>
- public ulong varReadOperationCount
- {
- set
- {
- _varreadoperationcount = value;
- }
- get
- {
- return _varreadoperationcount;
- }
- }
- private ulong _varreadoperationcount = new ulong();
- public bool ReadOperationCountIsReadable = true;
- #endregion Property: varReadOperationCount
- #region Property: ReadTransferCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ReadTransferCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ReadTransferCount property specifies the amount of data read.
- /// </summary>
- public ulong varReadTransferCount
- {
- set
- {
- _varreadtransfercount = value;
- }
- get
- {
- return _varreadtransfercount;
- }
- }
- private ulong _varreadtransfercount = new ulong();
- public bool ReadTransferCountIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_ReadTransferCountTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varReadTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_ReadTransferCountTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varReadTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varReadTransferCount
- #region Property: SessionId
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "SessionId" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The SessionId property specifies the unique identifier that is generated by the operating system
- /// when the session is created. A session spans a period of time from log in to log out on a particular
- /// system.
- /// </summary>
- public uint varSessionId
- {
- set
- {
- _varsessionid = value;
- }
- get
- {
- return _varsessionid;
- }
- }
- private uint _varsessionid = new uint();
- public bool SessionIdIsReadable = true;
- #endregion Property: varSessionId
- #region Property: Status
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "Status" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | Yes | Yes | No | No | Yes | No | No | 4 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// 'varStatus': No Summary Available in WMI
- /// https://www.google.com?q=root\CIMV2:Win32_Process.varStatus Try Googling it lol
- /// </summary>
- public string varStatus
- {
- set
- {
- _varstatus = value;
- }
- get
- {
- return _varstatus;
- }
- }
- private string _varstatus = "";
- public bool StatusIsReadable = true;
- public double StatusMaxLength = 10;
- #endregion Property: varStatus
- #region Property: TerminationDate
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "TerminationDate" CimType:DateTime )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 3 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// Time that the process was stopped or terminated.
- /// </summary>
- public DateTime varTerminationDate
- {
- set
- {
- _varterminationdate = value;
- }
- get
- {
- return _varterminationdate;
- }
- }
- private DateTime _varterminationdate = new DateTime();
- public bool TerminationDateIsReadable = true;
- #endregion Property: varTerminationDate
- #region Property: ThreadCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "ThreadCount" CimType:UInt32 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The ThreadCount property specifies the number of active threads in this process. An instruction
- /// is the basic unit of execution in a processor, and a thread is the object that executes instructions.
- /// Every running process has at least one thread. This property is for computers running Windows
- /// NT only.
- /// </summary>
- public uint varThreadCount
- {
- set
- {
- _varthreadcount = value;
- }
- get
- {
- return _varthreadcount;
- }
- }
- private uint _varthreadcount = new uint();
- public bool ThreadCountIsReadable = true;
- #endregion Property: varThreadCount
- #region Property: UserModeTime
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "UserModeTime" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 5 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// Time in user mode, in 100 nanoseconds. If this information is not available, a value of 0 should
- /// be used.
- /// </summary>
- public ulong varUserModeTime
- {
- set
- {
- _varusermodetime = value;
- }
- get
- {
- return _varusermodetime;
- }
- }
- private ulong _varusermodetime = new ulong();
- public bool UserModeTimeIsReadable = true;
- /// <summary>
- /// UserModeTime is measured in 100 nanoseconds
- /// </summary>
- public readonly string UserModeTime_units = "100 nanoseconds";
- #endregion Property: varUserModeTime
- #region Property: VirtualSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "VirtualSize" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The VirtualSize property specifies the current size in bytes of the virtual address space the
- /// process is using. Use of virtual address space does not necessarily imply corresponding use
- /// of either disk or main memory pages. Virtual space is finite, and by using too much, the process
- /// can limit its ability to load libraries.
- /// </summary>
- public ulong varVirtualSize
- {
- set
- {
- _varvirtualsize = value;
- }
- get
- {
- return _varvirtualsize;
- }
- }
- private ulong _varvirtualsize = new ulong();
- public bool VirtualSizeIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_VirtualSizeTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varVirtualSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_VirtualSizeTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varVirtualSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varVirtualSize
- #region Property: WindowsVersion
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "WindowsVersion" CimType:String )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The WindowsVersion property indicates the version of Windows in which the process is running.
- /// Example:
- /// 4.0
- /// </summary>
- public string varWindowsVersion
- {
- set
- {
- _varwindowsversion = value;
- }
- get
- {
- return _varwindowsversion;
- }
- }
- private string _varwindowsversion = "";
- public bool WindowsVersionIsReadable = true;
- #endregion Property: varWindowsVersion
- #region Property: WorkingSetSize
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "WorkingSetSize" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 4 | No |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The amount of memory in bytes that a process needs to execute efficiently, for an operating
- /// system that uses page-based memory management. If an insufficient amount of memory is available
- /// (< working set size), thrashing will occur. If this information is not known, NULL or 0 should
- /// be entered. If this data is provided, it could be monitored to understand a process' changing
- /// memory requirements as execution proceeds.
- /// </summary>
- public ulong varWorkingSetSize
- {
- set
- {
- _varworkingsetsize = value;
- }
- get
- {
- return _varworkingsetsize;
- }
- }
- private ulong _varworkingsetsize = new ulong();
- public bool WorkingSetSizeIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_WorkingSetSizeTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varWorkingSetSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_WorkingSetSizeTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varWorkingSetSize);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varWorkingSetSize
- #region Property: WriteOperationCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "WriteOperationCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | No | No | Yes | No | 5 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The WriteOperationCount property specifies the number of write operations performed.
- /// </summary>
- public ulong varWriteOperationCount
- {
- set
- {
- _varwriteoperationcount = value;
- }
- get
- {
- return _varwriteoperationcount;
- }
- }
- private ulong _varwriteoperationcount = new ulong();
- public bool WriteOperationCountIsReadable = true;
- #endregion Property: varWriteOperationCount
- #region Property: WriteTransferCount
- ///|----------------------------------------------------------------------------------------------------|
- ///| |
- ///| -=( Property: "WriteTransferCount" CimType:UInt64 )=- |
- ///| |
- ///|----------------------------------------------------------------------------------------------------|
- ///| Key | CIMKEY | Values | ValueMap | Read | Write | Units | MaxLen | Desc | Array | Quals | Local |
- ///|----------------------------------------------------------------------------------------------------|
- ///| No | No | No | No | Yes | No | Yes | No | Yes | No | 6 | Yes |
- ///|----------------------------------------------------------------------------------------------------|
- /// <summary>
- /// The WriteTransferCount property specifies the amount of data written.
- /// </summary>
- public ulong varWriteTransferCount
- {
- set
- {
- _varwritetransfercount = value;
- }
- get
- {
- return _varwritetransfercount;
- }
- }
- private ulong _varwritetransfercount = new ulong();
- public bool WriteTransferCountIsReadable = true;
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_WriteTransferCountTo_MB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varWriteTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Megabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- /// <summary>
- /// convert the value to a nice, human-readable format:
- /// </summary>
- public string Convert_WriteTransferCountTo_GB()
- {
- long xxxxxxxxxl = 0;
- try
- {
- xxxxxxxxxl = Convert.ToInt64( this.varWriteTransferCount);
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- return ConvertType.Make_Gigabytes_String_From_Long_Bytes(xxxxxxxxxl);
- }
- #endregion Property: varWriteTransferCount
- #region Load Key Properties
- private void _load_Key_Properties()
- {
- /// varHandle is a Key Property
- _key_properties.Add("varHandle");
- }
- #endregion
- #endregion
- #region public int Execute_Create_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// Execute_Create_Method(string instancepath, String _commandline, String _currentdirectory, Object _processstart
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_Create_Method( string instancepath, String _commandline, String _currentdirectory, Object _processstartupinformation )
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_Create_Method( string instancepath, String _commandline, String _currentdirectory, Object _processstartupinformation )
- {
- int i = -1;
- try {
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- mo.Scope.Connect();
- ManagementBaseObject inparams = mo.GetMethodParameters( "Create" );
- inparams["CommandLine"] = (String)_commandline;
- inparams["CurrentDirectory"] = (String)_currentdirectory;
- inparams["ProcessStartupInformation"] = (Object)_processstartupinformation;
- ManagementBaseObject param = mo.InvokeMethod( "Create" , inparams , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_Create_Method()
- #region public int Execute_Terminate_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// Execute_Terminate_Method(string instancepath, UInt32 _reason )
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_Terminate_Method( string instancepath, UInt32 _reason )
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_Terminate_Method( string instancepath, UInt32 _reason )
- {
- int i = -1;
- try {
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- mo.Scope.Connect();
- ManagementBaseObject inparams = mo.GetMethodParameters( "Terminate" );
- inparams["Reason"] = (UInt32)_reason;
- ManagementBaseObject param = mo.InvokeMethod( "Terminate" , inparams , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_Terminate_Method()
- #region public int Execute_GetOwner_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public int Execute_GetOwner_Method()
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_GetOwner_Method()
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_GetOwner_Method( string instancepath )
- {
- int i = -1;
- try{
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "Win32_Process=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- ManagementBaseObject param = mo.InvokeMethod( "GetOwner" , null , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_GetOwner_Method()
- #region public int Execute_GetOwnerSid_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public int Execute_GetOwnerSid_Method()
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_GetOwnerSid_Method()
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_GetOwnerSid_Method( string instancepath )
- {
- int i = -1;
- try{
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "Win32_Process=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- ManagementBaseObject param = mo.InvokeMethod( "GetOwnerSid" , null , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_GetOwnerSid_Method()
- #region public int Execute_SetPriority_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// Execute_SetPriority_Method(string instancepath, Int32 _priority )
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_SetPriority_Method( string instancepath, Int32 _priority )
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_SetPriority_Method( string instancepath, Int32 _priority )
- {
- int i = -1;
- try {
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- mo.Scope.Connect();
- ManagementBaseObject inparams = mo.GetMethodParameters( "SetPriority" );
- inparams["Priority"] = (Int32)_priority;
- ManagementBaseObject param = mo.InvokeMethod( "SetPriority" , inparams , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_SetPriority_Method()
- #region public int Execute_AttachDebugger_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public int Execute_AttachDebugger_Method()
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_AttachDebugger_Method()
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_AttachDebugger_Method( string instancepath )
- {
- int i = -1;
- try{
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "Win32_Process=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- ManagementBaseObject param = mo.InvokeMethod( "AttachDebugger" , null , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_AttachDebugger_Method()
- #region public int Execute_GetAvailableVirtualSize_Method()
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public int Execute_GetAvailableVirtualSize_Method()
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///<summary>
- /// Execute_GetAvailableVirtualSize_Method()
- ///</summary>
- ///<returns>int ReturnValue</returns>
- public int Execute_GetAvailableVirtualSize_Method( string instancepath )
- {
- int i = -1;
- try{
- string ip = instancepath;
- if (this.InstancePath != "") { ip = this.InstancePath; }
- else { ip = "Win32_Process=@"; }
- ManagementScope scope = new ManagementScope("ROOT\\CIMV2");
- ManagementObject mo = new ManagementObject(scope, new ManagementPath(ip), new ObjectGetOptions());
- mo.Scope.Options.EnablePrivileges = true;
- ManagementBaseObject param = mo.InvokeMethod( "GetAvailableVirtualSize" , null , null );
- i = Convert.ToInt32(param[ "ReturnValue" ].ToString());
- mo.Dispose();
- } catch (Exception ex) { LogError(ex); }
- return i;
- }
- #endregion public int Execute_GetAvailableVirtualSize_Method()
- #region Get_All_Win32_Process_Objects()
- ///===================================================================================================
- ///
- /// Get_All_Win32_Process_Objects()
- ///
- ///===================================================================================================
- /// <summary>
- /// Returns an ArrayList of 'Win32_Process' objects with all fields filled
- /// </summary>
- /// <returns>ArrayList of 'Win32_Process' objects</returns>
- public ArrayList Get_All_Win32_Process_Objects()
- {
- ArrayList the_ArrayList = new ArrayList();
- ConnectionOptions co = new ConnectionOptions();
- co.EnablePrivileges = true;
- co.Impersonation = ImpersonationLevel.Impersonate;
- co.Authentication = AuthenticationLevel.PacketPrivacy;
- co.Timeout = new TimeSpan(0, 0, 10);
- if(!this._islocalconnection)
- {
- co.Username = this._username;
- co.Password = this._password;
- co.Authority = "ntlmdomain:" + this._hostname;
- }
- ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);
- ms.Connect();
- while (!ms.IsConnected)
- {
- System.Threading.Thread.Sleep(1);
- }
- if( !ms.IsConnected )
- {
- LogWarning( "Could not connect to management scope!" + ms.Path );
- }
- else
- {
- ObjectQuery oQuery = new ObjectQuery(this._wmiquery);
- ManagementObjectSearcher searcher = new ManagementObjectSearcher(ms, oQuery);
- searcher.Options.UseAmendedQualifiers = false;
- ManagementObjectCollection moc = searcher.Get();
- foreach (ManagementObject mo in moc)
- {
- Win32_Process x = new Win32_Process();
- x._instancepath = mo.Path.RelativePath;
- x._knownhostid = this.KnownHostID;
- x._hostname = this._hostname;
- try
- {
- x.varCaption = Convert.ToString(mo.GetPropertyValue("Caption")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varCommandLine = Convert.ToString(mo.GetPropertyValue("CommandLine")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varCreationClassName = Convert.ToString(mo.GetPropertyValue("CreationClassName")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varCreationDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("CreationDate"))); //4733 Type:DateTime Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varCSCreationClassName = Convert.ToString(mo.GetPropertyValue("CSCreationClassName")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varCSName = Convert.ToString(mo.GetPropertyValue("CSName")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varDescription = Convert.ToString(mo.GetPropertyValue("Description")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varExecutablePath = Convert.ToString(mo.GetPropertyValue("ExecutablePath")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varExecutionState = Convert.ToUInt16(mo.GetPropertyValue("ExecutionState")); //todo: 4779 Type:UInt16 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varHandle = Convert.ToString(mo.GetPropertyValue("Handle")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varHandleCount = Convert.ToUInt32(mo.GetPropertyValue("HandleCount")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varInstallDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("InstallDate"))); //4733 Type:DateTime Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varKernelModeTime = Convert.ToUInt64(mo.GetPropertyValue("KernelModeTime")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varMaximumWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("MaximumWorkingSetSize")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varMinimumWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("MinimumWorkingSetSize")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varName = Convert.ToString(mo.GetPropertyValue("Name")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varOSCreationClassName = Convert.ToString(mo.GetPropertyValue("OSCreationClassName")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varOSName = Convert.ToString(mo.GetPropertyValue("OSName")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varOtherOperationCount = Convert.ToUInt64(mo.GetPropertyValue("OtherOperationCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varOtherTransferCount = Convert.ToUInt64(mo.GetPropertyValue("OtherTransferCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPageFaults = Convert.ToUInt32(mo.GetPropertyValue("PageFaults")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPageFileUsage = Convert.ToUInt32(mo.GetPropertyValue("PageFileUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varParentProcessId = Convert.ToUInt32(mo.GetPropertyValue("ParentProcessId")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPeakPageFileUsage = Convert.ToUInt32(mo.GetPropertyValue("PeakPageFileUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPeakVirtualSize = Convert.ToUInt64(mo.GetPropertyValue("PeakVirtualSize")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPeakWorkingSetSize = Convert.ToUInt32(mo.GetPropertyValue("PeakWorkingSetSize")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPriority = Convert.ToUInt32(mo.GetPropertyValue("Priority")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varPrivatePageCount = Convert.ToUInt64(mo.GetPropertyValue("PrivatePageCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varProcessId = Convert.ToUInt32(mo.GetPropertyValue("ProcessId")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varQuotaNonPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaNonPagedPoolUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varQuotaPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPagedPoolUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varQuotaPeakNonPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPeakNonPagedPoolUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varQuotaPeakPagedPoolUsage = Convert.ToUInt32(mo.GetPropertyValue("QuotaPeakPagedPoolUsage")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varReadOperationCount = Convert.ToUInt64(mo.GetPropertyValue("ReadOperationCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varReadTransferCount = Convert.ToUInt64(mo.GetPropertyValue("ReadTransferCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varSessionId = Convert.ToUInt32(mo.GetPropertyValue("SessionId")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varStatus = Convert.ToString(mo.GetPropertyValue("Status")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varTerminationDate = Hydra.ConvertType.CimTypeDateTime_ToDateTime( Convert.ToString( mo.GetPropertyValue("TerminationDate"))); //4733 Type:DateTime Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varThreadCount = Convert.ToUInt32(mo.GetPropertyValue("ThreadCount")); //todo: 4779 Type:UInt32 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varUserModeTime = Convert.ToUInt64(mo.GetPropertyValue("UserModeTime")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varVirtualSize = Convert.ToUInt64(mo.GetPropertyValue("VirtualSize")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varWindowsVersion = Convert.ToString(mo.GetPropertyValue("WindowsVersion")); //todo: 4779 Type:String Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varWorkingSetSize = Convert.ToUInt64(mo.GetPropertyValue("WorkingSetSize")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varWriteOperationCount = Convert.ToUInt64(mo.GetPropertyValue("WriteOperationCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- try
- {
- x.varWriteTransferCount = Convert.ToUInt64(mo.GetPropertyValue("WriteTransferCount")); //todo: 4779 Type:UInt64 Array?:False
- }
- catch(Exception ex)
- {
- LogError(ex);
- }
- the_ArrayList.Add(x);
- }
- searcher.Dispose();
- moc.Dispose();
- }
- return the_ArrayList;
- }
- #endregion
- ///====================================================================================================
- ///
- /// public ManagementObjectCollection GetInstances( ManagementClass m )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a managementobjectcollection from the selected class
- ///</summary>
- ///<param name="m">ManagementClass</param>
- ///<returns>ManagementObjectCollection</returns>
- public ManagementObjectCollection GetInstances( ManagementClass m )
- {
- ManagementPath mgtPath = new ManagementPath(m.Path.Path);
- ConnectionOptions co = new ConnectionOptions();
- co.Authentication = AuthenticationLevel.Packet;
- co.EnablePrivileges = true;
- co.Timeout = TimeSpan.MaxValue;
- if(this._username != ""){ co.Username = this._username; }
- if(this._password != ""){ co.Password = this._password; }
- ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);
- ms.Options.Timeout = TimeSpan.MaxValue;
- ms.Options.Impersonation = ImpersonationLevel.Impersonate;
- ms.Options.EnablePrivileges = true;
- ms.Connect();
- if( !ms.IsConnected )
- {
- LogWarning( "Could not connect to management scope!" + ms.Path );
- }
- SelectQuery selQuery = new SelectQuery( m.Path.ClassName );
- ManagementObjectSearcher s = new ManagementObjectSearcher( ms , selQuery );
- s.Options.UseAmendedQualifiers = true;
- s.Options.DirectRead = true;
- s.Options.EnumerateDeep = true;
- return s.Get();
- }
- ///====================================================================================================
- ///===================================================================================================
- ///
- /// public ManagementObject GetFirstInstance( string p_classname, string p_SysRelPath )
- ///
- ///===================================================================================================
- ///<summary>
- /// Get a ManagementObject by its key property value
- ///</summary>
- /// Win32_DiskDrive, DeviceID="\\.\PHYSICALDRIVE0"
- /// Win32_NetworkAdapter, DeviceID="0"
- /// <param name="p_ClassName">WMI Class Name</param>
- /// <param name="p_RelPath">DeviceID="CPU0" (Example)</param>
- ///<returns>ManagementObject</returns>
- public ManagementObject GetFirstInstance( string p_classname, string p_SysRelPath )
- {
- ManagementPath mgtPath = new ManagementPath(p_classname);
- ConnectionOptions co = new ConnectionOptions();
- co.Authentication = AuthenticationLevel.Packet;
- co.EnablePrivileges = true;
- co.Timeout = TimeSpan.MaxValue;
- if(this._username != ""){ co.Username = this._username; }
- if(this._password != ""){ co.Password = this._password; }
- ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);
- ms.Options.Timeout = TimeSpan.MaxValue;
- ms.Options.Impersonation = ImpersonationLevel.Impersonate;
- ms.Options.EnablePrivileges = true;
- ms.Connect();
- if( !ms.IsConnected )
- {
- LogWarning( "Could not connect to management scope!" + ms.Path );
- }
- SelectQuery selQuery = new SelectQuery( p_classname , p_SysRelPath );
- ManagementObjectSearcher moSearcher = new ManagementObjectSearcher( ms , selQuery );
- moSearcher.Options.UseAmendedQualifiers = false;
- ManagementObject mo = new ManagementObject();
- foreach( ManagementObject mob in moSearcher.Get() )
- {
- mo = mob;
- break;
- }
- return mo;
- }
- ///===================================================================================================
- ///
- /// public ManagementObject GetByPath( string p_SysFullPath )
- ///
- ///===================================================================================================
- ///<summary>
- /// Get a ManagementObject by its key property value
- ///</summary>
- /// Win32_DiskDrive, DeviceID="\\.\PHYSICALDRIVE0"
- /// Win32_NetworkAdapter, DeviceID="0"
- /// etc...
- /// <param name="p_ClassName">WMI Class Name</param>
- /// <param name="p_SysRelPath">DeviceID="CPU0" (Example)</param>
- ///<returns>ManagementObject</returns>
- public ManagementObject GetInstanceByPath(string p_classname, string p_SysRelPath )
- {
- ManagementPath mgtPath = new ManagementPath(p_classname);
- ConnectionOptions co = new ConnectionOptions();
- co.Authentication = AuthenticationLevel.Packet;
- co.EnablePrivileges = true;
- co.Timeout = TimeSpan.MaxValue;
- if(this._username != ""){ co.Username = this._username; }
- if(this._password != ""){ co.Password = this._password; }
- ManagementScope ms = new ManagementScope("\\\\"+ this._hostname + "\\" + this._namespace , co);
- ms.Options.Timeout = TimeSpan.MaxValue;
- ms.Options.Impersonation = ImpersonationLevel.Impersonate;
- ms.Options.EnablePrivileges = true;
- ms.Connect();
- if( !ms.IsConnected )
- {
- LogWarning( "Could not connect to management scope!" + ms.Path );
- }
- SelectQuery selQuery = new SelectQuery( p_classname , p_SysRelPath );
- ManagementObjectSearcher moSearcher = new ManagementObjectSearcher( ms , selQuery );
- moSearcher.Options.UseAmendedQualifiers = true;
- ManagementObject mob = new ManagementObject();
- foreach( ManagementObject mo in moSearcher.Get() )
- {
- mob = mo;
- }
- return mob;
- }
- ///====================================================================================================
- #region InstancesToHTML()
- ///===================================================================================================
- ///
- /// public static string InstancesToHTML()
- ///
- ///===================================================================================================
- /// <summary>
- /// Returns a html string of all instances of this class
- /// </summary>
- /// <returns>string html</returns>
- public static string InstancesToHtml()
- {
- ConnectionOptions co = new ConnectionOptions();
- co.EnablePrivileges = true;
- co.Impersonation = ImpersonationLevel.Impersonate;
- co.Authentication = AuthenticationLevel.PacketPrivacy;
- ManagementScope ms = new ManagementScope( "\\\\.\\\\root\\CIMV2", co );
- ObjectQuery oQuery = new ObjectQuery( "select * from Win32_Process" );
- ManagementObjectSearcher searcher = new ManagementObjectSearcher( ms , oQuery );
- ManagementObjectCollection moc = searcher.Get();
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- sb.AppendLine();
- sb.AppendLine( "<!-- generated by hydra-->" );
- sb.AppendLine( " < table border=1 cellpadding=5 cellspacing=0>" );
- sb.AppendLine( " < tr><td colspan=2><strong>" + searcher.Scope.Path.Path + "</strong></td></tr>" );
- foreach( ManagementObject mo in moc )
- {
- sb.AppendLine( "" );
- sb.AppendLine( " < tr><td colspan=2><strong>" + mo.Path.Path.ToString() + "</strong></td></tr>" );
- sb.AppendLine( " < tr><td>Caption</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Caption") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>CommandLine</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CommandLine") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>CreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CreationClassName") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>CreationDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CreationDate") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>CSCreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CSCreationClassName") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>CSName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("CSName") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>Description</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Description") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ExecutablePath</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ExecutablePath") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ExecutionState</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ExecutionState") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>Handle</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Handle") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>HandleCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("HandleCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>InstallDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("InstallDate") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>KernelModeTime</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("KernelModeTime") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>MaximumWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("MaximumWorkingSetSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>MinimumWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("MinimumWorkingSetSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>Name</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Name") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>OSCreationClassName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OSCreationClassName") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>OSName</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OSName") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>OtherOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OtherOperationCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>OtherTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("OtherTransferCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PageFaults</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PageFaults") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PageFileUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PageFileUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ParentProcessId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ParentProcessId") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PeakPageFileUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakPageFileUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PeakVirtualSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakVirtualSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PeakWorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PeakWorkingSetSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>Priority</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Priority") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>PrivatePageCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("PrivatePageCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ProcessId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ProcessId") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>QuotaNonPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaNonPagedPoolUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>QuotaPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPagedPoolUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>QuotaPeakNonPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPeakNonPagedPoolUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>QuotaPeakPagedPoolUsage</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("QuotaPeakPagedPoolUsage") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ReadOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ReadOperationCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ReadTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ReadTransferCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>SessionId</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("SessionId") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>Status</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("Status") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>TerminationDate</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("TerminationDate") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>ThreadCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("ThreadCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>UserModeTime</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("UserModeTime") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>VirtualSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("VirtualSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>WindowsVersion</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WindowsVersion") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>WorkingSetSize</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WorkingSetSize") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>WriteOperationCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WriteOperationCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td>WriteTransferCount</td><td>" + ConvertType.ManagementBaseObjectToString( mo.GetPropertyValue("WriteTransferCount") ) + "</td></tr>" );
- sb.AppendLine( " < tr><td colspan=2> </td></tr>" );
- }
- sb.AppendLine("</table>" );
- sb.AppendLine();
- searcher.Dispose();
- moc.Dispose();
- return sb.ToString();
- }
- #endregion
- #region LogError( Exception ex)
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogError(Exception ex)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- /// <summary>
- /// Log Errors
- /// </summary>
- public static void LogError(Exception ex)
- {
- EventLog Log = new EventLog( "Hydra" , ".", "Win32_Process");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(ex.ToString(), EventLogEntryType.Error, 420 );
- }
- #endregion
- #region LogError(Exception ex, int evt_id )
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogError(Exception ex, int evt_id)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- public static void LogError(Exception ex, int evt_id)
- {
- EventLog Log = new EventLog( "Hydra" , ".", "Win32_Process");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(ex.ToString(), EventLogEntryType.Error, evt_id );
- }
- #endregion
- #region LogWarning(string info)
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogWarning(string info)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- /// <summary>
- /// Log Warning
- /// </summary>
- public static void LogWarning(string info)
- {
- EventLog Log = new EventLog("Hydra",".", "Hydra");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(info, EventLogEntryType.Warning, 420 );
- }
- #endregion
- #region LogWarning(string info, int evt_id)
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogWarning(string info, int evt_id)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- /// <summary>
- /// Log Warning
- /// </summary>
- public static void LogWarning(string info, int evt_id)
- {
- EventLog Log = new EventLog("Hydra",".", "Hydra");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(info, EventLogEntryType.Warning, evt_id );
- }
- #endregion
- #region LogInfo(string info)
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogInfo(string info)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- /// <summary>
- /// Log Information
- /// </summary>
- public static void LogInfo(string info)
- {
- EventLog Log = new EventLog("Hydra",".", "Hydra");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(info, EventLogEntryType.Information, 420 );
- }
- #endregion
- #region LogInfo(string info, int evt_id)
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- ///
- /// public static void LogInfo(string info, int evt_id)
- ///
- ///-=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=--=<oo>=-
- /// <summary>
- /// Log Information
- /// </summary>
- public static void LogInfo(string info, int evt_id)
- {
- EventLog Log = new EventLog("Hydra",".", "Hydra");
- if (!EventLog.SourceExists("Win32_Process"))
- {
- EventLog.CreateEventSource("Win32_Process", "Hydra");
- }
- Log.Source = "Win32_Process";
- Log.WriteEntry(info, EventLogEntryType.Information, evt_id );
- }
- #endregion
- #region Database Helper Methods
- ///====================================================================================================
- ///
- /// public void InsertIntoDatabase(string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// insert this "Win32_Process" into the database
- ///</summary>
- public void InsertIntoDatabase(string DatabaseConnectionString )
- {
- System.Data.SqlClient.SqlParameter[] p = new SqlParameter[47];
- p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);
- try
- {
- p[0].Value = this.HostName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[1] = new SqlParameter("@KnownHostID", SqlDbType.BigInt);
- if(this.KnownHostID == -9 )
- { throw new ApplicationException("Known Host ID was not set when trying to insert into the database"); }
- try
- {
- p[1].Value = this.KnownHostID;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[2] = new SqlParameter("@Caption", SqlDbType.NVarChar, 255 );
- try
- {
- p[2].Value = this.varCaption;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[2].Value = "";
- }
- p[3] = new SqlParameter("@CommandLine", SqlDbType.NVarChar, 255 );
- try
- {
- p[3].Value = this.varCommandLine;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[3].Value = "";
- }
- p[4] = new SqlParameter("@CreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[4].Value = this.varCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[4].Value = "";
- }
- p[5] = new SqlParameter("@CreationDate", SqlDbType.DateTime);
- try
- {
- p[5].Value = Convert.ToDateTime(this.varCreationDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[5].Value = DateTime.Now;
- }
- p[6] = new SqlParameter("@CSCreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[6].Value = this.varCSCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[6].Value = "";
- }
- p[7] = new SqlParameter("@CSName", SqlDbType.NVarChar, 255 );
- try
- {
- p[7].Value = this.varCSName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[7].Value = "";
- }
- p[8] = new SqlParameter("@Description", SqlDbType.NVarChar, 255 );
- try
- {
- p[8].Value = this.varDescription;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[8].Value = "";
- }
- p[9] = new SqlParameter("@ExecutablePath", SqlDbType.NVarChar, 255 );
- try
- {
- p[9].Value = this.varExecutablePath;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[9].Value = "";
- }
- p[10] = new SqlParameter("@ExecutionState", SqlDbType.BigInt);
- try
- {
- p[10].Value = Convert.ToInt64(this.varExecutionState);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[10].Value = 0;
- }
- p[11] = new SqlParameter("@Handle", SqlDbType.NVarChar, 255 );
- try
- {
- p[11].Value = this.varHandle;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[11].Value = "";
- }
- p[12] = new SqlParameter("@HandleCount", SqlDbType.BigInt);
- try
- {
- p[12].Value = Convert.ToInt64(this.varHandleCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[12].Value = 0;
- }
- p[13] = new SqlParameter("@InstallDate", SqlDbType.DateTime);
- try
- {
- p[13].Value = Convert.ToDateTime(this.varInstallDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[13].Value = DateTime.Now;
- }
- p[14] = new SqlParameter("@KernelModeTime", SqlDbType.BigInt);
- try
- {
- p[14].Value = Convert.ToInt64(this.varKernelModeTime);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[14].Value = 0;
- }
- p[15] = new SqlParameter("@MaximumWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[15].Value = Convert.ToInt64(this.varMaximumWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[15].Value = 0;
- }
- p[16] = new SqlParameter("@MinimumWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[16].Value = Convert.ToInt64(this.varMinimumWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[16].Value = 0;
- }
- p[17] = new SqlParameter("@Name", SqlDbType.NVarChar, 255 );
- try
- {
- p[17].Value = this.varName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[17].Value = "";
- }
- p[18] = new SqlParameter("@OSCreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[18].Value = this.varOSCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[18].Value = "";
- }
- p[19] = new SqlParameter("@OSName", SqlDbType.NVarChar, 255 );
- try
- {
- p[19].Value = this.varOSName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[19].Value = "";
- }
- p[20] = new SqlParameter("@OtherOperationCount", SqlDbType.BigInt);
- try
- {
- p[20].Value = Convert.ToInt64(this.varOtherOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[20].Value = 0;
- }
- p[21] = new SqlParameter("@OtherTransferCount", SqlDbType.BigInt);
- try
- {
- p[21].Value = Convert.ToInt64(this.varOtherTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[21].Value = 0;
- }
- p[22] = new SqlParameter("@PageFaults", SqlDbType.BigInt);
- try
- {
- p[22].Value = Convert.ToInt64(this.varPageFaults);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[22].Value = 0;
- }
- p[23] = new SqlParameter("@PageFileUsage", SqlDbType.BigInt);
- try
- {
- p[23].Value = Convert.ToInt64(this.varPageFileUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[23].Value = 0;
- }
- p[24] = new SqlParameter("@ParentProcessId", SqlDbType.BigInt);
- try
- {
- p[24].Value = Convert.ToInt64(this.varParentProcessId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[24].Value = 0;
- }
- p[25] = new SqlParameter("@PeakPageFileUsage", SqlDbType.BigInt);
- try
- {
- p[25].Value = Convert.ToInt64(this.varPeakPageFileUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[25].Value = 0;
- }
- p[26] = new SqlParameter("@PeakVirtualSize", SqlDbType.BigInt);
- try
- {
- p[26].Value = Convert.ToInt64(this.varPeakVirtualSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[26].Value = 0;
- }
- p[27] = new SqlParameter("@PeakWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[27].Value = Convert.ToInt64(this.varPeakWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[27].Value = 0;
- }
- p[28] = new SqlParameter("@Priority", SqlDbType.BigInt);
- try
- {
- p[28].Value = Convert.ToInt64(this.varPriority);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[28].Value = 0;
- }
- p[29] = new SqlParameter("@PrivatePageCount", SqlDbType.BigInt);
- try
- {
- p[29].Value = Convert.ToInt64(this.varPrivatePageCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[29].Value = 0;
- }
- p[30] = new SqlParameter("@ProcessId", SqlDbType.BigInt);
- try
- {
- p[30].Value = Convert.ToInt64(this.varProcessId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[30].Value = 0;
- }
- p[31] = new SqlParameter("@QuotaNonPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[31].Value = Convert.ToInt64(this.varQuotaNonPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[31].Value = 0;
- }
- p[32] = new SqlParameter("@QuotaPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[32].Value = Convert.ToInt64(this.varQuotaPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[32].Value = 0;
- }
- p[33] = new SqlParameter("@QuotaPeakNonPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[33].Value = Convert.ToInt64(this.varQuotaPeakNonPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[33].Value = 0;
- }
- p[34] = new SqlParameter("@QuotaPeakPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[34].Value = Convert.ToInt64(this.varQuotaPeakPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[34].Value = 0;
- }
- p[35] = new SqlParameter("@ReadOperationCount", SqlDbType.BigInt);
- try
- {
- p[35].Value = Convert.ToInt64(this.varReadOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[35].Value = 0;
- }
- p[36] = new SqlParameter("@ReadTransferCount", SqlDbType.BigInt);
- try
- {
- p[36].Value = Convert.ToInt64(this.varReadTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[36].Value = 0;
- }
- p[37] = new SqlParameter("@SessionId", SqlDbType.BigInt);
- try
- {
- p[37].Value = Convert.ToInt64(this.varSessionId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[37].Value = 0;
- }
- p[38] = new SqlParameter("@Status", SqlDbType.NVarChar, 255 );
- try
- {
- p[38].Value = this.varStatus;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[38].Value = "";
- }
- p[39] = new SqlParameter("@TerminationDate", SqlDbType.DateTime);
- try
- {
- p[39].Value = Convert.ToDateTime(this.varTerminationDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[39].Value = DateTime.Now;
- }
- p[40] = new SqlParameter("@ThreadCount", SqlDbType.BigInt);
- try
- {
- p[40].Value = Convert.ToInt64(this.varThreadCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[40].Value = 0;
- }
- p[41] = new SqlParameter("@UserModeTime", SqlDbType.BigInt);
- try
- {
- p[41].Value = Convert.ToInt64(this.varUserModeTime);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[41].Value = 0;
- }
- p[42] = new SqlParameter("@VirtualSize", SqlDbType.BigInt);
- try
- {
- p[42].Value = Convert.ToInt64(this.varVirtualSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[42].Value = 0;
- }
- p[43] = new SqlParameter("@WindowsVersion", SqlDbType.NVarChar, 255 );
- try
- {
- p[43].Value = this.varWindowsVersion;
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[43].Value = "";
- }
- p[44] = new SqlParameter("@WorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[44].Value = Convert.ToInt64(this.varWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[44].Value = 0;
- }
- p[45] = new SqlParameter("@WriteOperationCount", SqlDbType.BigInt);
- try
- {
- p[45].Value = Convert.ToInt64(this.varWriteOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[45].Value = 0;
- }
- p[46] = new SqlParameter("@WriteTransferCount", SqlDbType.BigInt);
- try
- {
- p[46].Value = Convert.ToInt64(this.varWriteTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- p[46].Value = 0;
- }
- if(!Data.HydraDatabase.DatabaseIsOnline())
- {
- Logging.LogWarning("Hydra Database is Offline!!!", 911);
- }
- else
- {
- Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"Win32_Process_INSERT", p);
- }
- }
- ///====================================================================================================
- ///
- /// public void UpdateToDatabase( string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// update this instance in the database
- ///</summary>
- public void UpdateToDatabase( string DatabaseConnectionString )
- {
- System.Data.SqlClient.SqlParameter[] p = new SqlParameter[47];
- p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);
- p[0].Value = this.HydraID;
- p[1] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);
- p[1].Value = this.HostName;
- p[2] = new SqlParameter("@Caption", SqlDbType.NVarChar, 255 );
- try
- {
- p[2].Value = this.varCaption;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[3] = new SqlParameter("@CommandLine", SqlDbType.NVarChar, 255 );
- try
- {
- p[3].Value = this.varCommandLine;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[4] = new SqlParameter("@CreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[4].Value = this.varCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[5] = new SqlParameter("@CreationDate", SqlDbType.DateTime);
- try
- {
- p[5].Value = Convert.ToDateTime(this.varCreationDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[6] = new SqlParameter("@CSCreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[6].Value = this.varCSCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[7] = new SqlParameter("@CSName", SqlDbType.NVarChar, 255 );
- try
- {
- p[7].Value = this.varCSName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[8] = new SqlParameter("@Description", SqlDbType.NVarChar, 255 );
- try
- {
- p[8].Value = this.varDescription;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[9] = new SqlParameter("@ExecutablePath", SqlDbType.NVarChar, 255 );
- try
- {
- p[9].Value = this.varExecutablePath;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[10] = new SqlParameter("@ExecutionState", SqlDbType.BigInt);
- try
- {
- p[10].Value = Convert.ToInt64(this.varExecutionState);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[11] = new SqlParameter("@Handle", SqlDbType.NVarChar, 255 );
- try
- {
- p[11].Value = this.varHandle;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[12] = new SqlParameter("@HandleCount", SqlDbType.BigInt);
- try
- {
- p[12].Value = Convert.ToInt64(this.varHandleCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[13] = new SqlParameter("@InstallDate", SqlDbType.DateTime);
- try
- {
- p[13].Value = Convert.ToDateTime(this.varInstallDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[14] = new SqlParameter("@KernelModeTime", SqlDbType.BigInt);
- try
- {
- p[14].Value = Convert.ToInt64(this.varKernelModeTime);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[15] = new SqlParameter("@MaximumWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[15].Value = Convert.ToInt64(this.varMaximumWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[16] = new SqlParameter("@MinimumWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[16].Value = Convert.ToInt64(this.varMinimumWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[17] = new SqlParameter("@Name", SqlDbType.NVarChar, 255 );
- try
- {
- p[17].Value = this.varName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[18] = new SqlParameter("@OSCreationClassName", SqlDbType.NVarChar, 255 );
- try
- {
- p[18].Value = this.varOSCreationClassName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[19] = new SqlParameter("@OSName", SqlDbType.NVarChar, 255 );
- try
- {
- p[19].Value = this.varOSName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[20] = new SqlParameter("@OtherOperationCount", SqlDbType.BigInt);
- try
- {
- p[20].Value = Convert.ToInt64(this.varOtherOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[21] = new SqlParameter("@OtherTransferCount", SqlDbType.BigInt);
- try
- {
- p[21].Value = Convert.ToInt64(this.varOtherTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[22] = new SqlParameter("@PageFaults", SqlDbType.BigInt);
- try
- {
- p[22].Value = Convert.ToInt64(this.varPageFaults);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[23] = new SqlParameter("@PageFileUsage", SqlDbType.BigInt);
- try
- {
- p[23].Value = Convert.ToInt64(this.varPageFileUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[24] = new SqlParameter("@ParentProcessId", SqlDbType.BigInt);
- try
- {
- p[24].Value = Convert.ToInt64(this.varParentProcessId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[25] = new SqlParameter("@PeakPageFileUsage", SqlDbType.BigInt);
- try
- {
- p[25].Value = Convert.ToInt64(this.varPeakPageFileUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[26] = new SqlParameter("@PeakVirtualSize", SqlDbType.BigInt);
- try
- {
- p[26].Value = Convert.ToInt64(this.varPeakVirtualSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[27] = new SqlParameter("@PeakWorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[27].Value = Convert.ToInt64(this.varPeakWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[28] = new SqlParameter("@Priority", SqlDbType.BigInt);
- try
- {
- p[28].Value = Convert.ToInt64(this.varPriority);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[29] = new SqlParameter("@PrivatePageCount", SqlDbType.BigInt);
- try
- {
- p[29].Value = Convert.ToInt64(this.varPrivatePageCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[30] = new SqlParameter("@ProcessId", SqlDbType.BigInt);
- try
- {
- p[30].Value = Convert.ToInt64(this.varProcessId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[31] = new SqlParameter("@QuotaNonPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[31].Value = Convert.ToInt64(this.varQuotaNonPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[32] = new SqlParameter("@QuotaPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[32].Value = Convert.ToInt64(this.varQuotaPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[33] = new SqlParameter("@QuotaPeakNonPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[33].Value = Convert.ToInt64(this.varQuotaPeakNonPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[34] = new SqlParameter("@QuotaPeakPagedPoolUsage", SqlDbType.BigInt);
- try
- {
- p[34].Value = Convert.ToInt64(this.varQuotaPeakPagedPoolUsage);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[35] = new SqlParameter("@ReadOperationCount", SqlDbType.BigInt);
- try
- {
- p[35].Value = Convert.ToInt64(this.varReadOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[36] = new SqlParameter("@ReadTransferCount", SqlDbType.BigInt);
- try
- {
- p[36].Value = Convert.ToInt64(this.varReadTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[37] = new SqlParameter("@SessionId", SqlDbType.BigInt);
- try
- {
- p[37].Value = Convert.ToInt64(this.varSessionId);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[38] = new SqlParameter("@Status", SqlDbType.NVarChar, 255 );
- try
- {
- p[38].Value = this.varStatus;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[39] = new SqlParameter("@TerminationDate", SqlDbType.DateTime);
- try
- {
- p[39].Value = Convert.ToDateTime(this.varTerminationDate);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[40] = new SqlParameter("@ThreadCount", SqlDbType.BigInt);
- try
- {
- p[40].Value = Convert.ToInt64(this.varThreadCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[41] = new SqlParameter("@UserModeTime", SqlDbType.BigInt);
- try
- {
- p[41].Value = Convert.ToInt64(this.varUserModeTime);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[42] = new SqlParameter("@VirtualSize", SqlDbType.BigInt);
- try
- {
- p[42].Value = Convert.ToInt64(this.varVirtualSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[43] = new SqlParameter("@WindowsVersion", SqlDbType.NVarChar, 255 );
- try
- {
- p[43].Value = this.varWindowsVersion;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[44] = new SqlParameter("@WorkingSetSize", SqlDbType.BigInt);
- try
- {
- p[44].Value = Convert.ToInt64(this.varWorkingSetSize);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[45] = new SqlParameter("@WriteOperationCount", SqlDbType.BigInt);
- try
- {
- p[45].Value = Convert.ToInt64(this.varWriteOperationCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- p[46] = new SqlParameter("@WriteTransferCount", SqlDbType.BigInt);
- try
- {
- p[46].Value = Convert.ToInt64(this.varWriteTransferCount);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure, "Win32_Process_UPDATE", p);
- }
- ///====================================================================================================
- ///
- /// public static void DELETE_BY_HYDRA_ID( string DatabaseConnectionString, Int64 HydraID )
- ///
- ///====================================================================================================
- ///<summary>
- /// Delete this instance from the database
- ///</summary>
- public static void DELETE_BY_HYDRA_ID( string DatabaseConnectionString, Int64 HydraID )
- {
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);
- try
- {
- p[0].Value = HydraID;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_BY_HYDRA_ID", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- }
- ///====================================================================================================
- ///
- /// public static void Win32_Process_DELETE_BY_KNOWN_HOST_ID( double HostID, string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Delete this instance from the database
- ///</summary>
- public static void Win32_Process_DELETE_BY_KNOWN_HOST_ID( double HostID, string DatabaseConnectionString )
- {
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@KnownHostID", SqlDbType.BigInt);
- try
- {
- p[0].Value = HostID;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"Win32_Process_DELETE_BY_KNOWN_HOST_ID", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- }
- ///====================================================================================================
- ///
- /// public static void Delete_From_Database_By_HostName( string DatabaseConnectionString, string HostName )
- ///
- ///====================================================================================================
- ///<summary>
- /// Delete this instance from the database
- ///</summary>
- public static void Delete_From_Database_By_HostName( string DatabaseConnectionString, string HostName )
- {
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);
- try
- {
- p[0].Value = HostName;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_BY_HOSTNAME", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- }
- ///====================================================================================================
- ///
- /// public static void DELETE_ALL( string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Delete this instance from the database
- ///</summary>
- public static void DELETE_ALL_FROM_DATABASE( string DatabaseConnectionString )
- {
- try
- {
- Hydra.Data.SqlHelper.ExecuteNonQuery( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_DELETE_ALL");
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- }
- ///====================================================================================================
- ///
- /// public static DataSet Get_DataSet_By_HydraID( int HydraID, string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a DataSet representing this instance from the database
- ///</summary>
- public static DataSet Get_DataSet_By_Hydra_ID(int HydraID, string DatabaseConnectionString )
- {
- DataSet ds = new DataSet();
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HydraID", SqlDbType.BigInt);
- try
- {
- p[0].Value = HydraID;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECTBYID", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return ds;
- }
- ///====================================================================================================
- ///
- /// public static DataSet Get_DataSet_By_HOST_ID( double HostID, string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a DataSet representing this instance from the database
- ///</summary>
- public static DataSet Get_DataSet_By_Host_ID(double HostID, string DatabaseConnectionString )
- {
- DataSet ds = new DataSet();
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HostID", SqlDbType.BigInt);
- try
- {
- p[0].Value = HostID;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- ds = Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_BY_HOST_ID", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return ds;
- }
- ///====================================================================================================
- ///
- /// public static DataSet Get_DataSet_ALL( string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a static DataSet representing all instances from the database
- ///</summary>
- public static DataSet Get_DataSet_ALL( string DatabaseConnectionString )
- {
- DataSet ds = new DataSet();
- try
- {
- ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_ALL" );
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return ds;
- }
- ///====================================================================================================
- ///
- /// public static DataSet Get_DataSet_By_HostName( string phostname, string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a DataSet representing this instance from the database
- ///</summary>
- public static DataSet Get_DataSet_By_HostName( string phostname, string DatabaseConnectionString )
- {
- DataSet ds = new DataSet();
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HostName", SqlDbType.NVarChar, 255);
- try
- {
- p[0].Value = phostname;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- ds =Hydra.Data.SqlHelper.ExecuteDataset( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_SELECT_BY_HOSTNAME", p);
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return ds;
- }
- ///====================================================================================================
- ///
- /// public double Get_Count_By_KNOWN_Host_ID( double hostid, string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a double representing the number of instances in the database
- ///</summary>
- public static double Get_Count_By_KNOWN_Host_ID( double hostid, string DatabaseConnectionString )
- {
- double i = 0;
- SqlParameter[] p = new SqlParameter[1];
- p[0] = new SqlParameter("@HostID", SqlDbType.BigInt);
- try
- {
- p[0].Value = hostid;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- try
- {
- i = Convert.ToInt64(Hydra.Data.SqlHelper.ExecuteScalar( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_COUNT_BY_KNOWN_HOST_ID", p) ) ;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return i;
- }
- ///====================================================================================================
- ///
- /// public static double GetCount( string DatabaseConnectionString )
- ///
- ///====================================================================================================
- ///<summary>
- /// Get a int representing the number of rec in the table
- ///</summary>
- public static long GetCount( string DatabaseConnectionString )
- {
- Int64 i = 0;
- try
- {
- i = Convert.ToInt64(Hydra.Data.SqlHelper.ExecuteScalar( DatabaseConnectionString , CommandType.StoredProcedure,"WIN32_PROCESS_COUNT") ) ;
- }
- catch(Exception exp)
- {
- LogError(exp);
- }
- return i;
- }
- #endregion
- #region Generate SQL Strings
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement