]> gitweb.factorcode.org Git - factor.git/commitdiff
elevate.windows: Fix compile error.
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 26 Jan 2022 02:30:55 +0000 (20:30 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 26 Jan 2022 02:30:55 +0000 (20:30 -0600)
Needs to return a process somehow.

extra/elevate/windows/windows.factor

index 18034b8b1d2be21f0e611bd5a6b5de1694ce3c14..c5bc63fefd6c03183aaec95eb86552053fc9cefc 100644 (file)
@@ -1,6 +1,6 @@
-USING: accessors alien alien.c-types elevate io.launcher kernel
-locals math sequences splitting strings system windows.errors
-windows.kernel32 windows.shell32 windows.user32 ;
+USING: accessors alien elevate io.launcher kernel math sequences
+splitting strings system windows.errors windows.shell32
+windows.user32 ;
 IN: elevate.windows
 
 <PRIVATE
@@ -11,18 +11,20 @@ M: windows already-root?
     ! https://msdn.microsoft.com/en-us/library/windows/desktop/ms683182(v=vs.85).aspx
     f ;
 
-M:: windows elevated ( command replace? win-console? posix-graphical? -- process )
+M:: windows elevated ( $command $replace? $win-console? $posix-graphical? -- process )
     already-root? [
-        <process> command >>command
+        <process> $command >>command
     ] [
         ! hwnd lpOperation
         f "runas"
-        command dup string? [ " " split ] when
+        $command dup string? [ " " split ] when
         ! lpFile lpParameters lpDirectory (enum)nShowCmd
         [ first ] [ rest ] bi " " join f SW_SHOW
         ! call shell function with questionable return pointer handling (should use WaitForSingleObject but it hangs)
-        ShellExecuteW alien-address :> retval retval 32 <= [ retval n>win32-error-check ] [ ] if
-        replace? [ exit ] [ ] if
+        ShellExecuteW alien-address :> $retval
+        $retval 32 <= [ $retval n>win32-error-check ] [ ] if
+        $replace? [ $retval exit ] [ ] if
+        $retval
     ] if ;
 
 ! no-op (not possible to lower)