Index: /branches/win64/level-1/linux-files.lisp
===================================================================
--- /branches/win64/level-1/linux-files.lisp	(revision 9727)
+++ /branches/win64/level-1/linux-files.lisp	(revision 9728)
@@ -1523,7 +1523,10 @@
 	    (logior #$STARTF_USESTDHANDLES #$STARTF_USESHOWWINDOW))
       (setf (pref si #>STARTUPINFO.wShowWindow) #$SW_HIDE)
-      (setf (pref si #>STARTUPINFO.hStdInput) (#__get_osfhandle new-in))
-      (setf (pref si #>STARTUPINFO.hStdOutput) (#__get_osfhandle new-out))
-      (setf (pref si #>STARTUPINFO.hStdError) (#__get_osfhandle new-err))
+      (setf (pref si #>STARTUPINFO.hStdInput)
+            (%int-to-ptr (#__get_osfhandle (or new-in 0))))
+      (setf (pref si #>STARTUPINFO.hStdOutput)
+            (%int-to-ptr (#__get_osfhandle (or new-out 1))))
+      (setf (pref si #>STARTUPINFO.hStdError)
+            (%int-to-ptr (#__get_osfhandle (or new-err 2))))
       (if (zerop (#_CreateProcessW (%null-ptr)
 				   command
@@ -1536,5 +1539,5 @@
 				   si
 				   proc-info))
-	  (error "Process creation failed"))
+	  (error "Process creation failed: ~d" (#_GetLastError)))
       (#_CloseHandle (pref proc-info #>PROCESS_INFORMATION.hThread))
       (pref proc-info #>PROCESS_INFORMATION.hProcess))))
