]> gitweb.factorcode.org Git - factor.git/blob - basis/elevate/windows/windows.factor
flesh out windows implementation
[factor.git] / basis / elevate / windows / windows.factor
1 USING: io.launcher elevate ;
2 IN: elevate.windows
3
4
5 <PRIVATE
6 ! TODO
7 M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
8     already-root? [
9         <process> command >>command
10     ] [
11         ! hwnd lpOperation
12         f "runas"
13         command dup string? [ " " split ] when
14         ! lpFile lpParameters lpDirectory nShowCmd
15         [ first ] [ rest ] bi f win-console? 1 0 ?
16         ! call shell function
17         ShellExecuteW :> retval retval n>win32-error-check
18         retval replace? [ exit ] [ ] if
19     ] if ;
20
21 ! no-op (not possible to lower)
22 M: windows lowered
23 PRIVATE>