def METHOD_NAME(test, params, session, service):
    """
    Check & stop windows system service
    param session: a session to send commands
    param service: the name of the service to stop
    """
    service_check_cmd = params.get("service_check_cmd")
    service_stop_cmd = params.get("service_stop_cmd")
    s, o = session.cmd_status_output("sc query")
    if s:
        test.error("Failed to query service list, "
                   "status=%s, output=%s" % (s, o))
    service_item = re.search(
        r'SERVICE_NAME:\s+%s' % service, o, re.I | re.M)
    if not service_item:
        return
    s, o = session.cmd_status_output(service_check_cmd % service)
    if s:
        test.error("Failed to get status for service: %s, "
                   "status=%s, output=%s" % (service, s, o))
    if re.search(r'STOPPED', o, re.I | re.M):
        return
    session.cmd(service_stop_cmd.format(service))