postpone windows already-root?
parent
3e6287629f
commit
56d2435aeb
|
@ -1,11 +1,14 @@
|
||||||
USING: accessors alien alien.c-types elevate io.launcher kernel
|
USING: accessors alien alien.c-types elevate io.launcher kernel
|
||||||
locals math sequences splitting strings system windows.errors
|
locals math sequences splitting strings system windows.errors
|
||||||
windows.shell32 ;
|
windows.kernel32 windows.shell32 windows.user32 ;
|
||||||
IN: elevate.windows
|
IN: elevate.windows
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
! TODO
|
! TODO
|
||||||
M: windows already-root?
|
M: windows already-root?
|
||||||
|
! https://msdn.microsoft.com/en-us/library/windows/desktop/aa379296(v=vs.85).aspx
|
||||||
|
! https://msdn.microsoft.com/en-us/library/windows/desktop/aa446671%28v=vs.85%29.aspx
|
||||||
|
! https://msdn.microsoft.com/en-us/library/windows/desktop/ms683182(v=vs.85).aspx
|
||||||
f ;
|
f ;
|
||||||
|
|
||||||
M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
|
M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
|
||||||
|
@ -15,11 +18,11 @@ M:: windows elevated ( command replace? win-console? posix-graphical? -- process
|
||||||
! hwnd lpOperation
|
! hwnd lpOperation
|
||||||
f "runas"
|
f "runas"
|
||||||
command dup string? [ " " split ] when
|
command dup string? [ " " split ] when
|
||||||
! lpFile lpParameters lpDirectory nShowCmd
|
! lpFile lpParameters lpDirectory (int)nShowCmd
|
||||||
[ first ] [ rest ] bi " " join f win-console? >c-bool
|
[ first ] [ rest ] bi " " join f SW_SHOW
|
||||||
! call shell function
|
! call shell function
|
||||||
ShellExecuteW alien-address :> retval retval 32 <= [ retval n>win32-error-check ] [ ] if
|
ShellExecuteW alien-address :> retval retval 32 <= [ retval n>win32-error-check ] [ ] if
|
||||||
retval replace? [ exit ] [ ] if
|
replace? [ exit ] [ ] if
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
! no-op (not possible to lower)
|
! no-op (not possible to lower)
|
||||||
|
|
Loading…
Reference in New Issue