fix bugs in windows implementation
parent
889f82e2e4
commit
3e6287629f
|
@ -1,9 +1,13 @@
|
||||||
USING: io.launcher elevate ;
|
USING: accessors alien alien.c-types elevate io.launcher kernel
|
||||||
|
locals math sequences splitting strings system windows.errors
|
||||||
|
windows.shell32 ;
|
||||||
IN: elevate.windows
|
IN: elevate.windows
|
||||||
|
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
! TODO
|
! TODO
|
||||||
|
M: windows already-root?
|
||||||
|
f ;
|
||||||
|
|
||||||
M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
|
M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
|
||||||
already-root? [
|
already-root? [
|
||||||
<process> command >>command
|
<process> command >>command
|
||||||
|
@ -12,12 +16,12 @@ M:: windows elevated ( command replace? win-console? posix-graphical? -- process
|
||||||
f "runas"
|
f "runas"
|
||||||
command dup string? [ " " split ] when
|
command dup string? [ " " split ] when
|
||||||
! lpFile lpParameters lpDirectory nShowCmd
|
! lpFile lpParameters lpDirectory nShowCmd
|
||||||
[ first ] [ rest ] bi f win-console? 1 0 ?
|
[ first ] [ rest ] bi " " join f win-console? >c-bool
|
||||||
! call shell function
|
! call shell function
|
||||||
ShellExecuteW :> retval retval n>win32-error-check
|
ShellExecuteW alien-address :> retval retval 32 <= [ retval n>win32-error-check ] [ ] if
|
||||||
retval replace? [ exit ] [ ] if
|
retval replace? [ exit ] [ ] if
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
! no-op (not possible to lower)
|
! no-op (not possible to lower)
|
||||||
M: windows lowered
|
M: windows lowered ;
|
||||||
PRIVATE>
|
PRIVATE>
|
Loading…
Reference in New Issue