예제 #1
0
파일: launch.cpp 프로젝트: kodybrown/haiku
status_t
BPrivate::send_request_to_launch_daemon(KMessage& request, KMessage& reply)
{
	status_t status = request.SendTo(get_launch_daemon_port(),
		B_PREFERRED_TOKEN, &reply);
	if (status != B_OK)
		return status;

	return (status_t)reply.What();
}
예제 #2
0
status_t
BPrivate::send_authentication_request_to_registrar(KMessage& request,
	KMessage& reply)
{
	status_t error = request.SendTo(get_registrar_authentication_port(), 0,
		&reply);
	if (error != B_OK)
		return error;

	return (status_t)reply.What();
}
// _SendRequestReply
status_t
AuthenticationServer::_SendRequestReply(port_id port, int32 token,
	status_t error, bool cancelled, const char* user, const char* password)
{
	// prepare the reply
	KMessage reply;
	reply.AddInt32("error", error);
	if (error == B_OK) {
		reply.AddBool("cancelled", cancelled);
		if (!cancelled) {
			reply.AddString("user", user);
			reply.AddString("password", password);
		}
	}
	// send the reply
	return reply.SendTo(port, token);
}