Ejemplo n.º 1
0
/**
 * gck_slot_open_session_finish:
 * @self: The slot to open a session on.
 * @result: The result passed to the callback.
 * @err: A location to return an error or NULL.
 *
 * Get the result of an open session operation. If the 'auto reuse' setting is set,
 * then this may be a recycled session with the same flags.
 *
 * Return value: The new session or NULL if an error occurs.
 */
GckSession*
gck_slot_open_session_finish (GckSlot *self, GAsyncResult *result, GError **err)
{
	GckSession *session = NULL;

	g_object_ref (self);

	{
		OpenSession *args;

		if (_gck_call_basic_finish (result, err)) {
			args = _gck_call_arguments (result, OpenSession);
			session = make_session_object (self, args->flags, args->session);
		}
	}

	g_object_unref (self);

	return session;
}
Ejemplo n.º 2
0
/**
 * gck_module_initialize_finish:
 * @result: the asynchronous result
 * @error: location to place an error on failure
 *
 * Finishes the asynchronous initialize operation.
 *
 * Returns: (transfer full) (allow-none): The initialized module, or NULL
 */
GckModule *
gck_module_initialize_finish (GAsyncResult *result,
                              GError **error)
{
	GckModule *module = NULL;
	Initialize *args;

	args = _gck_call_arguments (result, Initialize);
	if (_gck_call_basic_finish (result, error)) {
		module = args->result;
		args->result = NULL;

	} else {
		/* A custom error from perform_initialize */
		if (args->error) {
			g_clear_error (error);
			g_propagate_error (error, args->error);
			args->error = NULL;
		}
	}

	return module;
}
Ejemplo n.º 3
0
gboolean
gck_slot_init_token_finish (GckSlot *self, GAsyncResult *result, GError **err)
{
	return _gck_call_basic_finish (self, result, err);
}