Overview of wmi_svc.inc

Public Function Summary

Public functions are intended to be called by the code that imports this library.

Name Summary
wmi_svc
wmi_svc_path
wmi_svc_prop
wmi_svc_state

Public Function Details

wmi_svc

Named Parameters

handle
svcName

Code

function wmi_svc(handle, svcName)
{
  if(!svcName){
    query = "Select Caption from Win32_Service";
  }
  else {
    query = 'Select Caption from Win32_Service Where Name = ' +
             raw_string(0x22) + svcName + raw_string(0x22);
  }

  svcList = wmi_query(wmi_handle:handle, query:query);

  if(("NTSTATUS" >< svcList) || !svcList){
    return(0);
  }

  svcList = ereg_replace(pattern:"\|", string:svcList, replace:" - ");
  return svcList;
}

function wmi_svc_state(handle, svcName)

		
top

wmi_svc_path

Named Parameters

handle
svcName

Code

function wmi_svc_path(handle, svcName)
{
  if(!svcName){
    query = "Select PathName from Win32_Service";
  }
  else {
    query = 'Select PathName from Win32_Service Where Name = ' +
             raw_string(0x22) + svcName + raw_string(0x22);
  }

  svcList = wmi_query(wmi_handle:handle, query:query);

  if(("NTSTATUS" >< svcList) || !svcList){
    return(0);
  }

  svcList = ereg_replace(pattern:"[.a-zA-Z0-9_ ]+\|" + '\\"?', string:svcList, replace:"");
  return svcList;
}


		
top

wmi_svc_prop

Named Parameters

handle
svcName

Code

function wmi_svc_prop(handle, svcName)
{
  if(!svcName){
    query = "Select * from Win32_Service";
  }
  else {
    query = 'Select * from Win32_Service Where Name = ' +
             raw_string(0x22) + svcName + raw_string(0x22);
  }

  svcList = wmi_query(wmi_handle:handle, query:query);

  if(("NTSTATUS" >< svcList) || !svcList){
    return(0);
  }

  return wmi_misc_split_res(List:svcList);
}

function wmi_svc(handle, svcName)

		
top

wmi_svc_state

Named Parameters

handle
svcName

Code

function wmi_svc_state(handle, svcName)
{
  if(!svcName){
    query = "Select State from Win32_Service";
  }
  else {
    query = 'Select State from Win32_Service Where Name = ' +
             raw_string(0x22) + svcName + raw_string(0x22);
  }

  svcList = wmi_query(wmi_handle:handle, query:query);

  if(("NTSTATUS" >< svcList) || !svcList){
    return(0);
  }

  svcList = ereg_replace(pattern:"\|", string:svcList, replace:" - ");
  return svcList;
}

function wmi_svc_path(handle, svcName)

		
top