flesh out windows implementation

elevate-erg
Cat Stevens 2018-05-19 16:57:15 -04:00 committed by Doug Coleman
parent eda9bcb839
commit 889f82e2e4
1 changed files with 14 additions and 3 deletions

View File

@ -4,9 +4,20 @@ IN: elevate.windows
<PRIVATE
! TODO
M: windows elevated
3drop run-process ;
M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
already-root? [
<process> command >>command
] [
! hwnd lpOperation
f "runas"
command dup string? [ " " split ] when
! lpFile lpParameters lpDirectory nShowCmd
[ first ] [ rest ] bi f win-console? 1 0 ?
! call shell function
ShellExecuteW :> retval retval n>win32-error-check
retval replace? [ exit ] [ ] if
] if ;
! no-op (not possible to lower)
M: windows lowered ;
M: windows lowered
PRIVATE>