lib/hawatel_ps/windows/proc_fetch.rb
# Get property from WIN32OLE object about process
# @param wmi_object [WmiCli::Instance] process instance represented by WMI object
# @example
#   extract_wmi_property(wmi_object)
# @return [Hash]
Get property from WIN32OLE object about process
Get property from WIN32OLE object about process
def extract_wmi_property(wmi_object)
          property_map = wmi_object.properties.dup
          property_map[:wmi_object] = wmi_object.wmi_ole_object
          property_map[:childs] = Array.new
          property_map[:sid] = get_owner_sid(wmi_object)
          get_owner(property_map)
          property_map[:availablevirtualsize] = get_avail_virtual_size(wmi_object)
          property_map[:memorypercent] = memory_percent(@memory_total, property_map[:workingsetsize])
          property_map[:cpupercent] = cpu_percent(cpu_time(
              :usermodetime => property_map[:usermodetime],
              :kernelmodetime => property_map[:kernelmodetime]))
          hash_value_to_string(property_map)
          property_map.delete(:status) if property_map.key?(:status)
          property_map
        end
def extract_wmi_property ( wmi_object ) property_map = wmi_object . properties . dup property_map [ :wmi_object ] = wmi_object . wmi_ole_object property_map [ :childs ] = Array . new property_map [ :sid ] = get_owner_sid ( wmi_object ) get_owner ( property_map ) property_map [ :availablevirtualsize ] = get_avail_virtual_size ( wmi_object ) property_map [ :memorypercent ] = memory_percent ( @memory_total , property_map [ :workingsetsize ] ) property_map [ :cpupercent ] = cpu_percent ( cpu_time ( :usermodetime => property_map [ :usermodetime ] , :kernelmodetime => property_map [ :kernelmodetime ] ) ) hash_value_to_string ( property_map ) property_map . delete ( :status ) if property_map . key? ( :status ) property_map end
Get property from WIN32OLE object about process
Get property from WIN32OLE object about process
None
Hash
wmi_object
process instance represented by WMI object
process instance represented by WMI object
example
None