summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/createprocess.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-09-03 14:38:02 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-09-03 14:38:02 +0000
commit1e664b94467a65841e63d2dea50cd1f64e8a3258 (patch)
tree377f874869769eb40984803bcc6b6648a06b68e4 /otherlibs/win32unix/createprocess.c
parent47745356d34649ee4c531fea679e3a008cf90197 (diff)
Implementation du type file_descr par le type HANDLE de Win32. Court-circuite la libc de MSVC.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1700 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/createprocess.c')
-rw-r--r--otherlibs/win32unix/createprocess.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c
index 8b3c935c0..ff07ba83e 100644
--- a/otherlibs/win32unix/createprocess.c
+++ b/otherlibs/win32unix/createprocess.c
@@ -18,8 +18,8 @@
/* From the Caml runtime */
extern char * searchpath(char * name);
-value win_create_process_native(cmd, cmdline, env, fd1, fd2, fd3)
- value cmd, cmdline, env, fd1, fd2, fd3;
+value win_create_process_native(value cmd, value cmdline, value env,
+ value fd1, value fd2, value fd3)
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
@@ -34,10 +34,9 @@ value win_create_process_native(cmd, cmdline, env, fd1, fd2, fd3)
}
GetStartupInfo(&si);
si.dwFlags |= STARTF_USESTDHANDLES;
-
- si.hStdInput = (HANDLE) _get_osfhandle(Int_val(fd1));
- si.hStdOutput = (HANDLE) _get_osfhandle(Int_val(fd2));
- si.hStdError = (HANDLE) _get_osfhandle(Int_val(fd3));
+ si.hStdInput = Handle_val(fd1);
+ si.hStdOutput = Handle_val(fd2);
+ si.hStdError = Handle_val(fd3);
if (! CreateProcess(exefile, String_val(cmdline), NULL, NULL,
TRUE, 0, envp, NULL, &si, &pi)) {
_dosmaperr(GetLastError());
@@ -46,9 +45,7 @@ value win_create_process_native(cmd, cmdline, env, fd1, fd2, fd3)
return Val_int(pi.hProcess);
}
-value win_create_process(argv, argn) /* ML */
- value * argv;
- int argn;
+value win_create_process(value * argv, int argn) /* ML */
{
return win_create_process_native(argv[0], argv[1], argv[2],
argv[3], argv[4], argv[5]);