Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Unix.kill on Win32
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Unix.kill on Win32
From: "James Scott" <j.scott@runbox.com>

> Would it be possible/sensible to have some limited implementation of
> Unix.kill for Win32, so that 'kill pid 9' or 'kill pid 15' worked for
> example?

I may be wrong, but when I looked at the problem about 5 years ago, I
couldn't find any way to act on a windows process from outside it.
The process manager must be using some internal API.

The only solution I found for ocamlbrowser is to have ocamlrun create
a special thread waiting on a pipe, and break when receiving C on this
pipe, and commit suicide when receiving T! This only works if you can
modify the source of the process you want to kill, so this cannot be
in the Unix module.

Now, as it seems that you can dynamically change the dlls a running
process is accessing, I suppose you could also do it without the
source code, if you're a guru.

By the way, the comment in the microsoft documentation about Ctrl-C
handlers being activated in another thread in console applications let
me think that this is more or less the standard way to do it on
windows :-(

I hope I am wrong.

Jacques Garrigue

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners