Search |
||
Introducing Winp: Windows Process Manipulation LibraryPosted by kohsuke on March 16, 2008 at 6:23 PM PDT
I wrote a library called winp that lets you do lower-level process managements on Windows. So far it includes things like killing random processes (not just the ones you launched), killing a process recursively, or finding out the environment variables and command line arguments given to the process. My short-term goal is to use this in Hudson so that I can clean up the run-away processes (which are often left by jobs that deal with daemons like application servers), but I thought this kind of features would hopefully be useful for other applications. In this library, I created a DLL without linking to the C runtime library, which helps me keep the DLL file size rather small (currently around 6K.) To use this library, just put winp.jar in your classpath — As with all my other projects that deal with JNI (like com4j), there's no need to deal with a DLL separately. »
Related Topics >>
Java Tools Comments
Comments are listed in date ascending order (oldest first)
Submitted by kohsuke on Tue, 2008-04-08 09:25.
MIT license. I updated the project site with this info.
Submitted by fullung on Tue, 2008-03-18 15:55.
I took a look at the winp native code a few weeks ago and it looked like you could also implement it using JNA. No need for another native DLL.
It might also be interesting to build out your library further, just as the JRuby folks are doing with their POSIX layer built on top of JNA.
Submitted by kohsuke on Mon, 2008-03-17 10:25.
djhagberg — yes, the entire source code is in the Subversion repository of the project. I'll post a separate note about how to create a small DLL.
trembovetski — Right. I guess I should have said "kill processes of your choice at will."
Submitted by thiamteck on Mon, 2008-04-07 19:22.
I would like to use it in my work, may I know what license is used for Winp?
Thank you.
Submitted by super_kohsuke on Tue, 2008-03-18 22:06.
I think in this situation, JNI was appropriate. This only works on 32bit Windows anyway, and JNA would have made this 10 times bigger.
Submitted by djhagberg on Sun, 2008-03-16 19:19.
Very nice. Do you have the source and notes on how you built the nice small .dll? MSVC? Gnu toolchain? The -sources.jar just has the .dll in it, none of the native code.
Thanks for all the excellent work!
-=- D. J.
Submitted by trembovetski on Mon, 2008-03-17 08:34.
So far it includes things like killing random processes
Mmm, killing random processes! Sounds like a new variant of Russian Roulette! =) Dmitri |
||
|
|