[][src]Struct sunrise_libuser::sm::IUserInterfaceProxy

pub struct IUserInterfaceProxy(ClientSession);

Service Manager

Services are system processes running in the background which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via inter-process communication (each service has a name up to 8 characters).

Handles for services are retrieved from the service manager port, "sm:", and are released via svcCloseHandle or when a process is terminated or crashes.

Manager service "sm:m" allows the Process Manager to tell sm: about the permissions of each process. By default, SM assumes a process has no permissions, and as such cannot access any service. "sm:m" RegisterProcess calls allows PM to tell the Service Manager about which services a certain process is allowed to access or host.

A Service is very similar to a kernel-managed Named Port: You can connect to it, and it returns a ClientSession. The difference is that a Service handled by "sm:" has an additional permission check done to ensure it isn't accessed by an unprivileged process.

Implementations

impl IUserInterfaceProxy[src]

pub fn raw_new() -> Result<IUserInterfaceProxy, Error>[src]

Creates a new IUserInterfaceProxy by connecting to the sm: service.

pub fn new() -> Result<&'static IUserInterfaceProxy, Error>[src]

Acquires the shared handle to the sm: service - connecting if it wasn't already.

impl IUserInterfaceProxy[src]

pub fn clone_current_object(&self) -> Result<Self, Error>[src]

Clones the current object, returning a new handle. The returned handle has its own IPC buffer - it may be used concurrently with the original.

pub fn initialize(&self) -> Result<(), Error>[src]

Initialize the UserInterface, acquiring the Pid of the remote process, which will then be used to validate the permissions of each calls.

pub fn get_service(&self, name: u64) -> Result<ClientSession, Error>[src]

Returns a handle to the given service. IPC messages may be sent to this handle through svcSendSyncRequest.

pub fn register_service(
    &self,
    name: u64,
    is_light: bool,
    max_handles: u32
) -> Result<ServerPort, Error>
[src]

Registers a service with the given name. The user can use svcAcceptSession on the returned handle to get a new Session handle, and use svcReplyAndReceive on those handles to reply to IPC requests.

pub fn unregister_service(&self, name: u64) -> Result<(), Error>[src]

Unregisters a service with the given name. Future calls to get_service will loop until the service is re-registered through register_service.

If the service doesn't exist, this returns a ServiceNotRegistered error.

Trait Implementations

impl Debug for IUserInterfaceProxy[src]

impl From<ClientSession> for IUserInterfaceProxy[src]

impl From<IUserInterfaceProxy> for ClientSession[src]

Auto Trait Implementations

impl RefUnwindSafe for IUserInterfaceProxy

impl Send for IUserInterfaceProxy

impl Sync for IUserInterfaceProxy

impl Unpin for IUserInterfaceProxy

impl UnwindSafe for IUserInterfaceProxy

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.