processmanager

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSessionPid

func SetSessionPid(pid int, username string) error

SetSessionPid finds or create the sessions for the specified user and affect the pid to it. pid is the pid of the proccess launched by windows as the shell program (usually exeplorer.exe). In our case, it's just a process that we use to detect the session state.

Types

type Application

type Application struct {
	// Usernane is the username of the user to launch the application on behalf
	// of.
	// The processmanager will look for a windows session owned by this user and
	// create the application process in this session if any. If not, the
	// processmanager will wait for the user sessions to be launched to create
	// the process.
	Username string

	// Domain is the name of the windows domain to which the user belongs.
	Domain string

	// Command is the command line to launch the application.
	Command []string

	// HideWindow specifies whenever the application should be hidden or not.
	// The application's process will be created with the `CREATE_NO_WINDOW` flag
	// if set to true.
	HideWindow bool

	// Stdin is standard input of the application's procces.
	Stdin *bytes.Reader

	// Stdout is standard output of the application's procces.
	Stdout bytes.Buffer

	// Stderr is standard error output of the application's procces.
	Stderr bytes.Buffer

	// Pid is the application's process id.
	Pid int
	// contains filtered or unexported fields
}

Application wraps a windows process.

func (*Application) Run

func (a *Application) Run() error

Run starts the application and wait for the process to end.

func (*Application) Start

func (a *Application) Start() error

Start asks the processmanager to launch the app as soon as possible. The application will be launched when this function retunrs if it succeed. It will returns and error otherwise.

func (*Application) Wait

func (a *Application) Wait() error

Wait waits for the application's process to end.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL