Ejemplo n.º 1
0
gboolean object_manager_find_object_by_name (ObjectManager *self,
                                             const gchar *name,
                                             MaestroObject **object,
                                             GError **error)
{
   GSList *pos = find_object_by_name(self->object_list, name);

   if (pos)
      *object = MAESTRO_OBJECT(pos->data);

   return TRUE;
}
Ejemplo n.º 2
0
NTSTATUS get_named_object( object_t **out, const OBJECT_ATTRIBUTES *oa )
{
	object_t *obj;
	NTSTATUS r;

	if (!oa || !oa->ObjectName || !oa->ObjectName->Buffer || !oa->ObjectName->Buffer[0])
		return STATUS_OBJECT_PATH_SYNTAX_BAD;

	r = find_object_by_name( &obj, oa );
	if (r < STATUS_SUCCESS)
		return r;

	*out = obj;
	return STATUS_SUCCESS;
}
Ejemplo n.º 3
0
static gboolean validate_variable_name(ObjectManager *self,
                                       MaestroObject *object,
                                       GError **error)
{
   const gchar *name;

   gboolean ret = FALSE;

   if ( maestro_object_get_name(object, &name, error))
   {
      GSList *item = NULL;

      if (self->object_list)
         item = find_object_by_name(self->object_list, name);

      if (item == NULL)
         ret = TRUE;
      else
         g_set_error(error, OBJECT_MANAGER_DOMAIN, 0, "%s '%s' %s",
            "Object with name", name, "already exist");
   }
   return ret;
}