[commons-daemon] 22/52: Imported Upstream version 1.0.2

Tony Mancill tmancill at moszumanska.debian.org
Wed Nov 12 05:31:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository commons-daemon.

commit faaf629b48ca3e7bca213956c8c3bc656a008444
Author: tony mancill <tmancill at debian.org>
Date:   Fri Nov 7 07:59:32 2014 -0800

    Imported Upstream version 1.0.2
---
 KEYS                                               |   51 -
 NOTICE.txt                                         |    3 +
 PROPOSAL.html                                      |   18 +-
 README                                             |   25 +-
 RELEASE-NOTES.txt                                  |   13 +-
 STATUS.html                                        |   74 -
 build-maven.xml                                    |  204 -
 build.properties.sample                            |   16 +
 build.xml                                          |  124 +-
 doap_daemon.rdf                                    |   29 -
 maven.xml                                          |   36 -
 pom.xml                                            |  133 +
 project.properties                                 |   24 -
 project.xml                                        |  137 -
 src/assembly/bin.xml                               |   45 +
 src/assembly/native-src.xml                        |   72 +
 src/assembly/src.xml                               |   42 +
 src/conf/MANIFEST.MF                               |    5 -
 src/docs/daemon.css                                |   17 +
 src/docs/daemon.html                               |   16 +
 src/java/org/apache/commons/daemon/Daemon.java     |   19 +-
 .../org/apache/commons/daemon/DaemonContext.java   |   15 +-
 .../apache/commons/daemon/DaemonController.java    |   15 +-
 .../org/apache/commons/daemon/DaemonListener.java  |   11 +-
 .../apache/commons/daemon/DaemonPermission.java    |   15 +-
 .../commons/daemon/support/DaemonLoader.java       |   14 +-
 src/native/nt/executables/vdmoniadm/resource.h     |   13 +-
 src/native/nt/executables/vdmonisvc/resource.h     |   13 +-
 src/native/nt/lib/moni_inst.h                      |   11 +-
 src/native/nt/moni/vdmoniadm.c                     |  487 +-
 src/native/nt/moni/vdmonisvc.c                     |   73 +-
 src/native/nt/procrun/LICENSE                      |  287 --
 src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.c     | 1705 -------
 src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.dsp   |  173 -
 src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.h     |  117 -
 .../nt/procrun/apps/apsvcmgr/apsvcmgr.manifest     |   10 -
 src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.rc    |  312 --
 .../nt/procrun/apps/apsvcmgr/apsvcmgr.vcproj       |  404 --
 src/native/nt/procrun/apps/jar2exe/jar2exe.c       |  542 ---
 src/native/nt/procrun/apps/jar2exe/jar2exe.h       |   86 -
 src/native/nt/procrun/apps/jar2exe/jar2exe.rc      |   55 -
 src/native/nt/procrun/apps/jar2exe/jar2exe.vcproj  |  145 -
 src/native/nt/procrun/apps/prunmgr/prunmgr.amd64   |  110 +
 src/native/nt/procrun/apps/prunmgr/prunmgr.c       |  417 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.dsp     |   35 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.h       |   15 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.ia64    |  110 +
 .../nt/procrun/apps/prunmgr/prunmgr.manifest       |    6 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.rc      |   38 +-
 src/native/nt/procrun/apps/prunmgr/prunmgr.x86     |  110 +
 src/native/nt/procrun/apps/prunsrv/prunsrv.amd64   |  109 +
 src/native/nt/procrun/apps/prunsrv/prunsrv.c       |  617 ++-
 src/native/nt/procrun/apps/prunsrv/prunsrv.dsp     |   16 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.h       |   13 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.ia64    |  109 +
 src/native/nt/procrun/apps/prunsrv/prunsrv.rc      |   22 +-
 src/native/nt/procrun/apps/prunsrv/prunsrv.x86     |  109 +
 src/native/nt/procrun/apps/srvbatch/MSG00001.bin   |  Bin 84 -> 0 bytes
 .../nt/procrun/apps/srvbatch/example/example.c     |   59 -
 .../procrun/apps/srvbatch/example/example.vcproj   |  132 -
 .../nt/procrun/apps/srvbatch/example/exservice.bat |   53 -
 src/native/nt/procrun/apps/srvbatch/srvbatch.c     |  827 ----
 src/native/nt/procrun/apps/srvbatch/srvbatch.rc    |   58 -
 src/native/nt/procrun/apps/srvbatch/srvbatch.sln   |   30 -
 .../nt/procrun/apps/srvbatch/srvbatch.vcproj       |  135 -
 src/native/nt/procrun/include/apxwin.h             |   19 +-
 src/native/nt/procrun/include/cmdline.h            |   11 +-
 src/native/nt/procrun/include/console.h            |   11 +-
 src/native/nt/procrun/include/gui.h                |   11 +-
 src/native/nt/procrun/include/handles.h            |   11 +-
 src/native/nt/procrun/include/javajni.h            |   22 +-
 src/native/nt/procrun/include/log.h                |   11 +-
 src/native/nt/procrun/include/registry.h           |   17 +-
 src/native/nt/procrun/include/rprocess.h           |   11 +-
 src/native/nt/procrun/include/service.h            |   13 +-
 src/native/nt/procrun/java/Test.java               |   34 -
 src/native/nt/procrun/libprocrun.amd64             |  158 +
 src/native/nt/procrun/libprocrun.dsp               |   10 +-
 src/native/nt/procrun/libprocrun.ia64              |  158 +
 src/native/nt/procrun/libprocrun.x86               |  158 +
 src/native/nt/procrun/resources/apsvcmgr.ico       |  Bin 7406 -> 0 bytes
 src/native/nt/procrun/resources/commons.bmp        |  Bin 0 -> 25462 bytes
 src/native/nt/procrun/resources/jakarta.bmp        |  Bin 25462 -> 0 bytes
 src/native/nt/procrun/resources/license.rtf        |    2 +-
 src/native/nt/procrun/resources/sorterd.bmp        |  Bin 190 -> 0 bytes
 src/native/nt/procrun/resources/sorteru.bmp        |  Bin 190 -> 0 bytes
 src/native/nt/procrun/resources/sstatus.bmp        |  Bin 630 -> 0 bytes
 src/native/nt/procrun/resources/toolbar.bmp        |  Bin 2294 -> 0 bytes
 src/native/nt/procrun/samples/cchild.c             |  133 -
 src/native/nt/procrun/samples/cchild.vcproj        |  227 -
 src/native/nt/procrun/src/cmdline.c                |   44 +-
 src/native/nt/procrun/src/console.c                |   11 +-
 src/native/nt/procrun/src/gui.c                    |   15 +-
 src/native/nt/procrun/src/handles.c                |   20 +-
 src/native/nt/procrun/src/javajni.c                |  355 +-
 src/native/nt/procrun/src/log.c                    |  127 +-
 src/native/nt/procrun/src/mclib.c                  |  144 +-
 src/native/nt/procrun/src/mclib.h                  |   11 +-
 src/native/nt/procrun/src/private.h                |   11 +-
 src/native/nt/procrun/src/registry.c               |  212 +-
 src/native/nt/procrun/src/rprocess.c               |   38 +-
 src/native/nt/procrun/src/service.c                |   48 +-
 src/native/nt/procrun/src/utils.c                  |  166 +-
 src/native/nt/procrun/testchild/testchild.c        |   79 -
 src/native/nt/procrun/testchild/testchild.dsp      |  106 -
 src/native/nt/procrun/testchild/testchild.vcproj   |  120 -
 src/native/nt/procrun/xdocs/index.xml              |   15 +
 src/native/nt/service/instmain.c                   |   13 +-
 src/native/nt/signals/kills.c                      |   13 +-
 src/native/nt/supcalls_nt/vdenv.c                  |   29 +-
 src/native/unix/CHANGES.txt                        |   30 +-
 src/native/unix/INSTALL.txt                        |   22 +
 src/native/unix/Makedefs                           |   32 +
 src/native/unix/Makedefs.in                        |   25 +-
 src/native/unix/Makefile                           |   40 +
 src/native/unix/Makefile.in                        |   25 +-
 src/native/unix/config.log                         |  264 ++
 src/native/unix/config.status                      |  866 ++++
 src/native/unix/configure                          | 4663 ++++++++++++++++++++
 src/native/unix/configure.in                       |   13 +-
 src/native/unix/man/fetch.sh                       |   15 +
 src/native/unix/man/jsvc.1.xml                     |   18 +-
 src/native/unix/native/Makefile                    |   45 +
 src/native/unix/native/Makefile.in                 |   30 +-
 src/native/unix/native/Tomcat.sh                   |   23 +-
 src/native/unix/native/Tomcat5.sh                  |   23 +-
 src/native/unix/native/arguments.c                 |   32 +-
 src/native/unix/native/arguments.h                 |   15 +-
 src/native/unix/native/arguments.o                 |  Bin 0 -> 20372 bytes
 src/native/unix/native/debug.c                     |   13 +-
 src/native/unix/native/debug.h                     |   13 +-
 src/native/unix/native/debug.o                     |  Bin 0 -> 6956 bytes
 src/native/unix/native/dso-dlfcn.c                 |   17 +-
 src/native/unix/native/dso-dlfcn.o                 |  Bin 0 -> 5616 bytes
 src/native/unix/native/dso-dyld.c                  |   13 +-
 src/native/unix/native/dso-dyld.o                  |  Bin 0 -> 3388 bytes
 src/native/unix/native/dso.h                       |   23 +-
 src/native/unix/native/help.c                      |   20 +-
 src/native/unix/native/help.h                      |   19 +-
 src/native/unix/native/help.o                      |  Bin 0 -> 8512 bytes
 src/native/unix/native/home.c                      |   13 +-
 src/native/unix/native/home.h                      |   13 +-
 src/native/unix/native/home.o                      |  Bin 0 -> 14068 bytes
 src/native/unix/native/java.c                      |   33 +-
 src/native/unix/native/java.h                      |   18 +-
 src/native/unix/native/java.o                      |  Bin 0 -> 39660 bytes
 src/native/unix/native/jsvc-unix.c                 |   82 +-
 src/native/unix/native/jsvc-unix.o                 |  Bin 0 -> 30668 bytes
 src/native/unix/native/jsvc.h                      |   21 +-
 src/native/unix/native/libservice.a                |  Bin 0 -> 113450 bytes
 src/native/unix/native/location.c                  |   13 +-
 src/native/unix/native/location.h                  |   19 +-
 src/native/unix/native/location.o                  |  Bin 0 -> 5980 bytes
 src/native/unix/native/{dso.h => locks.c}          |   38 +-
 src/native/unix/native/locks.h                     |   39 +
 src/native/unix/native/locks.o                     |  Bin 0 -> 857 bytes
 src/native/unix/native/replace.c                   |   13 +-
 src/native/unix/native/replace.h                   |   13 +-
 src/native/unix/native/replace.o                   |  Bin 0 -> 6004 bytes
 src/native/unix/native/signals.c                   |   21 +-
 src/native/unix/native/{dso.h => signals.h}        |   25 +-
 src/native/unix/native/signals.o                   |  Bin 0 -> 859 bytes
 src/native/unix/native/version.h                   |   63 +
 src/native/unix/support/apfunctions.m4             |   13 +-
 src/native/unix/support/apjava.m4                  |   13 +-
 src/native/unix/support/apsupport.m4               |   19 +-
 src/native/unix/support/buildconf.sh               |   28 +-
 src/native/unix/support/install.sh                 |   23 +-
 src/samples/AloneDaemon.sh                         |   26 +-
 src/samples/AloneService.java                      |   17 +-
 src/samples/Native.c                               |   20 +-
 src/samples/Native.sh                              |   12 +-
 src/samples/README.txt                             |    2 +-
 src/samples/ServiceDaemon.java                     |   17 +-
 src/samples/ServiceDaemon.sh                       |   26 +-
 src/samples/ServiceDaemonReadThread.java           |   13 +-
 src/samples/SimpleDaemon.java                      |   13 +-
 src/samples/SimpleDaemon.sh                        |   24 +-
 src/samples/build.xml                              |   17 +
 {xdocs => src/site/resources}/images/logo.gif      |  Bin
 {xdocs => src/site/resources}/images/logo.png      |  Bin
 src/site/site.xml                                  |   45 +
 src/site/xdoc/binaries.xml                         |   65 +
 src/site/xdoc/download_daemon.xml                  |  145 +
 {xdocs => src/site/xdoc}/faq.xml                   |   16 +
 {xdocs => src/site/xdoc}/index.xml                 |   52 +-
 src/site/xdoc/issue-tracking.xml                   |  102 +
 {xdocs => src/site/xdoc}/jsvc.xml                  |   99 +-
 {xdocs => src/site/xdoc}/procrun.xml               |   45 +-
 .../org/apache/commons/daemon/SimpleDaemon.java    |   15 +-
 xdocs/binaries.xml                                 |   49 -
 xdocs/navigation.xml                               |   33 -
 xdocs/style/project.css                            |    5 -
 193 files changed, 10712 insertions(+), 8295 deletions(-)

diff --git a/KEYS b/KEYS
deleted file mode 100644
index d598597..0000000
--- a/KEYS
+++ /dev/null
@@ -1,51 +0,0 @@
-This file contains the PGP&GPG keys of various Apache developers.
-Please don't use them for email unless you have to. Their main
-purpose is code signing.
- 
-Apache users: pgp < KEYS
-Apache developers:
-        (pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
-      or
-        (gpg --fingerprint --list-sigs <your name>
-             && gpg --armor --export <your name>) >> this file.
- 
-Apache developers: please ensure that your key is also available via the
-PGP keyservers (such as pgpkeys.mit.edu).
-
-Type Bits/KeyID    Date       User ID
-pub  1024D/86867BA6 2001-11-22 Jean-Frederic Clere (jfclere) <JFrederic.Clere at fujitsu-siemens.com>
-
- 
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.3.3 (GNU/Linux)
-
-mQGiBDv9Gx8RBADclmKwDLcibNVipQnhYW+bFIpuQjQnRrqRwn3gXM+/luzzJYJ4
-bbWpw13zjX0EkrAJ8qH2A/d0EIU1eZ0zHrLgRvMUfLGFUX7FFFw18JKFLTVGhG4/
-8sSl3ydHSA2Kd1PF6xjBP7iM7sg5dJfEkyMzvK5H4F0ZpTqy3087wsg1wwCgitRy
-Zg4x3lWZSkOwBj472qaO9GkD/2q6kyWfAK6XFe3GuB5AAs3poMfN1eqW+duM4TA8
-zUiWK0Wxx4JXJbL7n0i4d+JdXJsrjSjF++KKfelcxsrSxoUIBegez25MUSvHe09D
-R3nqkY8CVO+viEtzRBqkSgCMbUjAtfkQ+vp2jDnWSmmkNfY0OYAzt+KRyJKcjUSJ
-gvOOA/45+DN9wuTELoFTvsXh1JgOL/QvW1fmQ2HrcQk94BkzIsfVGWClCiig5gNw
-LCxTbfgA5htpI8U7vPR9/5gH7U8Wy3HR6xQUZxcbttMeYit2VbDEJzF5r5S0pJvD
-vyk3n1kiKU7r49sjhxGgE8J/VvDpO6YcIsDs8LoULwuJTg0DTrRDSmVhbi1GcmVk
-ZXJpYyBDbGVyZSAoamZjbGVyZSkgPEpGcmVkZXJpYy5DbGVyZUBmdWppdHN1LXNp
-ZW1lbnMuY29tPohGBBARAgAGBQJAEVHcAAoJEFd7hHVGA0DQsUsAoK2SuAnTybek
-AJkFmei/kbv59fA+AJ4/smxUz6EGuNmWOYwnHTxPz09c4IhXBBMRAgAXBQI7/Rsf
-BQsHCgMEAxUDAgMWAgECF4AACgkQ0+/mtoaGe6amGQCeJU5VZ8QCi8+PY0QJHPA6
-3e5uPyoAmgOWIwFm8A/xmW8qjEvVAWtbTjZxiJwEEwECAAYFAj/F+7gACgkQN+P0
-X+5l4yHDEwQAwp2yr9mwHIti5D2tvgNDQjOw9K/qbGbQ1IH3f/BLF0J5EHxYxUSt
-E0glh8GPJOi1U+0Jv999W/8xnOs5Tf16d0DmhscXvylxWYGis1PcoqA2zemaWuVM
-nBoJaA89gPiwconEEvdxym7vBGK1Lodz+ote2doiuCsWSjcfl74LFxeInAQTAQIA
-BgUCP8dbpwAKCRArAsNF4kSQGcqYA/9ZkL7Uwy1xZ8EPAQT6eXVCmS743C3Mc2kr
-Cv8CEnsVNQrsQMYzkU2OjsJ09semmIHnvpx14i8cGlLRoKpfNn7V+O6wmMEHr2zn
-HlMtDsgvk8FK12cDGGxUlHr9sz6wOTQyZG3bNLA9iQPUlHAjTTZlISx55i3/opKQ
-yI5LzOMaSrkBDQQ7/RsjEAQAgmxZUhfrnVv0M9qJJw3p/B6KpeENUOwlEE2z46EA
-HGIGYC67EeoXPWgiH9yreKmQYENTnvTPwHpjhYVNOFDad3YB5PdRGEb8fNEbmvfd
-qf/Fe0DocCAVW9lxPGrOZy9o/MOic+3krP24r8Zvcg9AB/yOR9NUQCYr0Wzk7FIE
-pA8AAwUD+QEZVtjanNFNe2rELJjGL09VDIjosgcFA/wyBBtl8tYZRL3ZY4PFlNuo
-3I6RqjK0+vU+GfnmdqFcokUE1uKjFASnNDW8/PYS9Kr/SuNRMccR/iYBNXLEVb5s
-AE/CMpZ4aH+0yS0Qbb2p9/qdtSsZdbkOzG5i0/O+bvr3PidPfHyIiEYEGBECAAYF
-Ajv9GyMACgkQ0+/mtoaGe6Z/VACfX9EytEEDrY0Ab8QIrLKKWIQyhxgAnj2YNJPb
-I+vcsJ1VqwUvX7xQvY3A
-=6E4I
------END PGP PUBLIC KEY BLOCK-----
diff --git a/NOTICE.txt b/NOTICE.txt
index 3f59805..795c658 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,2 +1,5 @@
+Apache Commons Daemon
+Copyright 1999-2010 The Apache Software Foundation
+
 This product includes software developed by
 The Apache Software Foundation (http://www.apache.org/).
diff --git a/PROPOSAL.html b/PROPOSAL.html
index 18250bd..7a9c82c 100644
--- a/PROPOSAL.html
+++ b/PROPOSAL.html
@@ -1,3 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 <html>
 <head>
 <title>Proposal for Daemon Package</title>
@@ -116,7 +132,7 @@ several existing components in the open source world.</p>
 <li>CVS Repository - New directory <code>daemon</code> in the
     <code>jakarta-commons</code> CVS repository.</li>
 <li>Mailing List - Discussions will take place on the general
-    <em>commons-dev at jakarta.apache.org</em> mailing list.  To help
+    <em>dev at commons.apache.org</em> mailing list.  To help
     list subscribers identify messages of interest, it is suggested that
     the message subject of messages about this component be prefixed with
     [Daemon].</li>
diff --git a/README b/README
index cd651b9..70b0f33 100644
--- a/README
+++ b/README
@@ -1,26 +1,33 @@
 To build the JAVA part:
 ant dist
 
+The Java portion of Commons Daemon requires Java 1.3 or later to build
+
 To build the native part:
 1 - jsvc:
   cd src/native/unix; configure; make
   You need a gnu make.
-  The jsvc executable could be found in dist.
-  There is a INSTALL.txt src/native/unix please have a look to it.
+  The jsvc executable is created in the dist directory.
+  There is a INSTALL.txt src/native/unix - please have a look at it.
 
-  On windoze the additional step is needed:
+  On Windows an additional step is needed:
   cd src/native/nt; make
-  There is a README in src/native/nt please have a look to it.
+  There is a README in src/native/nt - please have a look at it.
   The exe files are created in dist.
 2 - procrun:
   procrun is only for windows
-  cd src/native/nt/procrun; make
-  (It is also possible to use the m$ developement tools).
+  cd src\native\nt\procrun\apps
+  cd prunsrv
+  nmake -f prunsrv.x86 (prunsrv.amd64 | prunsrv.ia64)
+  cd ..\prunmgr
+  nmake -f prunmgs.x86
+  (It is also possible to use the MS development tools).
 
-To build the documentation: (See http://jakarta.apache.org/commons/building.html).
+To build the documentation: (See http://commons.apache.org/building.html).
 maven site:generate
-(Do not forget to get ../commons-build: (cd ..; svn co http://svn.apache.org/repos/asf/jakarta/commons/proper/commons-build/trunk/ commons-build))
+(Do not forget to get ../commons-build: (cd ..; svn co http://svn.apache.org/repos/asf/commons/proper/commons-build/trunk/ commons-build))
 
-To deploy the documentation to apache site:
+To deploy the documentation to the apache site:
 maven -Dmaven.username=${user.name} site:deploy
 (Check <siteAddress/> in project.xml).
+
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index babc7c6..c4142e4 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,7 +1,7 @@
-$Id: RELEASE-NOTES.txt 170552 2005-05-17 09:02:03Z jfclere $
+$Id: RELEASE-NOTES.txt 915160 2010-02-23 03:32:02Z billbarker $
 
 			Commons Daemon Package
-			   Version 1.0.1
+			   Version 1.0.2
 			    Release Notes
 
 
@@ -25,7 +25,16 @@ NEW FEATURES:
 
 * Allow to run as normal user for testing. (1.0.1).
 
+* Switch to JIRA bug tracking sytem.
 
 BUG FIXES:
 
 1.0.1: 304310,  30177, 27523, 29465, 31614, 33580, 31613, 34851.
+1.0.2: DAEMON-16, DAEMON-31, DAEMON-40, DAEMON-45, DAEMON-49, DAEMON-60,
+       DAEMON-84, DAEMON-90, DAEMON-91, DAEMON-92, DAEMON-93, DAEMON-94,
+       DAEMON-96, DAEMON-97, DAEMON-98, DAEMON-102, DAEMON-105, DAEMON-106,
+       DAEMON-110, DAEMON-112, DAEMON-113, DAEMON-114, DAEMON-115, DAEMON-116,
+       DAEMON-117, DAEMON-118, DAEMON-119, DAEMON-120, DAEMON-121, DAEMON-123, 
+       DAEMON-124, DAEMON-125, DAEMON-126, DAEMON-129, DAEMON-130, DAEMON-132,
+       DAEMON-133
+
diff --git a/STATUS.html b/STATUS.html
deleted file mode 100644
index 9c8580b..0000000
--- a/STATUS.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<html>
-<head>
-<title>Status File for Jakarta Commons "Daemon" Component</title>
-</head>
-<body bgcolor="white">
-
-
-<div align="center">
-<h1>The Jakarta Commons <em>Daemon</em> Component</h1>
-$Id: STATUS.html 155409 2005-02-26 12:57:06Z dirkv $<br />
-<a href="#Introduction">[Introduction]</a>
-<a href="#Dependencies">[Dependencies]</a>
-<a href="#Release Info">[Release Info]</a>
-<a href="#Committers">[Committers]</a>
-<br /><br />
-</div>
-
-
-<a name="Introduction"></a>
-<h3>1.  INTRODUCTION</h3>
-
-<p>The <em>Daemon</em> Component contains a set of Java and native code, 
-including:</p>
-<ul>
-<li>A set of Java interfaces applications must implement</li>
-<li>Unix native code to control a Java daemon from a Unix operating system</li>
-<li>Win32 code to control a Java daemon from a NT based Windows operating
-system</li>
-</ul>
-<p>This code was originally developped as part of the Tomcat project.</p>
-
-
-<a name="Dependencies"></a>
-<h3>2.  DEPENDENCIES</h3>
-
-<p>The <em>Daemon</em> component is dependent upon the following external
-components for development and use:</p>
-<ul>
-<li><a href="http://java.sun.com/j2se">Java Development Kit</a>
-    (Version 1.2 or later)</li>
-<li><a href="http://www.junit.org">JUnit Testing Framework</a>
-    (Version 3.7 or later) - for unit tests only, not required
-    for deployment</li>
-</ul>
-
-
-<a name="Release Info"></a>
-<h3>3.  RELEASE INFO</h3>
-
-<p>Current Release: Daemon is yet to be released.  We hope it will be RSN.</p>
-
-<p></p>
-
-
-<a name="Committers"></a>
-<h3>4.  COMMITTERS</h3>
-
-<p>The following individuals are the primary developers and maintainers of this
-component.  Developers who plan to use <em>Daemon</em> in their own
-projects are encouraged to collaborate on the future development of this
-component to ensure that it continues to meet a variety of needs.</p>
-<ul>
-<li>Jean-Frederic Clere</li>
-<li>Pier Fumagalli</li>
-<li>Patrick Luby</li>
-<li>Costin Manolache</li>
-<li>Remy Maucherat</li>
-<li>Yoav Shapira</li>
-<li>Bill Barker</li>
-</ul>
-
-
-</body>
-</html>
diff --git a/build-maven.xml b/build-maven.xml
deleted file mode 100644
index a49fb4b..0000000
--- a/build-maven.xml
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="maven" default="maven:jar" basedir=".">
-
-  <!-- Give user a chance to override without editing this file
-       (and without typing -D each time they invoke a target) -->
-
-  <!-- Allow any user specific values to override the defaults -->
-  <property file="${user.home}/build.properties" />
-  <!-- Allow user defaults for this build -->
-  <property file="build.properties" />
-  <!-- Set default values for the project -->
-  <property file="project.properties" />
-
-  <!-- maven:start -->
-  
-  <!-- ================================================================== -->
-  <!-- D E L E G A T O R S                                                -->
-  <!-- ================================================================== -->
-        
-
-    <target name="maven:site">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="site"/>
-    </target>
-
-
-    <target name="maven:dist">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="dist"/>
-    </target>
-
-
-    <target name="maven:env">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="env"/>
-    </target>
-
-
-    <target name="maven:test">
-      <ant antfile="${maven.home}/plugins/test/build.xml" target="test"/>
-    </target>
-
-
-    <target name="maven:announce">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="announce"/>
-    </target>
-
-
-    <target name="maven:activity-log">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="activity-log"/>
-    </target>
-
-
-    <target name="maven:compile">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="compile"/>
-    </target>
-
-
-    <target name="maven:validate-war">
-      <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="validate-war"/>
-    </target>
-
-
-    <target name="maven:pdf">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="pdf"/>
-    </target>
-
-
-    <target name="maven:iutest">
-      <ant antfile="${maven.home}/plugins/iutest/build.xml" target="iutest"/>
-    </target>
-
-
-    <target name="maven:deploy-site">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="deploy-site"/>
-    </target>
-
-
-    <target name="maven:deploy-dist">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="deploy-dist"/>
-    </target>
-
-
-    <target name="maven:war">
-      <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="war"/>
-    </target>
-
-
-    <target name="maven:verify-project">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="verify-project"/>
-    </target>
-
-
-    <target name="maven:cvs-change-log">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="cvs-change-log"/>
-    </target>
-
-
-    <target name="maven:ear">
-      <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="ear"/>
-    </target>
-
-
-    <target name="maven:cross-ref">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="cross-ref"/>
-    </target>
-
-
-    <target name="maven:update-jars">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="update-jars"/>
-    </target>
-
-
-    <target name="maven:validate-pom">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="validate-pom"/>
-    </target>
-
-
-    <target name="maven:install-jar">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="install-jar"/>
-    </target>
-
-
-    <target name="maven:fo">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="fo"/>
-    </target>
-
-
-    <target name="maven:javadocs">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="javadocs"/>
-    </target>
-
-
-    <target name="maven:validate-struts-war">
-      <ant antfile="${maven.home}/plugins/struts/build.xml" target="validate-struts-war"/>
-    </target>
-
-
-    <target name="maven:task-list">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="task-list"/>
-    </target>
-
-
-    <target name="maven:ejb">
-      <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="ejb"/>
-    </target>
-
-
-    <target name="maven:docs">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs"/>
-    </target>
-
-
-    <target name="maven:clean">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="clean"/>
-    </target>
-
-
-    <target name="maven:dist-build">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="dist-build"/>
-    </target>
-
-
-    <target name="maven:metrics">
-      <ant antfile="${maven.home}/plugins/metrics/build.xml" target="metrics"/>
-    </target>
-
-
-    <target name="maven:docs-quick">
-      <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs-quick"/>
-    </target>
-
-
-    <target name="maven:run-singletest">
-      <ant antfile="${maven.home}/plugins/test/build.xml" target="run-singletest"/>
-    </target>
-
-
-    <target name="maven:check-source">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="check-source"/>
-    </target>
-
-
-    <target name="maven:generate-reactor">
-      <ant antfile="${maven.home}/plugins/reactor/build.xml" target="generate-reactor"/>
-    </target>
-
-
-    <target name="maven:jar">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="jar"/>
-    </target>
-
-
-    <target name="maven:maven-update">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="maven-update"/>
-    </target>
-
-
-    <target name="maven:gump-descriptor">
-      <ant antfile="${maven.home}/plugins/core/build.xml" target="gump-descriptor"/>
-    </target>
-
-
-  <!-- maven:end -->
-
-</project>
diff --git a/build.properties.sample b/build.properties.sample
index 2a81d85..5832d53 100644
--- a/build.properties.sample
+++ b/build.properties.sample
@@ -1,3 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
 # The directory containing your binary distribution of JUnit, 
 # version 3.7 or later
 junit.home = /usr/local/junit3.7
diff --git a/build.xml b/build.xml
index a9b633e..8d0648f 100644
--- a/build.xml
+++ b/build.xml
@@ -1,9 +1,25 @@
 <project name="Daemon" default="dist" basedir=".">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 
 
 <!--
-        "Daemon" component of the Jakarta Commons Subproject
-        $Id: build.xml 469698 2006-10-31 23:10:36Z bayard $
+        "Daemon" component of the Apache Commons Subproject
+        $Id: build.xml 911319 2010-02-18 10:44:16Z mturk $
 -->
 
 
@@ -43,7 +59,7 @@
   <property name="component.title"         value="Java Daemons"/>
 
   <!-- The current version number of this component -->
-  <property name="component.version"       value="1.0.1"/>
+  <property name="component.version"       value="1.0.2"/>
 
   <!-- The base directory for compilation targets -->
   <property name="build.home"              value="target"/>
@@ -51,9 +67,6 @@
   <!-- The base directory for component executable files -->
   <property name="bin.home"                value="src/bin"/>
 
-  <!-- The base directory for component configuration files -->
-  <property name="conf.home"               value="src/conf"/>
-
   <!-- The base directory for distribution targets -->
   <property name="dist.home"               value="dist"/>
 
@@ -69,10 +82,22 @@
   <!-- The pattern to be used to grab ant jars (usefull for non standard layout)  -->
   <property name="ant.jars.pattern"        value="*.jar"/>
 
+  <!-- Name of the native arctifacts  -->
+  <property name="native.name"             value="commons-${component.name}-${component.version}-native-src"/>
+
+  <!-- Path of the native arctifacts  -->
+  <property name="native.path"             value="${dist.home}/bin/native/${native.name}"/>
+
 
 <!-- ========== Compiler Defaults ========================================= -->
 
 
+  <!-- compiler source JDK version -->
+  <property name="compile.source"          value="1.3"/>
+
+  <!-- compiler target JDK version -->
+  <property name="compile.target"          value="1.3"/>
+
   <!-- Should Java compilations set the 'debug' compiler option? -->
   <property name="compile.debug"           value="true"/>
 
@@ -119,23 +144,14 @@
 
   <target name="prepare" depends="init"
    description="Prepare build directory">
+    <tstamp/>
     <mkdir dir="${build.home}"/>
     <mkdir dir="${build.home}/classes"/>
     <mkdir dir="${build.home}/conf"/>
     <mkdir dir="${build.home}/tests"/>
   </target>
 
-
-  <target name="static" depends="prepare"
-   description="Copy static files to build directory">
-    <tstamp/>
-    <copy  todir="${build.home}/conf" filtering="on">
-      <fileset dir="${conf.home}" includes="*.MF"/>
-    </copy>
-  </target>
-
-
-  <target name="compile" depends="static"
+  <target name="compile" depends="prepare"
    description="Compile shareable components">
     <javac  srcdir="${source.home}"
            destdir="${build.home}/classes"
@@ -161,6 +177,8 @@
     <javac  srcdir="${test.home}"
            destdir="${build.home}/tests"
              debug="${compile.debug}"
+            source="${compile.source}" 
+            target="${compile.target}"
        deprecation="${compile.deprecation}"
           optimize="${compile.optimize}">
       <classpath refid="test.classpath"/>
@@ -194,7 +212,7 @@
                 version="true"
                doctitle="<h1>${component.title}</h1>"
             windowtitle="${component.title} (Version ${component.version})"
-                 bottom="Copyright (c) 2001-2002 - Apache Software Foundation">
+                 bottom="Copyright (c) 2002-2010 - Apache Software Foundation">
       <classpath refid="compile.classpath"/>
       <classpath location="${ant.lib}/ant.jar"/>
     </javadoc>
@@ -212,13 +230,47 @@
               todir="${dist.home}"/>
     <copy      file="RELEASE-NOTES.txt"
               todir="${dist.home}"/>
-    <copy todir="${dist.home}/bin/unix/jsvc-src">
+    <copy todir="${native.path}/unix">
+      <!-- Make sure this is clean repository with
+           running sh support/buildconf.sh
+           This will create configure script
+        -->
       <fileset dir="src/native/unix" />
     </copy>
-    <fixcrlf srcdir="${dist.home}/bin/unix" eol="lf" />
-    <tar compression="gzip" destfile="${dist.home}/bin/jsvc.tar.gz"
-         basedir="${dist.home}/bin/unix" />
-    <delete dir="${dist.home}/bin/unix" />
+    <copy todir="${native.path}/windows">
+      <fileset dir="src/native/nt/procrun" />
+    </copy>
+    <copy file="LICENSE.txt"
+          todir="${native.path}"/>
+    <copy file="NOTICE.txt"
+          todir="${native.path}"/>
+    <fixcrlf srcdir="${native.path}/unix" eol="lf" />
+    <fixcrlf srcdir="${native.path}/windows" eol="crlf" />
+    <tar longfile="gnu" compression="gzip"
+         tarfile="${dist.home}/bin/${native.name}.tar.gz">
+      <tarfileset dir="${dist.home}/bin/native">
+        <include name="${native.name}/**" />
+        <exclude name="${native.name}/unix/configure" />
+        <exclude name="${native.name}/unix/support/*.sh" />
+      </tarfileset>
+      <tarfileset dir="${dist.home}/bin/native" mode="755">
+        <include name="${native.name}/unix/configure" />
+        <include name="${native.name}/unix/support/*.sh" />
+      </tarfileset>
+    </tar>
+    <zip zipfile="${dist.home}/bin/${native.name}.zip">
+      <zipfileset dir="${dist.home}/bin/native">
+        <include name="${native.name}/**" />
+        <exclude name="${native.name}/unix/configure" />
+        <exclude name="${native.name}/unix/support/*.sh" />
+      </zipfileset>
+      <zipfileset dir="${dist.home}/bin/native" filemode="755">
+        <include name="${native.name}/unix/configure" />
+        <include name="${native.name}/unix/support/*.sh" />
+      </zipfileset>
+    </zip>
+
+    <delete dir="${dist.home}/bin/native" />
     <antcall target="jar"/>
   </target>
 
@@ -232,10 +284,24 @@
              tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
     <copy      file="NOTICE.txt"
              tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
-    <jar    jarfile="${dist.home}/commons-${component.name}.jar"
-            basedir="${build.home}/classes"
-           manifest="${build.home}/conf/MANIFEST.MF"
-           includes="org/apache/commons/daemon/**"/>
+    <jar    jarfile="${dist.home}/commons-${component.name}-${component.version}.jar">
+        <manifest>
+            <attribute name="Specification-Title" value="Commons Daemon"/>
+            <attribute name="Specification-Version" value="${component.version}"/>
+            <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
+            <attribute name="Implementation-Title" value="Commons Daemon"/>
+            <attribute name="Implementation-Version" value="${component.version}"/> 
+            <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+            <attribute name="Implementation-Vendor-Id" value="org.apache"/>
+            <attribute name="X-Compile-Source-JDK" value="${compile.source}"/>
+            <attribute name="X-Compile-Target-JDK" value="${compile.target}"/>
+        </manifest>
+        <fileset dir="${build.home}/classes">
+            <include name="org/apache/commons/daemon/**"/>
+            <include name="META-INF/LICENSE.txt"/>
+            <include name="META-INF/NOTICE.txt"/>
+        </fileset>
+    </jar>
   </target>
 
 
@@ -243,7 +309,7 @@
    description="--> Installs jar file in ${lib.repo}">
     <copy todir="${lib.repo}" filtering="off">
       <fileset dir="${dist.home}">
-        <include name="commons-${component.name}.jar"/>
+        <include name="commons-${component.name}-${component.version}.jar"/>
       </fileset>
     </copy>
   </target>
@@ -256,5 +322,5 @@
    description="Run all unit test cases">
   </target>
 
-
 </project>
+
diff --git a/doap_daemon.rdf b/doap_daemon.rdf
deleted file mode 100644
index 9aa02eb..0000000
--- a/doap_daemon.rdf
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:asfext="http://projects.apache.org/ns/asfext#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:doap="http://usefulinc.com/ns/doap#" xml:lang="en">
-  <Project rdf:about="http://jakarta.apache.org/commons/daemon/">
-    <name>Apache Jakarta Commons Daemon</name>
-    <homepage rdf:resource="http://jakarta.apache.org/commons/daemon/"/>
-    <programming-language>Java</programming-language>
-    <category rdf:resource="http://projects.apache.org/category/library"/>
-    <license rdf:resource="http://usefulinc.com/doap/licenses/asl20"/>
-    <bug-database rdf:resource="http://issues.apache.org/jira/browse/DAEMON"/>
-    <download-page rdf:resource="http://jakarta.apache.org/site/downloads/downloads_commons-daemon.cgi"/>
-    <asfext:pmc rdf:resource="http://jakarta.apache.org/"/>
-    <shortdesc xml:lang="en">Commons Daemon</shortdesc>
-    <description xml:lang="en">Commons Daemon</description>
-    <repository>
-      <SVNRepository>
-        <browse rdf:resource="http://svn.apache.org/repos/asf/jakarta/commons/proper/daemon/trunk"/>
-        <location rdf:resource="http://svn.apache.org/repos/asf/jakarta/commons/proper/daemon"/>
-      </SVNRepository>
-    </repository>
-    <release>
-      <revision>
-        <name>commons-daemon</name>
-        <created>2005-05-17</created>
-        <version>1.0.1</version>
-      </revision>
-    </release>
-    <mailing-list rdf:resource="http://jakarta.apache.org/site/mail2.html#Commons"/>
-  </Project>
-</rdf:RDF>
diff --git a/maven.xml b/maven.xml
deleted file mode 100644
index 34903d2..0000000
--- a/maven.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-   Copyright 2001-2004 The Apache Software Foundation
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<project default="java:jar"
-  xmlns:j="jelly:core">
-
-  <!-- ================================================================== -->
-  <!-- START : C O M M O N S - B U I L D                                  -->
-  <!-- ================================================================== -->
-  <!-- Required: Look and Feel for documentation within distributions     -->
-  <!-- ================================================================== -->
-  <postGoal name="xdoc:copy-resources">  
-    <copy todir="${basedir}/target/docs/style/" failonerror="false">
-      <fileset dir="${basedir}/../commons-build/xdocs/style">
-      	<include name='**/*'/>
-      	<exclude name='**/CVS/**'/>
-      </fileset>
-    </copy>
-  </postGoal>
-  <!-- ================================================================== -->
-  <!-- END: C O M M O N S - B U I L D                                     -->
-  <!-- ================================================================== -->
-  
-</project>
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..4311ece
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-parent</artifactId>
+    <version>12</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>commons-daemon</groupId>
+  <artifactId>commons-daemon</artifactId>
+  <version>1.0.2</version>
+  <name>Commons Daemon</name>
+  <!-- Daemon started in Commons in 2002 with an import of code from Tomcat,
+       which is why the NOTICE file has an earlier date than the inceptionYear -->
+  <inceptionYear>2002</inceptionYear>
+  <description>
+     Alternative invocation mechanism for unix-daemon-like java code.
+  </description>
+  <url>http://commons.apache.org/daemon/</url>
+
+  <issueManagement>
+    <system>jira</system>
+    <url>http://issues.apache.org/jira/browse/DAEMON</url>
+  </issueManagement>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/daemon/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/daemon/trunk</developerConnection>
+    <url>http://svn.apache.org/viewvc/commons/proper/daemon/trunk</url>
+  </scm>
+
+  <developers>
+    <developer>
+      <name>Jean-Frederic Clere</name>
+      <id>jfclere</id>
+      <email>jfclere at apache.org</email>
+    </developer>
+
+    <developer>
+      <name>Remy Maucherat</name>
+      <id>remm</id>
+      <email>remm at apache.org</email>
+    </developer>
+
+    <developer>
+      <name>Yoav Shapira</name>
+      <id>yoavs</id>
+      <email>yoavs at apache.org</email>
+    </developer>
+
+    <developer>
+      <name>Bill Barker</name>
+      <id>billbarker</id>
+      <email>billbarker at apache.org</email>
+    </developer>
+    <developer>
+      <name>Mladen Turk</name>
+      <id>mturk</id>
+      <email>mturk at apache.org</email>
+    </developer>
+  </developers>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <maven.compile.source>1.3</maven.compile.source>
+    <maven.compile.target>1.3</maven.compile.target>
+    <commons.componentid>daemon</commons.componentid>
+    <commons.release.version>1.0.2</commons.release.version>
+    <commons.jira.id>DAEMON</commons.jira.id>
+    <commons.jira.pid>12310468</commons.jira.pid>
+  </properties> 
+
+  <build>
+    <sourceDirectory>src/java</sourceDirectory>
+    <testSourceDirectory>src/test</testSourceDirectory>
+    <plugins>
+<!--
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+          <configuration>
+            <includes>
+              <include>**/*Test.java</include>
+            </includes>
+            <excludes>
+              <exclude>**/*AbstractTest.java</exclude>
+            </excludes>
+        </configuration>
+      </plugin>
+-->
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/assembly/native-src.xml</descriptor>
+            <descriptor>src/assembly/bin.xml</descriptor>
+            <descriptor>src/assembly/src.xml</descriptor>
+          </descriptors>
+          <tarLongFileMode>gnu</tarLongFileMode>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
+
diff --git a/project.properties b/project.properties
deleted file mode 100755
index 03fe087..0000000
--- a/project.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-##
-# Properties that override Maven build defaults
-##
-
-maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory
-
-# Jar Manifest Additional Attributes
-maven.jar.manifest.attributes.list=Implementation-Vendor-Id,X-Compile-Source-JDK,X-Compile-Target-JDK
-maven.jar.manifest.attribute.Implementation-Vendor-Id=org.apache
-maven.jar.manifest.attribute.X-Compile-Source-JDK=${maven.compile.source}
-maven.jar.manifest.attribute.X-Compile-Target-JDK=${maven.compile.target}
-
-#maven.checkstyle.properties=${basedir}/checkstyle.xml
-maven.test.failure = false
-maven.junit.fork=true
-maven.linkcheck.enable=false
-
-maven.xdoc.jsl=../commons-build/commons-site.jsl
-maven.xdoc.date=left
-maven.xdoc.version=${pom.currentVersion}
-maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html
-maven.xdoc.poweredby.image=maven-feather.png
-
-
diff --git a/project.xml b/project.xml
deleted file mode 100644
index 0de870a..0000000
--- a/project.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   Copyright 2001-2004 The Apache Software Foundation
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<project>
-  <pomVersion>3</pomVersion>
-  
-  <groupId>commons-daemon</groupId>
-  <artifactId>commons-daemon</artifactId>
-  <currentVersion>1.0.2-SNAPSHOT</currentVersion>
-  <inceptionYear>2003</inceptionYear>
-  <name>Daemon</name>
-  <shortDescription>Commons Daemon</shortDescription>
-  <description>Commons Daemon</description>
-  <logo>/images/logo.png</logo>
-  <url>http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</url>
-  <package>org.apache.commons.${pom.artifactId.substring(8)}</package>
-
-  <organization>
-    <name>The Apache Software Foundation</name>
-    <url>http://jakarta.apache.org</url>
-    <logo>http://jakarta.apache.org/images/jakarta-logo.gif</logo>
-  </organization>
- 
-  <licenses>
-	<license>
-    	<name>The Apache Software License, Version 2.0</name>
-    	<url>/LICENSE.txt</url>
-    	<distribution>repo</distribution>
-	</license>
-  </licenses>
-  
-  <gumpRepositoryId>jakarta</gumpRepositoryId>
-  <issueTrackingUrl>http://issues.apache.org/jira/</issueTrackingUrl>
-  <siteAddress>people.apache.org</siteAddress>
-  <siteDirectory>/www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</siteDirectory>
-  <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/</distributionDirectory>
-  
-  <repository>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk</connection>
-    <url>http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk</url>
-  </repository>
-  
-  <mailingLists>
-    <mailingList>
-      <name>Commons Dev List</name>
-      <subscribe>commons-dev-subscribe at jakarta.apache.org</subscribe>
-      <unsubscribe>commons-dev-unsubscribe at jakarta.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
-    </mailingList>
-    <mailingList>
-      <name>Commons User List</name>
-      <subscribe>commons-user-subscribe at jakarta.apache.org</subscribe>
-      <unsubscribe>commons-user-unsubscribe at jakarta.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org</archive>
-    </mailingList>
-  </mailingLists>
-
-  <developers>
-    <developer>
-      <name>Jean-Frederic Clere</name>
-      <id>jfclere</id>
-      <email>jfclere at apache.org</email>
-      <organization>Apache</organization>
-    </developer>
-
-    <developer>
-      <name>Remy Maucherat</name>
-      <id>remm</id>
-      <email>remm at apache.org</email>
-      <organization>Apache</organization>
-    </developer>
-
-    <developer>
-      <name>Yoav Shapira</name>
-      <id>yoavs</id>
-      <email>yoavs at apache.org</email>
-      <organization>Apache</organization>
-    </developer>
-
-    <developer>
-      <name>Bill Barker</name>
-      <id>billbarker</id>
-      <email>billbarker at apache.org</email>
-      <organization>Apache</organization>
-    </developer>
-  </developers>
-
-  <build>
-    <nagEmailAddress>commons-dev at jakarta.apache.org</nagEmailAddress>
-    <sourceDirectory>src/java</sourceDirectory>
-    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
-    <integrationUnitTestSourceDirectory/>
-    <aspectSourceDirectory/>
-    <unitTest>
-      <includes>
-        <include>**/*Test.java</include>
-      </includes>
-      <excludes>
-        <exclude>**/*AbstractTest.java</exclude>
-      </excludes>
-      <resources>
-         <resource>
-            <directory>${pom.build.unitTestSourceDirectory}</directory>
-            <includes>
-              <include>**/*.xml</include>
-            </includes>
-         </resource>
-      </resources>
-    </unitTest>
-  </build>
-  
-  <reports>
-  	<report>maven-changelog-plugin</report>
-   	<report>maven-changes-plugin</report>
-    <report>maven-developer-activity-plugin</report>
-    <report>maven-file-activity-plugin</report>
-    <report>maven-javadoc-plugin</report>
-    <report>maven-jdepend-plugin</report>
-    <report>maven-junit-report-plugin</report>
-    <report>maven-jxr-plugin</report>
-    <report>maven-license-plugin</report>
-    <report>maven-tasklist-plugin</report>
-  </reports>
-</project>
diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml
new file mode 100644
index 0000000..01d37de
--- /dev/null
+++ b/src/assembly/bin.xml
@@ -0,0 +1,45 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+    <id>bin</id>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+    <includeSiteDirectory>false</includeSiteDirectory>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>LICENSE.txt</include>
+                <include>NOTICE.txt</include>
+                <include>RELEASE-NOTES.txt</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <outputDirectory></outputDirectory>
+            <includes>
+                <include>*.jar</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>target/site/apidocs</directory>
+            <outputDirectory>apidocs</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
+
diff --git a/src/assembly/native-src.xml b/src/assembly/native-src.xml
new file mode 100644
index 0000000..1ec9bca
--- /dev/null
+++ b/src/assembly/native-src.xml
@@ -0,0 +1,72 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+    <id>native-src</id>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+    <baseDirectory>${project.artifactId}-${project.version}-native-src</baseDirectory>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>LICENSE.txt</include>
+                <include>NOTICE.txt</include>
+                <include>RELEASE-NOTES.txt</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/native/unix</directory>
+            <outputDirectory>unix</outputDirectory>
+            <lineEnding>lf</lineEnding>
+            <excludes>
+                <exclude>**/*.sh</exclude>
+                <exclude>configure</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>src/native/unix</directory>
+            <outputDirectory>unix</outputDirectory>
+            <lineEnding>lf</lineEnding>
+            <fileMode>775</fileMode>
+            <includes>
+                <include>**/*.sh</include>
+                <include>configure</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/native/nt/procrun</directory>
+            <outputDirectory>windows</outputDirectory>
+            <lineEnding>crlf</lineEnding>
+            <excludes>
+                <exclude>**/*.ico</exclude>
+                <exclude>**/*.bmp</exclude>
+            </excludes>
+            <fileMode>664</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>src/native/nt/procrun</directory>
+            <outputDirectory>windows</outputDirectory>
+            <includes>
+                <include>**/*.ico</include>
+                <include>**/*.bmp</include>
+            </includes>
+            <fileMode>664</fileMode>
+        </fileSet>
+    </fileSets>
+</assembly>
+
diff --git a/src/assembly/src.xml b/src/assembly/src.xml
new file mode 100644
index 0000000..ebb01b6
--- /dev/null
+++ b/src/assembly/src.xml
@@ -0,0 +1,42 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+    <id>src</id>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+    <baseDirectory>${project.artifactId}-${project.version}-src</baseDirectory>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>build.properties.sample</include>
+                <include>build.xml</include>
+                <include>LICENSE.txt</include>
+                <include>NOTICE.txt</include>
+                <include>pom.xml</include>
+                <include>PROPOSAL.html</include>
+                <include>README</include>
+                <include>RELEASE-NOTES.txt</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src</directory>
+        </fileSet>
+    </fileSets>
+</assembly>
+
diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF
deleted file mode 100644
index 2f6c767..0000000
--- a/src/conf/MANIFEST.MF
+++ /dev/null
@@ -1,5 +0,0 @@
-Extension-Name: @package@
-Specification-Vendor: Apache Software Foundation
-Specification-Version: 1.0
-Implementation-Vendor: Apache Software Foundation
-Implementation-Version: @version@
diff --git a/src/docs/daemon.css b/src/docs/daemon.css
index ac3e25b..f8b74a9 100644
--- a/src/docs/daemon.css
+++ b/src/docs/daemon.css
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 BODY {
   font-family: arial, helvetica, sans-serif;
   font-size: 10pt;
diff --git a/src/docs/daemon.html b/src/docs/daemon.html
index 0474a0f..0f7d0c1 100644
--- a/src/docs/daemon.html
+++ b/src/docs/daemon.html
@@ -1,4 +1,20 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 <HTML>
   <HEAD>
     <TITLE>Apache Daemon Specification - Version 1.0</TITLE>
diff --git a/src/java/org/apache/commons/daemon/Daemon.java b/src/java/org/apache/commons/daemon/Daemon.java
index f363166..a82ef44 100644
--- a/src/java/org/apache/commons/daemon/Daemon.java
+++ b/src/java/org/apache/commons/daemon/Daemon.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -28,9 +29,7 @@ package org.apache.commons.daemon;
  * fashion.
  * </p>
  * @author Pier Fumagalli
- * @author Copyright © 2000-2001 <a href="http://www.apache.org/">The
- *         Apache Software Foundation</a>. All rights reserved.
- * @version 1.0 <i>(CVS $Revision: 155409 $)</i>
+ * @version 1.0 <i>(CVS $Revision: 557416 $)</i>
  */
 public interface Daemon {
 
@@ -74,9 +73,9 @@ public interface Daemon {
      * Start the operation of this <code>Daemon</code> instance. This
      * method is to be invoked by the environment after the init()
      * method has been successfully invoked and possibly the security
-     * level of the JVM has been dropped.  <code>Implementors of this
+     * level of the JVM has been dropped. Implementors of this
      * method are free to start any number of threads, but need to
-     * return control avfter having done that to enable invocation of
+     * return control after having done that to enable invocation of
      * the stop()-method.
      */
     public void start()
diff --git a/src/java/org/apache/commons/daemon/DaemonContext.java b/src/java/org/apache/commons/daemon/DaemonContext.java
index 3acd4ee..ddc1b89 100644
--- a/src/java/org/apache/commons/daemon/DaemonContext.java
+++ b/src/java/org/apache/commons/daemon/DaemonContext.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -22,9 +23,7 @@ package org.apache.commons.daemon;
  * communicate with the Daemon container.
  *
  * @author Pier Fumagalli
- * @author Copyright © 2000-2001 <a href="http://www.apache.org/">The
- *         Apache Software Foundation</a>. All rights reserved.
- * @version 1.0 <i>(CVS $Revision: 155409 $)</i>
+ * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
  */
 public interface DaemonContext {
 
diff --git a/src/java/org/apache/commons/daemon/DaemonController.java b/src/java/org/apache/commons/daemon/DaemonController.java
index 7aade88..72b16ba 100644
--- a/src/java/org/apache/commons/daemon/DaemonController.java
+++ b/src/java/org/apache/commons/daemon/DaemonController.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -20,9 +21,7 @@ package org.apache.commons.daemon;
 /**
  *
  * @author Pier Fumagalli
- * @author Copyright © 2000-2001 <a href="http://www.apache.org/">The
- *         Apache Software Foundation</a>. All rights reserved.
- * @version 1.0 <i>(CVS $Revision: 155409 $)</i>
+ * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
  */
 public interface DaemonController {
 
diff --git a/src/java/org/apache/commons/daemon/DaemonListener.java b/src/java/org/apache/commons/daemon/DaemonListener.java
index 9a419eb..2439bac 100644
--- a/src/java/org/apache/commons/daemon/DaemonListener.java
+++ b/src/java/org/apache/commons/daemon/DaemonListener.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/java/org/apache/commons/daemon/DaemonPermission.java b/src/java/org/apache/commons/daemon/DaemonPermission.java
index 8a6fada..4b27b40 100644
--- a/src/java/org/apache/commons/daemon/DaemonPermission.java
+++ b/src/java/org/apache/commons/daemon/DaemonPermission.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 2001-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -82,9 +83,7 @@ import java.util.StringTokenizer;
  * </p>
  *
  * @author Pier Fumagalli
- * @author Copyright © 2000-2001 <a href="http://www.apache.org/">The
- *         Apache Software Foundation</a>. All rights reserved.
- * @version 1.0 <i>(CVS $Revision: 155409 $)</i>
+ * @version 1.0 <i>(CVS $Revision: 480475 $)</i>
  */
 public final class DaemonPermission extends Permission {
 
diff --git a/src/java/org/apache/commons/daemon/support/DaemonLoader.java b/src/java/org/apache/commons/daemon/support/DaemonLoader.java
index b710899..bc9144d 100644
--- a/src/java/org/apache/commons/daemon/support/DaemonLoader.java
+++ b/src/java/org/apache/commons/daemon/support/DaemonLoader.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,11 +15,10 @@
  *  limitations under the License.
  */
 
-/* @version $Id: DaemonLoader.java 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: DaemonLoader.java 912665 2010-02-22 17:16:00Z sebb $ */
 
 package org.apache.commons.daemon.support;
 
-import org.apache.commons.daemon.Daemon;
 import org.apache.commons.daemon.DaemonContext;
 import org.apache.commons.daemon.DaemonController;
 
diff --git a/src/native/nt/executables/vdmoniadm/resource.h b/src/native/nt/executables/vdmoniadm/resource.h
index c969996..66e0d56 100644
--- a/src/native/nt/executables/vdmoniadm/resource.h
+++ b/src/native/nt/executables/vdmoniadm/resource.h
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: resource.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: resource.h 480469 2006-11-29 08:22:04Z bayard $ */
 /* Used by vdmoniadm.rc */
 #define NO_ACCESS                       1
 #define NO_ACCESS_MONI                  2
diff --git a/src/native/nt/executables/vdmonisvc/resource.h b/src/native/nt/executables/vdmonisvc/resource.h
index d9d94f9..b253a5c 100644
--- a/src/native/nt/executables/vdmonisvc/resource.h
+++ b/src/native/nt/executables/vdmonisvc/resource.h
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: resource.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: resource.h 480469 2006-11-29 08:22:04Z bayard $ */
 /* Used by vdmonisvc.rc */
 
 /* Next default values for new objects */
diff --git a/src/native/nt/lib/moni_inst.h b/src/native/nt/lib/moni_inst.h
index fe27196..2d0f740 100644
--- a/src/native/nt/lib/moni_inst.h
+++ b/src/native/nt/lib/moni_inst.h
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/moni/vdmoniadm.c b/src/native/nt/moni/vdmoniadm.c
index 0a14a29..7ba10f0 100644
--- a/src/native/nt/moni/vdmoniadm.c
+++ b/src/native/nt/moni/vdmoniadm.c
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: vdmoniadm.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: vdmoniadm.c 909069 2010-02-11 16:43:36Z mturk $ */
 
 #include <windows.h>       /* required for all Windows applications */
 #include <stdio.h>         /* for sprintf                           */
@@ -32,11 +33,11 @@
 #define WINHEIGHT 460
 
 #define CLASSMAIN
-#define VM_ICON_MESS	WM_USER+1
-#define VM_ID_TIMER		WM_USER+2
-#define VM_START_ICON	WM_USER+3
-#define VM_ID_TIMER1	WM_USER+4
-#define VM_ID_TIMER2	WM_USER+5
+#define VM_ICON_MESS    WM_USER+1
+#define VM_ID_TIMER     WM_USER+2
+#define VM_START_ICON   WM_USER+3
+#define VM_ID_TIMER1    WM_USER+4
+#define VM_ID_TIMER2    WM_USER+5
 
 BOOL InitApplication(HANDLE hInstance);
 
@@ -78,20 +79,20 @@ char MessBox[256];
 BOOL MyTaskBarAddIcon(HWND hWnd)
 { 
     BOOL res; 
-	NOTIFYICONDATA  notifyicondata;
-	HICON hicon;
+    NOTIFYICONDATA  notifyicondata;
+    HICON hicon;
  
-	notifyicondata.cbSize=sizeof(notifyicondata); 
-	notifyicondata.hWnd=hWnd; 
-	notifyicondata.uID=ID_TASKICON; 
-	notifyicondata.uFlags= NIF_ICON|NIF_MESSAGE|NIF_TIP; 
-	notifyicondata.uCallbackMessage=VM_ICON_MESS;
-	hicon = LoadIcon(hInst,"OnServe");
+    notifyicondata.cbSize=sizeof(notifyicondata); 
+    notifyicondata.hWnd=hWnd; 
+    notifyicondata.uID=ID_TASKICON; 
+    notifyicondata.uFlags= NIF_ICON|NIF_MESSAGE|NIF_TIP; 
+    notifyicondata.uCallbackMessage=VM_ICON_MESS;
+    hicon = LoadIcon(hInst,"OnServe");
     notifyicondata.hIcon = hicon;
-	strcpy(notifyicondata.szTip,"Jakarta Service");
+    strcpy(notifyicondata.szTip,"Jakarta Service");
 
 
-	res = Shell_NotifyIcon(NIM_ADD,&notifyicondata);
+    res = Shell_NotifyIcon(NIM_ADD,&notifyicondata);
  
     if (hicon) 
         DestroyIcon(hicon); 
@@ -129,8 +130,8 @@ PROCESS_INFORMATION ProcessInformation;
    
   if (!CreateProcess(NULL,"vdcom.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
          NULL,NULL, &StartupInfo, &ProcessInformation)) {
-	  DisplayMess(hDlg,CANNOT_START_VDCOM);
-	  return;
+      DisplayMess(hDlg,CANNOT_START_VDCOM);
+      return;
      }
   /* the handle to the process */
   CloseHandle(ProcessInformation.hProcess); 
@@ -147,8 +148,8 @@ PROCESS_INFORMATION ProcessInformation;
    
   if (!CreateProcess(NULL,"vdconf.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
          NULL,NULL, &StartupInfo, &ProcessInformation)) {
-	  DisplayMess(hDlg,CANNOT_START_VDCONF);
-	  return;
+      DisplayMess(hDlg,CANNOT_START_VDCONF);
+      return;
      }
   /* the handle to the process */
   CloseHandle(ProcessInformation.hProcess); 
@@ -160,16 +161,16 @@ BOOL IsRunning(HWND hDlg)
 {
   SERVICE_STATUS  svcStatus;
 
-	if (!QueryServiceStatus(hService, &svcStatus)) {
-		DisplayMess(hDlg,ERROR_STATUS);
-		PostQuitMessage(0);
-		return(FALSE);
-	}
-	else {
-		if (SERVICE_RUNNING == svcStatus.dwCurrentState)
-			return(TRUE);
-	}
-	return(FALSE);
+    if (!QueryServiceStatus(hService, &svcStatus)) {
+        DisplayMess(hDlg,ERROR_STATUS);
+        PostQuitMessage(0);
+        return(FALSE);
+    }
+    else {
+        if (SERVICE_RUNNING == svcStatus.dwCurrentState)
+            return(TRUE);
+    }
+    return(FALSE);
 
 }
 /* test if service is stoppped */
@@ -177,114 +178,114 @@ BOOL IsStopped(HWND hDlg)
 {
   SERVICE_STATUS  svcStatus;
 
-	if (!QueryServiceStatus(hService, &svcStatus)) {
-		DisplayMess(hDlg,ERROR_STATUS);
-		PostQuitMessage(0);
-		return(FALSE);
-	}
-	else {
-		if (SERVICE_STOPPED == svcStatus.dwCurrentState)
-			return(TRUE);
-	}
-	return(FALSE);
+    if (!QueryServiceStatus(hService, &svcStatus)) {
+        DisplayMess(hDlg,ERROR_STATUS);
+        PostQuitMessage(0);
+        return(FALSE);
+    }
+    else {
+        if (SERVICE_STOPPED == svcStatus.dwCurrentState)
+            return(TRUE);
+    }
+    return(FALSE);
 
 }
 /* Yes/No dialog box */
-LRESULT APIENTRY StopYesNo(
+BOOL CALLBACK StopYesNo(
         HWND hDlg,                /* window handle of the dialog box */
         UINT message,             /* type of message                 */
-        UINT wParam,              /* message-specific information    */
-        LONG lParam)
+        WPARAM wParam,            /* message-specific information    */
+        LPARAM lParam)
 {
-	SERVICE_STATUS  svcStatus;
-	
-	switch (message) {
-	case WM_COMMAND:                     /* message: received a command */
-		if (LOWORD(wParam) == IDOK) {	 /* "OK" box selected */
-			if (!IsStopped(hDlg)) {
-				ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
-				EndDialog(hDlg, TRUE);
-			}
-			else
-				EndDialog(hDlg, FALSE);
-		}
-		if (LOWORD(wParam) == IDCANCEL)
-			EndDialog(hDlg, FALSE);
-		return(TRUE);
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+    SERVICE_STATUS  svcStatus;
+    
+    switch (message) {
+    case WM_COMMAND:                     /* message: received a command */
+        if (LOWORD(wParam) == IDOK) {     /* "OK" box selected */
+            if (!IsStopped(hDlg)) {
+                ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
+                EndDialog(hDlg, TRUE);
+            }
+            else
+                EndDialog(hDlg, FALSE);
+        }
+        if (LOWORD(wParam) == IDCANCEL)
+            EndDialog(hDlg, FALSE);
+        return(TRUE);
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
 /* Please wait stopping dialog box */
-LRESULT APIENTRY PleaseWait(
+BOOL CALLBACK PleaseWait(
         HWND hDlg,                /* window handle of the dialog box */
         UINT message,             /* type of message                 */
-        UINT wParam,              /* message-specific information    */
-        LONG lParam)
+        WPARAM wParam,            /* message-specific information    */
+        LPARAM lParam)
 {
-	
-	switch (message) {
-	case WM_INITDIALOG:
-		SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-	case WM_COMMAND:                     /* message: received a command */
-		if (LOWORD(wParam) == IDCANCEL)
-			EndDialog(hDlg, FALSE);
-		return(TRUE);
-	case WM_TIMER:
-		if(IsStopped(hDlg))
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+    
+    switch (message) {
+    case WM_INITDIALOG:
+        SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
+    case WM_COMMAND:                     /* message: received a command */
+        if (LOWORD(wParam) == IDCANCEL)
+            EndDialog(hDlg, FALSE);
+        return(TRUE);
+    case WM_TIMER:
+        if(IsStopped(hDlg))
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
-LRESULT APIENTRY StartYesNo(
+BOOL CALLBACK StartYesNo(
         HWND hDlg,                /* window handle of the dialog box */
         UINT message,             /* type of message                 */
-        UINT wParam,              /* message-specific information    */
-        LONG lParam)
+        WPARAM wParam,            /* message-specific information    */
+        LPARAM lParam)
 {
-	
-	switch (message) {
-	case WM_INITDIALOG:
-		if (!StartService(hService,0,NULL)) {
-			DisplayMess(hDlg,CANNOT_START);
-			PostQuitMessage(0);
-		}
-		/* test if running, if not set a timer. */
-		/* wait until service is start */
-		if (IsRunning(hDlg)) 
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-		
-	case WM_TIMER:
-		if(IsRunning(hDlg))
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-		
-	case WM_COMMAND:                    /* message: received a command */
-		if (LOWORD(wParam) == IDCANCEL) {
-			if (IsRunning(hDlg)) 
-				EndDialog(hDlg, TRUE);
-			else
-				PostQuitMessage(0);
-		}
-		return(TRUE);
-		
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+
+    switch (message) {
+    case WM_INITDIALOG:
+        if (!StartService(hService,0,NULL)) {
+            DisplayMess(hDlg,CANNOT_START);
+            PostQuitMessage(0);
+        }
+        /* test if running, if not set a timer. */
+        /* wait until service is start */
+        if (IsRunning(hDlg)) 
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+        
+    case WM_TIMER:
+        if(IsRunning(hDlg))
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+        
+    case WM_COMMAND:                    /* message: received a command */
+        if (LOWORD(wParam) == IDCANCEL) {
+            if (IsRunning(hDlg)) 
+                EndDialog(hDlg, TRUE);
+            else
+                PostQuitMessage(0);
+        }
+        return(TRUE);
+        
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
 
 /* Display the menu */
 
-void   ShowMenu(HWND hWnd)
+void ShowMenu(HWND hWnd)
 {
    HMENU hMenu,hMenu1;
    POINT point;
@@ -297,7 +298,7 @@ void   ShowMenu(HWND hWnd)
 
    SetForegroundWindow(hWnd); /* MS bug. */
    TrackPopupMenuEx(hMenu1,TPM_RIGHTALIGN|TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
-					point.x,point.y,hWnd,NULL);
+                    point.x,point.y,hWnd,NULL);
    PostMessage(hWnd, WM_USER, 0, 0); /* MS bug. */
    DestroyMenu(hMenu);
 
@@ -315,7 +316,7 @@ BOOL InitInstance(
     int             nCmdShow)           /* Param for first ShowWindow() call. */
 {
     HWND            hWnd;               /* Main window handle.                */
-	DWORD			dwStyle,dwExStyle;
+    DWORD           dwStyle,dwExStyle;
 
 
     /* Save the instance handle in static variable, which will be used in  */
@@ -325,20 +326,20 @@ BOOL InitInstance(
 
     /* Create a main window for this application instance.  */
 
-	if (optmode == VDMONISTART || optmode == VDMONICHECK) {
-		dwStyle = ICONWINDOW;
-		dwExStyle = WS_EX_APPWINDOW;
-	}
-	else {
-		dwStyle = NORMALWINDOW;
-		dwExStyle = 0;
-	}
+    if (optmode == VDMONISTART || optmode == VDMONICHECK) {
+        dwStyle = ICONWINDOW;
+        dwExStyle = WS_EX_APPWINDOW;
+    }
+    else {
+        dwStyle = NORMALWINDOW;
+        dwExStyle = 0;
+    }
 
     hWnd = CreateWindowEx(
-		dwExStyle,
+        dwExStyle,
         "OnServe",                      /* See RegisterClass() call.          */
-        "OnServe Monitor Control",		/* Text for window title bar.   */
-        dwStyle,						/* Window style.*/
+        "OnServe Monitor Control",      /* Text for window title bar.   */
+        dwStyle,                        /* Window style.*/
         CW_USEDEFAULT,                  /* Default horizontal position.       */
         CW_USEDEFAULT,                  /* Default vertical position.         */
         WINWIDTH,                       /* Windows width.                     */
@@ -354,7 +355,7 @@ BOOL InitInstance(
 
     if (!hWnd) {
         return (FALSE);
-	}
+    }
 
     return (TRUE);               /* Returns the value from PostQuitMessage */
 
@@ -367,137 +368,137 @@ BOOL InitInstance(
 *
 *\***************************************************************************/
 
-LONG APIENTRY MainWndProc(
+LRESULT CALLBACK MainWndProc(
         HWND hWnd,                /* window handle                   */
         UINT message,             /* type of message                 */
-        UINT wParam,              /* additional information          */
-        LONG lParam)              /* additional information          */
+        WPARAM wParam,            /* additional information          */
+        LPARAM lParam)            /* additional information          */
 {
    SERVICE_STATUS  svcStatus;
 
    switch (message) {
    case WM_CREATE:
 
-	  /* acces to service manager. */
+      /* acces to service manager. */
       hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-	  if (hManager==NULL) {
-		  DisplayMess(hWnd,NO_ACCESS);
-		  PostQuitMessage(0);
-		  break;
-	  }
-	  /* access to monitor service.  */
+      if (hManager==NULL) {
+          DisplayMess(hWnd,NO_ACCESS);
+          PostQuitMessage(0);
+          break;
+      }
+      /* access to monitor service.  */
       hService = OpenService(hManager, SZSERVICENAME, SERVICE_ALL_ACCESS);
-	  if (hService==NULL) {
-		  DisplayMess(hWnd,NO_ACCESS_MONI);
-		  PostQuitMessage(0);
-		  break;
-	  }
-	  /* check if running. */
+      if (hService==NULL) {
+          DisplayMess(hWnd,NO_ACCESS_MONI);
+          PostQuitMessage(0);
+          break;
+      }
+      /* check if running. */
       if (QueryServiceStatus(hService, &svcStatus)) {       
           /* and see if the service is stopped */
           if (SERVICE_STOPPED == svcStatus.dwCurrentState &&
-			  optmode == VDMONISTOP) {
-			  DisplayMess(hWnd,ALREADY_STOP);
-			  PostQuitMessage(0);
-			  break;
-		  }
-		  else if (SERVICE_RUNNING == svcStatus.dwCurrentState &&
-			  optmode == VDMONISTART) {
-			  DisplayMess(hWnd,ALREADY_START);
-			  PostQuitMessage(0);
-			  break;
-		  }
-
-	  }
-	  else {
-		  DisplayMess(hWnd,ERROR_STATUS);
-		  PostQuitMessage(0);
-		  break;
-	  }
+              optmode == VDMONISTOP) {
+              DisplayMess(hWnd,ALREADY_STOP);
+              PostQuitMessage(0);
+              break;
+          }
+          else if (SERVICE_RUNNING == svcStatus.dwCurrentState &&
+              optmode == VDMONISTART) {
+              DisplayMess(hWnd,ALREADY_START);
+              PostQuitMessage(0);
+              break;
+          }
+
+      }
+      else {
+          DisplayMess(hWnd,ERROR_STATUS);
+          PostQuitMessage(0);
+          break;
+      }
 
       /* DialogBoxes Yes/No */
-	  if (optmode == VDMONISTART)
-		  DialogBox(hInst,				     /* current instance         */
-		        "StartYesNo",                /* resource to use          */
-			    hWnd,                        /* parent handle            */
-				StartYesNo);                 /* instance address         */
-	  else if (optmode == VDMONISTOP)
-		  if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-			  DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-
-	
-	  if (optmode == VDMONISTOP)
-		  PostQuitMessage(0);
-	  else {
-		  SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-		  MyTaskBarAddIcon(hWnd);
-	  }
+      if (optmode == VDMONISTART)
+          DialogBox(hInst,                     /* current instance         */
+                "StartYesNo",                /* resource to use          */
+                hWnd,                        /* parent handle            */
+                StartYesNo);                 /* instance address         */
+      else if (optmode == VDMONISTOP)
+          if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
+              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
+
+    
+      if (optmode == VDMONISTOP)
+          PostQuitMessage(0);
+      else {
+          SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+          MyTaskBarAddIcon(hWnd);
+      }
 
       break;   /* WM_CREATE */
 
    case VM_ICON_MESS:
-	   switch ((UINT)lParam) {
-	   case WM_LBUTTONDBLCLK:
-		   StartVdcom(hWnd);
-		   break;
-	   case WM_RBUTTONDOWN:
-	  	   flagdown = 1;
-		   break;
-	   case WM_RBUTTONUP:
-		   if (flagdown == 1) {
-		   flagdown = 2;
-		   /* show a  menu. */
-		   ShowMenu(hWnd);
-		   }
-		   break;
-	   }
-	   break;
+       switch ((UINT)lParam) {
+       case WM_LBUTTONDBLCLK:
+           StartVdcom(hWnd);
+           break;
+       case WM_RBUTTONDOWN:
+             flagdown = 1;
+           break;
+       case WM_RBUTTONUP:
+           if (flagdown == 1) {
+           flagdown = 2;
+           /* show a  menu. */
+           ShowMenu(hWnd);
+           }
+           break;
+       }
+       break;
 
 
    case WM_TIMER:
-	   /* check if service is running */
+       /* check if service is running */
        if (QueryServiceStatus(hService, &svcStatus)) {       
           /* and see if the service is stopped */
-		   if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
-			   MyTaskBarDeleteIcon(hWnd);
-			   PostQuitMessage(0);
-		   }
-		   SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-		   return(0);
-	   }
-	   break;
+           if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
+               MyTaskBarDeleteIcon(hWnd);
+               PostQuitMessage(0);
+           }
+           SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+           return(0);
+       }
+       break;
 
    case VM_START_ICON:
-	   /* add the icon and timer. */
-	   MyTaskBarAddIcon(hWnd);
-	   SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-	   break;
+       /* add the icon and timer. */
+       MyTaskBarAddIcon(hWnd);
+       SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+       break;
 
    case WM_COMMAND:
-	   /* command for the popup menu. */
-	   switch (LOWORD(wParam)) {
-	   case ID_START_VDCOM:
-		   StartVdcom(hWnd);
-		   break;
-	   case ID_STOP_VDMONI:
-    	   if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-			  DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-		   break;
-	   case ID_PROPRETY:
-		   StartVdconf(hWnd);
-		   break;
-
-	   }
-	   break;
+       /* command for the popup menu. */
+       switch (LOWORD(wParam)) {
+       case ID_START_VDCOM:
+           StartVdcom(hWnd);
+           break;
+       case ID_STOP_VDMONI:
+           if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
+              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
+           break;
+       case ID_PROPRETY:
+           StartVdconf(hWnd);
+           break;
+
+       }
+       break;
 
   /*
    *   Clean up.
    */
    case WM_DESTROY:
-	   if (hService!=NULL)
-		   CloseServiceHandle(hService);
-	   if (hManager!=NULL) 
-		   CloseServiceHandle(hManager);
+       if (hService!=NULL)
+           CloseServiceHandle(hService);
+       if (hManager!=NULL) 
+           CloseServiceHandle(hManager);
       PostQuitMessage(0);
       break;
 
@@ -528,12 +529,12 @@ WINAPI WinMain(
     MSG msg;
 
     UNREFERENCED_PARAMETER( lpCmdLine );
-	if (strcmp(lpCmdLine,"start")==0) 
-		optmode = VDMONISTART;
-	else if (strcmp(lpCmdLine,"stop")==0)
-		optmode = VDMONISTOP;
-	else
-		optmode = VDMONICHECK;
+    if (strcmp(lpCmdLine,"start")==0) 
+        optmode = VDMONISTART;
+    else if (strcmp(lpCmdLine,"stop")==0)
+        optmode = VDMONISTOP;
+    else
+        optmode = VDMONICHECK;
 
     if (!hPrevInstance)                  /* Other instances of app running? */
         if (!InitApplication(hInstance)) /* Initialize shared things        */
@@ -575,7 +576,7 @@ BOOL InitApplication(HANDLE hInstance)       /* current instance             */
     /* main window.                                                           */
 
     wc.style = 0;                       /* Class style(s).                    */
-    wc.lpfnWndProc = (WNDPROC)MainWndProc;/* Function to retrieve messages for  */
+    wc.lpfnWndProc = MainWndProc;       /* Function to retrieve messages for  */
                                         /* windows of this class.             */
     wc.cbClsExtra = 0;                  /* No per-class extra data.           */
     wc.cbWndExtra = 0;                  /* No per-window extra data.          */
diff --git a/src/native/nt/moni/vdmonisvc.c b/src/native/nt/moni/vdmonisvc.c
index 3e4c015..4dc7ecf 100644
--- a/src/native/nt/moni/vdmonisvc.c
+++ b/src/native/nt/moni/vdmonisvc.c
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: vdmonisvc.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: vdmonisvc.c 909069 2010-02-11 16:43:36Z mturk $ */
 
 /* jsvc monitor service module:
  * Implements the body of the service.
@@ -68,20 +69,20 @@ VOID AddToMessageLog(LPTSTR lpszMsg)
 {
     TCHAR   szMsg[256];
     HANDLE  hEventSource;
-    LPTSTR  lpszStrings[2];
+    LPCTSTR lpszStrings[2];
 
 
         dwErr = GetLastError();
 
         /* Use event logging to log the error. */
 
-	if (isWindowsNT())
+    if (isWindowsNT())
             hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
-	else
-	    hEventSource = NULL;
+    else
+        hEventSource = NULL;
 
 #ifdef CYGWIN
-	sprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
+    sprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
 #else
         _stprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
 #endif
@@ -101,10 +102,10 @@ VOID AddToMessageLog(LPTSTR lpszMsg)
 
             (VOID) DeregisterEventSource(hEventSource);
         } else {
-	    /* Default to a trace file */
-	    FILE *log;
-	    log = fopen("c:/jakarta-service.log","a+");
-	    if (log != NULL) {
+        /* Default to a trace file */
+        FILE *log;
+        log = fopen("c:/jakarta-service.log","a+");
+        if (log != NULL) {
                 struct tm *newtime;
                 time_t long_time;
 
@@ -112,12 +113,12 @@ VOID AddToMessageLog(LPTSTR lpszMsg)
                 newtime = localtime( &long_time );
 
                 if (dwErr)
-		    fprintf(log,"%.24s:%s: %s\n",asctime(newtime),szMsg, lpszMsg);
+            fprintf(log,"%.24s:%s: %s\n",asctime(newtime),szMsg, lpszMsg);
                 else
-		    fprintf(log,"%.24s: %s\n",asctime(newtime), lpszMsg);
-		fclose(log);
-	    }
-	}
+            fprintf(log,"%.24s: %s\n",asctime(newtime), lpszMsg);
+        fclose(log);
+        }
+    }
 }
 
 /*
@@ -409,7 +410,7 @@ int ReportManager(int event)
  */
 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
 {
-char	Data[512];
+char    Data[512];
 DWORD   qreturn;
 STARTUPINFO StartupInfo;
 PROCESS_INFORMATION ProcessInformation;
@@ -628,9 +629,9 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
                                                    service_ctrl);
 
     if (!sshStatusHandle) {
-	AddToMessageLog(TEXT("service_main:RegisterServiceCtrlHandler failed"));
+    AddToMessageLog(TEXT("service_main:RegisterServiceCtrlHandler failed"));
         goto cleanup;
-	}
+    }
 
     /* SERVICE_STATUS members that don't change in example */
     ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
@@ -639,9 +640,9 @@ void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
 
     /* report the status to the service control manager. */
     if (!ReportStatusToSCMgr(SERVICE_START_PENDING,NO_ERROR,3000))   {
-	AddToMessageLog(TEXT("service_main:ReportStatusToSCMgr failed"));
+    AddToMessageLog(TEXT("service_main:ReportStatusToSCMgr failed"));
         goto cleanup;
-	}
+    }
 
 
     ServiceStart( dwArgc, lpszArgv );
@@ -692,16 +693,16 @@ void _CRTAPI1 main(int argc, char **argv)
         { NULL, NULL }
     };
 
-	AddToMessageLog(TEXT("StartService starting"));
-	if (isWindowsNT()) {
+    AddToMessageLog(TEXT("StartService starting"));
+    if (isWindowsNT()) {
             if (!StartServiceCtrlDispatcher(dispatchTable)) {
-		AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
-		return;
-	    }
-	    AddToMessageLog(TEXT("StartService started"));
-	} else {
-	    Windows9xServiceCtrlHandler();
-	    ServiceStart(argc,argv);
-	    AddToMessageLog(TEXT("StartService stopped"));
-	}
+        AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
+        return;
+        }
+        AddToMessageLog(TEXT("StartService started"));
+    } else {
+        Windows9xServiceCtrlHandler();
+        ServiceStart(argc,argv);
+        AddToMessageLog(TEXT("StartService stopped"));
+    }
 }
diff --git a/src/native/nt/procrun/LICENSE b/src/native/nt/procrun/LICENSE
deleted file mode 100644
index 876754a..0000000
--- a/src/native/nt/procrun/LICENSE
+++ /dev/null
@@ -1,287 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
-
-
-APACHE PORTABLE RUNTIME SUBCOMPONENTS: 
-
-The Apache Portable Runtime includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses. 
-
-For the include\apr_md5.h component: 
-/*
- * This is work is derived from material Copyright RSA Data Security, Inc.
- *
- * The RSA copyright statement and Licence for that original material is
- * included below. This is followed by the Apache copyright statement and
- * licence for the modifications made to that material.
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-   rights reserved.
-
-   License to copy and use this software is granted provided that it
-   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-   Algorithm" in all material mentioning or referencing this software
-   or this function.
-
-   License is also granted to make and use derivative works provided
-   that such works are identified as "derived from the RSA Data
-   Security, Inc. MD5 Message-Digest Algorithm" in all material
-   mentioning or referencing the derived work.
-
-   RSA Data Security, Inc. makes no representations concerning either
-   the merchantability of this software or the suitability of this
-   software for any particular purpose. It is provided "as is"
-   without express or implied warranty of any kind.
-
-   These notices must be retained in any copies of any part of this
-   documentation and/or software.
- */
-
-For the passwd\apr_md5.c component:
-
-/*
- * This is work is derived from material Copyright RSA Data Security, Inc.
- *
- * The RSA copyright statement and Licence for that original material is
- * included below. This is followed by the Apache copyright statement and
- * licence for the modifications made to that material.
- */
-
-/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-   rights reserved.
-
-   License to copy and use this software is granted provided that it
-   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-   Algorithm" in all material mentioning or referencing this software
-   or this function.
-
-   License is also granted to make and use derivative works provided
-   that such works are identified as "derived from the RSA Data
-   Security, Inc. MD5 Message-Digest Algorithm" in all material
-   mentioning or referencing the derived work.
-
-   RSA Data Security, Inc. makes no representations concerning either
-   the merchantability of this software or the suitability of this
-   software for any particular purpose. It is provided "as is"
-   without express or implied warranty of any kind.
-
-   These notices must be retained in any copies of any part of this
-   documentation and/or software.
- */
-/*
- * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
- * MD5 crypt() function, which is licenced as follows:
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk at login.dknet.dk> wrote this file.  As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return.  Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- */
-
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.c b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.c
deleted file mode 100644
index 170f4d1..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.c
+++ /dev/null
@@ -1,1705 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "apxwin.h"
-#include "apsvcmgr.h"
-
-LPAPXGUISTORE _gui_store  = NULL;
-HWND          hWndToolbar = NULL;
-HWND          hWndList    = NULL;
-HWND          hWndListHdr = NULL;
-WNDPROC       ListViewWinMain;
-WNDPROC       ListViewWinHead;
-HWND          hWndStatus  = NULL;
-HWND          hWndModal   = NULL;
-LVHITTESTINFO lvLastHit;
-int           lvHitItem = -1;
-/* Toolbar buttons 
- * TODO: Localize...
- */
-TBBUTTON tbButtons[] = {
-    { 4, IDAM_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
-    { 5, IDAM_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
-    { 7, IDMS_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
-    {16, IDMV_FILTER, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
-    { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0},
-    { 8, IDAM_DELETE, 0, TBSTYLE_BUTTON, 0, 0},
-    { 6, IDMS_PROPERTIES, 0, TBSTYLE_BUTTON, 0, 0},
-    { 0, IDMS_START, 0, TBSTYLE_BUTTON, 0, 0},
-    { 1, IDMS_STOP, 0, TBSTYLE_BUTTON, 0, 0},
-    { 2, IDMS_PAUSE, 0, TBSTYLE_BUTTON, 0, 0},
-    { 3, IDMS_RESTART, 0, TBSTYLE_BUTTON, 0, 0},
-    { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0},
-    {11, IDMH_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}
-};
-
-APXLVITEM lvItems[] = {
-    { 0, FALSE, 80,  80, LVCFMT_LEFT, TEXT("Status") },
-    { 0, TRUE, 120, 120, LVCFMT_LEFT, TEXT("Name") },
-    { 0, TRUE, 240, 240, LVCFMT_LEFT, TEXT("Description") },
-    { 0, TRUE,  80,  80, LVCFMT_LEFT, TEXT("Startup Type") },
-    { 0, TRUE,  80,  80, LVCFMT_LEFT, TEXT("Log On As") },
-    { 0, FALSE, 80,  80, LVCFMT_RIGHT, TEXT("Process Id") },
-    { 0, FALSE,  0,  80, LVCFMT_RIGHT, TEXT("# Handles") }
-};
-
-#define NUMTBBUTTONS  (sizeof(tbButtons) / sizeof(tbButtons[0]))
-#define NUMLVITEMS    (sizeof(lvItems) / sizeof(lvItems[0]))
-
-#define APSVCMGR_CLASS      TEXT("APSVCMGR")
-
-/* Display only Started/Paused status */
-#define STAT_STARTED        TEXT("Started")
-#define STAT_PAUSED         TEXT("Paused")
-#define STAT_STOPPED        TEXT("Stopped")
-#define STAT_DISABLED       TEXT("Disabled")
-#define STAT_NONE           TEXT("")
-#define STAT_SYSTEM         L"LocalSystem"
-
-#define START_AUTO           L"Automatic"
-#define START_MANUAL         L"Manual"
-#define START_DISABLED       L"Disabled"
-#define START_BOOT           L"Boot"
-#define START_SYSTEM         L"SystemInit"
-
-#define SFILT_KEY            L"Filters"
-#define SFILT_INAME          L"IncludeName"
-#define SFILT_XNAME          L"ExcludeName"
-#define SFILT_ISIMG          L"IncludeImage"
-#define SFILT_XSIMG          L"ExcludeImage"
-
-#define DISPLAY_KEY          "Display"
-#define DISPLAY_STATE        "GuiState"
-#define EMPTY_PASSWORD       L"               "
-#define EXPORT_TITLE         "Export Services list"
-#define EXPORT_EXTFILT       "Comma separated (*.csv)\0*.csv\0Tab Delimited (*.tab)\0*.txt\0All Files(*.*)\0*.*\0"
-
-
-#define WM_TIMER_REFRESH    10
-#define WM_USER_LREFRESH    WM_USER + 1
-#define UPD_FAST            10000
-#define UPD_SLOW            60000
-
-static int _toolbarHeight = 0;
-static int _statbarHeight = 0;
-static int _currentTimer  = IDMV_UPAUSED;
-static int _currentLitem  = 0;
-static int _listviewCols  = 0;
-static int _sortOrder     = 1;
-static int _sortColumn    = 1;
-static LPAPXSERVENTRY     _currentEntry = NULL;
-
-static LPWSTR   _filterIname    = NULL;
-static LPWSTR   _filterXname    = NULL;
-static LPWSTR   _filterIimage   = NULL;
-static LPWSTR   _filterXimage   = NULL;
-static LPSTR    _exportFilename = NULL;
-static DWORD    _exportIndex    = 0;
-/* Main application pool */
-APXHANDLE hPool     = NULL;
-APXHANDLE hService  = NULL;
-APXHANDLE hRegistry = NULL;
-
-/* Service browse callback declaration */
-BOOL ServiceCallback(APXHANDLE hObject, UINT uMsg,
-                     WPARAM wParam, LPARAM lParam);
-
-int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
-{
-    WCHAR  szA[1024] = {0};
-    WCHAR  szB[1024] = {0};
-    int    rc;
-    ListView_GetItemTextW(hWndList, (INT)lParam1, _sortColumn, szA, 1023);
-    ListView_GetItemTextW(hWndList, (INT)lParam2, _sortColumn, szB, 1023);
-    rc = lstrcmpW(szA, szB);
-
-    return rc * _sortOrder;
-}
-
-void DestroyListView()
-{
-    int i, x;
-    
-    x = ListView_GetItemCount(hWndList);
-    if (x > 0) {
-        LV_ITEM lvI;
-        lvI.mask = LVIF_PARAM;
-        for (i = 0; i < x; i++) {
-            lvI.iItem  = i;
-            lvI.lParam = 0;
-            ListView_GetItem(hWndList, &lvI);
-            if (lvI.lParam) {
-                LPAPXSERVENTRY lpEnt = (LPAPXSERVENTRY)lvI.lParam;
-                apxFree(lpEnt->lpConfig);
-                apxFree(lpEnt);
-            }
-        }
-    }
-    ListView_DeleteAllItems(hWndList);
-    _currentLitem = 0;
-}
-
-BOOL ExportListView(LPCSTR szFileName, DWORD dwIndex)
-{
-    int i, j, x;
-    CHAR szI[SIZ_DESLEN];
-    HANDLE hFile;
-    DWORD  dwWriten;
-    LPSTR  szD;
-    hFile = CreateFileA(szFileName, 
-                        GENERIC_WRITE,
-                        0,
-                        NULL,
-                        CREATE_ALWAYS,
-                        FILE_ATTRIBUTE_NORMAL,
-                        NULL);
-    if (IS_INVALID_HANDLE(hFile))
-        return FALSE;
-    x = ListView_GetItemCount(hWndList);
-    if (x > 0) {
-        LV_ITEM lvI;
-        lvI.mask = LVIF_PARAM;
-
-        if (dwIndex == 1)
-            szD = ";";
-        else
-            szD = "\t";
-        WriteFile(hFile, "ServiceName", sizeof("ServiceName") - 1, &dwWriten, NULL);
-        for (i = 1; i <  NUMLVITEMS; i++) {
-            if (lvItems[i].iWidth) {
-#ifdef _UNICODE
-                WideToAscii(lvItems[i].szLabel, szI);
-#else
-                lstrcpyA(szI, lvItems[i].szLabel);
-#endif
-                WriteFile(hFile, szD, 1, &dwWriten, NULL);
-                WriteFile(hFile, szI, lstrlenA(szI), &dwWriten, NULL);
-            }
-        }
-        WriteFile(hFile, "\r\n", 2, &dwWriten, NULL);           
-        for (i = 0; i < x; i++) {
-            lvI.iItem  = i;
-            lvI.lParam = 0;
-            ListView_GetItem(hWndList, &lvI);
-            if (lvI.lParam) {
-                LPAPXSERVENTRY lpEnt = (LPAPXSERVENTRY)lvI.lParam;
-                WideToAscii(lpEnt->szServiceName, szI);
-                WriteFile(hFile, szI, lstrlenA(szI), &dwWriten, NULL);
-                WriteFile(hFile, szD, 1, &dwWriten, NULL);
-                
-            }
-            for (j = 1; j < _listviewCols - 1; j++) {
-                szI[0] = '\0';
-                ListView_GetItemTextA(hWndList, i, j, szI, SIZ_DESMAX);
-                if (szI[0])
-                    WriteFile(hFile, szI, lstrlenA(szI), &dwWriten, NULL);
-                WriteFile(hFile, szD, 1, &dwWriten, NULL);
-            }
-            szI[0] = '\0';
-            ListView_GetItemTextA(hWndList, i, j, szI, SIZ_DESMAX);
-            if (szI[0])
-                WriteFile(hFile, szI, lstrlenA(szI), &dwWriten, NULL);
-            WriteFile(hFile, "\r\n", 2, &dwWriten, NULL);           
-        }
-    }  
-    CloseHandle(hFile);
-    return TRUE;
-}
-
-void RefreshServices(int iRefresh)
-{
-    int prev = _currentLitem;
-    _currentLitem = 0;
-    apxServiceBrowse(hService, _filterIname, _filterIimage,
-                     _filterXname, _filterXimage, WM_USER+1+iRefresh,
-                     ServiceCallback, NULL);
-    ListView_SortItemsEx(hWndList, CompareFunc, NULL);
-    if (prev > _currentLitem) {
-        DestroyListView();
-        apxServiceBrowse(hService, _filterIname, _filterIimage,
-                         _filterXname, _filterXimage, WM_USER+1,
-                         ServiceCallback, NULL);
-        ListView_SortItemsEx(hWndList, CompareFunc, NULL);
-    }
-    if ((lvHitItem = ListView_GetSelectionMark(hWndList)) >= 0) {
-#if 0
-        /* Ensure that the selected is visible */
-        ListView_EnsureVisible(hWndList,lvHitItem, FALSE);
-#endif
-        PostMessage(hWndList, WM_USER_LREFRESH, 0, 0);
-    }
-}
-
-void RestoreRefreshTimer()
-{
-    if (_currentTimer == IDMV_UFAST)
-        SetTimer(_gui_store->hMainWnd, WM_TIMER_REFRESH, UPD_FAST, NULL); 
-    else if (_currentTimer == IDMV_USLOW)
-        SetTimer(_gui_store->hMainWnd, WM_TIMER_REFRESH, UPD_SLOW, NULL); 
-    else
-        KillTimer(_gui_store->hMainWnd, WM_TIMER_REFRESH);
-}
-
-/* wParam progress dialog handle
- */
-static BOOL __startServiceCallback(APXHANDLE hObject, UINT uMsg,
-                                   WPARAM wParam, LPARAM lParam)
-{
-    HWND hDlg = (HWND)hObject;
-    APXHANDLE hSrv;
-    switch (uMsg) {
-        case WM_USER+1:
-            hDlg = (HWND)lParam;
-            hSrv = apxCreateService(hPool, SC_MANAGER_CONNECT, FALSE);
-            if (!hSrv) {
-                EndDialog(hDlg, IDOK);
-                PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                            MAKEWPARAM(IDMS_REFRESH, 0), 0);
-                return FALSE;
-            }
-            if (!apxServiceOpen(hSrv, _currentEntry->szServiceName,
-                                GENERIC_READ | GENERIC_EXECUTE)) {
-                apxCloseHandle(hSrv);
-                EndDialog(hDlg, IDOK);
-                PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                            MAKEWPARAM(IDMS_REFRESH, 0), 0);
-                return FALSE;
-            }
-            if (apxServiceControl(hSrv, SERVICE_CONTROL_CONTINUE, WM_USER+2,
-                                  __startServiceCallback, hDlg)) {
-                _currentEntry->stServiceStatus.dwCurrentState = SERVICE_RUNNING;
-                _currentEntry->stStatusProcess.dwCurrentState = SERVICE_RUNNING;
-                                
-            }
-            apxCloseHandle(hSrv);
-            EndDialog(hDlg, IDOK);
-            PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                        MAKEWPARAM(IDMS_REFRESH, 0), 0);
-        break;
-        case WM_USER+2:
-            SendMessage(hDlg, WM_USER+1, 0, 0);
-            Sleep(500);
-            break;
-    }
-    return TRUE;
-}
-
-static BOOL __stopServiceCallback(APXHANDLE hObject, UINT uMsg,
-                                   WPARAM wParam, LPARAM lParam)
-{
-    HWND hDlg = (HWND)hObject;
-    APXHANDLE hSrv;
-    switch (uMsg) {
-        case WM_USER+1:
-            hDlg = (HWND)lParam;
-            hSrv = apxCreateService(hPool, SC_MANAGER_CONNECT, FALSE);
-            if (!hSrv)
-                return FALSE;
-            if (!apxServiceOpen(hSrv, _currentEntry->szServiceName,
-                                GENERIC_READ | GENERIC_EXECUTE)) {
-                apxCloseHandle(hSrv);
-                return FALSE;
-            }
-            if (apxServiceControl(hSrv, SERVICE_CONTROL_STOP, WM_USER+2,
-                                  __stopServiceCallback, hDlg)) {
-            }
-            apxCloseHandle(hSrv);
-            EndDialog(hDlg, IDOK);
-            PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                        MAKEWPARAM(IDMS_REFRESH, 0), 0);
-        break;
-        case WM_USER+2:
-            if (wParam == 4)
-                AplCopyMemory(&_currentEntry->stServiceStatus,
-                              (LPVOID)lParam, sizeof(SERVICE_STATUS));
-            SendMessage(hDlg, WM_USER+1, 0, 0);
-            Sleep(100);
-            break;
-    }
-    return TRUE;
-}
-
-static BOOL __restartServiceCallback(APXHANDLE hObject, UINT uMsg,
-                                     WPARAM wParam, LPARAM lParam)
-{
-    HWND hDlg = (HWND)hObject;
-    APXHANDLE hSrv;
-    switch (uMsg) {
-        case WM_USER+1:
-            hDlg = (HWND)lParam;
-            hSrv = apxCreateService(hPool, SC_MANAGER_CONNECT, FALSE);
-            if (!hSrv)
-                return FALSE;
-            if (!apxServiceOpen(hSrv, _currentEntry->szServiceName,
-                                GENERIC_READ | GENERIC_EXECUTE)) {
-                apxCloseHandle(hSrv);
-                return FALSE;
-            }
-            /* TODO: use 128 as controll code */
-            if (apxServiceControl(hSrv, 128, WM_USER+2,
-                                  __restartServiceCallback, hDlg)) {
-                                
-            }
-            apxCloseHandle(hSrv);
-            EndDialog(hDlg, IDOK);
-            PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                        MAKEWPARAM(IDMS_REFRESH, 0), 0);
-        break;
-        case WM_USER+2:
-            if (wParam == 4)
-                AplCopyMemory(&_currentEntry->stServiceStatus,
-                              (LPVOID)lParam, sizeof(SERVICE_STATUS));
-
-            SendMessage(hDlg, WM_USER+1, 0, 0);
-            Sleep(100);
-            break;
-    }
-    return TRUE;
-}
-
-static BOOL __pauseServiceCallback(APXHANDLE hObject, UINT uMsg,
-                                   WPARAM wParam, LPARAM lParam)
-{
-    HWND hDlg = (HWND)hObject;
-    APXHANDLE hSrv;
-    switch (uMsg) {
-        case WM_USER+1:
-            hDlg = (HWND)lParam;
-            hSrv = apxCreateService(hPool, SC_MANAGER_CONNECT, FALSE);
-            if (!hSrv)
-                return FALSE;
-            if (!apxServiceOpen(hSrv, _currentEntry->szServiceName,
-                                GENERIC_READ | GENERIC_EXECUTE)) {
-                apxCloseHandle(hSrv);
-                return FALSE;
-            }
-            if (apxServiceControl(hSrv, SERVICE_CONTROL_PAUSE, WM_USER+2,
-                                  __pauseServiceCallback, hDlg)) {
-            }
-            apxCloseHandle(hSrv);
-            EndDialog(hDlg, IDOK);
-            PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                        MAKEWPARAM(IDMS_REFRESH, 0), 0);
-        break;
-        case WM_USER+2:
-            if (wParam == 4)
-                AplCopyMemory(&_currentEntry->stServiceStatus,
-                             (LPVOID)lParam, sizeof(SERVICE_STATUS));
-            SendMessage(hDlg, WM_USER+1, 0, 0);
-            Sleep(100);
-            break;
-    }
-    return TRUE;
-}
-
-LRESULT CALLBACK ListViewMainSubclass(HWND hWnd, UINT uMsg, WPARAM wParam,
-                                      LPARAM lParam)
-{
-    static POINTS  mouseClick;
-
-    HMENU         hMenu = NULL;
-    HMENU         hLoad = NULL;
-    HMENU         hMain = NULL;
-    switch (uMsg) {
-        case WM_LBUTTONDOWN:
-        case WM_RBUTTONDOWN:
-        case WM_LBUTTONDBLCLK:
-            mouseClick = MAKEPOINTS(lParam);
-            lvLastHit.pt.x = mouseClick.x;
-            lvLastHit.pt.y = mouseClick.y;
-        case WM_USER_LREFRESH:
-            lvHitItem = ListView_HitTest(hWndList, &lvLastHit);
-            _currentEntry = NULL;
-            hMain = GetMenu(_gui_store->hMainWnd);
-            CallWindowProc(ListViewWinMain, hWnd, uMsg, wParam, lParam);
-            EnableMenuItem(hMain, IDMS_START, MF_BYCOMMAND | MF_GRAYED);
-            EnableMenuItem(hMain, IDMS_STOP, MF_BYCOMMAND | MF_GRAYED);
-            EnableMenuItem(hMain, IDMS_PAUSE, MF_BYCOMMAND | MF_GRAYED);
-            EnableMenuItem(hMain, IDMS_RESTART, MF_BYCOMMAND | MF_GRAYED);
-            EnableMenuItem(hMain, IDAM_DELETE, MF_BYCOMMAND | MF_GRAYED);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_START, FALSE);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_STOP, FALSE);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_PAUSE, FALSE);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_RESTART, FALSE);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_PROPERTIES, FALSE);
-            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDAM_DELETE, FALSE);
-            EnableMenuItem(hMain, IDMS_PROPERTIES, MF_BYCOMMAND | MF_GRAYED);
-
-            if (lvHitItem >= 0) {
-                LV_ITEM lvI;
-                lvI.mask = LVIF_PARAM;
-                lvI.iItem  = lvHitItem;
-                lvI.lParam = 0;
-                ListView_GetItem(hWndList, &lvI);
-                if (lvI.lParam) {
-                    _currentEntry = (LPAPXSERVENTRY)lvI.lParam;
-                    SendMessageW(hWndStatus, WM_SETTEXT, 0, (LPARAM)_currentEntry->szServiceDescription);
-                    if (uMsg == WM_RBUTTONDOWN) {
-                        hLoad = LoadMenu(_gui_store->hInstance,
-                                         MAKEINTRESOURCE(IDM_POPUPMENU));
-
-                        hMenu = GetSubMenu(hLoad, 0);
-                    }
-                    switch (_currentEntry->stServiceStatus.dwCurrentState) {
-                        case SERVICE_RUNNING:
-                            if (_currentEntry->stServiceStatus.dwControlsAccepted & SERVICE_ACCEPT_STOP) {
-                                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_STOP, TRUE);
-                                EnableMenuItem(hMain, IDMS_STOP, MF_BYCOMMAND | MF_ENABLED);
-                                if (hMenu)
-                                    EnableMenuItem(hMenu, IDMS_STOP, MF_BYCOMMAND | MF_ENABLED);
-                            }
-                            if (_currentEntry->stServiceStatus.dwControlsAccepted & SERVICE_ACCEPT_PAUSE_CONTINUE) {
-                                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_PAUSE, TRUE);
-                                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_RESTART, TRUE);
-                                EnableMenuItem(hMain, IDMS_PAUSE, MF_BYCOMMAND | MF_ENABLED);
-                                EnableMenuItem(hMain, IDMS_RESTART, MF_BYCOMMAND | MF_ENABLED);
-                                if (hMenu) {
-                                    EnableMenuItem(hMenu, IDMS_PAUSE, MF_BYCOMMAND | MF_ENABLED);
-                                    EnableMenuItem(hMenu, IDMS_RESTART, MF_BYCOMMAND | MF_ENABLED);
-                                }
-                            }                            
-                        break;
-                        case SERVICE_PAUSED:
-                            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_RESTART, TRUE);
-                            SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_START, TRUE);
-                            EnableMenuItem(hMain, IDMS_RESTART, MF_BYCOMMAND | MF_ENABLED);
-                            EnableMenuItem(hMain, IDMS_START, MF_BYCOMMAND | MF_ENABLED);
-                            if (hMenu) {
-                                EnableMenuItem(hMenu, IDMS_RESTART, MF_BYCOMMAND | MF_ENABLED);
-                                EnableMenuItem(hMenu, IDMS_START, MF_BYCOMMAND | MF_ENABLED);
-                            }
-                        break;
-                        case SERVICE_STOPPED:
-                            if (_currentEntry->lpConfig->dwStartType != SERVICE_DISABLED) {
-                                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_START, TRUE);
-                                EnableMenuItem(hMain, IDMS_START, MF_BYCOMMAND | MF_ENABLED);
-                                if (hMenu)
-                                    EnableMenuItem(hMenu, IDMS_START, MF_BYCOMMAND | MF_ENABLED);
-                            }
-                        break;
-                        default:
-
-                        break;
-                    }
-                }
-                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDMS_PROPERTIES, TRUE);
-                EnableMenuItem(hMain, IDMS_PROPERTIES, MF_BYCOMMAND | MF_ENABLED);
-                SendMessage(hWndToolbar, TB_ENABLEBUTTON, IDAM_DELETE, TRUE);
-                EnableMenuItem(hMain, IDAM_DELETE, MF_BYCOMMAND | MF_ENABLED);
-                SetMenuDefaultItem(GetSubMenu(hMain, 1), IDMS_PROPERTIES, FALSE);
-
-                if (hMenu) {
-                    POINT pt; 
-                    EnableMenuItem(hMenu, IDMS_PROPERTIES, MF_BYCOMMAND | MF_ENABLED);
-                    SetMenuDefaultItem(hMenu, IDMS_PROPERTIES, FALSE);
-
-                    GetCursorPos(&pt); 
-                    TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, 
-                        pt.x, pt.y, 0, _gui_store->hMainWnd, NULL);
-                    DestroyMenu(hLoad);
-                    hMenu = NULL;
-                    hLoad = NULL;
-                }
-                /* Post the Properties message to main window */
-                if (uMsg == WM_LBUTTONDBLCLK) {
-                    PostMessage(_gui_store->hMainWnd, WM_COMMAND, 
-                                MAKEWPARAM(IDMS_PROPERTIES, 0), 0);
-                }
-            }
-            else {
-                SetMenuDefaultItem(GetSubMenu(hMain, 1), -1, FALSE);
-                SendMessageW(hWndStatus, WM_SETTEXT, 0, (LPARAM)(L""));
-            }
-            return TRUE;
-        break;
-    }
-    return CallWindowProc(ListViewWinMain, hWnd, uMsg, wParam, lParam);
-}
-
-LRESULT CALLBACK ListViewHeadSubclass(HWND hWnd, UINT uMsg, WPARAM wParam,
-                                      LPARAM lParam)
-{
-    DWORD     i, n = 0;
-
-    switch (uMsg) {
-        case WM_LBUTTONUP:
-            CallWindowProc(ListViewWinHead, hWnd, uMsg, wParam, lParam);
-            for (i = 0; i < NUMLVITEMS; i++) {
-                if (lvItems[i].iWidth) {
-                    lvItems[i].iWidth = ListView_GetColumnWidth(hWndList, n++);
-                }
-            }
-            return TRUE;
-        break;
-
-    }
-    return CallWindowProc(ListViewWinHead, hWnd, uMsg, wParam, lParam);
-}
-
-HWND CreateServiceList(HWND hWndParent)
-{
-    HWND        hWndList;
-    RECT        rc;
-    LV_COLUMN   lvC;
-    DWORD       i;
-    HBITMAP     hStatBmp;
-    HIMAGELIST  hStatImg;
-    DWORD       dwStyle;
-
-    dwStyle =   WS_TABSTOP | 
-                WS_CHILD | 
-                WS_VISIBLE |
-                LVS_SINGLESEL |
-                LVS_REPORT;
-
-    GetWindowRect(hWndToolbar, &rc);
-    _toolbarHeight = rc.bottom - rc.top;
-    GetWindowRect(hWndStatus, &rc);
-    _statbarHeight = rc.bottom - rc.top;
-    /* Get the size and position of the parent window. */
-    GetClientRect(hWndParent, &rc);
-
-    /* Create the list view window */
-    hWndList = CreateWindowEx(WS_EX_CLIENTEDGE,
-                              WC_LISTVIEW, TEXT(""), 
-                              dwStyle,
-                              0, _toolbarHeight, 
-                              rc.right - rc.left, 
-                              rc.bottom - rc.top - _toolbarHeight - _statbarHeight,
-                              hWndParent,
-                              (HMENU)IDC_LISTVIEW,
-                              _gui_store->hInstance, NULL);
-    if (hWndList == NULL)
-        return NULL;
-    GetClientRect(hWndList, &rc);
-    hStatImg = ImageList_Create(16, 16, ILC_COLOR4, 0, 16);
-    hStatBmp = LoadImage(GetModuleHandleA(NULL), MAKEINTRESOURCE(IDB_SSTATUS),
-                         IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
-
-    ImageList_Add(hStatImg, hStatBmp, NULL);
-    DeleteObject(hStatBmp);
-
-    ListView_SetImageList(hWndList, hStatImg, LVSIL_SMALL);
-    lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
-    _listviewCols = 0;
-    for (i = 0; i < NUMLVITEMS; i++) {
-        lvC.iSubItem = i;
-        lvC.cx       = lvItems[i].iWidth;
-        lvC.pszText  = lvItems[i].szLabel;
-        lvC.fmt      = lvItems[i].iFmt;
-        if (lvItems[i].iWidth > 0) {
-            ListView_InsertColumn(hWndList, i, &lvC ); 
-            _listviewCols++;
-        }
-    }
-#ifdef LVS_EX_FULLROWSELECT
-    ListView_SetExtendedListViewStyleEx(hWndList, 0,
-                LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
-#endif 
-    hWndListHdr = ListView_GetHeader(hWndList);
-    /* Sub-class */
-    ListViewWinMain = (WNDPROC)((SIZE_T)SetWindowLong(hWndList, GWLP_WNDPROC, 
-                                                      (LONG)((SIZE_T)ListViewMainSubclass))); 
-
-    ListViewWinHead = (WNDPROC)((SIZE_T)SetWindowLong(hWndListHdr, GWLP_WNDPROC, 
-                                                      (LONG)((SIZE_T)ListViewHeadSubclass))); 
-
-
-    return hWndList;
-}
-
-static DWORD  _propertyChanged;
-/* Service property pages */
-void CALLBACK __propertyCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam)
-{
-    switch(uMsg) {
-        case PSCB_PRECREATE:       
-           {
-                LPDLGTEMPLATE  lpTemplate = (LPDLGTEMPLATE)lParam;
-                if (!(lpTemplate->style & WS_SYSMENU))
-                    lpTemplate->style |= WS_SYSMENU;
-                apxCenterWindow(hwndPropSheet, _gui_store->hMainWnd);
-                _propertyChanged = 0;
-            }
-        break;
-        case PSCB_INITIALIZED:
-        break;
-
-    }
-}
-
-BOOL __generalPropertySave(HWND hDlg) 
-{
-    APXHANDLE hSrv;
-    WCHAR szN[256];
-    WCHAR szD[256];
-    DWORD dwStartType = SERVICE_NO_CHANGE;
-    int i;
-
-    if (!(TST_BIT_FLAG(_propertyChanged, 1)))
-        return TRUE;
-    CLR_BIT_FLAG(_propertyChanged, 1);
-
-    if (!(hSrv = apxCreateService(hPool, SC_MANAGER_CREATE_SERVICE, FALSE)))
-        return FALSE;
-    if (!apxServiceOpen(hSrv, _currentEntry->szServiceName, SERVICE_ALL_ACCESS)) {
-        apxCloseHandle(hSrv);
-        return FALSE;
-    }
-    GetDlgItemTextW(hDlg, IDC_PPSGDISP, szN, 255);
-    GetDlgItemTextW(hDlg, IDC_PPSGDESC, szD, 1023);
-    i = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PPSGCMBST));
-    if (i == 0)
-        dwStartType = SERVICE_AUTO_START;
-    else if (i == 1)
-        dwStartType = SERVICE_DEMAND_START;
-    else if (i == 2)
-        dwStartType = SERVICE_DISABLED;
-    apxServiceSetNames(hSrv, NULL, szN, szD, NULL, NULL);
-    apxServiceSetOptions(hSrv, SERVICE_NO_CHANGE, dwStartType, SERVICE_NO_CHANGE);
-
-    apxCloseHandle(hSrv);
-    if (!(TST_BIT_FLAG(_propertyChanged, 2)))
-        PostMessage(_gui_store->hMainWnd, WM_COMMAND, MAKEWPARAM(IDMS_REFRESH, 0), 0);
-
-    return TRUE;
-}
-
-BOOL __generalLogonSave(HWND hDlg) 
-{
-    APXHANDLE hSrv;
-    WCHAR szU[64];
-    WCHAR szP[64];
-    WCHAR szC[64];
-    DWORD dwStartType = SERVICE_NO_CHANGE;
-
-    if (!(TST_BIT_FLAG(_propertyChanged, 2)))
-        return TRUE;
-    CLR_BIT_FLAG(_propertyChanged, 2);
-
-    if (!(hSrv = apxCreateService(hPool, SC_MANAGER_CREATE_SERVICE, FALSE)))
-        return FALSE;
-    if (!apxServiceOpen(hSrv, _currentEntry->szServiceName, SERVICE_ALL_ACCESS)) {
-        apxCloseHandle(hSrv);
-        return FALSE;
-    }
-    GetDlgItemTextW(hDlg, IDC_PPSLUSER,  szU, 63);
-    GetDlgItemTextW(hDlg, IDC_PPSLPASS,  szP, 63);
-    GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, 63);
-    
-    if (lstrlenW(szU) && lstrcmpiW(szU, STAT_SYSTEM)) {
-        if (szP[0] != L' ' &&  szC[0] != L' ' && !lstrcmpW(szP, szC))
-            apxServiceSetNames(hSrv, NULL, NULL, NULL, szU, szP);
-        else {
-            MessageBoxW(hDlg, apxLoadResourceW(IDS_VALIDPASS, 0),
-                        apxLoadResourceW(IDS_APPLICATION, 1),
-                        MB_OK | MB_ICONSTOP);
-            apxCloseHandle(hSrv);
-            return FALSE;
-        }
-    }             
-    else {
-        if (IsDlgButtonChecked(hDlg, IDC_PPSLID) == BST_CHECKED)
-            apxServiceSetOptions(hSrv,
-                _currentEntry->stServiceStatus.dwServiceType | SERVICE_INTERACTIVE_PROCESS,
-                SERVICE_NO_CHANGE, SERVICE_NO_CHANGE);
-        else
-            apxServiceSetOptions(hSrv,
-                _currentEntry->stServiceStatus.dwServiceType & ~SERVICE_INTERACTIVE_PROCESS,
-                SERVICE_NO_CHANGE, SERVICE_NO_CHANGE);
-    }
-    apxCloseHandle(hSrv);
-    if (!(TST_BIT_FLAG(_propertyChanged, 1)))
-        PostMessage(_gui_store->hMainWnd, WM_COMMAND, MAKEWPARAM(IDMS_REFRESH, 0), 0);
-    return TRUE;
-}
-
-void __generalPropertyRefresh(HWND hDlg)
-{
-    Button_Enable(GetDlgItem(hDlg, IDC_PPSGSTART), FALSE);
-    Button_Enable(GetDlgItem(hDlg, IDC_PPSGSTOP), FALSE);
-    Button_Enable(GetDlgItem(hDlg, IDC_PPSGPAUSE), FALSE);
-    Button_Enable(GetDlgItem(hDlg, IDC_PPSGRESTART), FALSE);
-    switch (_currentEntry->stServiceStatus.dwCurrentState) {
-        case SERVICE_RUNNING:
-            if (_currentEntry->stServiceStatus.dwControlsAccepted & SERVICE_ACCEPT_STOP ||
-                _currentEntry->lpConfig->dwStartType != SERVICE_DISABLED) {
-                Button_Enable(GetDlgItem(hDlg, IDC_PPSGSTOP), TRUE);
-                SetDlgItemText(hDlg, IDC_PPSGSTATUS, STAT_STARTED);
-            }
-            else
-                SetDlgItemText(hDlg, IDC_PPSGSTATUS, STAT_DISABLED);
-            if (_currentEntry->stServiceStatus.dwControlsAccepted & SERVICE_ACCEPT_PAUSE_CONTINUE) {
-                Button_Enable(GetDlgItem(hDlg, IDC_PPSGPAUSE), TRUE);
-                Button_Enable(GetDlgItem(hDlg, IDC_PPSGRESTART), TRUE);
-            }
-        break;
-        case SERVICE_PAUSED:
-            Button_Enable(GetDlgItem(hDlg, IDC_PPSGSTART), TRUE);
-            Button_Enable(GetDlgItem(hDlg, IDC_PPSGRESTART), TRUE);
-            SetDlgItemText(hDlg, IDC_PPSGSTATUS, STAT_PAUSED);
-        break;
-        case SERVICE_STOPPED:
-            if (_currentEntry->lpConfig->dwStartType != SERVICE_DISABLED) {
-                Button_Enable(GetDlgItem(hDlg, IDC_PPSGSTART), TRUE);
-                SetDlgItemText(hDlg, IDC_PPSGSTATUS, STAT_DISABLED);
-            }
-            else
-                SetDlgItemText(hDlg, IDC_PPSGSTATUS, STAT_STOPPED);
-        break;
-        default:
-        break;
-    }
-}
-
-LRESULT CALLBACK __generalProperty(HWND hDlg,
-                                   UINT uMessage,
-                                   WPARAM wParam,
-                                   LPARAM lParam)
-{
-    LPPSHNOTIFY lpShn;
-    WCHAR       szBuf[1024]; 
-
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
-            {
-                PROPSHEETPAGE *lpPage = (PROPSHEETPAGE *)lParam;
-                LPAPXSERVENTRY lpService;
-                BOOL           bLocalSystem = TRUE;
-                
-                lpService = ( LPAPXSERVENTRY)lpPage->lParam;
-                SendMessage(GetDlgItem(hDlg, IDC_PPSGDISP), EM_LIMITTEXT, 255, 0);
-                SendMessage(GetDlgItem(hDlg, IDC_PPSGDESC), EM_LIMITTEXT, 1023, 0);
-
-                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSGCMBST), START_AUTO);
-                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSGCMBST), START_MANUAL);
-                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSGCMBST), START_DISABLED);
-                if (_currentEntry->lpConfig->dwStartType == SERVICE_AUTO_START)
-                    ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_PPSGCMBST), 0);
-                else if (_currentEntry->lpConfig->dwStartType == SERVICE_DEMAND_START)
-                    ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_PPSGCMBST), 1);
-                else if (_currentEntry->lpConfig->dwStartType == SERVICE_DISABLED)
-                    ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_PPSGCMBST), 2);
-
-                SetDlgItemTextW(hDlg, IDC_PPSGNAME, _currentEntry->szServiceName);
-                SetDlgItemTextW(hDlg, IDC_PPSGDISP, _currentEntry->lpConfig->lpDisplayName);
-                SetDlgItemTextW(hDlg, IDC_PPSGDESC, _currentEntry->szServiceDescription);
-                SetDlgItemTextW(hDlg, IDC_PPSGDEXE, _currentEntry->lpConfig->lpBinaryPathName);
-                __generalPropertyRefresh(hDlg);
-            }
-        break;
-        case WM_COMMAND:
-            switch (LOWORD(wParam)) {
-                case IDC_PPSGCMBST:
-                    if (HIWORD(wParam) == CBN_SELCHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 1);
-                    }
-                break;
-                case IDC_PPSGDISP:
-                    if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSGDISP, szBuf, 255);
-                        if (!lstrcmpW(szBuf, _currentEntry->lpConfig->lpDisplayName)) {
-                            PropSheet_UnChanged(GetParent(hDlg), hDlg);
-                            CLR_BIT_FLAG(_propertyChanged, 1);
-                        }
-                        else {
-                            PropSheet_Changed(GetParent(hDlg), hDlg);
-                            SET_BIT_FLAG(_propertyChanged, 1);
-                        }
-                    }
-                break;
-                case IDC_PPSGDESC:
-                    if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSGDESC, szBuf, 1023);
-                        if (!lstrcmpW(szBuf, _currentEntry->szServiceDescription)) {
-                            PropSheet_UnChanged(GetParent(hDlg), hDlg);
-                            CLR_BIT_FLAG(_propertyChanged, 1);
-                        }
-                        else {
-                            PropSheet_Changed(GetParent(hDlg), hDlg);
-                            SET_BIT_FLAG(_propertyChanged, 1);
-                        }
-                    }
-                break;
-                case IDC_PPSGSTART:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSSTART, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __startServiceCallback, NULL);
-                    __generalPropertyRefresh(hDlg);
-                break;
-                case IDC_PPSGSTOP:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSSTOP, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __stopServiceCallback, NULL);
-                    __generalPropertyRefresh(hDlg);
-                break;
-                case IDC_PPSGPAUSE:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSPAUSE, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __pauseServiceCallback, NULL);
-                    __generalPropertyRefresh(hDlg);
-                break;
-                case IDC_PPSGRESTART:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSRESTART, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __restartServiceCallback, NULL);
-                    __generalPropertyRefresh(hDlg);
-                break;
-            }
-        break;
-        case WM_NOTIFY:           
-            lpShn = (LPPSHNOTIFY )lParam;
-            switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
-                    if (__generalPropertySave(hDlg)) {
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
-                    }
-                    else {
-                        SET_BIT_FLAG(_propertyChanged, 1);
-                        SetWindowLong(hDlg, DWLP_MSGRESULT,
-                                      PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
-                    }
-
-                break;
-                default:
-                break;
-            }
-        break;
-        default:
-        break;
-    }
- 
-    return FALSE;
-}
-
-LRESULT CALLBACK __logonProperty(HWND hDlg,
-                                 UINT uMessage,
-                                 WPARAM wParam,
-                                 LPARAM lParam)
-{
-    LPPSHNOTIFY lpShn;
-    WCHAR       szBuf[1024]; 
-    switch (uMessage) { 
-        case WM_INITDIALOG:
-            {
-                BOOL           bAccount = FALSE;
-                
-                SendMessage(GetDlgItem(hDlg, IDC_PPSLUSER), EM_LIMITTEXT, 63, 0);
-                SendMessage(GetDlgItem(hDlg, IDC_PPSLPASS), EM_LIMITTEXT, 63, 0);
-                SendMessage(GetDlgItem(hDlg, IDC_PPSLCPASS), EM_LIMITTEXT, 63, 0);
-                if (lstrcmpiW(_currentEntry->szObjectName, STAT_SYSTEM)) {
-                    bAccount = TRUE;
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, IDC_PPSLUA);
-                    SetDlgItemTextW(hDlg, IDC_PPSLUSER, _currentEntry->szObjectName);
-                    SetDlgItemTextW(hDlg, IDC_PPSLPASS, EMPTY_PASSWORD);
-                    SetDlgItemTextW(hDlg, IDC_PPSLCPASS, EMPTY_PASSWORD);
-                }
-                else {
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, IDC_PPSLLS);
-                    if (_currentEntry->lpConfig->dwServiceType & 
-                        SERVICE_INTERACTIVE_PROCESS)
-                        CheckDlgButton(hDlg, IDC_PPSLID, BST_CHECKED);
-                }
-                EnableWindow(GetDlgItem(hDlg, IDC_PPSLID), !bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDC_PPSLUSER), bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDC_PPSLBROWSE), bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDL_PPSLPASS), bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDC_PPSLPASS), bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDL_PPSLCPASS), bAccount);
-                EnableWindow(GetDlgItem(hDlg, IDC_PPSLCPASS), bAccount);
-            }
-        break;
-        case WM_COMMAND:
-            switch (LOWORD(wParam)) {
-                case IDC_PPSLLS:
-                    SetDlgItemTextW(hDlg, IDC_PPSLUSER, L"");
-                    SetDlgItemTextW(hDlg, IDC_PPSLPASS, L"");
-                    SetDlgItemTextW(hDlg, IDC_PPSLCPASS, L"");
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLID), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLUSER), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLBROWSE), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDL_PPSLPASS), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLPASS), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDL_PPSLCPASS), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLCPASS), FALSE);
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);                     
-                    if (lstrcmpiW(_currentEntry->szObjectName, STAT_SYSTEM)) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 2);
-                    }
-                    else {
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
-                        CLR_BIT_FLAG(_propertyChanged, 2);
-                    }
-                    break;
-                case IDC_PPSLUA:
-                    SetDlgItemTextW(hDlg, IDC_PPSLUSER, _currentEntry->szObjectName);
-                    SetDlgItemTextW(hDlg, IDC_PPSLPASS, EMPTY_PASSWORD);
-                    SetDlgItemTextW(hDlg, IDC_PPSLCPASS, EMPTY_PASSWORD);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLID), FALSE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLUSER), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLBROWSE), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDL_PPSLPASS), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLPASS), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDL_PPSLCPASS), TRUE);
-                    EnableWindow(GetDlgItem(hDlg, IDC_PPSLCPASS), TRUE);
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);                     
-                    if (lstrcmpW(_currentEntry->szObjectName, STAT_SYSTEM)) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 2);
-                    }
-                    else {
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
-                        CLR_BIT_FLAG(_propertyChanged, 2);
-                    }
-                    break;
-                case IDC_PPSLID:
-                    PropSheet_Changed(GetParent(hDlg), hDlg); 
-                    SET_BIT_FLAG(_propertyChanged, 2);
-                break;
-                case IDC_PPSLUSER:
-                    if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSLUSER, szBuf, 63);
-                        if (!lstrcmpiW(szBuf, _currentEntry->szObjectName)) {
-                            PropSheet_UnChanged(GetParent(hDlg), hDlg);
-                            CLR_BIT_FLAG(_propertyChanged, 2);
-                        }
-                        else {
-                            PropSheet_Changed(GetParent(hDlg), hDlg);
-                            SET_BIT_FLAG(_propertyChanged, 2);
-                        }
-                    }
-                break;
-                case IDC_PPSLPASS:
-                case IDC_PPSLCPASS:
-                    if (HIWORD(wParam) == EN_CHANGE) {
-                        WCHAR szP[64];
-                        WCHAR szC[64];
-                        GetDlgItemTextW(hDlg, IDC_PPSLPASS, szP, 63);
-                        GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, 63);
-                        /* check for valid password match */
-                        if (szP[0] == L' ' &&  szC[0] == L' ') {
-                            PropSheet_UnChanged(GetParent(hDlg), hDlg);
-                            CLR_BIT_FLAG(_propertyChanged, 2);
-                        }
-                        else if (!lstrcmpW(szP, szC)) {
-                            PropSheet_Changed(GetParent(hDlg), hDlg);
-                            SET_BIT_FLAG(_propertyChanged, 2);
-                        }
-                    }
-                break;
-                case IDC_PPSLBROWSE:
-                    {
-                        WCHAR szUser[SIZ_RESLEN];
-                        if (apxDlgSelectUser(hDlg, szUser))
-                            SetDlgItemTextW(hDlg, IDC_PPSLUSER, szUser);
-                    }
-                break;
-            }
-        break;
-        case WM_NOTIFY:
-            lpShn = (LPPSHNOTIFY )lParam;
-            switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
-                    if (__generalLogonSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
-                    else {
-                        SET_BIT_FLAG(_propertyChanged, 2);
-                        SetWindowLong(hDlg, DWLP_MSGRESULT,
-                                      PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
-                    }
-
-                break;
-            }
-        break;
-
-        default:
-        break;
-    }
-    return FALSE;
-}
-
-void __initPpage(PROPSHEETPAGEW *lpPage, INT iDlg, INT iTitle, DLGPROC pfnDlgProc)
-{
-    lpPage->dwSize      = sizeof(PROPSHEETPAGE);
-    lpPage->dwFlags     = PSP_USETITLE;
-    lpPage->hInstance   = _gui_store->hInstance;
-    lpPage->pszTemplate = MAKEINTRESOURCEW(iDlg);
-    lpPage->pszIcon     = NULL;
-    lpPage->pfnDlgProc  = pfnDlgProc;
-    lpPage->pszTitle    = MAKEINTRESOURCEW(iTitle);
-    lpPage->lParam      = 0;
-}
-
-INT_PTR ShowServiceProperties(HWND hWnd)
-{
-    PROPSHEETPAGEW   psP[5];
-    PROPSHEETHEADERW psH; 
-    WCHAR           szT[1024] = {0};
-
-    __initPpage(&psP[0], IDD_PROPPAGE_SGENERAL, IDS_PPGENERAL, 
-                __generalProperty);
-    __initPpage(&psP[1], IDD_PROPPAGE_LOGON, IDS_PPLOGON, 
-                __logonProperty);
-
-    if (_currentEntry && _currentEntry->lpConfig)
-        lstrcpyW(szT, _currentEntry->lpConfig->lpDisplayName);
-    else
-        return (INT_PTR)0;
-    lstrcatW(szT, L" Service Properties");
-
-    psH.dwSize           = sizeof(PROPSHEETHEADER);
-    psH.dwFlags          = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK | PSH_NOCONTEXTHELP;
-    psH.hwndParent       = hWnd;
-    psH.hInstance        = _gui_store->hInstance;
-    psH.pszIcon          = MAKEINTRESOURCEW(IDI_MAINICON);
-    psH.pszCaption       = szT;
-    psH.nPages           = 2;
-    psH.ppsp             = (LPCPROPSHEETPAGEW) &psP;
-    psH.pfnCallback      = (PFNPROPSHEETCALLBACK)__propertyCallback;
-    psH.nStartPage       = 0;   
-
-    return PropertySheetW(&psH);
-}
-
-static LRESULT CALLBACK __filtersDlgProc(HWND hDlg, UINT uMsg,
-                                         WPARAM wParam, LPARAM lParam)
-{
-
-    switch (uMsg) {
-        case WM_INITDIALOG:
-            apxCenterWindow(hDlg, _gui_store->hMainWnd);
-            if (_filterIname)
-                SetDlgItemTextW(hDlg, IDC_FINAME, _filterIname);
-            if (_filterIimage)
-                SetDlgItemTextW(hDlg, IDC_FISIMG, _filterIimage);
-            if (_filterXname)
-                SetDlgItemTextW(hDlg, IDC_FXNAME, _filterXname);
-            if (_filterXimage)
-                SetDlgItemTextW(hDlg, IDC_FXSIMG, _filterXimage);
-            return TRUE;
-        break;
-        case WM_COMMAND:
-            switch (LOWORD(wParam)) {
-                case IDOK:
-                    {
-                        apxFree(_filterIname);
-                        _filterIname = apxGetDlgTextW(hPool, hDlg, IDC_FINAME);
-                        apxFree(_filterXname);
-                        _filterXname = apxGetDlgTextW(hPool, hDlg, IDC_FXNAME);
-                        apxFree(_filterIimage);
-                        _filterIimage = apxGetDlgTextW(hPool, hDlg, IDC_FISIMG);
-                        apxFree(_filterXimage);
-                        _filterXimage = apxGetDlgTextW(hPool, hDlg, IDC_FXSIMG);
-                        PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                                    MAKEWPARAM(IDMS_REFRESH, 0), 0);
-                    }
-                case IDCANCEL:
-                    EndDialog(hDlg, LOWORD(wParam));
-                return TRUE;
-            }
-        break;
-    }
-    return FALSE;
-} 
-
-void EditServiceFilters(HWND hWnd)
-{
-
-   DialogBox(_gui_store->hInstance,
-              MAKEINTRESOURCE(IDD_FILTER),
-              hWnd,
-              (DLGPROC)__filtersDlgProc);
-
-}
-
-static LRESULT CALLBACK __selectColsDlgProc(HWND hDlg, UINT uMsg,
-                                            WPARAM wParam, LPARAM lParam)
-{
-
-    switch (uMsg) {
-        case WM_INITDIALOG:
-            apxCenterWindow(hDlg, _gui_store->hMainWnd);
-            CheckDlgButton(hDlg, IDC_CCOL1, lvItems[1].iWidth != 0);
-            CheckDlgButton(hDlg, IDC_CCOL2, lvItems[2].iWidth != 0);
-            CheckDlgButton(hDlg, IDC_CCOL3, lvItems[3].iWidth != 0);
-            CheckDlgButton(hDlg, IDC_CCOL4, lvItems[4].iWidth != 0);
-            CheckDlgButton(hDlg, IDC_CCOL5, lvItems[5].iWidth != 0);
-
-            return TRUE;
-        break;
-        case WM_COMMAND:
-            switch (LOWORD(wParam)) {
-                case IDOK:
-                    if (IsDlgButtonChecked(hDlg, IDC_CCOL1) != BST_CHECKED)
-                        lvItems[1].iWidth = 0;
-                    else if (lvItems[1].iWidth == 0)
-                        lvItems[1].iWidth = lvItems[1].iDefault;
-                    if (IsDlgButtonChecked(hDlg, IDC_CCOL2) != BST_CHECKED)
-                        lvItems[2].iWidth = 0;
-                    else if (lvItems[2].iWidth == 0)
-                        lvItems[2].iWidth = lvItems[2].iDefault;
-                    if (IsDlgButtonChecked(hDlg, IDC_CCOL3) != BST_CHECKED)
-                        lvItems[3].iWidth = 0;
-                    else if (lvItems[3].iWidth == 0)
-                        lvItems[3].iWidth = lvItems[3].iDefault;
-                    if (IsDlgButtonChecked(hDlg, IDC_CCOL4) != BST_CHECKED)
-                        lvItems[4].iWidth = 0;
-                    else if (lvItems[4].iWidth == 0)
-                        lvItems[4].iWidth = lvItems[4].iDefault;
-                    if (IsDlgButtonChecked(hDlg, IDC_CCOL5) != BST_CHECKED)
-                        lvItems[5].iWidth = 0;
-                    else if (lvItems[5].iWidth == 0)
-                        lvItems[5].iWidth = lvItems[5].iDefault;
-                    CloseWindow(hWndList);
-                    hWndList = CreateServiceList(_gui_store->hMainWnd); 
-
-                    PostMessage(_gui_store->hMainWnd, WM_COMMAND,
-                                MAKEWPARAM(IDMS_REFRESH, 0), 0);
-
-                case IDCANCEL:
-                    EndDialog(hDlg, LOWORD(wParam));
-                return TRUE;
-            }
-        break;
-    }
-    return FALSE;
-} 
-
-void SelectDisplayColumns(HWND hWnd)
-{
-
-   DialogBox(_gui_store->hInstance,
-              MAKEINTRESOURCE(IDD_SELCOL),
-              hWnd,
-              (DLGPROC)__selectColsDlgProc);
-
-}
-
-LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
-                             WPARAM wParam, LPARAM lParam) 
-{
-    RECT rcP;
-    LPNMHDR     lpNmHdr; 
-
-    switch (uMsg) {
-        case WM_CREATE:
-
-            hWndToolbar = CreateToolbarEx(hWnd, 
-                                          WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT,  
-                                          IDC_TOOLBAR, NUMTOOLBUTTONS,
-                                          _gui_store->hInstance, IDB_TOOLBAR,
-                                          (LPCTBBUTTON)&tbButtons,
-                                          NUMTBBUTTONS, 16,16,16,16, sizeof(TBBUTTON)); 
-            hWndStatus = CreateStatusWindow(0x0800 /* SBT_TOOLTIPS */
-                                            | WS_CHILD | WS_VISIBLE,
-                                            TEXT(""), hWnd, IDC_STATBAR); 
-
-            hWndList = CreateServiceList(hWnd); 
-            RefreshServices(0);
-            CheckMenuRadioItem(GetMenu(hWnd), IDMV_UFAST, IDMV_UPAUSED,
-                               _currentTimer, MF_BYCOMMAND);
-            RestoreRefreshTimer();
-            return FALSE;
-        break;
-        case WM_SETFOCUS:
-            SetFocus(hWndList);
-            return FALSE;
-        break;
-        case WM_SIZE:
-            MoveWindow(hWndToolbar, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
-            MoveWindow(hWndList, 0, _toolbarHeight, LOWORD(lParam),
-                       HIWORD(lParam) -  _toolbarHeight - _statbarHeight, TRUE);
-            MoveWindow(hWndStatus, 0, HIWORD(lParam) - _statbarHeight, 
-                       LOWORD(lParam), HIWORD(lParam), TRUE);
-            GetWindowRect(hWnd, &rcP);
-            _gui_store->stState.rcPosition.top    = rcP.top;
-            _gui_store->stState.rcPosition.left   = rcP.left;
-            _gui_store->stState.rcPosition.right  = ABS(rcP.right - rcP.left);
-            _gui_store->stState.rcPosition.bottom = ABS(rcP.bottom - rcP.top);
-            if (wParam == SIZE_MAXIMIZED)
-                _gui_store->stState.dwShow = SW_SHOWMAXIMIZED;
-            else
-                _gui_store->stState.dwShow = SW_SHOW;
-
-            return FALSE;
-        break;   
-        case WM_TIMER: 
-            if (wParam == WM_TIMER_REFRESH) {
-                KillTimer(hWnd, WM_TIMER_REFRESH);
-                RefreshServices(1);
-                RestoreRefreshTimer();
-            }
-        break;
-        case WM_NOTIFY: 
-            lpNmHdr = (NMHDR FAR *)lParam;
-            switch (lpNmHdr->code) { 
-                case TTN_GETDISPINFO: 
-                    { 
-                        LPTOOLTIPTEXT lpttt; 
-                        lpttt = (LPTOOLTIPTEXT)lParam; 
-                        lpttt->hinst = _gui_store->hInstance; 
-                        /* Specify the resource identifier of the descriptive 
-                         * text for the given button. 
-                         */
-                        lpttt->lpszText = MAKEINTRESOURCE(lpttt->hdr.idFrom);
-                    }
-                break; 
-                case LVN_COLUMNCLICK :
-                    {
-                        LPNMLISTVIEW pLvi = (LPNMLISTVIEW)lParam;
-                        /* Find the real column */
-                        if (pLvi->iSubItem >= 0) {
-                            INT i, x = 0;
-                            for (i = 0; i < NUMLVITEMS; i++) {
-                                if (lvItems[i].iWidth && x < pLvi->iSubItem)
-                                    ++x;
-                                else
-                                    break;
-                            }
-                            if (lvItems[x].bSortable) {
-                                if (_sortColumn == x)
-                                    _sortOrder *= (-1);
-                                else {
-                                    _sortColumn = x;
-                                    _sortOrder  = 1;
-                                }
-                                ListView_SortItemsEx(hWndList, CompareFunc, NULL);
-                                if ((lvHitItem = ListView_GetSelectionMark(hWndList)) >= 0) {
-                                    ListView_EnsureVisible(hWndList,lvHitItem, FALSE);
-                                }
-                            }
-                        }
-                    }
-                break;
-                /* 
-                 * Process other notifications here. 
-                 */ 
-                default: 
-                break; 
-            } 
-        break;
-        case WM_COMMAND:
-            switch(LOWORD(wParam)) {
-                case IDMS_REFRESH:
-                    KillTimer(hWnd, WM_TIMER_REFRESH);
-                    RefreshServices(1);
-                    RestoreRefreshTimer();
-                break;
-                case IDAM_TRY:
-                    apxManageTryIconA(hWnd, NIM_ADD, NULL,
-                                      apxLoadResourceA(IDS_APPLICATION, 0),
-                                      NULL);
-
-                    KillTimer(hWnd, WM_TIMER_REFRESH);
-                    ShowWindow(hWnd, SW_HIDE);
-                break;
-                case IDAM_EXIT:
-                    SendMessage(hWnd, WM_CLOSE, 0, 0);
-                break;
-                case IDMH_ABOUT:
-                    apxAboutBox(hWnd);
-                break;
-                case IDMS_START:
-                    apxProgressBox(hWnd, apxLoadResource(IDS_HSSTART, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __startServiceCallback, NULL);
-                break;
-                case IDMS_STOP:
-                    apxProgressBox(hWnd, apxLoadResource(IDS_HSSTOP, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __stopServiceCallback, NULL);
-                break;
-                case IDMS_PAUSE:
-                    apxProgressBox(hWnd, apxLoadResource(IDS_HSPAUSE, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __pauseServiceCallback, NULL);
-                break;
-                case IDMS_RESTART:
-                    apxProgressBox(hWnd, apxLoadResource(IDS_HSRESTART, 0),
-                                   _currentEntry->lpConfig->lpDisplayName,
-                                   __restartServiceCallback, NULL);
-                break;
-                case IDMS_PROPERTIES:
-                    KillTimer(hWnd, WM_TIMER_REFRESH);
-                    ShowServiceProperties(hWnd);
-                    RestoreRefreshTimer();
-                break;
-                case IDMV_UFAST:
-                case IDMV_USLOW:
-                case IDMV_UPAUSED:
-                    _currentTimer = LOWORD(wParam);
-                    CheckMenuRadioItem(GetMenu(hWnd), IDMV_UFAST, IDMV_UPAUSED,
-                                       _currentTimer, MF_BYCOMMAND);
-                    RestoreRefreshTimer();
-                break;
-                case IDAM_DELETE:
-                    {
-                        TCHAR szT[1024+128];
-#ifndef _UNICODE
-                        CHAR dName[1024];
-                        WideToAscii(_currentEntry->lpConfig->lpDisplayName, dName);
-#endif
-                        if (!_currentEntry || !_currentEntry->lpConfig)
-                            return FALSE;
-
-                        wsprintf(szT, apxLoadResource(IDS_DELSERVICET, 0),
-#ifdef _UNICODE
-                                 _currentEntry->lpConfig->lpDisplayName);
-#else
-                                 dName);
-#endif
-                        KillTimer(hWnd, WM_TIMER_REFRESH);
-                        if (apxYesNoMessage(apxLoadResource(IDS_DELSERVICEC, 0),
-                                            szT, TRUE)) {
-                            APXHANDLE hSrv;
-                            if ((hSrv = apxCreateService(hPool, SC_MANAGER_CONNECT, FALSE))) {
-                                if (apxServiceOpen(hSrv, _currentEntry->szServiceName,
-                                                   SERVICE_ALL_ACCESS)) {
-                                    apxServiceDelete(hSrv);
-                                    RefreshServices(1);
-                                }
-                                apxCloseHandle(hSrv);
-                            }
-                        }
-                        RestoreRefreshTimer();
-                    }
-                break;
-                case IDMV_FILTER:
-                    EditServiceFilters(hWnd);
-                break;
-                case IDMV_SELECTCOLUMNS:
-                    SelectDisplayColumns(hWnd);
-                break;
-                case IDAM_SAVE:
-                    if (_exportFilename) {
-                        ExportListView(_exportFilename, _exportIndex);
-                        return FALSE;
-                    }
-                case IDAM_SAVEAS:
-                    if (_exportFilename)
-                        apxFree(_exportFilename);
-                    _exportFilename = apxGetFileNameA(hWnd, EXPORT_TITLE,
-                                                      EXPORT_EXTFILT,
-                                                      ".csv", NULL, FALSE,
-                                                      &_exportIndex);
-                    if (_exportFilename)
-                        ExportListView(_exportFilename, _exportIndex);
-                break;
-                case IDAM_NEW:
-                    /* TODO: New service wizard */
-                    MessageBox(hWnd, apxLoadResource(IDS_NOTIMPLEMENTED, 0),
-                               apxLoadResource(IDS_APPLICATION, 1),
-                               MB_OK | MB_ICONINFORMATION);
-                break;
-                default:
-                    return DefWindowProc(hWnd, uMsg, wParam, lParam); 
-                break;
-            }
-        break;
-        case WM_TRAYMESSAGE:
-            switch(lParam) {
-                case WM_LBUTTONDBLCLK:
-                    ShowWindow(hWnd, SW_SHOW);
-                    apxManageTryIconA(hWnd, NIM_DELETE, NULL, NULL, NULL);
-                    RestoreRefreshTimer();
-                break;
-            }
-        break;
-        case WM_MOUSEWHEEL:
-            {
-                int nScroll;
-                if ((SHORT)HIWORD(wParam) < 0)
-                    nScroll = _gui_store->nWhellScroll;
-                else
-                    nScroll = _gui_store->nWhellScroll * (-1);
-                ListView_Scroll(hWndList, 0, nScroll * 16);
-            }
-        break;
-        case WM_QUIT:
-            OutputDebugString(TEXT("WM_QUIT"));
-            return DefWindowProc(hWnd, uMsg, wParam, lParam); 
-        break;
-        case WM_DESTROY:
-            DestroyListView();
-            apxManageTryIconA(hWnd, NIM_DELETE, NULL, NULL, NULL);
-            OutputDebugString(TEXT("WM_DESTROY"));
-            PostQuitMessage(0);
-            return FALSE;
-        break;
-        default:
-            return DefWindowProc(hWnd, uMsg, wParam, lParam); 
-        break;
-    }
-
-    return FALSE; 
-}
-
-/* Browse service callback */
-BOOL ServiceCallback(APXHANDLE hObject, UINT uMsg,
-                     WPARAM wParam, LPARAM lParam)
-{
-    LPAPXSERVENTRY  lpEnt = (LPAPXSERVENTRY)wParam;
-    LV_ITEM         lvI;
-    LV_ITEM         lvO;
-    INT             row = 0x7FFFFFFF;
-    WCHAR           szPid[16];
-    LPAPXSERVENTRY  lpEntry = NULL;
-    int             i;
-
-    AplZeroMemory(&lvI, sizeof(LV_ITEM)); 
-    lvI.mask        = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
-    lvI.iItem       = 0x7FFFFFFF;
-    switch (lpEnt->stServiceStatus.dwCurrentState) {
-        case SERVICE_RUNNING:
-            lvI.iImage      = 0;
-            lvI.pszText     = STAT_STARTED;
-        break;
-        case SERVICE_STOPPED:
-            lvI.iImage      = 1;
-            lvI.pszText     = STAT_NONE;
-        break;
-        case SERVICE_PAUSED:
-            lvI.iImage      = 2;
-            lvI.pszText     = STAT_PAUSED;
-        break;
-        default:
-            lvI.iImage      = 3;
-            lvI.pszText     = STAT_NONE;
-        break;
-    }
-    /* Search the items if this is a refresh callback */
-    if (uMsg == (WM_USER + 2)) {
-        for (i = 0; i < ListView_GetItemCount(hWndList); i++) {
-            lvO.iItem = i;
-            lvO.mask = LVIF_PARAM;
-            ListView_GetItem(hWndList, &lvO);
-            lpEntry = (LPAPXSERVENTRY)lvO.lParam;
-            if (!lstrcmpW(lpEntry->szServiceName, lpEnt->szServiceName)) {
-                row = lvO.iItem;
-                /* release the old config */
-                apxFree(lpEntry->lpConfig);
-                break;
-            }
-            else
-                lpEntry = NULL;
-        }
-    }
-    if (row == 0x7FFFFFFF || !lpEntry)
-        lpEntry = (LPAPXSERVENTRY) apxPoolAlloc(hPool, sizeof(APXSERVENTRY));
-    AplCopyMemory(lpEntry, lpEnt, sizeof(APXSERVENTRY));
-    lvI.lParam = (LPARAM)lpEntry;
-    if (row == 0x7FFFFFFF)
-        row = ListView_InsertItem(hWndList, &lvI);
-    else {
-        lvI.iItem = row;
-        ListView_SetItem(hWndList, &lvI);
-    }
-    if (row == -1)
-        return TRUE; 
-
-    ListView_SetItemTextW(hWndList, row, 1, lpEnt->lpConfig->lpDisplayName); 
-    i = 2;
-    if (lvItems[2].iWidth > 0) {
-        if (lpEnt->szServiceDescription)
-            ListView_SetItemTextW(hWndList, row, i, lpEnt->szServiceDescription);
-        i++;
-    }
-    if (lvItems[3].iWidth > 0) {
-        if (lpEnt->dwStart == SERVICE_DEMAND_START) {
-            ListView_SetItemTextW(hWndList, row, i, START_MANUAL);
-        }
-        else if (lpEnt->dwStart == SERVICE_AUTO_START) {
-            ListView_SetItemTextW(hWndList, row, i, START_AUTO);
-        }
-        else if (lpEnt->dwStart == SERVICE_DISABLED) {
-            ListView_SetItemTextW(hWndList, row, i, START_DISABLED);
-        }
-        else if (lpEnt->dwStart == SERVICE_BOOT_START) {
-            ListView_SetItemTextW(hWndList, row, i, START_BOOT);
-        }        
-        else if (lpEnt->dwStart == SERVICE_SYSTEM_START) {
-            ListView_SetItemTextW(hWndList, row, i, START_SYSTEM);
-        }
-        i++;
-    }
-    if (lvItems[4].iWidth > 0) {
-        ListView_SetItemTextW(hWndList, row, i++, *lpEnt->szObjectName ? 
-                              lpEnt->szObjectName : STAT_SYSTEM);
-    }
-    if (lvItems[5].iWidth > 0) {
-        if (lpEnt->stStatusProcess.dwProcessId) {
-            wsprintfW(szPid, L"%d", lpEnt->stStatusProcess.dwProcessId);
-            ListView_SetItemTextW(hWndList, row, i, szPid);
-        }
-        i++;
-    }
-    _currentLitem++;
-    return TRUE;
-}
-
-static BOOL loadConfiguration()
-{
-    DWORD dwSize, i;
-    /* Load the GUI State first */    
-    if (IS_INVALID_HANDLE(hRegistry))
-        return FALSE;
-
-    dwSize = sizeof(APXGUISTATE);
-    if (apxRegistryGetBinaryA(hRegistry, APXREG_USER, DISPLAY_KEY, DISPLAY_STATE,
-                              (LPBYTE)(&(_gui_store->stState)), &dwSize)) {
-        _gui_store->stStartupInfo.wShowWindow = (WORD)_gui_store->stState.dwShow;
-        if (_gui_store->stStartupInfo.wShowWindow == SW_MAXIMIZE) {
-            _gui_store->stState.rcPosition.top    = CW_USEDEFAULT;
-            _gui_store->stState.rcPosition.left   = CW_USEDEFAULT;
-            _gui_store->stState.rcPosition.bottom = CW_USEDEFAULT;
-            _gui_store->stState.rcPosition.right  = CW_USEDEFAULT;
-        }
-        if (_gui_store->stState.nColumnWidth[0] > 50)
-            lvItems[0].iWidth = _gui_store->stState.nColumnWidth[0];
-        if (_gui_store->stState.nColumnWidth[1] > 50)
-            lvItems[1].iWidth = _gui_store->stState.nColumnWidth[1];
-
-        for (i = 2; i < NUMLVITEMS; i++) {
-            lvItems[i].iWidth = _gui_store->stState.nColumnWidth[i];
-        }
-        _sortColumn   = _gui_store->stState.nUser[0];
-        _sortOrder    = _gui_store->stState.nUser[1];
-        _currentTimer = _gui_store->stState.nUser[2];
-    }
-    _filterIname  = apxRegistryGetStringW(hRegistry, APXREG_USER,
-                                          SFILT_KEY, SFILT_INAME);
-    _filterXname  = apxRegistryGetStringW(hRegistry, APXREG_USER,
-                                          SFILT_KEY, SFILT_XNAME);
-    _filterIimage = apxRegistryGetStringW(hRegistry, APXREG_USER,
-                                          SFILT_KEY, SFILT_ISIMG);
-    _filterIimage = apxRegistryGetStringW(hRegistry, APXREG_USER,
-                                          SFILT_KEY, SFILT_XSIMG);
-    /* try to load system defalut filters */
-    if (!_filterIname)
-        _filterIname  = apxRegistryGetStringW(hRegistry, APXREG_SOFTWARE,
-                                              SFILT_KEY, SFILT_INAME);
-    if (!_filterXname)
-        _filterXname  = apxRegistryGetStringW(hRegistry, APXREG_SOFTWARE,
-                                              SFILT_KEY, SFILT_XNAME);
-    if (!_filterIimage)
-        _filterIimage = apxRegistryGetStringW(hRegistry, APXREG_SOFTWARE,
-                                              SFILT_KEY, SFILT_ISIMG);
-    if (!_filterXimage)
-        _filterXimage = apxRegistryGetStringW(hRegistry, APXREG_SOFTWARE,
-                                              SFILT_KEY, SFILT_XSIMG);
-
-    return TRUE;
-}
-
-#define REGSET_FILTER(str, key) \
-    APXMACRO_BEGIN              \
-    if (str && lstrlenW(str))   \
-        apxRegistrySetStrW(hRegistry, APXREG_USER, SFILT_KEY, key, str);    \
-    else                                                                    \
-        apxRegistryDeleteW(hRegistry, APXREG_USER, SFILT_KEY, key);         \
-    APXMACRO_END
-
-static BOOL saveConfiguration()
-{
-    DWORD i;
-    if (IS_INVALID_HANDLE(hRegistry))
-        return FALSE;
-    for (i = 0; i < NUMLVITEMS; i++) {
-        _gui_store->stState.nColumnWidth[i] = lvItems[i].iWidth;
-    }
-    _gui_store->stState.nUser[0] = _sortColumn;
-    _gui_store->stState.nUser[1] = _sortOrder;
-    _gui_store->stState.nUser[2] = _currentTimer;
-
-    apxRegistrySetBinaryA(hRegistry, APXREG_USER, DISPLAY_KEY, DISPLAY_STATE,
-                          (LPBYTE)(&(_gui_store->stState)), sizeof(APXGUISTATE));
-    REGSET_FILTER(_filterIname,  SFILT_INAME);
-    REGSET_FILTER(_filterXname,  SFILT_XNAME);
-    REGSET_FILTER(_filterIimage, SFILT_ISIMG);
-    REGSET_FILTER(_filterXimage, SFILT_XSIMG);
-
-    return TRUE;
-}
-
-/* Main program entry
- * Since we are inependant from CRT
- * the arguments are not used
- */
-#ifdef _NO_CRTLIBRARY
-int xMain(void)
-#else
-int WINAPI WinMain(HINSTANCE hInstance,
-                   HINSTANCE hPrevInstance,
-                   LPSTR lpCmdLine,
-                   int nCmdShow)
-#endif
-{
-    MSG    msg;
-
-    apxHandleManagerInitialize();
-    hPool     = apxPoolCreate(NULL, 0);
-    hService  = apxCreateService(hPool, GENERIC_ALL, TRUE);
-
-    _gui_store = apxGuiInitialize(MainWndProc, APSVCMGR_CLASS);
-
-    if (!_gui_store) {
-        goto cleanup;
-    }
-    hRegistry = apxCreateRegistry(hPool, KEY_ALL_ACCESS, NULL,
-                                  apxLoadResource(IDS_APPLICATION, 0),
-                                  APXREG_USER);
-    loadConfiguration();
-    _gui_store->hMainWnd = CreateWindow(_gui_store->szWndClass,
-                                        apxLoadResource(IDS_APPLICATION, 0),
-                                        WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
-                                        _gui_store->stState.rcPosition.left,
-                                        _gui_store->stState.rcPosition.top,
-                                        _gui_store->stState.rcPosition.right,
-                                        _gui_store->stState.rcPosition.bottom,
-                                        NULL, NULL,
-                                        _gui_store->hInstance,
-                                        NULL);
-    if (!_gui_store->hMainWnd) {
-        goto cleanup;
-    }
-
-    ShowWindow(_gui_store->hMainWnd, _gui_store->stStartupInfo.wShowWindow);
-    UpdateWindow(_gui_store->hMainWnd); 
-    SetMenuDefaultItem(GetMenu(_gui_store->hMainWnd), IDMS_PROPERTIES, FALSE);
-
-    while (GetMessage(&msg, NULL, 0, 0))  {
-        if(!TranslateAccelerator(_gui_store->hMainWnd,
-                                 _gui_store->hAccel, &msg)) {
-            TranslateMessage(&msg);
-            DispatchMessage(&msg);
-        }
-    }
-    saveConfiguration();
-
-cleanup:
-    apxFree(_filterIname);
-    apxFree(_filterXname);
-    apxFree(_filterIimage);
-    apxFree(_filterXimage);
-    apxFree(_exportFilename);
-    apxCloseHandle(hService);
-    apxHandleManagerDestroy();
-    ExitProcess(0);
-    return 0;
-}
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.dsp b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.dsp
deleted file mode 100644
index 9be62c9..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.dsp
+++ /dev/null
@@ -1,173 +0,0 @@
-# Microsoft Developer Studio Project File - Name="apsvcmgr" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=apsvcmgr - Win32 Unicode Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "apsvcmgr.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "apsvcmgr.mak" CFG="apsvcmgr - Win32 Unicode Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "apsvcmgr - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "apsvcmgr - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE "apsvcmgr - Win32 Unicode Release" (based on "Win32 (x86) Application")
-!MESSAGE "apsvcmgr - Win32 Unicode Debug" (based on "Win32 (x86) Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "apsvcmgr - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386
-
-!ELSEIF  "$(CFG)" == "apsvcmgr - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/apsvcmgrd.exe" /pdbtype:sept
-
-!ELSEIF  "$(CFG)" == "apsvcmgr - Win32 Unicode Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Unicode Release"
-# PROP BASE Intermediate_Dir "Unicode Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Unicode Release"
-# PROP Intermediate_Dir "Unicode Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "NDEBUG"
-# ADD RSC /l 0x41a /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386 /out:"Unicode Release/apsvcmgru.exe"
-
-!ELSEIF  "$(CFG)" == "apsvcmgr - Win32 Unicode Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Unicode Debug"
-# PROP BASE Intermediate_Dir "Unicode Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Unicode Debug"
-# PROP Intermediate_Dir "Unicode Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x41a /d "_DEBUG"
-# ADD RSC /l 0x41a /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Unicode Debug/apsvcmgrdu.exe" /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "apsvcmgr - Win32 Release"
-# Name "apsvcmgr - Win32 Debug"
-# Name "apsvcmgr - Win32 Unicode Release"
-# Name "apsvcmgr - Win32 Unicode Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\apsvcmgr.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\apsvcmgr.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\apsvcmgr.rc
-# ADD BASE RSC /l 0x41a
-# ADD RSC /l 0x41a /i "..\..\include" /d "USE_MAINFEST"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.h b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.h
deleted file mode 100644
index 0ffa755..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#undef  PRG_VERSION
-#define PRG_VERSION    "2.0.1.0" 
-
-#define NUMTOOLBUTTONS                  17
-#define IDC_TOOLBAR                     2000
-#define IDB_TOOLBAR                     2001
-#define IDB_SSTATUS                     2002
-#define IDC_LISTVIEW                    2003
-
-#define IDM_ARROWUP                     2004
-#define IDM_ARROWDOWN                   2005
-#define IDS_HSSTART                     2006
-#define IDS_HSSTOP                      2007
-#define IDS_HSPAUSE                     2008
-#define IDS_HSRESTART                   2009
-#define IDM_POPUPMENU                   2010
-
-#define IDAM_TRY                        2100
-#define IDAM_SAVE                       2101
-#define IDAM_SAVEAS                     2102
-#define IDAM_EXIT                       2103
-#define IDAM_NEW                        2104
-#define IDAM_DELETE                     2105
-
-#define IDMS_START                      2110
-#define IDMS_STOP                       2111
-#define IDMS_PAUSE                      2112
-#define IDMS_RESTART                    2113
-#define IDMS_REFRESH                    2114
-#define IDMS_PROPERTIES                 2115
-#define IDMS_HELP                       2116
-
-#define IDMV_UFAST                      2120
-#define IDMV_USLOW                      2121
-#define IDMV_UPAUSED                    2122
-#define IDMV_SELECTCOLUMNS              2123
-#define IDMV_FILTER                     2124
-
-#define IDMH_HELP                       2130
-#define IDMH_ABOUT                      2131
-
-/* Property pages */
-
-#define IDD_PROPPAGE_SGENERAL           2600
-#define IDC_PPSGNAME                    2601
-#define IDC_PPSGDISP                    2602
-#define IDC_PPSGDESC                    2603
-#define IDC_PPSGDEXE                    2604
-#define IDC_PPSGCMBST                   2605
-#define IDC_PPSGSTATUS                  2606
-#define IDC_PPSGSTART                   2607
-#define IDC_PPSGSTOP                    2608
-#define IDC_PPSGPAUSE                   2609
-#define IDC_PPSGRESTART                 2610
-
-#define IDD_PROPPAGE_LOGON              2620
-#define IDC_PPSLLS                      2621
-#define IDC_PPSLID                      2622
-#define IDC_PPSLUA                      2623
-#define IDC_PPSLUSER                    2624
-#define IDC_PPSLBROWSE                  2625
-#define IDC_PPSLPASS                    2626
-#define IDC_PPSLCPASS                   2627
-#define IDL_PPSLPASS                    2628
-#define IDL_PPSLCPASS                   2629
-
-
-#define IDD_FILTER                      2640
-#define IDC_FINAME                      2641
-#define IDC_FXNAME                      2642
-#define IDC_FISIMG                      2643
-#define IDC_FXSIMG                      2644
-
-#define IDD_SELCOL                      2650
-#define IDC_CCOL1                       2651
-#define IDC_CCOL2                       2652
-#define IDC_CCOL3                       2653
-#define IDC_CCOL4                       2654
-#define IDC_CCOL5                       2655
-
-
-#if 0
-#define IDAMS_NEW                       3000
-#define IDAMS_DELETE                    3001
-#define IDAMS_SAVE                      3002
-#define IDMVS_REFRESH                   3003
-#define IDMSS_PROPERTIES                3004
-#define IDMSS_START                     3005
-#define IDMSS_STOP                      3006
-#define IDMSS_PAUSE                     3007
-#define IDMSS_RESTART                   3008
-#define IDMHS_HELP                      3009    
-#define IDMVS_FILTER                    3010
-#endif
-
-#define IDS_DELSERVICEC                 3100
-#define IDS_DELSERVICET                 3101
-#define IDS_VALIDPASS                   3102
-#define IDS_PPGENERAL                   3103
-#define IDS_PPLOGON                     3104
-#define IDS_NOTIMPLEMENTED              3105
-
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.manifest b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.manifest
deleted file mode 100644
index c698a56..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.manifest
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
-<assemblyIdentity version="2.0.1.0" processorArchitecture="X86" name="Apache.Procrun.Apsvcmgr" type="win32" /> 
-<description>Service Manager.</description> 
-<dependency> 
-<dependentAssembly> 
-<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> 
-</dependentAssembly> 
-</dependency> 
-</assembly> 
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.rc b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.rc
deleted file mode 100644
index 43a7551..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.rc
+++ /dev/null
@@ -1,312 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "apxwin.h"
-#include "apsvcmgr.h"
-
-#define RSTR_ASM        "Apache Service Manager"
-#define RSTR_SCMATS     "Service Manager is attempting to "
-
-IDI_MAINICON         ICON                   "../../resources/apsvcmgr.ico" 
-IDB_TOOLBAR          BITMAP  DISCARDABLE    "../../resources/toolbar.bmp"
-IDB_SSTATUS          BITMAP  DISCARDABLE    "../../resources/sstatus.bmp"
-IDB_SUSERS           BITMAP  DISCARDABLE    "../../resources/susers.bmp"
-IDR_LICENSE          RTF                    "../../resources/license.rtf"
-BMP_JAKARTA          BITMAP                 "../../resources/jakarta.bmp"
-
-#ifdef USE_MAINFEST
-CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "apsvcmgr.manifest"
-#endif
-
-IDC_APPLICATION MENU 
-BEGIN
-    POPUP "&Action"
-    BEGIN
-        MENUITEM "&Minimize to try",            IDAM_TRY
-        MENUITEM SEPARATOR
-        MENUITEM "&New",                        IDAM_NEW
-        MENUITEM "&Delete",                     IDAM_DELETE, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "&Save                       CRTL+S", IDAM_SAVE
-        MENUITEM "Save &As...              CTRL+A", IDAM_SAVEAS
-        MENUITEM SEPARATOR
-        MENUITEM "E&xit",                       IDAM_EXIT
-    END
-    POPUP "&Service"
-    BEGIN
-        MENUITEM "P&ropeties ...",               IDMS_PROPERTIES, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "&Start",                       IDMS_START, GRAYED
-        MENUITEM "S&top",                        IDMS_STOP, GRAYED
-        MENUITEM "&Pause",                       IDMS_PAUSE, GRAYED
-        MENUITEM "Res&tart",                     IDMS_RESTART, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "Re&fresh",                     IDMS_REFRESH
-        MENUITEM SEPARATOR
-        MENUITEM "&Help",                        IDMS_HELP
-    END
-    POPUP "&View"
-    BEGIN
-        MENUITEM "Re&fresh Now      F5",         IDMS_REFRESH
-        POPUP "Update speed"
-        BEGIN
-            MENUITEM "10 Seconds",              IDMV_UFAST
-            MENUITEM "1    Minute",             IDMV_USLOW
-            MENUITEM "Paused",                  IDMV_UPAUSED
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Select Columns ...",          IDMV_SELECTCOLUMNS
-        MENUITEM "Filter Services ...",         IDMV_FILTER
-    END
-    POPUP "&Help"
-    BEGIN
-        MENUITEM "&Help ...",                   IDMH_HELP
-        MENUITEM "&About",                      IDMH_ABOUT
-    END
-END
-
-IDM_POPUPMENU MENU DISCARDABLE 
-BEGIN
-    POPUP "Popup Menu"
-    BEGIN
-        MENUITEM "Propeties ...",              IDMS_PROPERTIES, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "Start",                      IDMS_START, GRAYED
-        MENUITEM "Stop",                       IDMS_STOP, GRAYED
-        MENUITEM "Pause",                      IDMS_PAUSE, GRAYED
-        MENUITEM "Restart",                    IDMS_RESTART, GRAYED
-        MENUITEM SEPARATOR
-        MENUITEM "Refresh",                    IDMS_REFRESH
-        MENUITEM SEPARATOR
-        MENUITEM "Help",                       IDMS_HELP, HELP
-    END
-END
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 337, 187
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
-CAPTION "Apache Service Manager"
-FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
-BEGIN
-    DEFPUSHBUTTON   "&OK",IDOK,285,150,50,14
-    CONTROL         "",IDC_LICENSE,"RichEdit20A",ES_MULTILINE | 
-                    ES_READONLY | WS_BORDER | WS_VSCROLL,0,31,335,115
-    CONTROL         "BMP_JAKARTA",IDC_STATIC,"Static",SS_BITMAP,0,0,337,30
-    LTEXT           " ",IDC_ABOUTAPP,2,150,270,12
-    LTEXT           "Copyright � 2000-2003 The Apache Software Foundation.",IDC_STATIC,2,160,270,12
-    LTEXT           "http://www.jakarta.org",IDC_STATIC,2,170,270,12 
-    PUSHBUTTON      "&System Info",IAB_SYSINF,285,170,50,14
-END
-
-IDD_PROGRESS DIALOGEX 0, 0, 322, 92
-STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | 
-    WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOPMOST
-CAPTION "Apache Service Manager"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
-    DEFPUSHBUTTON   "Cl&ose",IDOK,261,73,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,202,73,50,14
-    LTEXT           " ",
-                    IDDP_HEAD,40,4,250,8
-    LTEXT           " ",IDDP_TEXT,40,15,250,44
-    CONTROL         "",IDDP_PROGRESS,"msctls_progress32",WS_BORDER,10,50,302,
-                    14
-    ICON            IDI_MAINICON,IDC_STATIC,10,4,20,20,0,WS_EX_TRANSPARENT
-END
-
-IDD_PROPPAGE_SGENERAL DIALOGEX 0, 0, 260, 186
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-FONT 8, "MS Shell Dlg", 0, 0, 0x0
-BEGIN
-    LTEXT           "Service Name: ",IDC_STATIC,10,8,52,8
-    LTEXT           "  ",IDC_PPSGNAME,70,8,240,8
-    LTEXT           "Display &name: ",IDC_STATIC,10,23,50,8
-    EDITTEXT        IDC_PPSGDISP,70,22,180,14,ES_AUTOHSCROLL
-    LTEXT           "&Description: ",IDC_STATIC,10,41,43,8
-    EDITTEXT        IDC_PPSGDESC,70,40,180,14,ES_AUTOHSCROLL
-    LTEXT           "Pat&h to executable:",IDC_STATIC,10,63,66,8
-    EDITTEXT        IDC_PPSGDEXE,10,75,240,14,ES_AUTOHSCROLL | WS_DISABLED
-    LTEXT           "Startup typ&e:",IDC_STATIC,10,94,46,8
-    COMBOBOX        IDC_PPSGCMBST,70,93,180,80,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,128,240,1                    
-    LTEXT           "Service Status:",IDC_STATIC,10,138,52,8
-    LTEXT           "  ",IDC_PPSGSTATUS,70,138,240,8
-    PUSHBUTTON      "&Start",IDC_PPSGSTART,10,160,55,14,WS_DISABLED
-    PUSHBUTTON      "S&top",IDC_PPSGSTOP,71,160,55,14,WS_DISABLED
-    PUSHBUTTON      "&Pause",IDC_PPSGPAUSE,132,160,55,14,WS_DISABLED
-    PUSHBUTTON      "&Restart",IDC_PPSGRESTART,193,160,55,14,WS_DISABLED
-END
-
-IDD_PROPPAGE_LOGON DIALOGEX 0, 0, 260, 186
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-FONT 8, "MS Shell Dlg", 0, 0, 0x0
-BEGIN
-    LTEXT           "Log on as:",IDC_STATIC,10,8,51,8
-    CONTROL         "&Local System account",IDC_PPSLLS,"Button",
-                    BS_AUTORADIOBUTTON,10,23,85,10
-    CONTROL         "Allo&w service to interact with desktop",IDC_PPSLID,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,37,135,10
-    CONTROL         "&This account:",IDC_PPSLUA,"Button",BS_AUTORADIOBUTTON,
-                    10,59,61,10
-    EDITTEXT        IDC_PPSLUSER,86,58,114,14,ES_AUTOHSCROLL
-    PUSHBUTTON      "&Browse...",IDC_PPSLBROWSE,205,58,50,14
-    LTEXT           "&Password:",IDL_PPSLPASS,21,76,36,8
-    EDITTEXT        IDC_PPSLPASS,86,75,114,14,ES_PASSWORD | ES_AUTOHSCROLL
-    LTEXT           "&Confirm Password:",IDL_PPSLCPASS,20,93,63,8
-    EDITTEXT        IDC_PPSLCPASS,86,92,114,14,ES_PASSWORD | ES_AUTOHSCROLL
-END
-
-IDD_FILTER DIALOGEX 0, 0, 296, 199
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTEXTHELP
-CAPTION "Service display filters"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
-    LTEXT           "Enter multiple filter match strings separated by the ';' character. '*' is a wildcard.",
-                    IDC_STATIC,10,7,278,8
-    DEFPUSHBUTTON   "&OK",IDOK,232,175,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,176,175,50,14
-    GROUPBOX        " Service name filters ",IDC_STATIC,10,28,275,62
-    LTEXT           "Include:",IDC_STATIC,18,48,27,8
-    EDITTEXT        IDC_FINAME,63,46,211,14,ES_AUTOHSCROLL
-    LTEXT           "Exclude:",IDC_STATIC,18,66,28,8
-    EDITTEXT        IDC_FXNAME,63,64,211,14,ES_AUTOHSCROLL
-    GROUPBOX        "Service image path filters",IDC_STATIC,10,102,275,62
-    LTEXT           "Include:",IDC_STATIC,17,120,27,8
-    EDITTEXT        IDC_FISIMG,63,118,211,14,ES_AUTOHSCROLL
-    LTEXT           "Exclude:",IDC_STATIC,17,138,28,8
-    EDITTEXT        IDC_FXSIMG,63,136,211,14,ES_AUTOHSCROLL
-END
-
-IDD_SELCOL DIALOGEX 0, 0, 220, 130
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "Select Columns"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,156,105,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,96,105,50,14
-    LTEXT           "Select the columns that will apear on the Service view of the Service Manager",
-                    IDC_STATIC,16,2,194,16
-    CONTROL         "Name",IDC_CCOL1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
-                    16,26,83,10
-    CONTROL         "Description",IDC_CCOL2,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,16,39,83,10
-    CONTROL         "Startup Type",IDC_CCOL3,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,16,52,83,10
-    CONTROL         "Log On As",IDC_CCOL4,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,16,65,83,10
-    CONTROL         "Process Id",IDC_CCOL5,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,16,78,83,10
-END
-
-IDD_SELUSER DIALOGEX 0, 0, 410, 201
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
-    WS_THICKFRAME
-EXSTYLE WS_EX_CONTEXTHELP
-CAPTION "Select User"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
-    LTEXT           "Name:",IDSU_SELNAME,10,183,22,8
-    EDITTEXT        IDSU_SELECTED,48,200,213,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "OK",IDOK,292,180,50,14,WS_DISABLED
-    PUSHBUTTON      "Cancel",IDCANCEL,348,180,50,14
-    LTEXT           "Look In:",IDC_STATIC,10,9,27,8
-    CONTROL         "",IDSU_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | 
-                    LVS_SORTASCENDING | LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER | 
-                    WS_TABSTOP,0,26,410,149,WS_EX_CLIENTEDGE
-    CONTROL         "",IDSU_COMBO,"ComboBoxEx32",CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP,47,6,260,80
-END
-
-IDC_APPLICATION ACCELERATORS 
-BEGIN
-    "/",            IDMH_ABOUT,              ASCII,  ALT, NOINVERT
-    "?",            IDMH_ABOUT,              ASCII,  ALT, NOINVERT
-    VK_F1,          IDMH_HELP,               VIRTKEY, NOINVERT
-    "S",            IDAM_SAVE,               VIRTKEY, CONTROL, NOINVERT
-    "A",            IDAM_SAVEAS,             VIRTKEY, CONTROL, NOINVERT    
-    "F",            IDMV_FILTER,             VIRTKEY, CONTROL, NOINVERT    
-    VK_F5,          IDMS_REFRESH,            VIRTKEY, NOINVERT
-END
-
-
-STRINGTABLE 
-BEGIN
-    IDS_APPLICATION     RSTR_ASM
-    IDS_APPVERSION      "Version 1.0.0"
-    IDS_APPFULLNAME     RSTR_ASM " Version " PRG_VERSION
-    IDS_APPCOPYRIGHT    "Copyright � 2000-2003 The Apache Software Foundation"
-    IDS_APPDESCRIPTION  "Apache NT Service Management Tool"
-    IDS_HSSTART         RSTR_SCMATS "start the following service ..."
-    IDS_HSSTOP          RSTR_SCMATS "stop the following service ..."
-    IDS_HSRESTART       RSTR_SCMATS "to restart the following service ..."
-    IDS_HSPAUSE         RSTR_SCMATS "to pause the following service ..."
-    
-    IDAM_NEW            "New Service"
-    IDAM_DELETE         "Delete Service"
-    IDAM_SAVE           "Export List"
-    IDMS_REFRESH        "Refresh"
-    IDMV_FILTER         "Filter Services"
-    IDMS_PROPERTIES     "Properties"
-    IDMS_START          "Start Service"
-    IDMS_STOP           "Stop Service"
-    IDMS_PAUSE          "Pause Service"
-    IDMS_RESTART        "Restart Service"
-    IDMH_HELP           "Help"    
-    
-    IDS_DELSERVICEC     "Confirm Delete Service"
-    IDS_DELSERVICET     "You cannot undo the effects of this dialog box!\r\n\r\nYou are about to delete '%s' service.\r\nDeleting services may cause your system unusable.\r\n\r\nDo you want to proceed?"
-    IDS_VALIDPASS       "Please enter a valid password"    
-    IDS_PPGENERAL       "General"
-    IDS_PPLOGON         "Log On"
-    IDS_NOTIMPLEMENTED  "Sorry, but this feature is not implemented yet"
-END
- 
-
-1 VERSIONINFO
- FILEVERSION 2,0,1,0
- PRODUCTVERSION 2,0,1,0
- FILEFLAGSMASK 0x3fL
-#if defined(_DEBUG)
- FILEFLAGS 0x03L
-#else
- FILEFLAGS 0x02L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904b0"
-    BEGIN
-      VALUE "Comments", "NT Service Management Tool\0"
-      VALUE "CompanyName", "Apache Software Foundation\0"
-      VALUE "FileDescription", RSTR_ASM "\0"
-      VALUE "FileVersion", PRG_VERSION
-      VALUE "InternalName", RSTR_ASM "\0"
-      VALUE "LegalCopyright", "Copyright � 2000-2006 The Apache Software Foundation.\0"
-      VALUE "OriginalFilename", "apsvcmgr.exe\0"
-      VALUE "ProductName", RSTR_ASM "\0"
-      VALUE "ProductVersion", PRG_VERSION
-    END
-  END
-  BLOCK "VarFileInfo"
-  BEGIN
-    VALUE "Translation", 0x409, 1200
-  END
-END 
diff --git a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.vcproj b/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.vcproj
deleted file mode 100644
index 20aa63c..0000000
--- a/src/native/nt/procrun/apps/apsvcmgr/apsvcmgr.vcproj
+++ /dev/null
@@ -1,404 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8,00"
-	Name="apsvcmgr"
-	ProjectGUID="{E2B48545-30FA-4D6F-B32C-B7B29B35FE45}"
-	RootNamespace="apsvcmgr"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="2"
-				AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="1"
-				AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="2"
-				AdditionalManifestDependencies=""
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib comctl32.lib netapi32.lib"
-				LinkIncremental="1"
-				AdditionalManifestDependencies=""
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath=".\apsvcmgr.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath=".\apsvcmgr.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-			<File
-				RelativePath=".\apsvcmgr.rc"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCResourceCompilerTool"
-						AdditionalIncludeDirectories="..\..\include"
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/apps/jar2exe/jar2exe.c b/src/native/nt/procrun/apps/jar2exe/jar2exe.c
deleted file mode 100644
index 2e651a0..0000000
--- a/src/native/nt/procrun/apps/jar2exe/jar2exe.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-/* ====================================================================
- * jar2exe -- convert .jar file to WIN executable.
- * Contributed by Mladen Turk <mturk at apache.org>
- * 05 Aug 2003
- * ==================================================================== 
- */
-
-/* Force the JNI vprintf functions */
-#define _DEBUG_JNI  1
-#include "apxwin.h"
-#include <imagehlp.h>
-#include "jar2exe.h"
-#pragma comment( lib, "imagehlp.lib" )
-
-
-#ifdef _DEBUG
-#define LOG_MARK        _verbose, __FILE__, __LINE__
-#else
-#define LOG_MARK        _verbose, NULL, 0
-#endif
-
-#define EXE_SUFFIX      ".EXE"
-#define EXE_SUFFIX_SZ   (sizeof(".EXE") - 1)
-#define JAR_LINT        "jar2exe Copyright (c) 2000-2003 The Apache Software Foundation."
-
-#define EMBED_SIZE      2048
-#define EMBED_MAX       2044
-
-typedef struct {
-    char    s_signature[16];
-    char    s_class[EMBED_SIZE];
-    UINT32  s_flags[4];
-    char    e_signature[16];
-} st_config;
-
-static char         _progname[MAX_PATH+1];
-static char         _progpath[MAX_PATH+1];
-static HANDLE       _hstub   = NULL;
-static BOOL         _verbose = FALSE;
-static BOOL         _makegui = FALSE;
-static const char   *_lint   = JAR_LINT;
-static st_config    *_config = NULL;
-
-/* zip file header magic */
-static BYTE zip_fh_magic[4] = { '\120', '\113', '\001', '\002'};
-/* end of central directory signature */
-static BYTE zip_ec_magic[4] = { '\120', '\113', '\005', '\006'}; 
-/* lower case configuration block signature 
- * to enable binary searching
- */
-static BYTE c_signature[] = {
-    's', 't', 'a', 'r', 't', 'u', 's', 'e', 'r', 's', 'b', 'l', 'o', 'c', 'k', '\0' 
-};
-
-/* space in exe stub for user configuration */
-static BYTE conf_in_exe[EMBED_SIZE + 48] = {
-    'S', 'T', 'A', 'R', 'T', 'U', 'S', 'E', 'R', 'S', 'B', 'L', 'O', 'C', 'K', '\0',
-
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-
-    '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-    'E', 'N', 'D', 'O', 'F', 'U', 'S', 'E', 'R', 'S', 'B', 'L', 'O', 'C', 'K', '\0',
-};
-
-static LPCSTR _usage = JAR_LINT "\n"                                     \
-    "Usage:\n"                                                           \
-    "  jar2exe [options] <output.exe> <class> <embed.jar> [params ...]\n" \
-    "  options:\n"                                          \
-    "  -d\t\tdisplay error messages\n"                      \
-    "  -g\t\tmake non-console application\n"                \
-    "  -m<nn>\t\tInitial memory pool (nn MB)\n"             \
-    "  -x<nn>\t\tMaximum memory size (nn MB)\n"             \
-    "  -s<nn>\t\tThread stack size (nn Bytes)\n"            \
-    "  output.exe\toutput executable\n"                     \
-    "  class\t\tmain class name\n"                          \
-    "  embed.jar\tjar file to embed in stub\n"              \
-    "  params\t\tJava VM parameters\n";
-
-/* Fix the ZIP central directory 
- * Find the central dir position and
- * add the stub length offset to each enty.
- */
-static int fixjar(size_t slen)
-{
-    HANDLE hmap;
-    BYTE *map, *cd, *hd, *mp;
-    size_t len, off, cdir, cpos = 0;
-    int i, nent, rc = 0;
-
-    len = SetFilePointer(_hstub, 0, NULL, FILE_END);
-    if ((hmap = CreateFileMapping(_hstub, NULL, 
-                                  PAGE_READWRITE, 0, 0, NULL)) == NULL) {
-        apxDisplayError(LOG_MARK, "%s unable to map the stub file\n",
-                        _progname);
-        return -1;
-    }
-    if ((map = MapViewOfFile(hmap, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
-        apxDisplayError(LOG_MARK, "%s unable to map the view of file\n",
-                        _progname);
-        CloseHandle(hmap);
-    }
-    off = len - ZIPOFF_CDIR_CLEN;
-    cd  = map + off;
-    mp  = CHECK_4_MAGIC(cd, zip_ec_magic) ? cd : NULL; 
-    while ((len - off) < (64 * 1024)) { 
-        i = 0;
-        if (!mp) {
-            off -= ZIPOFF_CDIR_CLEN;
-            cd = map + off;
-
-            if (!CHECK_4_MAGIC(cd, zip_ec_magic)) {
-                for (; i < ZIPOFF_CDIR_CLEN; i++) {
-                    if (CHECK_4_MAGIC((cd + i), zip_ec_magic)) {
-                        mp = cd + i;
-                        break;
-                    }
-                }
-            }
-            else
-                mp = cd;
-        }         
-
-        if (mp) { 
-            cpos = READ_32_BITS(mp, ZIPOFF_CDIR_OFFSET);
-            nent = READ_16_BITS(mp, ZIPOFF_CDIR_TOTENTRIES);
-            cdir = off + i;
-            break;
-        }
-
-    }
-    if (cpos) {
-        hd = map + cpos + slen;
-        for (i = 0; i < nent; i++) {
-            size_t xl, cl, fl, sp;
-            if (!CHECK_4_MAGIC(hd, zip_fh_magic)) {
-                rc = -1;     
-                apxDisplayError(LOG_MARK, "Wrong header at %d\n", hd - map);
-                goto cleanup;
-            }
-            sp = READ_32_BITS(hd, ZIPOFF_FH_LFHOFFSET);
-            fl = READ_16_BITS(hd, ZIPOFF_FH_FNLEN);
-            xl = READ_16_BITS(hd, ZIPOFF_FH_XFLEN);
-            cl = READ_16_BITS(hd, ZIPOFF_FH_FCLEN);
-            if (i == 0 && sp != 0) {
-                apxDisplayError(LOG_MARK, "The first entry is not zero\n");
-                rc = -1;     
-                goto cleanup;
-            }
-            WRITE_32_BITS(hd, ZIPOFF_FH_LFHOFFSET, sp + slen);            
-            hd += (fl + xl + cl + ZIPLEN_FH);
-        }
-        /* repos to the end of central dir */
-        mp = map + cdir;
-        WRITE_32_BITS(mp, ZIPOFF_CDIR_OFFSET, cpos + slen);            
-    }
-cleanup:
-    UnmapViewOfFile(map);
-    CloseHandle(hmap);
-    return rc;
-
-}
-
-/* Merge the stub with jar file
- * Fix the userblock bounded code.
- */
-static int merge(LPCSTR jar, size_t slen)
-{
-    HANDLE hjar, hmap;
-    char buff[4096];
-    BYTE bmatch[16];
-
-    DWORD rd, wr;
-    BYTE *map, *ss;
-    int i;
-    if ((hmap = CreateFileMapping(_hstub, NULL, 
-                                  PAGE_READWRITE, 0, 0, NULL)) == NULL) {
-        apxDisplayError(LOG_MARK, "%s unable to map the stub file\n",
-                        _progname);
-        return -1;
-    }
-    if ((hjar = CreateFile(jar, GENERIC_READ, 0, NULL,
-                           OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) {
-        apxDisplayError(LOG_MARK, "%s unable to open jar file : %s\n",
-                        _progname, jar);
-        return -1;
-    }
-    
-    if ((map = MapViewOfFile(hmap, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
-        apxDisplayError(LOG_MARK, "%s unable to map the view of file\n",
-                        _progname);
-        CloseHandle(hmap);
-        return -1;
-    }
-    /* convert to upper case */
-    for (i = 0; i < 15; i++)
-        bmatch[i] = c_signature[i] - 32;
-    bmatch[15] = 0;
-    if ((ss = ApcMemSearch(map, bmatch, 16, slen)) != NULL) {
-        st_config cfg;
-        AplCopyMemory(&cfg, ss, sizeof(st_config));
-        AplCopyMemory(ss, _config, sizeof(st_config));
-    }
-    UnmapViewOfFile(map);
-    CloseHandle(hmap);
-    SetFilePointer(_hstub, 0, NULL, FILE_END);
-    while (ReadFile(hjar, buff, 4096, &rd, NULL)) {
-        if (rd)
-            WriteFile(_hstub, buff, rd, &wr, NULL);
-        else
-            break;
-        if (rd != wr) {
-            apxDisplayError(LOG_MARK, "%s mismatch read/write\n(Readed : %d Written %d)\n",
-                            _progname, rd, wr);
-            CloseHandle(hjar);
-            return -1;
-        }
-    }
-    CloseHandle(hjar);
-    return 0;
-}
-
-static int
-jar2exe(int argc, char *argv[])
-{
-    int i = 1, l;
-    BY_HANDLE_FILE_INFORMATION stub_inf;
-    char *p;
-    LOADED_IMAGE li;
-
-    while (argc > 1 && *argv[1] == '-') {
-        p = argv[1];
-        /* Check if verbose mode is on */
-        while (*p) {
-            if (*p == 'm') {
-                _config->s_flags[0] = atoi(p + 1);
-                break;
-            }
-            else if (*p == 'x') {
-                _config->s_flags[1] = atoi(p + 1);
-                break;
-            }
-            else if (*p == 's') {
-                _config->s_flags[2] = atoi(p + 1);
-                break;
-            }
-            else if (*p == 'd')
-                _verbose = TRUE;
-            else if (*p == 'g')
-                _makegui = TRUE;
-            ++p;
-        }
-        --argc;
-        ++argv;
-    }
-    if (argc < 4) {
-        SetLastError(ERROR_SUCCESS);
-        apxDisplayError(TRUE, NULL, 0, _usage);
-        return -1;
-    }
-    AplZeroMemory(_config->s_class, EMBED_SIZE);
-    lstrcpyA(_config->s_class, argv[2]);
-    l = lstrlenA(_config->s_class);
-    for (i = 0; i < l; i++) {
-        if (_config->s_class[i] == '.')
-            _config->s_class[i] = '/';
-    }
-    p = (char *)(&(_config->s_class[l+1]));
-    *p++ = '\0';
-    if (argc > 4) {
-        --p;
-        for (i = 4; i < argc; i++) {
-            l += lstrlenA(argv[i]);
-            if (l > EMBED_MAX) {
-                apxDisplayError(LOG_MARK, "%s args are too long (max %d are allowed)\n",
-                                _progname, EMBED_MAX);
-                return -1;
-            }
-            lstrcpyA(p, argv[i]);
-            p += lstrlenA(argv[i]);
-            *p++ = '\0';
-        }
-    }
-    *p++ = '\0';
-    DeleteFile(argv[1]);
-    CopyFile(_progpath, argv[1], TRUE);
-    if ((_hstub = CreateFile(argv[1], GENERIC_READ | GENERIC_WRITE, 0, NULL,
-                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) {
-        apxDisplayError(LOG_MARK, "%s unable to open stub %s\n",
-                        _progname, argv[1]);
-        DeleteFile(argv[1]);
-        return -1;
-    }
-    /* Get original stub size */
-    GetFileInformationByHandle(_hstub, &stub_inf);
-    
-    if (merge(argv[3], stub_inf.nFileSizeLow))
-        goto cleanup;
-    if (fixjar(stub_inf.nFileSizeLow))
-        goto cleanup;
-    CloseHandle(_hstub);
-    if (_makegui) {
-        /* Change a portable executable (PE) image Subsytem to GUI.
-         * It will also calculate a new Checksum.
-         */
-        if (MapAndLoad(argv[1], NULL, &li, FALSE, FALSE)) {
-            if (li.FileHeader)
-                li.FileHeader->OptionalHeader.Subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI;
-            UnMapAndLoad(&li);
-        }
-        else
-            apxDisplayError(LOG_MARK, "%s MapAndLoad %s\n",
-                            _progname, argv[1]);
-    }
-    return 0;
-cleanup:
-    CloseHandle(_hstub);
-    DeleteFile(argv[1]);
-    return -1;
-}
-
-/* Run the embedded jar file
- *
- */
-int run(int argc, char *argv[])
-{
-    HANDLE hPool, hJava;
-    DWORD  rv = 0;
-    apxHandleManagerInitialize();
-    hPool = apxPoolCreate(NULL, 0);
-    /* Use default JVM */
-    hJava = apxCreateJava(hPool, NULL);
-    if (!IS_INVALID_HANDLE(hJava)) {
-        LPSTR lpCmd;
-        if (!apxJavaInitialize(hJava, _progpath,
-                              _config->s_class + 
-                              strlen(_config->s_class) + 1,
-                              _config->s_flags[0],
-                              _config->s_flags[1],
-                              _config->s_flags[2])) {            
-            rv = 1;
-            goto cleanup;
-        }
-        lpCmd = apxArrayToMultiSzA(hPool, argc - 1, &argv[1]);
-        if (!apxJavaLoadMainClass(hJava, _config->s_class, NULL, lpCmd)) {
-            rv = 2;
-            goto cleanup;
-        }
-        if (!apxJavaStart(hJava)) {
-            rv = 3;
-        }
-        else
-            apxJavaWait(hJava, INFINITE, FALSE);
-cleanup:
-        apxCloseHandle(hJava);
-    }
-    else {
-        rv = 4;
-    }
-
-    apxHandleManagerDestroy();
-    ExitProcess(rv);
-    return 0;
-}
-
-int main(int argc, char *argv[])
-{
-    char *p;
-    char path[MAX_PATH+1];
-    GetModuleFileName(GetModuleHandle(NULL), path, MAX_PATH);
-    lstrcpyA(_progpath, path);
-    
-    _config = (st_config *)conf_in_exe;
-    if (lstrcmpiA(_config->s_signature, c_signature)) {
-        apxDisplayError(LOG_MARK, "%s\nWrong user block signature\n", _lint);
-        ExitProcess(1);
-    }
-    /* remove the path and extension from module name */
-    if ((p = AplRindexA(path, '\\')))
-        *p++ = '\0';
-    else
-        p = &path[0];
-    lstrcpyA(_progname, p);
-    if (lstrlenA(_progname) > EXE_SUFFIX_SZ && ((p = AplRindexA(_progname, '.')) != NULL)) {
-        if (!lstrcmpiA(p, EXE_SUFFIX))
-            *p = '\0';
-    }
-    
-    if (lstrcmpiA(_progname, "jar2exe") == 0)
-        return jar2exe(argc, argv);
-    else if (lstrcmpiA(_progname, "jar2exew") == 0) {
-        /* default is to make gui app */
-        _makegui = TRUE;
-        return jar2exe(argc, argv);
-    }
-    else /* run the embedded jar */
-        return run(argc, argv);
-    
-    /* NOT REACHED */
-    return 0;
-}
diff --git a/src/native/nt/procrun/apps/jar2exe/jar2exe.h b/src/native/nt/procrun/apps/jar2exe/jar2exe.h
deleted file mode 100644
index 5bef749..0000000
--- a/src/native/nt/procrun/apps/jar2exe/jar2exe.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-/* ====================================================================
- * jar2exe -- convert .jar file to WIN executable.
- * Contributed by Mladen Turk <mturk at apache.org>
- * 05 Aug 2003
- * ==================================================================== 
- */
-
-#ifndef _JAR2EXE_H
-#define _JAR2EXE_H
-
-#undef  PRG_VERSION
-#define PRG_VERSION    "1.0.0.0" 
-
-#define ZIPOFF_CDIR_CLEN            20
-#define ZIPOFF_CDIR_DISKNO          4
-#define ZIPOFF_CDIR_FINALDISKNO     6
-#define ZIPOFF_CDIR_ENTRIES         8
-#define ZIPOFF_CDIR_TOTENTRIES      10
-#define ZIPOFF_CDIR_SIZE            12
-#define ZIPOFF_CDIR_OFFSET          16
-
-#define ZIPOFF_FH_VERSION           4
-#define ZIPOFF_FH_NEEDVERSION       6
-#define ZIPOFF_FH_GPBF              8
-#define ZIPOFF_FH_CM                10
-#define ZIPOFF_FH_MTIME             12
-#define ZIPOFF_FH_MDATE             14
-#define ZIPOFF_FH_CRC32             16
-#define ZIPOFF_FH_CSIZE             20
-#define ZIPOFF_FH_USIZE             24
-#define ZIPOFF_FH_FNLEN             28
-#define ZIPOFF_FH_XFLEN             30
-#define ZIPOFF_FH_FCLEN             32
-#define ZIPOFF_FH_DISKNO            34
-#define ZIPOFF_FH_IFATTR            36
-#define ZIPOFF_FH_EFATTR            38
-#define ZIPOFF_FH_LFHOFFSET         42
-#define ZIPLEN_FH                   46
-
-#define READ_32_BITS(base, offset)                \
-        ((((unsigned char)(base)[offset + 0])) |       \
-         (((unsigned char)(base)[offset + 1]) << 8)  | \
-         (((unsigned char)(base)[offset + 2]) << 16) | \
-         (((unsigned char)(base)[offset + 3]) << 24))
-        
-#define READ_16_BITS(base, offset)                \
-        ((((unsigned char)(base)[offset])) |         \
-         (((unsigned char)(base)[offset + 1]) << 8)) \
-
-#define WRITE_32_BITS(base, offset, value) { \
-    (base)[offset + 0] = (unsigned char)(value & 0xff);               \
-    (base)[offset + 1] = (unsigned char)((value & 0xff00) >> 8);      \
-    (base)[offset + 2] = (unsigned char)((value & 0xff0000) >> 16);   \
-    (base)[offset + 3] = (unsigned char)((value & 0xff000000) >> 24); \
-}
-
-#define WRITE_16_BITS(base, offset, value) { \
-    (base)[offset + 0] = (unsigned char)(value & 0xff);               \
-    (base)[offset + 1] = (unsigned char)((value & 0xff00) >> 8);      \
-}
-
-/* shuld be faster then memcmp */
-#define CHECK_4_MAGIC(base, magic) \
-    ( ((base)[0] == (magic)[0]) && \
-      ((base)[1] == (magic)[1]) && \
-      ((base)[2] == (magic)[2]) && \
-      ((base)[3] == (magic)[3]) )
-
-
-#endif /* _JAR2EXE_H */
-
diff --git a/src/native/nt/procrun/apps/jar2exe/jar2exe.rc b/src/native/nt/procrun/apps/jar2exe/jar2exe.rc
deleted file mode 100644
index 4f40410..0000000
--- a/src/native/nt/procrun/apps/jar2exe/jar2exe.rc
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "apxwin.h"
-#include "jar2exe.h"
-
-#define RSTR_JAR2EXE "Java jar launcher"
-
-IDI_MAINICON         ICON                   "../../resources/procrunw.ico" 
-
-1 VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGSMASK 0x3fL
-#if defined(_DEBUG)
- FILEFLAGS 0x03L
-#else
- FILEFLAGS 0x02L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904b0"
-    BEGIN
-      VALUE "Comments", "\0"
-      VALUE "CompanyName", "Apache Software Foundation\0"
-      VALUE "FileDescription", RSTR_JAR2EXE "\0"
-      VALUE "FileVersion", PRG_VERSION
-      VALUE "InternalName", RSTR_JAR2EXE "\0"
-      VALUE "LegalCopyright", "Copyright � 2000-2003 The Apache Software Foundation.\0"
-      VALUE "OriginalFilename", "jar2exe.exe\0"
-      VALUE "ProductName", RSTR_JAR2EXE "\0"
-      VALUE "ProductVersion", PRG_VERSION
-    END
-  END
-  BLOCK "VarFileInfo"
-  BEGIN
-    VALUE "Translation", 0x409, 1200
-  END
-END 
diff --git a/src/native/nt/procrun/apps/jar2exe/jar2exe.vcproj b/src/native/nt/procrun/apps/jar2exe/jar2exe.vcproj
deleted file mode 100644
index 92cfa6f..0000000
--- a/src/native/nt/procrun/apps/jar2exe/jar2exe.vcproj
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="jar2exe"
-	ProjectGUID="{DA9F3DDA-F85A-492A-B914-6A361429FC41}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\..\obj\Debug"
-			IntermediateDirectory="..\..\obj\Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories=".\;..\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				OutputFile="../../bin/jar2exe.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/jar2exe.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalIncludeDirectories="..\..\include"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\..\obj\Release"
-			IntermediateDirectory="..\..\obj\Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".\;..\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="shlwapi.lib"
-				OutputFile="../../bin/jar2exe.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="TRUE"
-				GenerateDebugInformation="FALSE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				AdditionalIncludeDirectories="..\..\include"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\jar2exe.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-			<File
-				RelativePath=".\jar2exe.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-			<File
-				RelativePath=".\jar2exe.rc">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64 b/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64
new file mode 100644
index 0000000..0a5f5b6
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.amd64
@@ -0,0 +1,110 @@
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_amd64
+INTDIR=.\Release_amd64
+# Begin Custom Macros
+OutDir=.\Release_amd64
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunmgr.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunmgr.obj"
+	- at erase "$(INTDIR)\prunmgr.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunmgr.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H  /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+MTL=midl.exe
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib bufferoverflowu.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:AMD64 /out:"$(OUTDIR)\prunmgr.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunmgr.obj" \
+	"$(INTDIR)\prunmgr.res" \
+	"..\..\Release_amd64\libprocrun.lib"
+
+"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
+
+SOURCE=.\prunmgr.c
+
+"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunmgr.rc
+
+"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.amd64
+   cd ".\APPS\prunmgr"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.amd64 RECURSE=1 CLEAN 
+   cd ".\APPS\prunmgr"
+
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.c b/src/native/nt/procrun/apps/prunmgr/prunmgr.c
index df31513..54d0158 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.c
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 /* ====================================================================
  * prunsrv -- Service Runner.
  * Contributed by Mladen Turk <mturk at apache.org>
  * 05 Aug 2003
- * ==================================================================== 
+ * ====================================================================
  */
 
 /* Force the JNI vprintf functions */
@@ -53,7 +54,13 @@ LPAPXGUISTORE _gui_store  = NULL;
 #define START_DISABLED       L"Disabled"
 #define START_BOOT           L"Boot"
 #define START_SYSTEM         L"SystemInit"
-#define EMPTY_PASSWORD       L"               " 
+#define EMPTY_PASSWORD       L"               "
+
+#ifdef WIN64
+#define KREG_WOW6432  KEY_WOW64_32KEY
+#else
+#define KREG_WOW6432  0
+#endif
 
 /* Main application pool */
 APXHANDLE hPool     = NULL;
@@ -89,7 +96,7 @@ static APXCMDLINEOPT _options[] = {
             { NULL }
 };
 
-/* Create RBUTTON try menu 
+/* Create RBUTTON try menu
  * Configure... (default, or lbutton dblclick)
  * Start <service name>
  * Stop  <service name>
@@ -103,8 +110,8 @@ static void createRbuttonTryMenu(HWND hWnd)
     BOOL canStop  = FALSE;
     BOOL canStart = FALSE;
     hMnu = CreatePopupMenu();
-    
-    if (_currentEntry) {        
+
+    if (_currentEntry) {
         if (_currentEntry->stServiceStatus.dwCurrentState == SERVICE_RUNNING) {
             if (_currentEntry->stServiceStatus.dwControlsAccepted & SERVICE_ACCEPT_STOP)
                 canStop = TRUE;
@@ -121,15 +128,15 @@ static void createRbuttonTryMenu(HWND hWnd)
     apxAppendMenuItem(hMnu, IDM_TM_EXIT,   TMNU_EXIT,  FALSE, TRUE);
     apxAppendMenuItem(hMnu,    -1, NULL,   FALSE, FALSE);
     apxAppendMenuItem(hMnu, IDM_TM_ABOUT,  TMNU_ABOUT, FALSE, TRUE);
-    
+
     /* Ensure we have a focus */
     if (!SetForegroundWindow(hWnd))
         SetForegroundWindow(NULL);
     GetCursorPos(&pt);
     /* Display the try menu */
-    TrackPopupMenu(hMnu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, 
+    TrackPopupMenu(hMnu, TPM_LEFTALIGN | TPM_RIGHTBUTTON,
                    pt.x, pt.y, 0, hWnd, NULL);
-    DestroyMenu(hMnu); 
+    DestroyMenu(hMnu);
 }
 
 /* wParam progress dialog handle
@@ -152,7 +159,7 @@ static BOOL __startServiceCallback(APXHANDLE hObject, UINT uMsg,
                                   __startServiceCallback, hDlg)) {
                 _currentEntry->stServiceStatus.dwCurrentState = SERVICE_RUNNING;
                 _currentEntry->stStatusProcess.dwCurrentState = SERVICE_RUNNING;
-                                
+
             }
             EndDialog(hDlg, IDOK);
             PostMessage(_gui_store->hMainWnd, WM_COMMAND,
@@ -164,7 +171,7 @@ static BOOL __startServiceCallback(APXHANDLE hObject, UINT uMsg,
             break;
     }
     return TRUE;
-} 
+}
 
 static BOOL __stopServiceCallback(APXHANDLE hObject, UINT uMsg,
                                    WPARAM wParam, LPARAM lParam)
@@ -206,7 +213,7 @@ static BOOL __restartServiceCallback(APXHANDLE hObject, UINT uMsg,
             /* TODO: use 128 as controll code */
             if (apxServiceControl(hService, 128, WM_USER+2,
                                   __restartServiceCallback, hDlg)) {
-                                
+
             }
             EndDialog(hDlg, IDOK);
             PostMessage(_gui_store->hMainWnd, WM_COMMAND,
@@ -258,7 +265,7 @@ static HWND   _propertyHwnd = NULL;
 int CALLBACK __propertyCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam)
 {
     switch(uMsg) {
-        case PSCB_PRECREATE:       
+        case PSCB_PRECREATE:
            {
                 LPDLGTEMPLATE  lpTemplate = (LPDLGTEMPLATE)lParam;
                 if (!(lpTemplate->style & WS_SYSMENU))
@@ -276,10 +283,10 @@ int CALLBACK __propertyCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam)
     return TRUE;
 }
 
-BOOL __generalPropertySave(HWND hDlg) 
+BOOL __generalPropertySave(HWND hDlg)
 {
-    WCHAR szN[256];
-    WCHAR szD[256];
+    WCHAR szN[SIZ_RESLEN];
+    WCHAR szD[SIZ_DESLEN];
     DWORD dwStartType = SERVICE_NO_CHANGE;
     int i;
 
@@ -289,8 +296,8 @@ BOOL __generalPropertySave(HWND hDlg)
 
     if (IS_INVALID_HANDLE(hService))
         return FALSE;
-    GetDlgItemTextW(hDlg, IDC_PPSGDISP, szN, 255);
-    GetDlgItemTextW(hDlg, IDC_PPSGDESC, szD, 1023);
+    GetDlgItemTextW(hDlg, IDC_PPSGDISP, szN, SIZ_RESMAX);
+    GetDlgItemTextW(hDlg, IDC_PPSGDESC, szD, SIZ_DESMAX);
     i = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PPSGCMBST));
     if (i == 0)
         dwStartType = SERVICE_AUTO_START;
@@ -307,11 +314,11 @@ BOOL __generalPropertySave(HWND hDlg)
     return TRUE;
 }
 
-BOOL __generalLogonSave(HWND hDlg) 
+BOOL __generalLogonSave(HWND hDlg)
 {
-    WCHAR szU[64];
-    WCHAR szP[64];
-    WCHAR szC[64];
+    WCHAR szU[SIZ_RESLEN];
+    WCHAR szP[SIZ_RESLEN];
+    WCHAR szC[SIZ_RESLEN];
     DWORD dwStartType = SERVICE_NO_CHANGE;
 
     if (!(TST_BIT_FLAG(_propertyChanged, 2)))
@@ -320,21 +327,25 @@ BOOL __generalLogonSave(HWND hDlg)
 
     if (IS_INVALID_HANDLE(hService))
         return FALSE;
-    GetDlgItemTextW(hDlg, IDC_PPSLUSER,  szU, 63);
-    GetDlgItemTextW(hDlg, IDC_PPSLPASS,  szP, 63);
-    GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, 63);
-    
+    GetDlgItemTextW(hDlg, IDC_PPSLUSER,  szU, SIZ_RESMAX);
+    GetDlgItemTextW(hDlg, IDC_PPSLPASS,  szP, SIZ_RESMAX);
+    GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, SIZ_RESMAX);
+
     if (lstrlenW(szU) && lstrcmpiW(szU, STAT_SYSTEM)) {
-        if (szP[0] != L' ' &&  szC[0] != L' ' && !lstrcmpW(szP, szC))
+        if (szP[0] != L' ' &&  szC[0] != L' ' && !lstrcmpW(szP, szC)) {
             apxServiceSetNames(hService, NULL, NULL, NULL, szU, szP);
+            lstrlcpyW(_currentEntry->szObjectName, SIZ_RESLEN, szU);
+        }
         else {
             MessageBoxW(hDlg, apxLoadResourceW(IDS_VALIDPASS, 0),
                         apxLoadResourceW(IDS_APPLICATION, 1),
                         MB_OK | MB_ICONSTOP);
             return FALSE;
         }
-    }             
+    }
     else {
+        apxServiceSetNames(hService, NULL, NULL, NULL, STAT_SYSTEM, L"");
+        lstrlcpyW(_currentEntry->szObjectName, SIZ_RESLEN, STAT_SYSTEM);
         if (IsDlgButtonChecked(hDlg, IDC_PPSLID) == BST_CHECKED)
             apxServiceSetOptions(hService,
                 _currentEntry->stServiceStatus.dwServiceType | SERVICE_INTERACTIVE_PROCESS,
@@ -349,7 +360,7 @@ BOOL __generalLogonSave(HWND hDlg)
     return TRUE;
 }
 
-BOOL __generalLoggingSave(HWND hDlg) 
+BOOL __generalLoggingSave(HWND hDlg)
 {
     WCHAR szB[SIZ_DESLEN];
 
@@ -361,24 +372,24 @@ BOOL __generalLoggingSave(HWND hDlg)
         return FALSE;
 
     GetDlgItemTextW(hDlg, IDC_PPLGLEVEL,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Level", szB); 
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Level", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGPATH,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Path", szB); 
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Path", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGPREFIX,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Prefix", szB); 
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"Prefix", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGSTDOUT,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"StdOutput", szB); 
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"StdOutput", szB);
     GetDlgItemTextW(hDlg, IDC_PPLGSTDERR,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"StdError", szB); 
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_log, L"StdError", szB);
 
     if (!(TST_BIT_FLAG(_propertyChanged, 1)))
         PostMessage(_gui_store->hMainWnd, WM_COMMAND, MAKEWPARAM(IDMS_REFRESH, 0), 0);
     return TRUE;
 }
 
-BOOL __generalJvmSave(HWND hDlg) 
+BOOL __generalJvmSave(HWND hDlg)
 {
-    WCHAR szB[SIZ_DESLEN];
+    WCHAR szB[SIZ_HUGLEN];
     LPWSTR p, s;
     DWORD  l;
     if (!(TST_BIT_FLAG(_propertyChanged, 4)))
@@ -388,14 +399,14 @@ BOOL __generalJvmSave(HWND hDlg)
     if (IS_INVALID_HANDLE(hService))
         return FALSE;
     if (!IsDlgButtonChecked(hDlg, IDC_PPJAUTO)) {
-        GetDlgItemTextW(hDlg, IDC_PPJJVM,  szB, SIZ_DESMAX);
+        GetDlgItemTextW(hDlg, IDC_PPJJVM,  szB, SIZ_HUGMAX);
     }
     else
         lstrcpyW(szB, L"auto");
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_java, L"Jvm", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPJCLASSPATH,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_java, L"Classpath", szB); 
-    
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_java, L"Jvm", szB);
+    GetDlgItemTextW(hDlg, IDC_PPJCLASSPATH,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_java, L"Classpath", szB);
+
     l = GetWindowTextLength(GetDlgItem(hDlg, IDC_PPJOPTIONS));
     p = apxPoolAlloc(hPool, (l + 2) * sizeof(WCHAR));
     GetDlgItemTextW(hDlg, IDC_PPJOPTIONS,  p, l + 1);
@@ -403,7 +414,7 @@ BOOL __generalJvmSave(HWND hDlg)
     apxFree(p);
     apxRegistrySetMzStrW(hRegserv, APXREG_PARAMSOFTWARE,
                          _s_java, L"Options", s, l);
-    if (!GetDlgItemTextW(hDlg, IDC_PPJMS,  szB, SIZ_DESMAX))
+    if (!GetDlgItemTextW(hDlg, IDC_PPJMS,  szB, SIZ_HUGMAX))
         szB[0] = L'\0';
 
     apxRegistrySetNumW(hRegserv, APXREG_PARAMSOFTWARE, _s_java, L"JvmMs",
@@ -422,9 +433,9 @@ BOOL __generalJvmSave(HWND hDlg)
     return TRUE;
 }
 
-BOOL __generalStartSave(HWND hDlg) 
+BOOL __generalStartSave(HWND hDlg)
 {
-    WCHAR szB[SIZ_DESLEN];
+    WCHAR szB[SIZ_HUGLEN];
     LPWSTR p, s;
     DWORD  l;
 
@@ -435,17 +446,17 @@ BOOL __generalStartSave(HWND hDlg)
     if (IS_INVALID_HANDLE(hService))
         return FALSE;
 
-    GetDlgItemTextW(hDlg, IDC_PPRCLASS,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Class", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPRIMAGE,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Image", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPRWPATH,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"WorkingPath", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPRMETHOD,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Method", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPRMODE,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Mode", szB); 
-    
+    GetDlgItemTextW(hDlg, IDC_PPRCLASS,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Class", szB);
+    GetDlgItemTextW(hDlg, IDC_PPRIMAGE,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Image", szB);
+    GetDlgItemTextW(hDlg, IDC_PPRWPATH,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"WorkingPath", szB);
+    GetDlgItemTextW(hDlg, IDC_PPRMETHOD,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Method", szB);
+    GetDlgItemTextW(hDlg, IDC_PPRMODE,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_start, L"Mode", szB);
+
     l = GetWindowTextLength(GetDlgItem(hDlg, IDC_PPRARGS));
     p = apxPoolAlloc(hPool, (l + 2) * sizeof(WCHAR));
     GetDlgItemTextW(hDlg, IDC_PPRARGS,  p, l + 1);
@@ -460,9 +471,9 @@ BOOL __generalStartSave(HWND hDlg)
     return TRUE;
 }
 
-BOOL __generalStopSave(HWND hDlg) 
+BOOL __generalStopSave(HWND hDlg)
 {
-    WCHAR szB[SIZ_DESLEN];
+    WCHAR szB[SIZ_HUGLEN];
     LPWSTR p, s;
     DWORD  l;
 
@@ -473,19 +484,19 @@ BOOL __generalStopSave(HWND hDlg)
     if (IS_INVALID_HANDLE(hService))
         return FALSE;
 
-    GetDlgItemTextW(hDlg, IDC_PPSCLASS,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Class", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPSIMAGE,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Image", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPSWPATH,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"WorkingPath", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPSMETHOD,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Method", szB); 
-    GetDlgItemTextW(hDlg, IDC_PPSTIMEOUT,  szB, SIZ_DESMAX);
-    apxRegistrySetNumW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Timeout", apxAtoulW(szB)); 
-    GetDlgItemTextW(hDlg, IDC_PPSMODE,  szB, SIZ_DESMAX);
-    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Mode", szB); 
-    
+    GetDlgItemTextW(hDlg, IDC_PPSCLASS,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Class", szB);
+    GetDlgItemTextW(hDlg, IDC_PPSIMAGE,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Image", szB);
+    GetDlgItemTextW(hDlg, IDC_PPSWPATH,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"WorkingPath", szB);
+    GetDlgItemTextW(hDlg, IDC_PPSMETHOD,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Method", szB);
+    GetDlgItemTextW(hDlg, IDC_PPSTIMEOUT,  szB, SIZ_HUGMAX);
+    apxRegistrySetNumW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Timeout", apxAtoulW(szB));
+    GetDlgItemTextW(hDlg, IDC_PPSMODE,  szB, SIZ_HUGMAX);
+    apxRegistrySetStrW(hRegserv, APXREG_PARAMSOFTWARE, _s_stop, L"Mode", szB);
+
     l = GetWindowTextLength(GetDlgItem(hDlg, IDC_PPSARGS));
     p = apxPoolAlloc(hPool, (l + 2) * sizeof(WCHAR));
     GetDlgItemTextW(hDlg, IDC_PPSARGS,  p, l + 1);
@@ -545,11 +556,11 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
                                    LPARAM lParam)
 {
     LPPSHNOTIFY lpShn;
-    WCHAR       szBuf[1024]; 
+    WCHAR       szBuf[SIZ_DESLEN];
 
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
-            {              
+    switch (uMessage) {
+        case WM_INITDIALOG:
+            {
                 if (!bEnableTry)
                     apxCenterWindow(GetParent(hDlg), NULL);
                 else if (!bpropCentered)
@@ -558,8 +569,8 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
                 startPage = 0;
                 if (!bEnableTry)
                     apxCenterWindow(GetParent(hDlg), NULL);
-                SendMessage(GetDlgItem(hDlg, IDC_PPSGDISP), EM_LIMITTEXT, 255, 0);
-                SendMessage(GetDlgItem(hDlg, IDC_PPSGDESC), EM_LIMITTEXT, 1023, 0);
+                SendMessage(GetDlgItem(hDlg, IDC_PPSGDISP), EM_LIMITTEXT, SIZ_RESMAX, 0);
+                SendMessage(GetDlgItem(hDlg, IDC_PPSGDESC), EM_LIMITTEXT, SIZ_DESMAX, 0);
 
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSGCMBST), START_AUTO);
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSGCMBST), START_MANUAL);
@@ -582,13 +593,13 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
             switch (LOWORD(wParam)) {
                 case IDC_PPSGCMBST:
                     if (HIWORD(wParam) == CBN_SELCHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 1);
                     }
                 break;
                 case IDC_PPSGDISP:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSGDISP, szBuf, 255);
+                        GetDlgItemTextW(hDlg, IDC_PPSGDISP, szBuf, SIZ_RESMAX);
                         if (!lstrcmpW(szBuf, _currentEntry->lpConfig->lpDisplayName)) {
                             PropSheet_UnChanged(GetParent(hDlg), hDlg);
                             CLR_BIT_FLAG(_propertyChanged, 1);
@@ -601,7 +612,7 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
                 break;
                 case IDC_PPSGDESC:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSGDESC, szBuf, 1023);
+                        GetDlgItemTextW(hDlg, IDC_PPSGDESC, szBuf, SIZ_DESMAX);
                         if (!lstrcmpW(szBuf, _currentEntry->szServiceDescription)) {
                             PropSheet_UnChanged(GetParent(hDlg), hDlg);
                             CLR_BIT_FLAG(_propertyChanged, 1);
@@ -638,10 +649,10 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
                 break;
             }
         break;
-        case WM_NOTIFY:           
+        case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalPropertySave(hDlg)) {
                         PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     }
@@ -649,7 +660,7 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
                         SET_BIT_FLAG(_propertyChanged, 1);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -660,7 +671,7 @@ LRESULT CALLBACK __generalProperty(HWND hDlg,
         default:
         break;
     }
- 
+
     return FALSE;
 }
 
@@ -670,8 +681,8 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
                                  LPARAM lParam)
 {
     LPPSHNOTIFY lpShn;
-    WCHAR       szBuf[1024]; 
-    switch (uMessage) { 
+    WCHAR       szBuf[SIZ_DESLEN];
+    switch (uMessage) {
         case WM_INITDIALOG:
             {
                 BOOL           bAccount = FALSE;
@@ -693,7 +704,7 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
                 }
                 else {
                     CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, IDC_PPSLLS);
-                    if (_currentEntry->lpConfig->dwServiceType & 
+                    if (_currentEntry->lpConfig->dwServiceType &
                         SERVICE_INTERACTIVE_PROCESS)
                         CheckDlgButton(hDlg, IDC_PPSLID, BST_CHECKED);
                 }
@@ -719,13 +730,13 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
                     EnableWindow(GetDlgItem(hDlg, IDC_PPSLPASS), FALSE);
                     EnableWindow(GetDlgItem(hDlg, IDL_PPSLCPASS), FALSE);
                     EnableWindow(GetDlgItem(hDlg, IDC_PPSLCPASS), FALSE);
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);                     
+                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);
                     if (lstrcmpiW(_currentEntry->szObjectName, STAT_SYSTEM)) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 2);
                     }
                     else {
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                         CLR_BIT_FLAG(_propertyChanged, 2);
                     }
                     break;
@@ -740,23 +751,23 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
                     EnableWindow(GetDlgItem(hDlg, IDC_PPSLPASS), TRUE);
                     EnableWindow(GetDlgItem(hDlg, IDL_PPSLCPASS), TRUE);
                     EnableWindow(GetDlgItem(hDlg, IDC_PPSLCPASS), TRUE);
-                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);                     
+                    CheckRadioButton(hDlg, IDC_PPSLLS, IDC_PPSLUA, (INT)wParam);
                     if (lstrcmpW(_currentEntry->szObjectName, STAT_SYSTEM)) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 2);
                     }
                     else {
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                         CLR_BIT_FLAG(_propertyChanged, 2);
                     }
                     break;
                 case IDC_PPSLID:
-                    PropSheet_Changed(GetParent(hDlg), hDlg); 
+                    PropSheet_Changed(GetParent(hDlg), hDlg);
                     SET_BIT_FLAG(_propertyChanged, 2);
                 break;
                 case IDC_PPSLUSER:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        GetDlgItemTextW(hDlg, IDC_PPSLUSER, szBuf, 63);
+                        GetDlgItemTextW(hDlg, IDC_PPSLUSER, szBuf, SIZ_RESMAX);
                         if (!lstrcmpiW(szBuf, _currentEntry->szObjectName)) {
                             PropSheet_UnChanged(GetParent(hDlg), hDlg);
                             CLR_BIT_FLAG(_propertyChanged, 2);
@@ -770,10 +781,10 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
                 case IDC_PPSLPASS:
                 case IDC_PPSLCPASS:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        WCHAR szP[64];
-                        WCHAR szC[64];
-                        GetDlgItemTextW(hDlg, IDC_PPSLPASS, szP, 63);
-                        GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, 63);
+                        WCHAR szP[SIZ_RESLEN];
+                        WCHAR szC[SIZ_RESLEN];
+                        GetDlgItemTextW(hDlg, IDC_PPSLPASS, szP, SIZ_RESMAX);
+                        GetDlgItemTextW(hDlg, IDC_PPSLCPASS, szC, SIZ_RESMAX);
                         /* check for valid password match */
                         if (szP[0] == L' ' &&  szC[0] == L' ') {
                             PropSheet_UnChanged(GetParent(hDlg), hDlg);
@@ -797,14 +808,14 @@ LRESULT CALLBACK __logonProperty(HWND hDlg,
         case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalLogonSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     else {
                         SET_BIT_FLAG(_propertyChanged, 2);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -825,8 +836,8 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
     LPPSHNOTIFY lpShn;
     LPWSTR      lpBuf;
 
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
+    switch (uMessage) {
+        case WM_INITDIALOG:
             {
                 LPWSTR b;
                 startPage = 2;
@@ -850,61 +861,68 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
                     apxFree(b);
                 }
                 else
-                    ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_PPLGLEVEL), 0);
+                    ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_PPLGLEVEL), 1);
                 if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
                                                _s_log, L"Path")) != NULL) {
-                    SetDlgItemTextW(hDlg, IDC_PPLGPATH, b);                    
+                    SetDlgItemTextW(hDlg, IDC_PPLGPATH, b);
                     apxFree(b);
                 }
                 if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
+                                               _s_log, L"Prefix")) != NULL) {
+                    SetDlgItemTextW(hDlg, IDC_PPLGPREFIX, b);
+                    apxFree(b);
+                }
+                else
+                    SetDlgItemTextW(hDlg, IDC_PPLGPREFIX, L"jakarta_service_");
+                if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
                                                _s_log, L"StdOutput")) != NULL) {
-                    SetDlgItemTextW(hDlg, IDC_PPLGSTDOUT, b);                    
+                    SetDlgItemTextW(hDlg, IDC_PPLGSTDOUT, b);
                     apxFree(b);
                 }
                 if ((b = apxRegistryGetStringW(hRegserv, APXREG_PARAMSOFTWARE,
                                                _s_log, L"StdError")) != NULL) {
-                    SetDlgItemTextW(hDlg, IDC_PPLGSTDERR, b);                    
+                    SetDlgItemTextW(hDlg, IDC_PPLGSTDERR, b);
                     apxFree(b);
-                }                
+                }
             }
         break;
         case WM_COMMAND:
             switch (LOWORD(wParam)) {
                 case IDC_PPLGLEVEL:
                     if (HIWORD(wParam) == CBN_SELCHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
                 case IDC_PPLGPATH:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 3);                    
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
+                        SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
                 case IDC_PPLGPREFIX:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 3);                    
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
+                        SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
                 case IDC_PPLGSTDERR:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 3);                    
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
+                        SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
                 case IDC_PPLGSTDOUT:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
-                        SET_BIT_FLAG(_propertyChanged, 3);                    
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
+                        SET_BIT_FLAG(_propertyChanged, 3);
                     }
                 break;
                 case IDC_PPLGBPATH:
                     lpBuf = apxBrowseForFolderW(hDlg, apxLoadResourceW(IDS_LGPATHTITLE, 0),
                                                 NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPLGPATH, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPLGPATH, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 3);
@@ -915,7 +933,7 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
                                             apxLoadResourceW(IDS_ALLFILES, 1), NULL,
                                             NULL, FALSE, NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPLGSTDOUT, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPLGSTDOUT, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 3);
@@ -926,7 +944,7 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
                                             apxLoadResourceW(IDS_ALLFILES, 1), NULL,
                                             NULL, FALSE, NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPLGSTDERR, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPLGSTDERR, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 3);
@@ -937,14 +955,14 @@ LRESULT CALLBACK __loggingProperty(HWND hDlg,
         case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalLoggingSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     else {
                         SET_BIT_FLAG(_propertyChanged, 3);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -967,8 +985,8 @@ LRESULT CALLBACK __jvmProperty(HWND hDlg,
     DWORD       v;
     CHAR        bn[32];
 
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
+    switch (uMessage) {
+        case WM_INITDIALOG:
             {
                 startPage = 3;
                 if (!bpropCentered)
@@ -1031,14 +1049,14 @@ LRESULT CALLBACK __jvmProperty(HWND hDlg,
                                             TRUE, NULL);
                     apxFree(b);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPJJVM, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPJJVM, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 4);
                     }
                 break;
                 case IDC_PPJAUTO:
-                    PropSheet_Changed(GetParent(hDlg), hDlg); 
+                    PropSheet_Changed(GetParent(hDlg), hDlg);
                     SET_BIT_FLAG(_propertyChanged, 4);
                     if (IsDlgButtonChecked(hDlg, IDC_PPJAUTO)) {
                         EnableWindow(GetDlgItem(hDlg, IDC_PPJJVM), FALSE);
@@ -1061,7 +1079,7 @@ LRESULT CALLBACK __jvmProperty(HWND hDlg,
                 case IDC_PPJMS:
                 case IDC_PPJSS:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 4);
                     }
                 break;
@@ -1070,14 +1088,14 @@ LRESULT CALLBACK __jvmProperty(HWND hDlg,
         case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalJvmSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     else {
                         SET_BIT_FLAG(_propertyChanged, 4);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -1098,15 +1116,15 @@ LRESULT CALLBACK __startProperty(HWND hDlg,
     LPPSHNOTIFY lpShn;
     LPWSTR      lpBuf, b;
 
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
+    switch (uMessage) {
+        case WM_INITDIALOG:
             {
                 startPage = 4;
                 if (!bpropCentered)
                     apxCenterWindow(GetParent(hDlg), NULL);
                 bpropCentered = TRUE;
 
-                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPRMODE), L"");
+                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPRMODE), L"exe");
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPRMODE), L"jvm");
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPRMODE), _s_java);
 
@@ -1161,7 +1179,7 @@ LRESULT CALLBACK __startProperty(HWND hDlg,
                     lpBuf = apxBrowseForFolderW(hDlg, apxLoadResourceW(IDS_PPWPATH, 0),
                                                 NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPRWPATH, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPRWPATH, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 5);
@@ -1172,7 +1190,7 @@ LRESULT CALLBACK __startProperty(HWND hDlg,
                                             apxLoadResourceW(IDS_EXEFILES, 1), NULL,
                                             NULL, TRUE, NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPRIMAGE, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPRIMAGE, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 5);
@@ -1184,13 +1202,13 @@ LRESULT CALLBACK __startProperty(HWND hDlg,
                 case IDC_PPRIMAGE:
                 case IDC_PPRWPATH:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 5);
                     }
                 break;
                 case IDC_PPRMODE:
                     if (HIWORD(wParam) == CBN_SELCHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 5);
                         if (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PPRMODE))) {
                             EnableWindow(GetDlgItem(hDlg, IDC_PPRIMAGE), FALSE);
@@ -1208,14 +1226,14 @@ LRESULT CALLBACK __startProperty(HWND hDlg,
         case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalStartSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     else {
                         SET_BIT_FLAG(_propertyChanged, 5);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -1237,15 +1255,15 @@ LRESULT CALLBACK __stopProperty(HWND hDlg,
     LPWSTR      lpBuf, b;
     DWORD       v;
 
-    switch (uMessage) { 
-        case WM_INITDIALOG: 
+    switch (uMessage) {
+        case WM_INITDIALOG:
             {
                 startPage = 5;
                 if (!bpropCentered)
                     apxCenterWindow(GetParent(hDlg), NULL);
                 bpropCentered = TRUE;
 
-                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSMODE), L"");
+                ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSMODE), L"exe");
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSMODE), L"jvm");
                 ComboBox_AddStringW(GetDlgItem(hDlg, IDC_PPSMODE), _s_java);
 
@@ -1307,7 +1325,7 @@ LRESULT CALLBACK __stopProperty(HWND hDlg,
                     lpBuf = apxBrowseForFolderW(hDlg, apxLoadResourceW(IDS_PPWPATH, 0),
                                                 NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPSWPATH, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPSWPATH, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 6);
@@ -1318,7 +1336,7 @@ LRESULT CALLBACK __stopProperty(HWND hDlg,
                                             apxLoadResourceW(IDS_EXEFILES, 1), NULL,
                                             NULL, TRUE, NULL);
                     if (lpBuf) {
-                        SetDlgItemTextW(hDlg, IDC_PPSIMAGE, lpBuf);                    
+                        SetDlgItemTextW(hDlg, IDC_PPSIMAGE, lpBuf);
                         apxFree(lpBuf);
                         PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 6);
@@ -1331,13 +1349,13 @@ LRESULT CALLBACK __stopProperty(HWND hDlg,
                 case IDC_PPSIMAGE:
                 case IDC_PPSWPATH:
                     if (HIWORD(wParam) == EN_CHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 6);
                     }
                 break;
                 case IDC_PPSMODE:
                     if (HIWORD(wParam) == CBN_SELCHANGE) {
-                        PropSheet_Changed(GetParent(hDlg), hDlg); 
+                        PropSheet_Changed(GetParent(hDlg), hDlg);
                         SET_BIT_FLAG(_propertyChanged, 6);
                         if (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PPSMODE))) {
                             EnableWindow(GetDlgItem(hDlg, IDC_PPSIMAGE), FALSE);
@@ -1355,14 +1373,14 @@ LRESULT CALLBACK __stopProperty(HWND hDlg,
         case WM_NOTIFY:
             lpShn = (LPPSHNOTIFY )lParam;
             switch (lpShn->hdr.code) {
-                case PSN_APPLY:   /* sent when OK or Apply button pressed */ 
+                case PSN_APPLY:   /* sent when OK or Apply button pressed */
                     if (__generalStopSave(hDlg))
-                        PropSheet_UnChanged(GetParent(hDlg), hDlg); 
+                        PropSheet_UnChanged(GetParent(hDlg), hDlg);
                     else {
                         SET_BIT_FLAG(_propertyChanged, 6);
                         SetWindowLong(hDlg, DWLP_MSGRESULT,
                                       PSNRET_INVALID_NOCHANGEPAGE);
-                        return TRUE;                        
+                        return TRUE;
                     }
 
                 break;
@@ -1390,31 +1408,31 @@ void __initPpage(PROPSHEETPAGEW *lpPage, INT iDlg, INT iTitle, DLGPROC pfnDlgPro
 void ShowServiceProperties(HWND hWnd)
 {
     PROPSHEETPAGEW   psP[6];
-    PROPSHEETHEADERW psH; 
-    WCHAR           szT[1024] = {0};
-    
+    PROPSHEETHEADERW psH;
+    WCHAR           szT[SIZ_DESLEN] = {0};
+
     if (_propertyOpened) {
         SetForegroundWindow(_gui_store->hMainWnd);
         return;
     }
-    __initPpage(&psP[0], IDD_PROPPAGE_SGENERAL, IDS_PPGENERAL, 
+    __initPpage(&psP[0], IDD_PROPPAGE_SGENERAL, IDS_PPGENERAL,
                 __generalProperty);
-    __initPpage(&psP[1], IDD_PROPPAGE_LOGON, IDS_PPLOGON, 
+    __initPpage(&psP[1], IDD_PROPPAGE_LOGON, IDS_PPLOGON,
                 __logonProperty);
-    __initPpage(&psP[2], IDD_PROPPAGE_LOGGING, IDS_PPLOGGING, 
+    __initPpage(&psP[2], IDD_PROPPAGE_LOGGING, IDS_PPLOGGING,
                 __loggingProperty);
-    __initPpage(&psP[3], IDD_PROPPAGE_JVM, IDS_PPJAVAVM, 
+    __initPpage(&psP[3], IDD_PROPPAGE_JVM, IDS_PPJAVAVM,
                 __jvmProperty);
-    __initPpage(&psP[4], IDD_PROPPAGE_START, IDS_PPSTART, 
+    __initPpage(&psP[4], IDD_PROPPAGE_START, IDS_PPSTART,
                 __startProperty);
-    __initPpage(&psP[5], IDD_PROPPAGE_STOP, IDS_PPSTOP, 
+    __initPpage(&psP[5], IDD_PROPPAGE_STOP, IDS_PPSTOP,
                 __stopProperty);
 
     if (_currentEntry && _currentEntry->lpConfig)
-        lstrcpyW(szT, _currentEntry->lpConfig->lpDisplayName);
+        lstrlcpyW(szT, SIZ_DESMAX, _currentEntry->lpConfig->lpDisplayName);
     else
         return;
-    lstrcatW(szT, L" Properties");
+    lstrlcatW(szT, SIZ_DESMAX, L" Properties");
 
     psH.dwSize           = sizeof(PROPSHEETHEADER);
     psH.dwFlags          = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK | PSH_NOCONTEXTHELP;
@@ -1425,8 +1443,8 @@ void ShowServiceProperties(HWND hWnd)
     psH.nPages           = 6;
     psH.ppsp             = (LPCPROPSHEETPAGEW) &psP;
     psH.pfnCallback      = (PFNPROPSHEETCALLBACK)__propertyCallback;
-    psH.nStartPage       = startPage;   
-    
+    psH.nStartPage       = startPage;
+
     PropertySheetW(&psH);
     _propertyOpened = FALSE;
     if (!bEnableTry)
@@ -1440,13 +1458,15 @@ static void signalService(LPCWSTR szServiceName)
     HANDLE event;
     WCHAR en[SIZ_DESLEN];
     int i;
-    lstrcpyW(en, szServiceName);
-    lstrcatW(en, L"SIGNAL");
-    for (i = 0; i < lstrlenW(en); i++) {
+
+    lstrlcpyW(en, SIZ_DESLEN, L"Global\\");
+    lstrlcatW(en, SIZ_DESLEN, szServiceName);
+    lstrlcatW(en, SIZ_DESLEN, L"SIGNAL");
+    for (i = 7; i < lstrlenW(en); i++) {
         if (en[i] >= L'a' && en[i] <= L'z')
             en[i] = en[i] - 32;
     }
-    
+
 
     event = OpenEventW(EVENT_MODIFY_STATE, FALSE, en);
     if (event) {
@@ -1459,7 +1479,7 @@ static void signalService(LPCWSTR szServiceName)
 }
 
 LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
-                             WPARAM wParam, LPARAM lParam) 
+                             WPARAM wParam, LPARAM lParam)
 {
     switch (uMsg) {
         case WM_CREATE:
@@ -1481,21 +1501,21 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
 
         break;
         case WM_COMMAND:
-            switch(LOWORD(wParam)) { 
+            switch(LOWORD(wParam)) {
                 case IDM_TM_CONFIG:
                     ShowServiceProperties(hWnd);
                 break;
                 case IDM_TM_ABOUT:
-                    apxAboutBox(hWnd); 
+                    apxAboutBox(hWnd);
                 break;
                 case IDM_TM_EXIT:
-                    SendMessage(hWnd, WM_CLOSE, 0, 0);                
+                    SendMessage(hWnd, WM_CLOSE, 0, 0);
                 break;
                 case IDM_TM_START:
                     if (!_propertyOpened)
                         apxProgressBox(hWnd, apxLoadResource(IDS_HSSTART, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
-                                       __startServiceCallback, NULL); 
+                                       __startServiceCallback, NULL);
                 break;
                 case IDM_TM_STOP:
                     if (!_propertyOpened)
@@ -1514,17 +1534,17 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
                         apxProgressBox(hWnd, apxLoadResource(IDS_HSRESTART, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
                                        __restartServiceCallback, NULL);
-                break; 
+                break;
                 case IDM_TM_DUMP:
                     signalService(_currentEntry->szServiceName);
                 break;
                 case IDMS_REFRESH:
-                    if (bEnableTry && 
+                    if (bEnableTry &&
                         (_currentEntry = apxServiceEntry(hService, TRUE)) != NULL) {
                         BOOL isRunning = _currentEntry->stServiceStatus.dwCurrentState == SERVICE_RUNNING;
                         apxManageTryIconW(hWnd, NIM_MODIFY, NULL,
                                           _currentEntry->lpConfig->lpDisplayName,
-                                          isRunning ? hIcoRun : hIcoStop);                        
+                                          isRunning ? hIcoRun : hIcoStop);
                     }
                 break;
 
@@ -1542,7 +1562,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
             }
         break;
         case WM_QUIT:
-            return DefWindowProc(hWnd, uMsg, wParam, lParam); 
+            return DefWindowProc(hWnd, uMsg, wParam, lParam);
         break;
         case WM_DESTROY:
             if (bEnableTry)
@@ -1550,11 +1570,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg,
             PostQuitMessage(0);
         break;
         default:
-            return DefWindowProc(hWnd, uMsg, wParam, lParam); 
+            return DefWindowProc(hWnd, uMsg, wParam, lParam);
         break;
     }
 
-    return FALSE; 
+    return FALSE;
 }
 
 static BOOL loadConfiguration()
@@ -1598,7 +1618,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
     if (!lpCmdline->dwCmdIndex) {
         /* Skip sytem error message */
         SetLastError(ERROR_SUCCESS);
-        apxDisplayError(TRUE, NULL, 0, 
+        apxDisplayError(TRUE, NULL, 0,
                         apxLoadResourceA(IDS_ERRORCMD, 0),
                         lpCmdLine);
         goto cleanup;
@@ -1615,16 +1635,20 @@ int WINAPI WinMain(HINSTANCE hInstance,
     }
     /* Open the main service handle */
     if (!apxServiceOpen(hService, lpCmdline->szApplication,
-                        GENERIC_READ | GENERIC_EXECUTE)) {
+                        SERVICE_ALL_ACCESS)) {
         LPWSTR w = lpCmdline->szApplication + lstrlenW(lpCmdline->szApplication) - 1;
         if (*w == L'w')
             *w = L'\0';
         if (!apxServiceOpen(hService, lpCmdline->szApplication,
-                            GENERIC_READ | GENERIC_EXECUTE)) {
-            if (!quiet)
-                apxDisplayError(TRUE, NULL, 0, "Unable to open the service '%S'",
-                                lpCmdline->szApplication);
-            goto cleanup;
+                            SERVICE_ALL_ACCESS)) {
+            if (!apxServiceOpen(hService, lpCmdline->szApplication,
+                                GENERIC_READ | GENERIC_EXECUTE)) {
+
+                if (!quiet)
+                    apxDisplayError(TRUE, NULL, 0, "Unable to open the service '%S'",
+                                    lpCmdline->szApplication);
+                goto cleanup;
+            }
         }
     }
     /* Obtain service parameters and status */
@@ -1649,10 +1673,10 @@ int WINAPI WinMain(HINSTANCE hInstance,
         goto cleanup;
     }
     hIcoRun  = LoadImage(_gui_store->hInstance, MAKEINTRESOURCE(IDI_ICONRUN),
-                         IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);  
+                         IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
     hIcoStop = LoadImage(_gui_store->hInstance, MAKEINTRESOURCE(IDI_ICONSTOP),
-                         IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);  
-    
+                         IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+
     /* Handle //MQ// option */
     if (lpCmdline->dwCmdIndex == 4) {
         HANDLE hOther = FindWindow(_gui_store->szWndClass, NULL);
@@ -1663,7 +1687,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
 
     if (!_options[0].dwValue) {
         mutex = CreateMutex(NULL, FALSE, _gui_store->szWndMutex);
-        if ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) { 
+        if ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) {
             /* Skip sytem error message */
             SetLastError(ERROR_SUCCESS);
             if (!quiet)
@@ -1676,7 +1700,8 @@ int WINAPI WinMain(HINSTANCE hInstance,
                                   apxLoadResource(IDS_APPLICATION, 0),
                                   APXREG_USER);
     loadConfiguration();
-    hRegserv = apxCreateRegistryW(hPool, KEY_READ | KEY_WRITE, PRG_REGROOT,
+    hRegserv = apxCreateRegistryW(hPool, KEY_READ | KEY_WRITE | KREG_WOW6432,
+                                  PRG_REGROOT,
                                   lpCmdline->szApplication,
                                   APXREG_SOFTWARE | APXREG_SERVICE);
 
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp b/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp
index 423a293..122e57b 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.dsp
@@ -7,21 +7,21 @@
 CFG=prunmgr - Win32 Unicode Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "prunmgr.mak".
-!MESSAGE 
+!MESSAGE
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "prunmgr.mak" CFG="prunmgr - Win32 Unicode Debug"
-!MESSAGE 
+!MESSAGE
 !MESSAGE Possible choices for configuration are:
-!MESSAGE 
+!MESSAGE
 !MESSAGE "prunmgr - Win32 Release" (based on "Win32 (x86) Application")
 !MESSAGE "prunmgr - Win32 Debug" (based on "Win32 (x86) Application")
 !MESSAGE "prunmgr - Win32 Unicode Release" (based on "Win32 (x86) Application")
 !MESSAGE "prunmgr - Win32 Unicode Debug" (based on "Win32 (x86) Application")
-!MESSAGE 
+!MESSAGE
 
 # Begin Project
 # PROP AllowPerConfigDependencies 0
@@ -81,7 +81,12 @@ BSC32=bscmake.exe
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/prunmgrd.exe" /pdbtype:sept
-
+# Begin Special Build Tool
+TargetPath=.\Debug\httpd.exe
+SOURCE="$(InputPath)"
+PostBuild_Desc=Embed .manifest
+PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
+# End Special Build Tool
 !ELSEIF  "$(CFG)" == "prunmgr - Win32 Unicode Release"
 
 # PROP BASE Use_MFC 0
@@ -107,6 +112,12 @@ BSC32=bscmake.exe
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386
 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /machine:I386 /out:"Unicode Release/prunmgru.exe"
+# Begin Special Build Tool
+TargetPath=.\Debug\httpd.exe
+SOURCE="$(InputPath)"
+PostBuild_Desc=Embed .manifest
+PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
+# End Special Build Tool
 
 !ELSEIF  "$(CFG)" == "prunmgr - Win32 Unicode Debug"
 
@@ -133,8 +144,14 @@ BSC32=bscmake.exe
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Unicode Debug/prunmgrdu.exe" /pdbtype:sept
-
-!ENDIF 
+# Begin Special Build Tool
+TargetPath=.\Debug\httpd.exe
+SOURCE="$(InputPath)"
+PostBuild_Desc=Embed .manifest
+PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);1
+# End Special Build Tool
+
+!ENDIF
 
 # Begin Target
 
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.h b/src/native/nt/procrun/apps/prunmgr/prunmgr.h
index 323c0cf..8677178 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.h
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,6 @@
  */
  
 /* ====================================================================
- * jar2exe -- convert .jar file to WIN32 executable.
  * Contributed by Mladen Turk <mturk at apache.org>
  * 05 Aug 2003
  * ==================================================================== 
@@ -24,7 +24,7 @@
 #define _PRUNMGR_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "2.0.1.0" 
+#define PRG_VERSION    "1.0.2.0" 
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #define IDM_TM_EXIT                     2000
@@ -137,3 +137,4 @@
 #define IDS_NOTIMPLEMENTED              3199
  
 #endif /* _PRUNMGR_H */
+
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64 b/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64
new file mode 100644
index 0000000..0f47bb4
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.ia64
@@ -0,0 +1,110 @@
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_ia64
+INTDIR=.\Release_ia64
+# Begin Custom Macros
+OutDir=.\Release_ia64
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunmgr.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunmgr.obj"
+	- at erase "$(INTDIR)\prunmgr.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunmgr.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H  /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+MTL=midl.exe
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib bufferoverflowu.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:IA64 /out:"$(OUTDIR)\prunmgr.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunmgr.obj" \
+	"$(INTDIR)\prunmgr.res" \
+	"..\..\Release_ia64\libprocrun.lib"
+
+"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
+
+SOURCE=.\prunmgr.c
+
+"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunmgr.rc
+
+"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.ia64
+   cd ".\APPS\prunmgr"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.ia64 RECURSE=1 CLEAN 
+   cd ".\APPS\prunmgr"
+
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.manifest b/src/native/nt/procrun/apps/prunmgr/prunmgr.manifest
index e67bb32..7d4e33b 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.manifest
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.manifest
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
-<assemblyIdentity version="2.0.1.0" processorArchitecture="X86" name="Apache.Procrun.Prunmgr" type="win32" /> 
-<description>Procrun Service Manager</description> 
+<assemblyIdentity version="3.1.0.0" processorArchitecture="*" name="Apache.Procrun.Prunmgr" type="win32" /> 
+<description>Apache Procrun Service Manager</description> 
 <dependency> 
 <dependentAssembly> 
-<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> 
+<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> 
 </dependentAssembly> 
 </dependency> 
 </assembly> 
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.rc b/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
index a4c2021..5edd4ca 100644
--- a/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.rc
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -16,22 +17,20 @@
 #include "apxwin.h"
 #include "prunmgr.h"
 
-#define RSTR_PSM        "Procrun Service Manager"
+#define RSTR_PSM        "Commons Daemon Service Manager"
 #define RSTR_SCMATS     "Service Manager is attempting to "
  
 IDI_MAINICON         ICON                   "../../resources/procrunw.ico" 
 IDI_ICONSTOP         ICON                   "../../resources/procruns.ico" 
 IDI_ICONRUN          ICON                   "../../resources/procrunr.ico" 
 IDR_LICENSE          RTF                    "../../resources/license.rtf"
-BMP_JAKARTA          BITMAP                 "../../resources/jakarta.bmp"
+BMP_JAKARTA          BITMAP                 "../../resources/commons.bmp"
 
 #if 0 
 BMP_APMNUHDR         BITMAP                 "../../resources/apmnuhdr.bmp"
 #endif
 
-#ifdef USE_MAINFEST
 CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "prunmgr.manifest"
-#endif
 
 IDD_ABOUTBOX DIALOGEX 0, 0, 337, 187
 STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
@@ -43,8 +42,8 @@ BEGIN
                     ES_READONLY | WS_BORDER | WS_VSCROLL,0,31,335,115
     CONTROL         "BMP_JAKARTA",IDC_STATIC,"Static",SS_BITMAP|0x00000040L,0,0,337,30
     LTEXT           " ",IDC_ABOUTAPP,2,150,270,12
-    LTEXT           "Copyright � 2000-2003 The Apache Software Foundation.",IDC_STATIC,2,160,270,12
-    LTEXT           "http://www.jakarta.org",IDC_STATIC,2,170,270,12 
+    LTEXT           "Copyright � 2000-2010 The Apache Software Foundation.",IDC_STATIC,2,160,270,12
+    LTEXT           "http://commons.apache.org",IDC_STATIC,2,170,270,12 
     PUSHBUTTON      "&System Info",IAB_SYSINF,285,170,50,14
 END
 
@@ -52,7 +51,7 @@ IDD_PROGRESS DIALOGEX 0, 0, 322, 92
 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | 
     WS_CAPTION | WS_SYSMENU
 EXSTYLE WS_EX_TOPMOST
-CAPTION "Apache Service Manager"
+CAPTION "Apache Commons Daemon Service Manager"
 FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
     DEFPUSHBUTTON   "Cl&ose",IDOK,261,73,50,14
@@ -226,10 +225,10 @@ END
 STRINGTABLE 
 BEGIN
     IDS_APPLICATION     RSTR_PSM
-    IDS_APPVERSION      "Version 1.0.0"
+    IDS_APPVERSION      "Version 1.0.2"
     IDS_APPFULLNAME     RSTR_PSM " Version " PRG_VERSION
-    IDS_APPCOPYRIGHT    "Copyright � 2000-2004 The Apache Software Foundation"
-    IDS_APPDESCRIPTION  "Apache Procrun Service Management Tool"
+    IDS_APPCOPYRIGHT    "Copyright � 2000-2010 The Apache Software Foundation"
+    IDS_APPDESCRIPTION  "Apache Commons Daemon Service Management Tool"
     IDS_ALREAY_RUNING   "An instance of '%S' application is already running"
     IDS_ERRORCMD        "Unknown command line option '%s'\nSee the manual for command line usage."
     IDS_HSSTART         RSTR_SCMATS "start the following service ..."
@@ -257,8 +256,8 @@ BEGIN
 END
 
 1 VERSIONINFO
- FILEVERSION 2,0,1,0
- PRODUCTVERSION 2,0,1,0
+ FILEVERSION 1,0,2,0
+ PRODUCTVERSION 1,0,2,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
@@ -273,12 +272,12 @@ BEGIN
   BEGIN
     BLOCK "040904b0"
     BEGIN
-      VALUE "Comments", "Procrun Service Management Tool\0"
+      VALUE "Comments", "Commons Daemon Service Management Tool\0"
       VALUE "CompanyName", "Apache Software Foundation\0"
       VALUE "FileDescription", RSTR_PSM "\0"
       VALUE "FileVersion", PRG_VERSION
       VALUE "InternalName", RSTR_PSM "\0"
-      VALUE "LegalCopyright", "Copyright � 2000-2006 The Apache Software Foundation.\0"
+      VALUE "LegalCopyright", "Copyright � 2000-2010 The Apache Software Foundation.\0"
       VALUE "OriginalFilename", "prunmgr.exe\0"
       VALUE "ProductName", RSTR_PSM "\0"
       VALUE "ProductVersion", PRG_VERSION
@@ -289,3 +288,4 @@ BEGIN
     VALUE "Translation", 0x409, 1200
   END
 END
+
diff --git a/src/native/nt/procrun/apps/prunmgr/prunmgr.x86 b/src/native/nt/procrun/apps/prunmgr/prunmgr.x86
new file mode 100644
index 0000000..a6d57c1
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunmgr/prunmgr.x86
@@ -0,0 +1,110 @@
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_x86
+INTDIR=.\Release_x86
+# Begin Custom Macros
+OutDir=.\Release_x86
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunmgr.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunmgr.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunmgr.obj"
+	- at erase "$(INTDIR)\prunmgr.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunmgr.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\prunmgr.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+MTL=midl.exe
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "USE_MANIFEST"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunmgr.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib comctl32.lib netapi32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\prunmgr.pdb" /machine:I386 /out:"$(OUTDIR)\prunmgr.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunmgr.obj" \
+	"$(INTDIR)\prunmgr.res" \
+	"..\..\Release_x86\libprocrun.lib"
+
+"$(OUTDIR)\prunmgr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+	if exist $(OUTDIR)\prunmgr.exe.manifest mt.exe -manifest $(OUTDIR)\prunmgr.exe.manifest -outputresource:$(OUTDIR)\prunmgr.exe;1
+
+SOURCE=.\prunmgr.c
+
+"$(INTDIR)\prunmgr.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunmgr.rc
+
+"$(INTDIR)\prunmgr.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunmgr.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" /d "USE_MANIFEST" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.x86
+   cd ".\APPS\prunmgr"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.x86 RECURSE=1 CLEAN 
+   cd ".\APPS\prunmgr"
+
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64 b/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64
new file mode 100644
index 0000000..ee8a2be
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.amd64
@@ -0,0 +1,109 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_amd64
+INTDIR=.\Release_amd64
+# Begin Custom Macros
+OutDir=.\Release_amd64
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunsrv.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunsrv.obj"
+	- at erase "$(INTDIR)\prunsrv.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunsrv.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32"  /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib bufferoverflowu.lib /nologo /stack:0x40000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:AMD64 /out:"$(OUTDIR)\prunsrv.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunsrv.obj" \
+	"$(INTDIR)\prunsrv.res" \
+	"..\..\Release_amd64\libprocrun.lib"
+
+"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
+
+SOURCE=.\prunsrv.c
+
+"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunsrv.rc
+
+"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.amd64
+   cd ".\APPS\prunsrv"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.amd64 RECURSE=1 CLEAN 
+   cd ".\APPS\prunsrv"
+
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.c b/src/native/nt/procrun/apps/prunsrv/prunsrv.c
index cae26a5..0ea3dc7 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.c
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 /* ====================================================================
  * prunsrv -- Service Runner.
  * Contributed by Mladen Turk <mturk at apache.org>
  * 05 Aug 2003
- * ==================================================================== 
+ * ====================================================================
  */
 
 /* Force the JNI vprintf functions */
@@ -31,9 +32,20 @@
 #include <fcntl.h>
 #include <io.h>         /* _open_osfhandle */
 
+#ifndef  MIN
+#define  MIN(a,b)    (((a)<(b)) ? (a) : (b))
+#endif
+
 #define STDIN_FILENO  0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
+#define ONE_MINUTE    (60 * 1000)
+
+#ifdef WIN64
+#define KREG_WOW6432  KEY_WOW64_32KEY
+#else
+#define KREG_WOW6432  0
+#endif
 
 typedef struct APX_STDWRAP {
     LPCWSTR szLogPath;
@@ -41,10 +53,8 @@ typedef struct APX_STDWRAP {
     LPCWSTR szStdErrFilename;
     HANDLE  hStdOutFile;
     HANDLE  hStdErrFile;
-    FILE    *fpStdOutFile;
-    FILE    *fpStdErrFile;
-    FILE    fpStdOutSave;
-    FILE    fpStdErrSave;
+    int     fdStdOutFile;
+    int     fdStdErrFile;
 } APX_STDWRAP;
 
 /* Use static variables instead of #defines */
@@ -55,6 +65,8 @@ static LPCWSTR      PRSRV_MANUAL = L"manual";
 static LPCWSTR      PRSRV_JBIN   = L"\\bin\\java.exe";
 static LPCWSTR      PRSRV_SIGNAL = L"SIGNAL";
 
+static LPCWSTR      STYPE_INTERACTIVE = L"interactive";
+
 static LPWSTR       _service_name = NULL;
 /* Allowed procrun commands */
 static LPCWSTR _commands[] = {
@@ -73,40 +85,44 @@ static APXCMDLINEOPT _options[] = {
 /* 0  */    { L"Description",       L"Description",     NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
 /* 1  */    { L"DisplayName",       L"DisplayName",     NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
 /* 2  */    { L"Install",           L"ImagePath",       NULL,           APXCMDOPT_STE | APXCMDOPT_SRV, NULL, 0},
-/* 3  */    { L"Startup",           L"Startup",         NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
-/* 4  */    { L"DependsOn",         L"DependsOn",       NULL,           APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
-/* 5  */    { L"Environment",       L"Environment",     NULL,           APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
-/* 6  */    { L"User",              L"User",            NULL,           APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 7  */    { L"Password",          L"Password",        NULL,           APXCMDOPT_BIN | APXCMDOPT_REG, NULL, 0},
-
-/* 8  */    { L"JavaHome",          L"JavaHome",        L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 9  */    { L"Jvm",               L"Jvm",             L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 10 */    { L"JvmOptions",        L"Options",         L"Java",        APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
-/* 11 */    { L"Classpath",         L"Classpath",       L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 12 */    { L"JvmMs",             L"JvmMs",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
-/* 13 */    { L"JvmMx",             L"JvmMx",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
-/* 14 */    { L"JvmSs",             L"JvmSs",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
-
-/* 15 */    { L"StopImage",         L"Image",           L"Stop",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 16 */    { L"StopPath",          L"WorkingPath",     L"Stop",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 17 */    { L"StopClass",         L"Class",           L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 18 */    { L"StopParams",        L"Params",          L"Stop",        APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
-/* 19 */    { L"StopMethod",        L"Method",          L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 20 */    { L"StopMode",          L"Mode",            L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 21 */    { L"StopTimeout",       L"Timeout",         L"Stop",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
-
-/* 22 */    { L"StartImage",        L"Image",           L"Start",       APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 23 */    { L"StartPath",         L"WorkingPath",     L"Start",       APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 24 */    { L"StartClass",        L"Class",           L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 25 */    { L"StartParams",       L"Params",          L"Start",       APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
-/* 26 */    { L"StartMethod",       L"Method",          L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 27 */    { L"StartMode",         L"Mode",            L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-
-/* 28 */    { L"LogPath",           L"Path",            L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 29 */    { L"LogPrefix",         L"Prefix",          L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 30 */    { L"LogLevel",          L"Level",           L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
-/* 31 */    { L"StdError",          L"StdError",        L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
-/* 32 */    { L"StdOutput",         L"StdOutput",       L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 3  */    { L"ServiceUser",       L"ServiceUser",     NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
+/* 4  */    { L"ServicePassword",   L"ServicePassword", NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
+/* 5  */    { L"Startup",           L"Startup",         NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
+/* 6  */    { L"Type",              L"Type",            NULL,           APXCMDOPT_STR | APXCMDOPT_SRV, NULL, 0},
+
+/* 7  */    { L"DependsOn",         L"DependsOn",       NULL,           APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
+/* 8  */    { L"Environment",       L"Environment",     NULL,           APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
+/* 9  */    { L"User",              L"User",            NULL,           APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 10 */    { L"Password",          L"Password",        NULL,           APXCMDOPT_BIN | APXCMDOPT_REG, NULL, 0},
+
+/* 11 */    { L"JavaHome",          L"JavaHome",        L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 12 */    { L"Jvm",               L"Jvm",             L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 13 */    { L"JvmOptions",        L"Options",         L"Java",        APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
+/* 14 */    { L"Classpath",         L"Classpath",       L"Java",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 15 */    { L"JvmMs",             L"JvmMs",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
+/* 16 */    { L"JvmMx",             L"JvmMx",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
+/* 17 */    { L"JvmSs",             L"JvmSs",           L"Java",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
+
+/* 18 */    { L"StopImage",         L"Image",           L"Stop",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 19 */    { L"StopPath",          L"WorkingPath",     L"Stop",        APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 20 */    { L"StopClass",         L"Class",           L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 21 */    { L"StopParams",        L"Params",          L"Stop",        APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
+/* 22 */    { L"StopMethod",        L"Method",          L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 23 */    { L"StopMode",          L"Mode",            L"Stop",        APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 24 */    { L"StopTimeout",       L"Timeout",         L"Stop",        APXCMDOPT_INT | APXCMDOPT_REG, NULL, 0},
+
+/* 25 */    { L"StartImage",        L"Image",           L"Start",       APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 26 */    { L"StartPath",         L"WorkingPath",     L"Start",       APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 27 */    { L"StartClass",        L"Class",           L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 28 */    { L"StartParams",       L"Params",          L"Start",       APXCMDOPT_MSZ | APXCMDOPT_REG, NULL, 0},
+/* 29 */    { L"StartMethod",       L"Method",          L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 30 */    { L"StartMode",         L"Mode",            L"Start",       APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+
+/* 31 */    { L"LogPath",           L"Path",            L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 32 */    { L"LogPrefix",         L"Prefix",          L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 33 */    { L"LogLevel",          L"Level",           L"Log",         APXCMDOPT_STR | APXCMDOPT_REG, NULL, 0},
+/* 34 */    { L"StdError",          L"StdError",        L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
+/* 35 */    { L"StdOutput",         L"StdOutput",       L"Log",         APXCMDOPT_STE | APXCMDOPT_REG, NULL, 0},
             /* NULL terminate the array */
             { NULL }
 };
@@ -118,47 +134,54 @@ static APXCMDLINEOPT _options[] = {
 #define ST_DESCRIPTION      GET_OPT_T(0)
 #define ST_DISPLAYNAME      GET_OPT_T(1)
 #define ST_INSTALL          GET_OPT_T(2)
-#define ST_STARTUP          GET_OPT_T(3)
+#define ST_SUSER            GET_OPT_T(3)
+#define ST_SPASSWORD        GET_OPT_T(4)
+#define ST_STARTUP          GET_OPT_T(5)
+#define ST_TYPE             GET_OPT_T(6)
 
 #define SO_DESCRIPTION      GET_OPT_V(0)
 #define SO_DISPLAYNAME      GET_OPT_V(1)
 #define SO_INSTALL          GET_OPT_V(2)
-#define SO_STARTUP          GET_OPT_V(3)
-#define SO_DEPENDSON        GET_OPT_V(4)
-#define SO_ENVIRONMENT      GET_OPT_V(5)
-
-#define SO_USER             GET_OPT_V(6)
-#define SO_PASSWORD         GET_OPT_V(7)
-
-#define SO_JAVAHOME         GET_OPT_V(8)
-#define SO_JVM              GET_OPT_V(9)
-#define SO_JVMOPTIONS       GET_OPT_V(10)
-#define SO_CLASSPATH        GET_OPT_V(11)
-#define SO_JVMMS            GET_OPT_I(12)
-#define SO_JVMMX            GET_OPT_I(13)
-#define SO_JVMSS            GET_OPT_I(14)
-
-#define SO_STOPIMAGE        GET_OPT_V(15)
-#define SO_STOPPATH         GET_OPT_V(16)
-#define SO_STOPCLASS        GET_OPT_V(17)
-#define SO_STOPPARAMS       GET_OPT_V(18)
-#define SO_STOPMETHOD       GET_OPT_V(19)
-#define SO_STOPMODE         GET_OPT_V(20)
-#define SO_STOPTIMEOUT      GET_OPT_I(21)
-
-#define SO_STARTIMAGE       GET_OPT_V(22)
-#define SO_STARTPATH        GET_OPT_V(23)
-#define SO_STARTCLASS       GET_OPT_V(24)
-#define SO_STARTPARAMS      GET_OPT_V(25)
-#define SO_STARTMETHOD      GET_OPT_V(26)
-#define SO_STARTMODE        GET_OPT_V(27)
-
-#define SO_LOGPATH          GET_OPT_V(28)
-#define SO_LOGPREFIX        GET_OPT_V(29)
-#define SO_LOGLEVEL         GET_OPT_V(30)
-
-#define SO_STDERROR         GET_OPT_V(31)
-#define SO_STDOUTPUT        GET_OPT_V(32)
+#define SO_SUSER            GET_OPT_V(3)
+#define SO_SPASSWORD        GET_OPT_V(4)
+#define SO_STARTUP          GET_OPT_V(5)
+#define SO_TYPE             GET_OPT_V(6)
+
+#define SO_DEPENDSON        GET_OPT_V(7)
+#define SO_ENVIRONMENT      GET_OPT_V(8)
+
+#define SO_USER             GET_OPT_V(9)
+#define SO_PASSWORD         GET_OPT_V(10)
+
+#define SO_JAVAHOME         GET_OPT_V(11)
+#define SO_JVM              GET_OPT_V(12)
+#define SO_JVMOPTIONS       GET_OPT_V(13)
+#define SO_CLASSPATH        GET_OPT_V(14)
+#define SO_JVMMS            GET_OPT_I(15)
+#define SO_JVMMX            GET_OPT_I(16)
+#define SO_JVMSS            GET_OPT_I(17)
+
+#define SO_STOPIMAGE        GET_OPT_V(18)
+#define SO_STOPPATH         GET_OPT_V(19)
+#define SO_STOPCLASS        GET_OPT_V(20)
+#define SO_STOPPARAMS       GET_OPT_V(21)
+#define SO_STOPMETHOD       GET_OPT_V(22)
+#define SO_STOPMODE         GET_OPT_V(23)
+#define SO_STOPTIMEOUT      GET_OPT_I(24)
+
+#define SO_STARTIMAGE       GET_OPT_V(25)
+#define SO_STARTPATH        GET_OPT_V(26)
+#define SO_STARTCLASS       GET_OPT_V(27)
+#define SO_STARTPARAMS      GET_OPT_V(28)
+#define SO_STARTMETHOD      GET_OPT_V(29)
+#define SO_STARTMODE        GET_OPT_V(30)
+
+#define SO_LOGPATH          GET_OPT_V(31)
+#define SO_LOGPREFIX        GET_OPT_V(32)
+#define SO_LOGLEVEL         GET_OPT_V(33)
+
+#define SO_STDERROR         GET_OPT_V(34)
+#define SO_STDOUTPUT        GET_OPT_V(35)
 
 /* Main servic table entry
  * filled at run-time
@@ -167,30 +190,34 @@ static SERVICE_TABLE_ENTRYW _service_table[] = {
         {NULL, NULL},
         {NULL, NULL}
 };
- 
-static SERVICE_STATUS        _service_status; 
-static SERVICE_STATUS_HANDLE _service_status_handle = NULL; 
+
+static SERVICE_STATUS        _service_status;
+static SERVICE_STATUS_HANDLE _service_status_handle = NULL;
 /* Set if launched by SCM   */
 static BOOL                  _service_mode = FALSE;
 /* JVM used as worker       */
 static BOOL                  _jni_startup  = FALSE;
 /* JVM used for shutdown    */
 static BOOL                  _jni_shutdown = FALSE;
+/* Java used as worker       */
+static BOOL                  _java_startup  = FALSE;
+/* Java used for shutdown    */
+static BOOL                  _java_shutdown = FALSE;
 /* Global variables and objects */
 static APXHANDLE    gPool;
 static APXHANDLE    gWorker;
 static APX_STDWRAP  gStdwrap;           /* stdio/stderr redirection */
 
-static LPWSTR _jni_jvmpath              = NULL;   /* Path to jvm dll */
-static LPSTR  _jni_jvmoptions           = NULL;   /* Path to jvm options */
+static LPWSTR   _jni_jvmpath              = NULL;   /* Path to jvm dll */
+static LPSTR    _jni_jvmoptions           = NULL;   /* Path to jvm options */
 
-static LPSTR  _jni_classpath            = NULL;
-static LPSTR  _jni_rparam               = NULL;    /* Startup  arguments */
-static LPSTR  _jni_sparam               = NULL;    /* Shutdown arguments */
-static LPSTR  _jni_rmethod              = NULL;    /* Startup  arguments */
-static LPSTR  _jni_smethod              = NULL;    /* Shutdown arguments */
-static CHAR   _jni_rclass[SIZ_RESLEN]   = {'\0'};  /* Startup  class */
-static CHAR   _jni_sclass[SIZ_RESLEN]   = {'\0'};  /* Shutdown class */
+static LPSTR    _jni_classpath            = NULL;
+static LPCWSTR  _jni_rparam               = NULL;    /* Startup  arguments */
+static LPCWSTR  _jni_sparam               = NULL;    /* Shutdown arguments */
+static LPSTR    _jni_rmethod              = NULL;    /* Startup  arguments */
+static LPSTR    _jni_smethod              = NULL;    /* Shutdown arguments */
+static LPSTR    _jni_rclass               = NULL;    /* Startup  class */
+static LPSTR    _jni_sclass               = NULL;    /* Shutdown class */
 
 static HANDLE gShutdownEvent = NULL;
 static HANDLE gSignalEvent   = NULL;
@@ -213,7 +240,7 @@ DWORD WINAPI eventThread(LPVOID lpParam)
     return 0;
 }
 
-/* redirect console stdout/stderr to files 
+/* redirect console stdout/stderr to files
  * so that java messages can get logged
  * If stderrfile is not specified it will
  * go to stdoutfile.
@@ -223,22 +250,14 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
     BOOL aErr = FALSE;
     BOOL aOut = FALSE;
 
-    /* Clear up the handles */    
-    lpWrapper->fpStdErrFile = NULL;
-    lpWrapper->fpStdOutFile = NULL;
-    
-    /* Save the original streams */
-    lpWrapper->fpStdOutSave = *stdout;
-    lpWrapper->fpStdErrSave = *stderr;
-
     /* redirect to file or console */
     if (lpWrapper->szStdOutFilename) {
         if (lstrcmpiW(lpWrapper->szStdOutFilename, PRSRV_AUTO) == 0) {
             aOut = TRUE;
             lpWrapper->szStdOutFilename = apxLogFile(gPool,
                                                      lpWrapper->szLogPath,
-                                                     NULL,
-                                                     L"stdout_");
+                                                     L"stdout_",
+                                                     NULL);
         }
         /* Delete the file if not in append mode
          * XXX: See if we can use the params instead of that.
@@ -246,11 +265,11 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
         if (!aOut)
             DeleteFileW(lpWrapper->szStdOutFilename);
         lpWrapper->hStdOutFile = CreateFileW(lpWrapper->szStdOutFilename,
-                                             GENERIC_WRITE | GENERIC_READ,
+                                             GENERIC_WRITE,
                                              FILE_SHARE_READ | FILE_SHARE_WRITE,
                                              NULL,
                                              OPEN_ALWAYS,
-                                             FILE_ATTRIBUTE_NORMAL,
+                                             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
                                              NULL);
         if (IS_INVALID_HANDLE(lpWrapper->hStdOutFile))
             return FALSE;
@@ -259,12 +278,12 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
     }
     else {
         lpWrapper->hStdOutFile = CreateFileW(L"CONOUT$",
-                                             GENERIC_READ | GENERIC_WRITE, 
-                                             FILE_SHARE_READ | FILE_SHARE_WRITE, 
+                                             GENERIC_WRITE,
+                                             FILE_SHARE_READ | FILE_SHARE_WRITE,
                                              NULL,
                                              OPEN_EXISTING,
                                              0,
-                                             NULL); 
+                                             NULL);
         if (IS_INVALID_HANDLE(lpWrapper->hStdOutFile))
             return FALSE;
     }
@@ -273,17 +292,17 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
             aErr = TRUE;
             lpWrapper->szStdErrFilename = apxLogFile(gPool,
                                                      lpWrapper->szLogPath,
-                                                     NULL,
-                                                     L"stderr_");
+                                                     L"stderr_",
+                                                     NULL);
         }
         if (!aErr)
             DeleteFileW(lpWrapper->szStdErrFilename);
         lpWrapper->hStdErrFile = CreateFileW(lpWrapper->szStdErrFilename,
-                                             GENERIC_WRITE | GENERIC_READ,
+                                             GENERIC_WRITE,
                                              FILE_SHARE_READ | FILE_SHARE_WRITE,
                                              NULL,
                                              OPEN_ALWAYS,
-                                             FILE_ATTRIBUTE_NORMAL,
+                                             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
                                              NULL);
         if (IS_INVALID_HANDLE(lpWrapper->hStdErrFile))
             return FALSE;
@@ -297,44 +316,31 @@ static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
     else {
         lpWrapper->hStdErrFile = lpWrapper->hStdOutFile;
     }
-    /* Open the stream buffers 
+    /* Open the stream buffers
      * This will redirect all printf to go to the redirected files.
      * It is used for JNI vprintf functionality.
      */
-    lpWrapper->fpStdOutFile = _fdopen(_open_osfhandle(
-                                      (intptr_t)lpWrapper->hStdOutFile,
-                                      _O_TEXT), "w");
-    lpWrapper->fpStdErrFile = _fdopen(_open_osfhandle(
-                                      (intptr_t)lpWrapper->hStdErrFile,
-                                      _O_TEXT), "w");
-    if (lpWrapper->fpStdOutFile) {
-        *stdout = *lpWrapper->fpStdOutFile;
-        setvbuf(stdout, NULL, _IONBF, 0);
+    lpWrapper->fdStdOutFile = _open_osfhandle((ptrdiff_t)lpWrapper->hStdOutFile,
+                                              _O_WRONLY | _O_TEXT);
+    if (lpWrapper->fdStdOutFile > 0) {
+        lpWrapper->fdStdOutFile = dup2(lpWrapper->fdStdOutFile, 1);
+        if (lpWrapper->fdStdOutFile > 0)
+            setvbuf(stdout, NULL, _IONBF, 0);
     }
-    if (lpWrapper->fpStdErrFile) {
-        *stderr = *lpWrapper->fpStdErrFile;
-        setvbuf(stderr, NULL, _IONBF, 0);
+    lpWrapper->fdStdErrFile = _open_osfhandle((ptrdiff_t)lpWrapper->hStdErrFile,
+                                              _O_WRONLY | _O_TEXT);
+    if (lpWrapper->fdStdErrFile > 0) {
+        lpWrapper->fdStdErrFile = dup2(lpWrapper->fdStdErrFile, 2);
+        if (lpWrapper->fdStdErrFile > 0)
+            setvbuf(stderr, NULL, _IONBF, 0);
     }
-    return TRUE;
-}
 
-static void cleanupStdStreams(APX_STDWRAP *lpWrapper)
-{
-    /* Close the redirectied streams */
-    if (lpWrapper->fpStdOutFile) {
-        fclose(lpWrapper->fpStdOutFile);
-        *stdout = lpWrapper->fpStdOutSave;
-    }
-    if (lpWrapper->fpStdErrFile) {
-        fclose(lpWrapper->fpStdErrFile);
-        *stderr = lpWrapper->fpStdErrSave;
-    }
+    return TRUE;
 }
 
 /* Debugging functions */
 static void printUsage(LPAPXCMDLINE lpCmdline)
 {
-#ifdef _DEBUG
     int i = 0;
     fwprintf(stderr, L"Usage: %s //CMD//Servce [--options]\n",
              lpCmdline->szExecutable);
@@ -344,15 +350,14 @@ static void printUsage(LPAPXCMDLINE lpCmdline)
     fwprintf(stderr, L"  //DS//ServiceName  Delete Service\n");
     fwprintf(stderr, L"  //RS//ServiceName  Run Service\n");
     fwprintf(stderr, L"  //SS//ServiceName  Stop Service\n");
-    fwprintf(stderr,
-             L"  //TS//ServiceName  Run Service as console application\n");
+    fwprintf(stderr, L"  //TS//ServiceName  Run Service as console application\n");
     fwprintf(stderr, L"  Options:\n");
     while (_options[i].szName) {
         fwprintf(stderr, L"  --%s\n", _options[i].szName);
         ++i;
     }
-#endif
 }
+
 /* Display configuration parameters */
 static void dumpCmdline()
 {
@@ -376,7 +381,7 @@ static void setInprocEnvironment()
 
     if (!SO_ENVIRONMENT)
         return;    /* Nothing to do */
-    
+
     for (p = SO_ENVIRONMENT; *p; p++) {
         e = apxExpandStrW(gPool, p);
         _wputenv(e);
@@ -395,7 +400,8 @@ static BOOL loadConfiguration(LPAPXCMDLINE lpCmdline)
     int i = 0;
 
     SetLastError(ERROR_SUCCESS);
-    hRegistry = apxCreateRegistryW(gPool, KEY_READ, PRG_REGROOT,
+    hRegistry = apxCreateRegistryW(gPool, KEY_READ | KREG_WOW6432,
+                                   PRG_REGROOT,
                                    lpCmdline->szApplication,
                                    APXREG_SOFTWARE | APXREG_SERVICE);
     if (IS_INVALID_HANDLE(hRegistry)) {
@@ -455,7 +461,7 @@ static BOOL loadConfiguration(LPAPXCMDLINE lpCmdline)
         ++i;
     }
     apxCloseHandle(hRegistry);
-#ifdef _DEBUG    
+#ifdef _DEBUG
     dumpCmdline();
 #endif
     return TRUE;
@@ -467,7 +473,8 @@ static BOOL saveConfiguration(LPAPXCMDLINE lpCmdline)
 {
     APXHANDLE hRegistry;
     int i = 0;
-    hRegistry = apxCreateRegistryW(gPool, KEY_WRITE, PRG_REGROOT,
+    hRegistry = apxCreateRegistryW(gPool, KEY_WRITE | KREG_WOW6432,
+                                   PRG_REGROOT,
                                    lpCmdline->szApplication,
                                    APXREG_SOFTWARE | APXREG_SERVICE);
     if (IS_INVALID_HANDLE(hRegistry))
@@ -508,8 +515,9 @@ static BOOL docmdInstallService(LPAPXCMDLINE lpCmdline)
     APXHANDLE hService;
     BOOL  rv;
     DWORD dwStart = SERVICE_DEMAND_START;
+    DWORD dwType  = SERVICE_WIN32_OWN_PROCESS;
     WCHAR szImage[SIZ_HUGLEN];
-    
+
     apxLogWrite(APXLOG_MARK_DEBUG "Installing service...");
     hService = apxCreateService(gPool, SC_MANAGER_CREATE_SERVICE, FALSE);
     if (IS_INVALID_HANDLE(hService)) {
@@ -520,20 +528,25 @@ static BOOL docmdInstallService(LPAPXCMDLINE lpCmdline)
     if ((ST_STARTUP & APXCMDOPT_FOUND) &&
         lstrcmpiW(SO_STARTUP, PRSRV_AUTO) == 0)
         dwStart = SERVICE_AUTO_START;
+    /* Check the service type */
+    if ((ST_TYPE & APXCMDOPT_FOUND) &&
+        lstrcmpiW(SO_TYPE, STYPE_INTERACTIVE) == 0)
+        dwType |= SERVICE_INTERACTIVE_PROCESS;
+
     /* Check if --Install is provided */
     if (!SO_INSTALL) {
-        lstrcpyW(szImage, lpCmdline->szExePath);
-        lstrcatW(szImage, L"\\");
-        lstrcatW(szImage, lpCmdline->szExecutable);
-        lstrcatW(szImage, L".exe");
+        lstrlcpyW(szImage, SIZ_HUGLEN, lpCmdline->szExePath);
+        lstrlcatW(szImage, SIZ_HUGLEN, L"\\");
+        lstrlcatW(szImage, SIZ_HUGLEN, lpCmdline->szExecutable);
+        lstrlcatW(szImage, SIZ_HUGLEN, L".exe");
     }
     else
         lstrcpyW(szImage, SO_INSTALL);
     /* Replace not needed qoutes */
     apxStrQuoteInplaceW(szImage);
     /* Add run-service command line option */
-    lstrcatW(szImage, L" //RS//");
-    lstrcatW(szImage, lpCmdline->szApplication);
+    lstrlcatW(szImage, SIZ_HUGLEN, L" //RS//");
+    lstrlcatW(szImage, SIZ_HUGLEN, lpCmdline->szApplication);
     SO_INSTALL = apxPoolStrdupW(gPool, szImage);
     /* Ensure that option gets saved in the registry */
     ST_INSTALL |= APXCMDOPT_FOUND;
@@ -541,21 +554,36 @@ static BOOL docmdInstallService(LPAPXCMDLINE lpCmdline)
     /* Display configured options */
     dumpCmdline();
 #endif
-    apxLogWrite(APXLOG_MARK_INFO "Service %S name %S", lpCmdline->szApplication, 
+    apxLogWrite(APXLOG_MARK_INFO "Service %S name %S", lpCmdline->szApplication,
                 SO_DISPLAYNAME);
-    rv = apxServiceInstall(hService, 
+    rv = apxServiceInstall(hService,
                           lpCmdline->szApplication,
                           SO_DISPLAYNAME,    /* --DisplayName  */
-                          SO_INSTALL,    
+                          SO_INSTALL,
                           SO_DEPENDSON,      /* --DependendsOn */
-                          SERVICE_WIN32_OWN_PROCESS,
+                          dwType,
                           dwStart);
     /* Set the --Description */
-    if (rv && (ST_DESCRIPTION & APXCMDOPT_FOUND)) {
-        apxLogWrite(APXLOG_MARK_DEBUG "Setting service description %S",
-                    SO_DESCRIPTION);
-        apxServiceSetNames(hService, NULL, NULL, SO_DESCRIPTION,
-                           NULL, NULL);
+    if (rv) {
+        LPCWSTR sd = NULL;
+        LPCWSTR su = NULL;
+        LPCWSTR sp = NULL;
+        if (ST_DESCRIPTION & APXCMDOPT_FOUND) {
+            sd = SO_DESCRIPTION;
+            apxLogWrite(APXLOG_MARK_DEBUG "Setting service description %S",
+                        SO_DESCRIPTION);
+        }
+        if (ST_SUSER & APXCMDOPT_FOUND) {
+            su = SO_SUSER;
+            apxLogWrite(APXLOG_MARK_DEBUG "Setting service user %S",
+                        SO_SUSER);
+        }
+        if (ST_SPASSWORD & APXCMDOPT_FOUND) {
+            sp = SO_SPASSWORD;
+            apxLogWrite(APXLOG_MARK_DEBUG "Setting service password %S",
+                        SO_SPASSWORD);
+        }
+        apxServiceSetNames(hService, NULL, NULL, sd, su, sp);
     }
     apxCloseHandle(hService);
     if (rv) {
@@ -585,8 +613,8 @@ static BOOL docmdDeleteService(LPAPXCMDLINE lpCmdline)
     if (apxServiceOpen(hService, lpCmdline->szApplication, SERVICE_ALL_ACCESS)) {
         WCHAR szWndManagerClass[SIZ_RESLEN];
         HANDLE hWndManager = NULL;
-        lstrcpyW(szWndManagerClass, lpCmdline->szApplication);
-        lstrcatW(szWndManagerClass, L"_CLASS");
+        lstrlcpyW(szWndManagerClass, SIZ_RESLEN, lpCmdline->szApplication);
+        lstrlcatW(szWndManagerClass, SIZ_RESLEN, L"_CLASS");
         /* Close the monitor application if running */
         if ((hWndManager = FindWindowW(szWndManagerClass, NULL)) != NULL) {
             SendMessage(hWndManager, WM_CLOSE, 0, 0);
@@ -595,7 +623,7 @@ static BOOL docmdDeleteService(LPAPXCMDLINE lpCmdline)
     }
     if (rv) {
         /* Delete all service registry settings */
-        apxDeleteRegistryW(PRG_REGROOT, lpCmdline->szApplication, TRUE);
+        apxDeleteRegistryW(PRG_REGROOT, lpCmdline->szApplication, KREG_WOW6432, TRUE);
         apxLogWrite(APXLOG_MARK_DEBUG "Service %S deleted",
                     lpCmdline->szApplication);
     }
@@ -648,7 +676,7 @@ static BOOL docmdStopService(LPAPXCMDLINE lpCmdline)
 static BOOL docmdUpdateService(LPAPXCMDLINE lpCmdline)
 {
     APXHANDLE hService;
-    BOOL  rv = FALSE;
+    BOOL  rv = TRUE;
 
     apxLogWrite(APXLOG_MARK_INFO "Updating service...");
 
@@ -660,33 +688,52 @@ static BOOL docmdUpdateService(LPAPXCMDLINE lpCmdline)
     SetLastError(0);
     /* Open the service */
     if (apxServiceOpen(hService, lpCmdline->szApplication, SERVICE_ALL_ACCESS)) {
-        apxServiceSetNames(hService,
-                           NULL,                /* Never update the ImagePath */
-                           SO_DISPLAYNAME,
-                           SO_DESCRIPTION,
-                           NULL,
-                           NULL);
+        DWORD dwStart = SERVICE_NO_CHANGE;
+        DWORD dwType  = SERVICE_NO_CHANGE;
+        LPCWSTR su = NULL;
+        LPCWSTR sp = NULL;
+        if (ST_SUSER & APXCMDOPT_FOUND) {
+            su = SO_SUSER;
+            apxLogWrite(APXLOG_MARK_DEBUG "Setting service user %S",
+                        SO_SUSER);
+        }
+        if (ST_SPASSWORD & APXCMDOPT_FOUND) {
+            sp = SO_SPASSWORD;
+            apxLogWrite(APXLOG_MARK_DEBUG "Setting service password %S",
+                        SO_SPASSWORD);
+        }
+        rv = (rv && apxServiceSetNames(hService,
+                                       NULL,                /* Never update the ImagePath */
+                                       SO_DISPLAYNAME,
+                                       SO_DESCRIPTION,
+                                       su,
+                                       sp));
         /* Update the --Startup mode */
         if (ST_STARTUP & APXCMDOPT_FOUND) {
-            DWORD dwStart = SERVICE_NO_CHANGE;
             if (!lstrcmpiW(SO_STARTUP, PRSRV_AUTO))
                 dwStart = SERVICE_AUTO_START;
             else if (!lstrcmpiW(SO_STARTUP, PRSRV_MANUAL))
                 dwStart = SERVICE_DEMAND_START;
-            apxServiceSetOptions(hService,
-                                 SERVICE_NO_CHANGE,
-                                 dwStart,
-                                 SERVICE_NO_CHANGE);
-    
         }
+        if (ST_TYPE & APXCMDOPT_FOUND) {
+            if (!lstrcmpiW(SO_TYPE, STYPE_INTERACTIVE))
+                dwType = SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS;
+        }
+        rv = (rv && apxServiceSetOptions(hService,
+                                         dwType,
+                                         dwStart,
+                                         SERVICE_NO_CHANGE));
+
         apxLogWrite(APXLOG_MARK_INFO "Service %S updated",
                     lpCmdline->szApplication);
 
-        saveConfiguration(lpCmdline);
+        rv = (rv && saveConfiguration(lpCmdline));
     }
-    else
+    else {
         apxDisplayError(TRUE, NULL, 0, "Unable to open %S service",
                         lpCmdline->szApplication);
+        rv = FALSE;
+    }
     apxCloseHandle(hService);
     apxLogWrite(APXLOG_MARK_INFO "Update service finished.");
     return rv;
@@ -702,7 +749,7 @@ int reportServiceStatus(DWORD dwCurrentState,
    static DWORD dwCheckPoint = 1;
    BOOL fResult = TRUE;
 
-   if (_service_mode && _service_status_handle) {      
+   if (_service_mode && _service_status_handle) {
        if (dwCurrentState == SERVICE_START_PENDING)
             _service_status.dwControlsAccepted = 0;
         else
@@ -744,12 +791,13 @@ BOOL child_callback(APXHANDLE hObject, UINT uMsg,
 }
 
 /* Executed when the service receives stop event */
-static DWORD serviceStop()
+static DWORD WINAPI serviceStop(LPVOID lpParameter)
 {
     APXHANDLE hWorker = NULL;
     DWORD  rv = 0;
     BOOL   wait_to_die = FALSE;
     DWORD  timeout     = SO_STOPTIMEOUT * 1000;
+    DWORD  dwCtrlType  = (DWORD)((BYTE *)lpParameter - (BYTE *)0);
 
     apxLogWrite(APXLOG_MARK_INFO "Stopping service...");
 
@@ -759,7 +807,7 @@ static DWORD serviceStop()
     }
     if (_jni_shutdown) {
         if (!SO_STARTPATH && SO_STOPPATH) {
-            /* If the Working path is specified change the current directory 
+            /* If the Working path is specified change the current directory
              * but only if the start path wasn't specified already.
              */
             SetCurrentDirectoryW(SO_STARTPATH);
@@ -789,16 +837,16 @@ static DWORD serviceStop()
         }
         else {
             apxLogWrite(APXLOG_MARK_DEBUG "Waiting for java jni stop worker to finish...");
-            apxJavaWait(hWorker, INFINITE, FALSE);        
+            apxJavaWait(hWorker, INFINITE, FALSE);
             apxLogWrite(APXLOG_MARK_DEBUG "Java jni stop worker finished.");
         }
         wait_to_die = TRUE;
-    } 
+    }
     else if (SO_STOPMODE) { /* Only in case we have a stop mode */
         DWORD nArgs;
         LPWSTR *pArgs;
         /* Redirect process */
-        hWorker = apxCreateProcessW(gPool, 
+        hWorker = apxCreateProcessW(gPool,
                                     0,
                                     child_callback,
                                     SO_USER,
@@ -815,7 +863,15 @@ static DWORD serviceStop()
             goto cleanup;
         }
         /* Assemble the command line */
-        nArgs = apxMultiSzToArrayW(gPool, SO_STOPPARAMS, &pArgs);
+        if (_java_shutdown) {
+            nArgs = apxJavaCmdInitialize(gPool, SO_CLASSPATH, SO_STOPCLASS,
+                                         SO_JVMOPTIONS, SO_JVMMS, SO_JVMMX,
+                                         SO_JVMSS, SO_STOPPARAMS, &pArgs);
+        }
+        else {
+            nArgs = apxMultiSzToArrayW(gPool, SO_STOPPARAMS, &pArgs);
+        }
+
         /* Pass the argv to child process */
         if (!apxProcessSetCommandArgsW(hWorker, SO_STOPIMAGE,
                                        nArgs, pArgs)) {
@@ -831,7 +887,7 @@ static DWORD serviceStop()
                         SO_STOPPATH);
             goto cleanup;
         }
-        /* Finally execute the child process 
+        /* Finally execute the child process
          */
         if (!apxProcessExecute(hWorker)) {
             rv = 5;
@@ -839,7 +895,7 @@ static DWORD serviceStop()
             goto cleanup;
         } else {
             apxLogWrite(APXLOG_MARK_DEBUG "Waiting stop worker to finish...");
-            apxHandleWait(hWorker, INFINITE, FALSE);        
+            apxHandleWait(hWorker, INFINITE, FALSE);
             apxLogWrite(APXLOG_MARK_DEBUG "Stop worker finished.");
         }
         wait_to_die = TRUE;
@@ -862,11 +918,15 @@ cleanup:
     }
     SetEvent(gShutdownEvent);
     if (timeout > 0x7FFFFFFF)
-        timeout = INFINITE;     /* If the timeout was '-1' wait forewer */ 
+        timeout = INFINITE;     /* If the timeout was '-1' wait forewer */
     if (wait_to_die && !timeout)
         timeout = 300 * 1000;   /* Use the 5 minute default shutdown */
 
-    if (timeout) {  
+    if (dwCtrlType == SERVICE_CONTROL_SHUTDOWN)
+        timeout = MIN(timeout, apxGetMaxServiceTimeout(gPool));
+    reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, timeout);
+
+    if (timeout) {
         FILETIME fts, fte;
         ULARGE_INTEGER s, e;
         DWORD    nms;
@@ -893,6 +953,7 @@ cleanup:
     }
 
     apxLogWrite(APXLOG_MARK_INFO "Service stopped.");
+    reportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
     return rv;
 }
 
@@ -946,7 +1007,7 @@ static DWORD serviceStart()
     }
     else {
         /* Redirect process */
-        gWorker = apxCreateProcessW(gPool, 
+        gWorker = apxCreateProcessW(gPool,
                                     0,
                                     child_callback,
                                     SO_USER,
@@ -963,7 +1024,15 @@ static DWORD serviceStart()
             goto cleanup;
         }
         /* Assemble the command line */
-        nArgs = apxMultiSzToArrayW(gPool, SO_STARTPARAMS, &pArgs);
+        if (_java_startup) {
+            nArgs = apxJavaCmdInitialize(gPool, SO_CLASSPATH, SO_STARTCLASS,
+                                         SO_JVMOPTIONS, SO_JVMMS, SO_JVMMX,
+                                         SO_JVMSS, SO_STARTPARAMS, &pArgs);
+        }
+        else {
+            nArgs = apxMultiSzToArrayW(gPool, SO_STARTPARAMS, &pArgs);
+        }
+
         /* Pass the argv to child process */
         if (!apxProcessSetCommandArgsW(gWorker, SO_STARTIMAGE,
                                        nArgs, pArgs)) {
@@ -979,7 +1048,7 @@ static DWORD serviceStart()
                         SO_STARTPATH);
             goto cleanup;
         }
-        /* Finally execute the child process 
+        /* Finally execute the child process
          */
         if (!apxProcessExecute(gWorker)) {
             rv = 5;
@@ -1004,30 +1073,51 @@ cleanup:
     if (!IS_INVALID_HANDLE(gWorker))
         apxCloseHandle(gWorker);    /* Close the worker handle */
     gWorker = NULL;
-    return rv;    
+    return rv;
 }
 
 /* Service control handler
  */
 void WINAPI service_ctrl_handler(DWORD dwCtrlCode)
 {
+    DWORD  threadId;
+    HANDLE stopThread;
+
     switch (dwCtrlCode) {
         case SERVICE_CONTROL_STOP:
-            apxLogWrite(APXLOG_MARK_INFO "Service STOP signaled");
-            reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-            /* Call the stop handler that will actualy stop the service */
-            serviceStop();
+            reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 3000);
+            /* Stop the service asynchronously */
+            stopThread = CreateThread(NULL, 0,
+                                      serviceStop,
+                                      (LPVOID)SERVICE_CONTROL_STOP,
+                                      0, &threadId);
+            WaitForSingleObject(stopThread, INFINITE);
+            CloseHandle(stopThread);
+
+            return;
+        case SERVICE_CONTROL_SHUTDOWN:
+            apxLogWrite(APXLOG_MARK_INFO "Service SHUTDOWN signaled");
+            reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 3000);
+            /* Stop the service asynchronously */
+            stopThread = CreateThread(NULL, 0,
+                                      serviceStop,
+                                      (LPVOID)SERVICE_CONTROL_SHUTDOWN,
+                                      0, &threadId);
+            WaitForSingleObject(stopThread, INFINITE);
+            CloseHandle(stopThread);
             return;
         case SERVICE_CONTROL_INTERROGATE:
-        break;
+            reportServiceStatus(_service_status.dwCurrentState,
+                                _service_status.dwWin32ExitCode,
+                                _service_status.dwWaitHint);
+            return;
         default:
-        break;
+            break;
    }
-   reportServiceStatus(_service_status.dwCurrentState, NO_ERROR, 0);
 }
 
 /* Console control handler
- * 
+ *
  */
 BOOL WINAPI console_handler(DWORD dwCtrlType)
 {
@@ -1037,20 +1127,20 @@ BOOL WINAPI console_handler(DWORD dwCtrlType)
             return FALSE;
         case CTRL_C_EVENT:
             apxLogWrite(APXLOG_MARK_INFO "Console CTRL+C event signaled");
-            serviceStop();
+            serviceStop((LPVOID)SERVICE_CONTROL_STOP);
             return TRUE;
         case CTRL_CLOSE_EVENT:
             apxLogWrite(APXLOG_MARK_INFO "Console CTRL+CLOSE event signaled");
-            serviceStop();
+            serviceStop((LPVOID)SERVICE_CONTROL_STOP);
             return TRUE;
         case CTRL_SHUTDOWN_EVENT:
             apxLogWrite(APXLOG_MARK_INFO "Console SHUTDOWN event signaled");
-            serviceStop();
+            serviceStop((LPVOID)SERVICE_CONTROL_SHUTDOWN);
             return TRUE;
         case CTRL_LOGOFF_EVENT:
             apxLogWrite(APXLOG_MARK_INFO "Console LOGOFF event signaled");
             if (!_service_mode) {
-                serviceStop();
+                serviceStop((LPVOID)SERVICE_CONTROL_STOP);
             }
             return TRUE;
         break;
@@ -1064,23 +1154,24 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
 {
     DWORD rc;
     _service_status.dwServiceType      = SERVICE_WIN32_OWN_PROCESS;
-    _service_status.dwCurrentState     = SERVICE_START_PENDING; 
+    _service_status.dwCurrentState     = SERVICE_START_PENDING;
     _service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
-                                         SERVICE_ACCEPT_PAUSE_CONTINUE; 
-    _service_status.dwWin32ExitCode    = 0; 
-    _service_status.dwCheckPoint       = 0; 
-    _service_status.dwWaitHint         = 0; 
-    _service_status.dwServiceSpecificExitCode = 0; 
+                                         SERVICE_ACCEPT_PAUSE_CONTINUE;
+    _service_status.dwWin32ExitCode    = 0;
+    _service_status.dwCheckPoint       = 0;
+    _service_status.dwWaitHint         = 0;
+    _service_status.dwServiceSpecificExitCode = 0;
 
     apxLogWrite(APXLOG_MARK_DEBUG "Inside ServiceMain...");
-    
+
     if (_service_name) {
-        WCHAR en[SIZ_DESLEN];
+        WCHAR en[SIZ_HUGLEN];
         int i;
         PSECURITY_ATTRIBUTES sa = GetNullACL();
-        lstrcpyW(en, _service_name);
-        lstrcatW(en, PRSRV_SIGNAL);
-        for (i = 0; i < lstrlenW(en); i++) {
+        lstrlcpyW(en, SIZ_DESLEN, L"Global\\");
+        lstrlcatW(en, SIZ_DESLEN, _service_name);
+        lstrlcatW(en, SIZ_DESLEN, PRSRV_SIGNAL);
+        for (i = 7; i < lstrlenW(en); i++) {
             if (en[i] >= L'a' && en[i] <= L'z')
                 en[i] = en[i] - 32;
         }
@@ -1095,20 +1186,27 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
     /* Check the StartMode */
     if (SO_STARTMODE) {
         if (!lstrcmpiW(SO_STARTMODE, PRSRV_JVM)) {
-            _jni_startup = TRUE;            
-            WideToAscii(SO_STARTCLASS, _jni_rclass);
+            _jni_startup = TRUE;
+            _jni_rclass  = WideToUTF8(SO_STARTCLASS);
             /* Exchange all dots with slashes */
             apxStrCharReplaceA(_jni_rclass, '.', '/');
-            _jni_rparam = MzWideToAscii(SO_STARTPARAMS, (LPSTR)SO_STARTPARAMS);
+            _jni_rparam = SO_STARTPARAMS;
         }
         else if (!lstrcmpiW(SO_STARTMODE, PRSRV_JAVA)) {
-            LPWSTR jx = NULL, szJH = apxGetJavaSoftHome(gPool, FALSE);
+            LPWSTR jx = NULL, szJH = SO_JAVAHOME;
+            if (!szJH)
+                szJH = apxGetJavaSoftHome(gPool, FALSE);
             if (szJH) {
                 jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
                 lstrcpyW(jx, szJH);
                 lstrcatW(jx, PRSRV_JBIN);
                 SO_STARTPATH = szJH;
             }
+            else {
+                apxLogWrite(APXLOG_MARK_ERROR "Unable to find Java Runtime Environment.");
+                goto cleanup;
+            }
+            _java_startup = TRUE;
             /* StartImage now contains the full path to the java.exe */
             SO_STARTIMAGE = jx;
         }
@@ -1116,19 +1214,26 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
     /* Check the StopMode */
     if (SO_STOPMODE) {
         if (!lstrcmpiW(SO_STOPMODE, PRSRV_JVM)) {
-            _jni_shutdown = TRUE;            
-            WideToAscii(SO_STOPCLASS, _jni_sclass);
+            _jni_shutdown = TRUE;
+            _jni_sclass = WideToUTF8(SO_STOPCLASS);
             apxStrCharReplaceA(_jni_sclass, '.', '/');
-            _jni_sparam = MzWideToAscii(SO_STOPPARAMS, (LPSTR)SO_STOPPARAMS);
+            _jni_sparam = SO_STOPPARAMS;
         }
         else if (!lstrcmpiW(SO_STOPMODE, PRSRV_JAVA)) {
-            LPWSTR jx = NULL, szJH = apxGetJavaSoftHome(gPool, FALSE);
+            LPWSTR jx = NULL, szJH = SO_JAVAHOME;
+            if (!szJH)
+                szJH = apxGetJavaSoftHome(gPool, FALSE);
             if (szJH) {
                 jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
                 lstrcpyW(jx, szJH);
                 lstrcatW(jx, PRSRV_JBIN);
                 SO_STOPPATH = szJH;
             }
+            else {
+                apxLogWrite(APXLOG_MARK_ERROR "Unable to find Java Runtime Environment.");
+                goto cleanup;
+            }
+            _java_shutdown = TRUE;
             /* StopImage now contains the full path to the java.exe */
             SO_STOPIMAGE = jx;
         }
@@ -1140,19 +1245,17 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
                 _jni_jvmpath = SO_JVM;
         }
         if (SO_CLASSPATH)
-            _jni_classpath = WideToAscii(SO_CLASSPATH, (LPSTR)SO_CLASSPATH);
+            _jni_classpath = WideToUTF8(SO_CLASSPATH);
         if (SO_STARTMETHOD)
-            _jni_rmethod = WideToAscii(SO_STARTMETHOD, (LPSTR)SO_STARTMETHOD);
+            _jni_rmethod   = WideToAscii(SO_STARTMETHOD, (LPSTR)SO_STARTMETHOD);
         if (SO_STOPMETHOD)
-            _jni_smethod = WideToAscii(SO_STOPMETHOD, (LPSTR)SO_STOPMETHOD);
-        if (SO_JVMOPTIONS) {
-            _jni_jvmoptions = MzWideToAscii(SO_JVMOPTIONS, (LPSTR)SO_JVMOPTIONS);
-        }
+            _jni_smethod   = WideToAscii(SO_STOPMETHOD, (LPSTR)SO_STOPMETHOD);
+        _jni_jvmoptions    = MzWideToUTF8(SO_JVMOPTIONS);
     }
     if (_service_mode) {
         /* Register Service Control handler */
         _service_status_handle = RegisterServiceCtrlHandlerW(_service_name,
-                                                              service_ctrl_handler); 
+                                                              service_ctrl_handler);
         if (IS_INVALID_HANDLE(_service_status_handle)) {
             apxLogWrite(APXLOG_MARK_ERROR "Failed to register Service Control for %S",
                         _service_name);
@@ -1172,20 +1275,33 @@ void WINAPI serviceMain(DWORD argc, LPTSTR *argv)
 
         rv = apxHandleWait(gWorker, INFINITE, FALSE);
         apxLogWrite(APXLOG_MARK_DEBUG "Worker finished.");
-        reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-        fflush(stdout);
     }
     else {
         apxLogWrite(APXLOG_MARK_ERROR "ServiceStart returned %d", rc);
         goto cleanup;
     }
     if (gShutdownEvent) {
+        reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
         /* Ensure that shutdown thread exits before us */
         apxLogWrite(APXLOG_MARK_DEBUG "Waiting for ShutdownEvent");
-        WaitForSingleObject(gShutdownEvent, 60 * 1000);
+        WaitForSingleObject(gShutdownEvent, ONE_MINUTE);
         apxLogWrite(APXLOG_MARK_DEBUG "ShutdownEvent signaled");
         CloseHandle(gShutdownEvent);
+        /* This will cause to wait for all threads to exit
+         */
+        apxLogWrite(APXLOG_MARK_DEBUG "Waiting 1 minute for all threads to exit");
+        apxDestroyJvm(ONE_MINUTE);
+    }
+    else {
+        /* We came here without shutdown event
+         * Probably because main() returned without ensuring all threads
+         * have finished
+         */
+        apxLogWrite(APXLOG_MARK_DEBUG "Waiting for all threads to exit");
+        apxDestroyJvm(INFINITE);
+        reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
     }
+    apxLogWrite(APXLOG_MARK_DEBUG "JVM destroyed.");
     reportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
 
     return;
@@ -1206,7 +1322,7 @@ BOOL docmdDebugService(LPAPXCMDLINE lpCmdline)
     apxLogWrite(APXLOG_MARK_INFO "Debugging Service...");
     serviceMain(0, NULL);
     apxLogWrite(APXLOG_MARK_INFO "Debug service finished.");
-    
+
     return rv;
 }
 
@@ -1219,7 +1335,7 @@ BOOL docmdRunService(LPAPXCMDLINE lpCmdline)
     _service_name = lpCmdline->szApplication;
     _service_table[0].lpServiceName = lpCmdline->szApplication;
     _service_table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTIONW)serviceMain;
-    rv = (StartServiceCtrlDispatcherW(_service_table) == FALSE); 
+    rv = (StartServiceCtrlDispatcherW(_service_table) == FALSE);
     apxLogWrite(APXLOG_MARK_INFO "Run service finished.");
     return rv;
 }
@@ -1230,6 +1346,18 @@ void __cdecl main(int argc, char **argv)
 
     LPAPXCMDLINE lpCmdline;
 
+    if (argc > 1 && strncmp(argv[1], "//PP//", 6) == 0) {
+        /* Handy sleep routine defaulting to 1 minute */
+        DWORD ss = 60;
+        if (argv[1][6]) {
+             int us = atoi(argv[1] + 6);
+             if (us > 0)
+                ss = (DWORD)us;
+        }
+        Sleep(ss * 1000);
+        ExitProcess(0);
+        return;
+    }
     apxHandleManagerInitialize();
     /* Create the main Pool */
     gPool = apxPoolCreate(NULL, 0);
@@ -1250,10 +1378,11 @@ void __cdecl main(int argc, char **argv)
 
     apxLogOpen(gPool, SO_LOGPATH, SO_LOGPREFIX);
     apxLogLevelSetW(NULL, SO_LOGLEVEL);
-    apxLogWrite(APXLOG_MARK_DEBUG "Procrun log initialized");
+    apxLogWrite(APXLOG_MARK_DEBUG "Commons Daemon procrun log initialized");
+    apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun (%s) started", PRG_VERSION);
 
     AplZeroMemory(&gStdwrap, sizeof(APX_STDWRAP));
-    
+
     gStdwrap.szLogPath = SO_LOGPATH;
     /* In debug mode allways use console */
     if (lpCmdline->dwCmdIndex != 1) {
@@ -1295,14 +1424,14 @@ void __cdecl main(int argc, char **argv)
     }
 
 cleanup:
-    apxLogWrite(APXLOG_MARK_INFO "Procrun finished.");
+    apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun finished.");
     if (lpCmdline)
         apxCmdlineFree(lpCmdline);
     if (_service_status_handle)
         CloseHandle(_service_status_handle);
     _service_status_handle = NULL;
+    _flushall();
     apxLogClose(NULL);
     apxHandleManagerDestroy();
-    cleanupStdStreams(&gStdwrap);
     ExitProcess(rv);
 }
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp b/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp
index 6194c6c..9710271 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.dsp
@@ -51,8 +51,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /machine:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x50000 /subsystem:console /machine:I386
 
 !ELSEIF  "$(CFG)" == "prunsrv - Win32 Debug"
 
@@ -67,15 +67,15 @@ LINK32=link.exe
 # PROP Intermediate_Dir "Debug"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ  /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ  /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
 # ADD BASE RSC /l 0x41a /d "_DEBUG"
 # ADD RSC /l 0x41a /d "_DEBUG"
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x40000 /subsystem:console /debug /machine:I386 /out:"Debug/prunsrvd.exe" /pdbtype:sept
 
 !ELSEIF  "$(CFG)" == "prunsrv - Win32 Unicode Release"
@@ -93,7 +93,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /YX /FD /c
 # ADD BASE RSC /l 0x41a /d "NDEBUG"
 # ADD RSC /l 0x41a /d "NDEBUG"
 BSC32=bscmake.exe
@@ -117,8 +117,8 @@ LINK32=link.exe
 # PROP Intermediate_Dir "Unicode Debug"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ  /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /YX /FD /GZ  /c
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /YX /FD /GZ /c
 # ADD BASE RSC /l 0x41a /d "_DEBUG"
 # ADD RSC /l 0x41a /d "_DEBUG"
 BSC32=bscmake.exe
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.h b/src/native/nt/procrun/apps/prunsrv/prunsrv.h
index 362babe..03141a3 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.h
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -24,7 +25,7 @@
 #define _PRUNSRV_H
 
 #undef  PRG_VERSION
-#define PRG_VERSION    "2.0.1.0" 
+#define PRG_VERSION    "1.0.2.0" 
 #define PRG_REGROOT   L"Apache Software Foundation\\Procrun 2.0"
 
 #endif /* _PRUNSRV_H */
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64 b/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64
new file mode 100644
index 0000000..fe8e397
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.ia64
@@ -0,0 +1,109 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_ia64
+INTDIR=.\Release_ia64
+# Begin Custom Macros
+OutDir=.\Release_ia64
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunsrv.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunsrv.obj"
+	- at erase "$(INTDIR)\prunsrv.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunsrv.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32"  /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib bufferoverflowu.lib /nologo /stack:0x40000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:IA64 /out:"$(OUTDIR)\prunsrv.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunsrv.obj" \
+	"$(INTDIR)\prunsrv.res" \
+	"..\..\Release_ia64\libprocrun.lib"
+
+"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
+
+SOURCE=.\prunsrv.c
+
+"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunsrv.rc
+
+"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.ia64
+   cd ".\APPS\prunsrv"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.ia64 RECURSE=1 CLEAN 
+   cd ".\APPS\prunsrv"
+
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.rc b/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
index 5a9758a..1a650e0 100644
--- a/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.rc
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -16,13 +17,13 @@
 #include "apxwin.h"
 #include "prunsrv.h"
 
-#define RSTR_PRUNSRV "Service Runner"
+#define RSTR_PRUNSRV "Commons Daemon Service Runner"
 
 IDI_MAINICON         ICON                   "../../resources/procrunw.ico" 
 
 1 VERSIONINFO
- FILEVERSION 2,0,1,0
- PRODUCTVERSION 2,0,1,0
+ FILEVERSION 1,0,2,0
+ PRODUCTVERSION 1,0,2,0
  FILEFLAGSMASK 0x3fL
 #if defined(_DEBUG)
  FILEFLAGS 0x03L
@@ -42,7 +43,7 @@ BEGIN
       VALUE "FileDescription", RSTR_PRUNSRV "\0"
       VALUE "FileVersion", PRG_VERSION
       VALUE "InternalName", RSTR_PRUNSRV "\0"
-      VALUE "LegalCopyright", "Copyright � 2000-2006 The Apache Software Foundation.\0"
+      VALUE "LegalCopyright", "Copyright � 2000-2010 The Apache Software Foundation.\0"
       VALUE "OriginalFilename", "prunsrv.exe\0"
       VALUE "ProductName", RSTR_PRUNSRV "\0"
       VALUE "ProductVersion", PRG_VERSION
@@ -52,4 +53,5 @@ BEGIN
   BEGIN
     VALUE "Translation", 0x409, 1200
   END
-END 
+END
+
diff --git a/src/native/nt/procrun/apps/prunsrv/prunsrv.x86 b/src/native/nt/procrun/apps/prunsrv/prunsrv.x86
new file mode 100644
index 0000000..5ae161a
--- /dev/null
+++ b/src/native/nt/procrun/apps/prunsrv/prunsrv.x86
@@ -0,0 +1,109 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_x86
+INTDIR=.\Release_x86
+# Begin Custom Macros
+OutDir=.\Release_x86
+# End Custom Macros
+
+!IF "$(RECURSE)" == "0" 
+
+ALL : "$(OUTDIR)\prunsrv.exe"
+
+!ELSE 
+
+ALL : "libprocrun MAKE" "$(OUTDIR)\prunsrv.exe"
+
+!ENDIF 
+
+!IF "$(RECURSE)" == "1" 
+CLEAN :"libprocrun CLEAN" 
+!ELSE 
+CLEAN :
+!ENDIF 
+	- at erase "$(INTDIR)\prunsrv.obj"
+	- at erase "$(INTDIR)\prunsrv.res"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\prunsrv.exe"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\..\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\prunsrv.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" 
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\prunsrv.bsc" 
+BSC32_SBRS= \
+	
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib shlwapi.lib /nologo /stack:0x50000 /subsystem:console /incremental:no /pdb:"$(OUTDIR)\prunsrv.pdb" /machine:I386 /out:"$(OUTDIR)\prunsrv.exe" 
+LINK32_OBJS= \
+	"$(INTDIR)\prunsrv.obj" \
+	"$(INTDIR)\prunsrv.res" \
+	"..\..\Release_x86\libprocrun.lib"
+
+"$(OUTDIR)\prunsrv.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+    $(LINK32) @<<
+  $(LINK32_FLAGS) $(LINK32_OBJS) commode.obj
+<<
+	if exist $(OUTDIR)\prunsrv.exe.manifest mt.exe -manifest $(OUTDIR)\prunsrv.exe.manifest -outputresource:$(OUTDIR)\prunsrv.exe;1
+
+SOURCE=.\prunsrv.c
+
+"$(INTDIR)\prunsrv.obj" : $(SOURCE) "$(INTDIR)"
+
+
+SOURCE=.\prunsrv.rc
+
+"$(INTDIR)\prunsrv.res" : $(SOURCE) "$(INTDIR)"
+	$(RSC) /l 0x409 /fo"$(INTDIR)\prunsrv.res" /i "..\..\include" /d "NDEBUG" /d "_UNICODE" /d "UNICODE" $(SOURCE)
+
+
+"libprocrun MAKE" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.x86
+   cd ".\APPS\prunsrv"
+
+"libprocrun CLEAN" : 
+   cd "..\.."
+   $(MAKE) /F .\libprocrun.x86 RECURSE=1 CLEAN 
+   cd ".\APPS\prunsrv"
+
diff --git a/src/native/nt/procrun/apps/srvbatch/MSG00001.bin b/src/native/nt/procrun/apps/srvbatch/MSG00001.bin
deleted file mode 100644
index 1c30b04..0000000
Binary files a/src/native/nt/procrun/apps/srvbatch/MSG00001.bin and /dev/null differ
diff --git a/src/native/nt/procrun/apps/srvbatch/example/example.c b/src/native/nt/procrun/apps/srvbatch/example/example.c
deleted file mode 100644
index f1a1bb1..0000000
--- a/src/native/nt/procrun/apps/srvbatch/example/example.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <process.h>
-
-HANDLE hGlobalEvent; 
-#define EVENT_NAME "ServBatchExampleEvent"
-
-
-int main(int argc, char **argv)
-{
-    int mode = 0;
-    int i;
-
-    for (i = 0; i < argc; i++)
-        fprintf(stdout, "Command line param [%d] = %s\n", i, argv[i]);
-
-    if (argc > 1 && stricmp(argv[1], "stop") == 0)
-        mode = 1;
-    
-    if (mode) {
-        fprintf(stdout, "Stopping service\n");
-        hGlobalEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, EVENT_NAME);
-        if (!hGlobalEvent)
-            fprintf(stderr, "Unable to upen the Global Event\n");
-        else {
-            fprintf(stdout, "Signaling service event\n");
-            SetEvent(hGlobalEvent);
-        }
-
-    }
-    else {
-        fprintf(stdout, "Starting service\n");
-        hGlobalEvent = CreateEvent(NULL, FALSE, FALSE, EVENT_NAME);
-        WaitForSingleObject(hGlobalEvent, INFINITE);
-        fprintf(stdout, "Event Signaled\n");
-    }
- 
-    fprintf(stdout, "Service mode %d finished\n", mode);
-    return 0;
-}
diff --git a/src/native/nt/procrun/apps/srvbatch/example/example.vcproj b/src/native/nt/procrun/apps/srvbatch/example/example.vcproj
deleted file mode 100644
index 5393cf6..0000000
--- a/src/native/nt/procrun/apps/srvbatch/example/example.vcproj
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="example"
-	ProjectGUID="{1C38835C-714F-49F3-85FC-9E6372149DF3}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="example.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/example.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/example.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\example.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/apps/srvbatch/example/exservice.bat b/src/native/nt/procrun/apps/srvbatch/example/exservice.bat
deleted file mode 100644
index 33d0fa4..0000000
--- a/src/native/nt/procrun/apps/srvbatch/example/exservice.bat
+++ /dev/null
@@ -1,53 +0,0 @@
- at echo off
-REM Copyright 2000-2004 The Apache Software Foundation
-REM
-REM Licensed under the Apache License, Version 2.0 (the "License");
-REM you may not use this file except in compliance with the License.
-REM You may obtain a copy of the License at
-REM
-REM     http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-REM
-
- at if not "%ECHO%" == ""  echo %ECHO%
- at if "%OS%" == "Windows_NT"  setlocal
-
-set SERVICE_EXECUTABLE=example.exe
-
-REM Figure out the running mode
-
- at if "%1" == "install"   goto cmdInstall
- at if "%1" == "uninstall" goto cmdUninstall
- at if "%1" == "start"     goto cmdStart
- at if "%1" == "stop"      goto cmdStop
- at if "%1" == "restart"   goto cmdRestart
-echo Usage
-goto cmdEnd
-
-:cmdInstall
-..\Debug\srvbatch.exe -iwdcl SrvbatchExample "%CD%" "Srvbatch Example Service" "This is an Example service" exservice.bat 
-goto cmdEnd
-
-:cmdUninstall
-..\Debug\srvbatch.exe -u SrvbatchExample
-goto cmdEnd
-
-:cmdStart
-%SERVICE_EXECUTABLE% start
-goto cmdEnd
-
-:cmdStop
-%SERVICE_EXECUTABLE% stop
-goto cmdEnd
-
-:cmdRestart
-%SERVICE_EXECUTABLE% stop
-%SERVICE_EXECUTABLE% start
-goto cmdEnd
-
-:cmdEnd
diff --git a/src/native/nt/procrun/apps/srvbatch/srvbatch.c b/src/native/nt/procrun/apps/srvbatch/srvbatch.c
deleted file mode 100644
index bad77b1..0000000
--- a/src/native/nt/procrun/apps/srvbatch/srvbatch.c
+++ /dev/null
@@ -1,827 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <process.h>
-
-/* Custom return error values */
-#define ERR_RET_USAGE           1
-#define ERR_RET_VERSION         2
-#define ERR_RET_INSTALL         3
-#define ERR_RET_REMOVE          4
-#define ERR_RET_PARAMS          5
-#define ERR_RET_MODE            6
-
-#define MSG_ERROR               0xC0000001L
-#define MSG_INFO                0x40000002L
-
-
-
-#define MAX_CMDLINE   8192
-/* Extensions On, Old quote style */
-static LPCSTR CMD_DEFAULT     = "/E:ON /S /C \"SET SERVICE_PPID=%d && SET SERVICE_NAME=%s && CALL %s %s";
-static LPCSTR REGSERVICE_ROOT = "SYSTEM\\CurrentControlSet\\Services\\"; 
-static LPCSTR REGSERVICE_LOG  = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\";
-
-static LPCSTR REGPARAMS       = "\\Parameters";
-static LPCSTR REGDESCRIPTION  = "Description"; 
-static LPCSTR REG_SERVFILE    = "ServiceFile";
-static LPCSTR REG_LOGFILE     = "LogFile";
-static LPCSTR REG_WPATH       = "WorkingPath";
-
-
-/* Main servic table entry
- * filled at run-time
- */
-static SERVICE_TABLE_ENTRY  _service_table[] = {
-        {NULL, NULL},
-        {NULL, NULL}
-};
- 
-static SERVICE_STATUS        _service_status; 
-static SERVICE_STATUS_HANDLE _service_status_handle = NULL; 
-static char                  _service_name[MAX_PATH + 1];
-static char                  _service_disp[MAX_PATH + 1];
-static char                  _service_desc[MAX_PATH * 2 + 1];
-static char                  _working_path[MAX_PATH + 1];
-static char                  _service_image[MAX_PATH + 1];
-static char                  _service_bat[MAX_PATH + 1];
-static char                  _cmd_exe[MAX_PATH + 1];
-static BOOL                  _service_log = FALSE;
-
-enum _service_mode_e {
-    mode_none,
-    mode_install,
-    mode_uninstall,
-    mode_debug,
-    mode_run
-};
-
-static enum _service_mode_e   _service_mode = mode_none;
-
-static BOOL IsWindowsNT()
-{
-    BOOL rv = FALSE;
-    OSVERSIONINFO osvi;
-
-    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
-    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-
-    if (!GetVersionEx(&osvi))
-        return FALSE;
-
-    switch (osvi.dwPlatformId) {
-        case VER_PLATFORM_WIN32_NT:
-            rv = TRUE;
-        break;
-        default:
-            rv = FALSE;
-        break;
-    }
-    return rv;
-}
-
-
-static BOOL IsServiceRunning(LPCSTR szServiceName)
-{
-    DWORD rc = 0;
-    SC_HANDLE schService;
-    SC_HANDLE schSCManager;
-    SERVICE_STATUS schSStatus;
-
-    schSCManager = OpenSCManager(NULL, NULL,
-                                 SC_MANAGER_CONNECT);
-    if (!schSCManager)
-        return FALSE;
-
-    schService = OpenService(schSCManager, szServiceName, 
-                             SERVICE_QUERY_STATUS);
-    if (schService != NULL) {
-        if (QueryServiceStatus(schService, &schSStatus))
-            rc = schSStatus.dwCurrentState;
-        CloseServiceHandle(schService);
-        CloseServiceHandle(schSCManager);
-        return rc == SERVICE_RUNNING ? TRUE : FALSE;
-    }
-    CloseServiceHandle(schSCManager);
-    return FALSE;
-
-}
-
-static void AddToMessageLog(BOOL isError, LPSTR szFormat, ...)
-{
-    char szMsg [MAX_PATH];
-    LPSTR   lpszStrings[2];
-    LPVOID  lpMsgBuf = NULL;
-    HANDLE  hEventSource;
-    DWORD dwErr = GetLastError();
-    WORD  wErrType;
-    DWORD dwErrId;
-    WORD  nStr;
-    va_list args;
-
-    if (!_service_log && !isError) {
-        /* Nothing to log */
-        return;
-    }
-
-    va_start(args, szFormat);
-    vsprintf(szMsg, szFormat, args);
-    va_end(args); 
-
-    if (isError) {
-        nStr = 2;
-        wErrType = EVENTLOG_ERROR_TYPE;
-        dwErrId = MSG_ERROR;
-        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                        FORMAT_MESSAGE_FROM_SYSTEM |
-                        FORMAT_MESSAGE_IGNORE_INSERTS,
-                        NULL, GetLastError(),
-                        MAKELANGID(LANG_NEUTRAL, LANG_NEUTRAL),
-                        (LPSTR) &lpMsgBuf, 0, NULL);
-        lpszStrings[0] = lpMsgBuf;
-        lpszStrings[1] = szMsg;
-    }
-    else {
-        wErrType = EVENTLOG_INFORMATION_TYPE;
-        dwErrId = MSG_INFO;
-        nStr = 1;
-        lpszStrings[0] = szMsg;
-    }
-    /* Use event logging to log the error.
-    */
-    hEventSource = RegisterEventSource(NULL, _service_name);
-
-    if (hEventSource != NULL) {
-        ReportEvent(hEventSource, // handle of event source
-            wErrType,             // event type
-            0,                    // event category
-            dwErrId,              // event ID
-            NULL,                 // current user's SID
-            nStr,                 // strings in lpszStrings
-            0,                    // no bytes of raw data
-            lpszStrings,          // array of error strings
-            NULL);                // no raw data
-        DeregisterEventSource(hEventSource);
-    }
-    if (lpMsgBuf)
-        LocalFree(lpMsgBuf);
-}
-
-static void ErrorUsage()
-{
-    if (_service_mode == mode_run)
-        return;
-
-    fprintf(stderr, "srvbatch -- program for running batch files as services.\n\n");
-    fprintf(stderr, "Usage: srvbatch -i        service service.bat\n");
-    fprintf(stderr, "                -i[wdcl]  service workingpath description comment\n"
-                    "                          service.bat\n");
-    fprintf(stderr, "                -u        service\n");
-    fprintf(stderr, "                -t        service\n");
-    fprintf(stderr, "Options:\n");
-    fprintf(stderr, "   -d   Service display name\n");
-    fprintf(stderr, "   -c   Service description\n");
-    fprintf(stderr, "   -w   Service working path\n");
-    fprintf(stderr, "   -l   Turn info logging On\n");
-
-    ExitProcess(ERR_RET_USAGE);
-}
-
-static void DumpParams()
-{
-    if (_service_mode == mode_run)
-        return;
-
-    fprintf(stdout, "Name           %s\n", _service_name);
-    fprintf(stdout, "Display        %s\n", _service_disp);
-    fprintf(stdout, "Description    %s\n", _service_desc);
-    fprintf(stdout, "ImagePath      %s\n", _service_image);
-    fprintf(stdout, "Shell          %s\n", _cmd_exe);
-    fprintf(stdout, "WorkingPath    %s\n", _working_path);
-    fprintf(stdout, "Service Script %s\n", _service_bat);
-
-}
-
-static void BuildCommandLine(char *buf, const char *action)
-{
-
-    ZeroMemory(buf, MAX_CMDLINE);
-    lstrcpy(buf, _cmd_exe);
-    lstrcat(buf, " ");
-    buf += lstrlen(buf);
-
-    sprintf(buf, CMD_DEFAULT, getpid(), _service_name, _service_bat, action);
-    lstrcat(buf, "\"");
-    fprintf(stdout, "Service Cmd    %s\n", buf);
-}
-
-/* We could use the ChangeServiceConfig2 on WIN2K+ 
- * For now use the registry.
- */
-static BOOL SetServiceDescription(LPCSTR szServiceName,
-                                  LPCSTR szDescription)
-{
-    HKEY  hKey;
-    CHAR  szName[MAX_PATH + 1];
-    DWORD rc;
-
-    if (lstrlen(szServiceName) > MAX_PATH)
-        return FALSE;
-    lstrcpy(szName, REGSERVICE_ROOT);
-    lstrcat(szName, szServiceName);
-
-    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szName, 0, KEY_WRITE, &hKey);
-    if (rc != ERROR_SUCCESS) {
-        return FALSE;
-    }
-
-    rc = RegSetValueEx(hKey, REGDESCRIPTION, 0, REG_SZ,
-                       (CONST BYTE *)szDescription,
-                       lstrlen(szDescription) + 1);
-    CloseHandle(hKey);
-
-    return rc == ERROR_SUCCESS;
-}
-
-/* We could use the ChangeServiceConfig2 on WIN2K+ 
- * For now use the registry.
- */
-static BOOL SetServiceEventLog(LPCSTR szServiceName)
-{
-    HKEY  hKey;
-    CHAR  szName[MAX_PATH + 1];
-    DWORD dwData;
-
-    if (lstrlen(szServiceName) > MAX_PATH)
-        return FALSE;
-    lstrcpy(szName, REGSERVICE_LOG);
-    lstrcat(szName, szServiceName);
-
-    RegCreateKey(HKEY_LOCAL_MACHINE, szName, &hKey);
-
-    if (!GetModuleFileName(NULL, szName, MAX_PATH)) {
-        RegCloseKey(hKey);
-        return FALSE;
-    }
-
-    RegSetValueEx(hKey, "EventMessageFile", 0, REG_SZ, (LPBYTE)szName,
-                  lstrlen(szName) + 1);
-    dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
-             EVENTLOG_INFORMATION_TYPE;
-
-    RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (LPBYTE)&dwData,
-                  sizeof(DWORD));
- 
-    RegFlushKey(hKey);
-    RegCloseKey(hKey);
-
-    return TRUE;
-}
-
-BOOL SetServiceParameters(LPCSTR szServiceName)
-{
-    HKEY  hKey;
-    CHAR  szName[MAX_PATH + 1];
-    DWORD rc;
-    BOOL  rv = TRUE;
-
-    if (lstrlen(szServiceName) > MAX_PATH)
-        return FALSE;
-
-    lstrcpy(szName, REGSERVICE_ROOT);
-    lstrcat(szName, szServiceName);
-    lstrcat(szName, REGPARAMS);
-
-    rc = RegCreateKeyEx(HKEY_LOCAL_MACHINE,
-                        szName,
-                        0,
-                        NULL,
-                        0,
-                        KEY_WRITE,
-                        NULL,
-                        &hKey,
-                        NULL);
-    if (rc != ERROR_SUCCESS) {
-        rv = FALSE;
-        goto cleanup;
-    }
-    rc = RegSetValueEx(hKey, REG_SERVFILE, 0, REG_SZ,
-                       (CONST BYTE *)_service_bat,
-                       lstrlen(_service_bat) + 1);
-    if (rc != ERROR_SUCCESS) {
-        rv = FALSE;
-        goto cleanup;
-    }
-    if (_service_log) {
-        rc = RegSetValueEx(hKey, REG_LOGFILE, 0, REG_DWORD,
-            (CONST BYTE *)&_service_log,
-            sizeof(DWORD));
-        if (rc != ERROR_SUCCESS) {
-            rv = FALSE;
-            goto cleanup;
-        }
-    }
-    if (lstrlen(_working_path)) {
-        rc = RegSetValueEx(hKey, REG_WPATH, 0, REG_SZ,
-            (CONST BYTE *)_working_path,
-            lstrlen(_working_path) + 1);
-        if (rc != ERROR_SUCCESS) {
-            rv = FALSE;
-            goto cleanup;
-        }
-    }
-
-cleanup:
-    CloseHandle(hKey);
-    return rv;
-}
-
-BOOL GetServiceParameters(LPCSTR szServiceName)
-{
-    HKEY  hKey;
-    CHAR  szName[MAX_PATH + 1];
-    DWORD rc;
-    BOOL  rv = TRUE;
-    DWORD dwType;
-    DWORD dwSize;
-
-    if (lstrlen(szServiceName) > MAX_PATH)
-        return FALSE;
-    lstrcpy(szName, REGSERVICE_ROOT);
-    lstrcat(szName, szServiceName);
-    lstrcat(szName, REGPARAMS);
-    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szName, 0, KEY_READ, &hKey);
-    if (rc != ERROR_SUCCESS) {
-        return FALSE;
-    }
-    dwSize = MAX_PATH + 1;
-    rc = RegQueryValueEx(hKey, REG_SERVFILE, NULL, &dwType,
-                         (LPBYTE)_service_bat, &dwSize);
-    if (rc != ERROR_SUCCESS || dwType != REG_SZ) {
-        rv = FALSE;
-        goto cleanup;
-    }
-    dwSize = sizeof(DWORD);
-    rc = RegQueryValueEx(hKey, REG_LOGFILE, NULL, &dwType,
-                         (LPBYTE)&_service_log, &dwSize);
-    if (rc != ERROR_SUCCESS || dwType != REG_DWORD) {
-        _service_log = FALSE;
-    }
-    dwSize = MAX_PATH + 1;
-    rc = RegQueryValueEx(hKey, REG_WPATH, NULL, &dwType,
-                         (LPBYTE)_working_path, &dwSize);
-    if (rc != ERROR_SUCCESS || dwType != REG_SZ) {
-        _working_path[0] = '\0';
-    }
-
-    if (GetSystemDirectory(szName, MAX_PATH + 1)) {
-        lstrcat(szName, "\\cmd.exe");
-        if (strchr(_cmd_exe, ' ')) {
-            _cmd_exe[0] = '"';
-            lstrcpy(&_cmd_exe[1], szName);
-            lstrcat(_cmd_exe, "\"");
-        }
-        else
-            lstrcpy(_cmd_exe, szName);
-    }
-
-cleanup:
-    CloseHandle(hKey);
-    return rv;
-}
-
-BOOL InstallService(LPCSTR szServiceName)
-{
-    char szImage[MAX_PATH + 1];
-    char szPath[MAX_PATH + 1];
-    char *p;
-    BOOL rv = TRUE;
-    SC_HANDLE hManager; 
-    SC_HANDLE hService;
-
-    if (!(hManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE))) {
-        return FALSE;
-    }
-
-    p = &szImage[1];
-    if (!GetModuleFileName(NULL, p, MAX_PATH)) {
-        rv = FALSE;
-        goto cleanup;
-    }
-    lstrcpy(szPath, p);
-    
-    if ((p = strrchr(szPath, '\\'))) {
-        *p = '\0';
-    }
-    szImage[0] = '"';
-    lstrcat(szImage, "\" -r ");
-    lstrcat(szImage, szServiceName);
-    if (!_working_path[0])
-        lstrcpy(_working_path, szPath);
-
-    hService = CreateService(hManager,                  // SCManager database
-                             _service_name,             // name of service
-                             _service_disp,             // name to display
-                             SERVICE_ALL_ACCESS,        // access required
-                             SERVICE_WIN32_OWN_PROCESS, // service type
-                             SERVICE_AUTO_START,        // start type
-                             SERVICE_ERROR_NORMAL,      // error control type
-                             szImage,                   // service's binary
-                             NULL,                      // no load svc group
-                             NULL,                      // no tag identifier
-                             "Tcpip\0Afd\0",            // dependencies
-                             NULL,                      // use SYSTEM account
-                             NULL);                     // no password
-    if (!hService) {
-        rv = FALSE;
-        goto cleanup;
-    }
-cleanup:
-    if (hService)
-        CloseServiceHandle(hService);
-    CloseServiceHandle(hManager);
-
-    return rv;
-}
-
-BOOL RemoveService(LPCSTR szServiceName)
-{
-    BOOL rv = TRUE;
-    SC_HANDLE hManager; 
-    SC_HANDLE hService;
-
-    if (!(hManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT))) {
-        return FALSE;
-    }
-    hService = OpenService(hManager, _service_name, DELETE);
-    if (!hService) {
-        rv = FALSE;
-        goto cleanup;
-    }
-
-    rv = DeleteService(hService);
-
-cleanup:
-    if (hService)
-        CloseServiceHandle(hService);
-    CloseServiceHandle(hManager);
-    return rv;
-
-}
-
-/* Report the service status to the SCM
- */
-BOOL ReportServiceStatus(DWORD dwCurrentState,
-                         DWORD dwWin32ExitCode,
-                         DWORD dwWaitHint)
-{
-   static DWORD dwCheckPoint = 1;
-   BOOL fResult = TRUE;
-
-   if (_service_mode == mode_run && _service_status_handle) {      
-       if (dwCurrentState == SERVICE_START_PENDING)
-            _service_status.dwControlsAccepted = 0;
-        else
-            _service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-
-       _service_status.dwCurrentState  = dwCurrentState;
-       _service_status.dwWin32ExitCode = dwWin32ExitCode;
-       _service_status.dwWaitHint      = dwWaitHint;
-
-       if ((dwCurrentState == SERVICE_RUNNING) ||
-           (dwCurrentState == SERVICE_STOPPED))
-           _service_status.dwCheckPoint = 0;
-       else
-           _service_status.dwCheckPoint = dwCheckPoint++;
-       fResult = SetServiceStatus(_service_status_handle, &_service_status);
-       if (!fResult) {
-           /* TODO: Deal with error */
-       }
-   }
-   return fResult;
-}
-
-static BOOL RunChildProcess(LPCSTR szApplication, LPSTR szCmdLine,
-                            LPPROCESS_INFORMATION lpprInfo)
-{
-    STARTUPINFO stInfo;
-    BOOL bResult;
-
-    ZeroMemory(&stInfo, sizeof(stInfo));
-    stInfo.cb = sizeof(stInfo);
-    stInfo.dwFlags = STARTF_USESHOWWINDOW;
-    stInfo.wShowWindow = SW_HIDE;
-
-    bResult = CreateProcess(szApplication,
-                            szCmdLine,
-                            NULL,
-                            NULL,
-                            TRUE,
-                            CREATE_NEW_PROCESS_GROUP,
-                            NULL,
-                            _working_path,
-                            &stInfo,
-                            lpprInfo);
-
-    return bResult;
-}
-
-
-/* Executed when the service receives stop event */
-static DWORD ServiceStop()
-{ 
-    DWORD rv;
-    PROCESS_INFORMATION prInfo;
-    char cmd[MAX_CMDLINE + 1];
-    
-    if (!IsServiceRunning(_service_name)) {
-        AddToMessageLog(FALSE, "Service %s is already stopped", _service_name);
-        return 0;
-    }
-    BuildCommandLine(cmd, "stop");
-    AddToMessageLog(FALSE, "Stopping service %s", _service_name);
-    if (RunChildProcess(_cmd_exe, cmd, &prInfo)) {
-        ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-        rv = WaitForSingleObject(prInfo.hProcess, INFINITE);
-        AddToMessageLog(FALSE, "Stopped service %s", _service_name);
-        CloseHandle(prInfo.hProcess);
-        CloseHandle(prInfo.hThread);
-        return 0;
-    }
-    else {
-        AddToMessageLog(TRUE, "Stopping service %s", _service_name);
-        return 1;
-    }
-}
-
-/* Executed when the service receives restart event */
-static DWORD ServiceRestart()
-{ 
-    DWORD rv;
-    PROCESS_INFORMATION prInfo;
-    char cmd[MAX_CMDLINE + 1];    
-
-    BuildCommandLine(cmd, "restart");
-    ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-    if (RunChildProcess(_cmd_exe, cmd, &prInfo)) {
-        ReportServiceStatus(SERVICE_RUNNING, NO_ERROR, 0);
-        rv = WaitForSingleObject(prInfo.hProcess, INFINITE);
-        printf("Restart Wait %d %d\n", rv, WAIT_OBJECT_0);
-        CloseHandle(prInfo.hProcess);
-        CloseHandle(prInfo.hThread);
-        rv = 0;
-    }
-    else {
-        AddToMessageLog(TRUE, "Restarting service %s", _service_name);
-        rv = 1;
-    }
-    ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-    ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
-
-    return rv;
-}
-
-/* Service controll handler
- */
-void WINAPI ServiceCtrlHandler(DWORD dwCtrlCode)
-{
-
-    switch (dwCtrlCode) {
-        case SERVICE_CONTROL_STOP:
-            ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-            /* Call the stop handler that will actualy stop the service */
-            ServiceStop();
-            return;
-        case SERVICE_CONTROL_INTERROGATE:
-        break;
-        default:
-        break;
-   }
-   ReportServiceStatus(_service_status.dwCurrentState, NO_ERROR, 0);
-}
-
-/* Console control handler
- * 
- */
-BOOL WINAPI ConsoleHandler(DWORD dwCtrlType)
-{
-
-    switch (dwCtrlType) {
-        case CTRL_BREAK_EVENT:
-            if (_service_mode == mode_run) {
-                ServiceStop();
-                return TRUE;
-            }
-            else
-                return FALSE;
-        case CTRL_C_EVENT:
-        case CTRL_CLOSE_EVENT:
-        case CTRL_SHUTDOWN_EVENT:
-            ServiceStop();
-            return TRUE;
-        break;
-    }
-
-    return FALSE;
-} 
-
-/* Executed when the service receives start event */
-static DWORD ServiceStart()
-{ 
-    DWORD rv;
-    PROCESS_INFORMATION prInfo;
-    char cmd[MAX_CMDLINE + 1];    
-
-    BuildCommandLine(cmd, "start");
-
-    DumpParams();
-
-    AddToMessageLog(FALSE, "Starting service %s", _service_name);
-    if (RunChildProcess(_cmd_exe, cmd, &prInfo)) {
-        AddToMessageLog(FALSE, "Started service %s", _service_name);
-        ReportServiceStatus(SERVICE_RUNNING, NO_ERROR, 0);
-        SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
-
-        rv = WaitForSingleObject(prInfo.hProcess, INFINITE);
-        AddToMessageLog(FALSE, "Finished service %s", _service_name);
-        ReportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);
-        ReportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
- 
-        CloseHandle(prInfo.hProcess);
-        CloseHandle(prInfo.hThread);
-        return 0;
-    }
-    else {
-        AddToMessageLog(TRUE, "Starting service %s", _service_name);
-        return 1;
-    }
-}
-
-/* Main service execution loop */
-void WINAPI ServiceMain(DWORD argc, LPTSTR *argv)
-{
-    DWORD rc;
-    _service_status.dwServiceType      = SERVICE_WIN32_OWN_PROCESS;
-    _service_status.dwCurrentState     = SERVICE_START_PENDING; 
-    _service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
-                                         SERVICE_ACCEPT_PAUSE_CONTINUE; 
-    _service_status.dwWin32ExitCode    = 0; 
-    _service_status.dwCheckPoint       = 0; 
-    _service_status.dwWaitHint         = 0; 
-    _service_status.dwServiceSpecificExitCode = 0; 
- 
-    if (_service_mode == mode_run) {
-        /* Register Service Control handler */
-        _service_status_handle = RegisterServiceCtrlHandler(_service_name,
-                                                            ServiceCtrlHandler); 
-        if (!_service_status_handle) {
-            AddToMessageLog(TRUE, "RegisterServiceCtrlHandler failed for %s",
-                            _service_name);
-            goto cleanup;
-        }
-    } 
-    ReportServiceStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
-    if ((rc = ServiceStart()) == 0) {
-        AddToMessageLog(FALSE, "Service %s Main finished", _service_name);
-    } 
-
-    return;
-cleanup:
-    /* Cleanup */
-    ReportServiceStatus(SERVICE_STOPPED, ERROR_SERVICE_SPECIFIC_ERROR, 0);
-    return; 
-}
-
-
-void __cdecl main(int argc, char **argv)
-{
-    UINT rv = 0;
-    char *arg;
-    int i;
-    int args_left = 1;
-    int need_desc = 0;
-    int need_disp = 0;
-    int need_path = 0;
-
-    if (argc < 3) {
-        ErrorUsage();
-    }
-
-    if (!IsWindowsNT()) {
-        fprintf(stderr, "This program will run only on Windows NT or higher\n");
-        ExitProcess(ERR_RET_VERSION);
-    }
-
-    for (i = 1; i < argc; i++) {
-        arg = argv[i];
-        if (*arg != '-')
-            break;
-
-        while (*++arg != '\0') {
-            switch (*arg) {
-                case 'i':
-                    _service_mode = mode_install;
-                    args_left++;
-                break;
-                case 'u':
-                    _service_mode = mode_uninstall;
-                break;
-                case 't':
-                    _service_mode = mode_debug;
-                break;
-                case 'r':
-                    _service_mode = mode_run;
-                break;
-                case 'd':
-                    need_disp = 1;
-                    args_left++;
-                break;
-                case 'c':
-                    need_desc = 1;
-                    args_left++;
-                break;
-                case 'w':
-                    need_path = 1;
-                    args_left++;
-                break;
-                case 'l':
-                    _service_log = TRUE;
-                break;
-                default:
-                    ErrorUsage();
-                break;
-            }
-        }
-    }
-    if ((argc - i) < args_left)
-        ErrorUsage();
-    lstrcpy(_service_name, argv[i++]);
-    if (need_path)
-        lstrcpy(_working_path, argv[i++]);
-    if (need_disp)
-        lstrcpy(_service_disp, argv[i++]);
-    if (need_desc)
-        lstrcpy(_service_desc, argv[i++]);
-
-    SetServiceEventLog(_service_name);
-    if (_service_mode == mode_install) {
-        lstrcpy(_service_bat, argv[i++]);
-        if (!InstallService(_service_name)) {
-            rv = ERR_RET_INSTALL;
-            AddToMessageLog(TRUE, "Failed installing %s", _service_name);
-            goto cleanup;
-        }
-        SetServiceParameters(_service_name);
-        if (need_desc)
-            SetServiceDescription(_service_name, _service_desc);
-        AddToMessageLog(FALSE, "Installed %s", _service_name);
-    }
-    else if (_service_mode == mode_uninstall) {
-        GetServiceParameters(_service_name);
-        AddToMessageLog(FALSE, "Uninstalling %s", _service_name);
-        ServiceStop();
-        if (!RemoveService(_service_name)) {
-            AddToMessageLog(TRUE, "Failed removing %s", _service_name);
-            rv = ERR_RET_REMOVE;
-        }
-    }
-    else if (_service_mode == mode_run) {
-        GetServiceParameters(_service_name);
-        AddToMessageLog(FALSE, "Initialized %s", _service_name);
-        _service_table[0].lpServiceName = _service_name;
-        _service_table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain; 
-        StartServiceCtrlDispatcher(_service_table);
-    }
-    else if (_service_mode == mode_debug) {
-        GetServiceParameters(_service_name);
-        AddToMessageLog(FALSE, "Debugging %s", _service_name);
-        ServiceMain(argc, argv);
-    }
-    else {
-        AddToMessageLog(TRUE, "Unknown service mode for %s", _service_name);
-        rv = ERR_RET_MODE;
-    }
-
-
-cleanup:
-    AddToMessageLog(FALSE, "SrvBatch finished");
-    ExitProcess(rv);
-}
diff --git a/src/native/nt/procrun/apps/srvbatch/srvbatch.rc b/src/native/nt/procrun/apps/srvbatch/srvbatch.rc
deleted file mode 100644
index e54d78d..0000000
--- a/src/native/nt/procrun/apps/srvbatch/srvbatch.rc
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
- #include <windows.h>
- 
- #define PRODUCT_VER_STRING "1.0.0.0\0"
- #define PRODUCT_VER_NAME   "ServBatch\0"
- 
- IDI_MAINICON         ICON                   "../../resources/procrunw.ico"
-
-LANGUAGE 0x9,0x1
-1 11 MSG00001.bin
- 
- 1 VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGSMASK 0x3fL
-#if defined(_DEBUG)
- FILEFLAGS 0x03L
-#else
- FILEFLAGS 0x02L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904b0"
-    BEGIN
-      VALUE "Comments", "\0"
-      VALUE "CompanyName", "Apache Software Foundation\0"
-      VALUE "FileDescription", "Application for running batch files as services\0"
-      VALUE "FileVersion", PRODUCT_VER_STRING
-      VALUE "InternalName", PRODUCT_VER_NAME
-      VALUE "LegalCopyright", "Copyright � 2000-2004 The Apache Software Foundation.\0"
-      VALUE "OriginalFilename", "srvbatch.exe\0"
-      VALUE "ProductVersion", PRODUCT_VER_STRING
-      VALUE "ProductName", PRODUCT_VER_NAME
-    END
-  END
-  BLOCK "VarFileInfo"
-  BEGIN
-    VALUE "Translation", 0x409, 1200
-  END
-END
diff --git a/src/native/nt/procrun/apps/srvbatch/srvbatch.sln b/src/native/nt/procrun/apps/srvbatch/srvbatch.sln
deleted file mode 100644
index f22d73a..0000000
--- a/src/native/nt/procrun/apps/srvbatch/srvbatch.sln
+++ /dev/null
@@ -1,30 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srvbatch", "srvbatch.vcproj", "{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example\example.vcproj", "{1C38835C-714F-49F3-85FC-9E6372149DF3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB} = {6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		Debug = Debug
-		Release = Release
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
-		{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}.Debug.ActiveCfg = Debug|Win32
-		{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}.Debug.Build.0 = Debug|Win32
-		{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}.Release.ActiveCfg = Release|Win32
-		{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}.Release.Build.0 = Release|Win32
-		{1C38835C-714F-49F3-85FC-9E6372149DF3}.Debug.ActiveCfg = Debug|Win32
-		{1C38835C-714F-49F3-85FC-9E6372149DF3}.Debug.Build.0 = Debug|Win32
-		{1C38835C-714F-49F3-85FC-9E6372149DF3}.Release.ActiveCfg = Release|Win32
-		{1C38835C-714F-49F3-85FC-9E6372149DF3}.Release.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
-EndGlobal
diff --git a/src/native/nt/procrun/apps/srvbatch/srvbatch.vcproj b/src/native/nt/procrun/apps/srvbatch/srvbatch.vcproj
deleted file mode 100644
index 4f3a350..0000000
--- a/src/native/nt/procrun/apps/srvbatch/srvbatch.vcproj
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="srvbatch"
-	ProjectGUID="{6AD26261-F2A9-4E6A-9CE6-92B4F2AA37AB}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/srvbatch.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/srvbatch.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/srvbatch.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\srvbatch.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-			<File
-				RelativePath=".\srvbatch.rc">
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/include/apxwin.h b/src/native/nt/procrun/include/apxwin.h
index 39b45fc..c2490a6 100644
--- a/src/native/nt/procrun/include/apxwin.h
+++ b/src/native/nt/procrun/include/apxwin.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -34,7 +35,6 @@
 #include <shellapi.h>
 #include <zmouse.h>
 #include <richedit.h>
-
 #include <lm.h>
 
 #ifndef _INTPTR_T_DEFINED
@@ -143,6 +143,8 @@ APX_OSLEVEL apxGetOsLevel();
 LPWSTR      AsciiToWide(LPCSTR s, LPWSTR ws);
 LPSTR       WideToAscii(LPCWSTR ws, LPSTR s);
 LPSTR       MzWideToAscii(LPCWSTR ws, LPSTR s);
+LPSTR       WideToUTF8(LPCWSTR ws);
+LPSTR       MzWideToUTF8(LPCWSTR ws);
 
 typedef struct APXMULTISZ APXMULTISZ;
 typedef APXMULTISZ*       LPAPXMULTISZ;
@@ -198,6 +200,11 @@ LPSTR   AplRindexA(LPCSTR lpStr, int ch);
 
 #define AplMoveMemory   AplCopyMemory
 
+LPSTR   lstrlcatA(LPSTR dst, int siz, LPCSTR src);
+LPWSTR  lstrlcatW(LPWSTR dst, int siz, LPCWSTR src);
+LPSTR   lstrlcpyA(LPSTR dst, int siz, LPCSTR src);
+LPWSTR  lstrlcpyW(LPWSTR dst, int siz, LPCWSTR src);
+
 PSECURITY_ATTRIBUTES GetNullACL();
 void CleanNullACL(void *sa);
 
diff --git a/src/native/nt/procrun/include/cmdline.h b/src/native/nt/procrun/include/cmdline.h
index fd22a0c..3ec8677 100644
--- a/src/native/nt/procrun/include/cmdline.h
+++ b/src/native/nt/procrun/include/cmdline.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/console.h b/src/native/nt/procrun/include/console.h
index 1af2c53..36d53dc 100644
--- a/src/native/nt/procrun/include/console.h
+++ b/src/native/nt/procrun/include/console.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/gui.h b/src/native/nt/procrun/include/gui.h
index 10e1b14..c4bef4b 100644
--- a/src/native/nt/procrun/include/gui.h
+++ b/src/native/nt/procrun/include/gui.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/handles.h b/src/native/nt/procrun/include/handles.h
index bd05931..c0c6d17 100644
--- a/src/native/nt/procrun/include/handles.h
+++ b/src/native/nt/procrun/include/handles.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/javajni.h b/src/native/nt/procrun/include/javajni.h
index f083a9b..39326aa 100644
--- a/src/native/nt/procrun/include/javajni.h
+++ b/src/native/nt/procrun/include/javajni.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,17 +13,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #ifndef _JAVAJNI_H_INCLUDED_
 #define _JAVAJNI_H_INCLUDED_
 
 __APXBEGIN_DECLS
 
+#define     APX_JVM_DESTROY 0x00000001
+
 APXHANDLE   apxCreateJava(APXHANDLE hPool, LPCWSTR szJvmDllPath);
 
 BOOL        apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                               LPCVOID lpOptions, DWORD dwMs, DWORD dwMx,
                               DWORD dwSs);
+DWORD
+apxJavaCmdInitialize(APXHANDLE hPool, LPCWSTR szClassPath, LPCWSTR szClass,
+                     LPCWSTR szOptions, DWORD dwMs, DWORD dwMx,
+                     DWORD dwSs, LPCWSTR szCmdArgs, LPWSTR **lppArray);
 
 BOOL        apxJavaLoadMainClass(APXHANDLE hJava, LPCSTR szClassName,
                                  LPCSTR szMethodName,
@@ -34,6 +41,9 @@ DWORD       apxJavaWait(APXHANDLE hJava, DWORD dwMilliseconds, BOOL bKill);
 
 BOOL        apxJavaSetOut(APXHANDLE hJava, BOOL setErrorOrOut,
                           LPCWSTR szFilename);
+DWORD       apxJavaSetOptions(APXHANDLE hJava, DWORD dwOptions);
+
+BOOL        apxDestroyJvm(DWORD dwTimeout);
 
 
 __APXEND_DECLS
diff --git a/src/native/nt/procrun/include/log.h b/src/native/nt/procrun/include/log.h
index 3f20249..50fc1de 100644
--- a/src/native/nt/procrun/include/log.h
+++ b/src/native/nt/procrun/include/log.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/registry.h b/src/native/nt/procrun/include/registry.h
index 10f42c0..20f3f8b 100644
--- a/src/native/nt/procrun/include/registry.h
+++ b/src/native/nt/procrun/include/registry.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -42,12 +43,13 @@ APXHANDLE apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
 #endif
 
 /** Delete the process registry keys
+ *  samDesired only needs to be KREG_WOW6432 or 0
  */
 BOOL      apxDeleteRegistryA(LPCSTR szRoot, LPCSTR szKeyName,
-                            BOOL bDeleteEmpty);
+                            REGSAM samDesired, BOOL bDeleteEmptyRoot);
 
 BOOL      apxDeleteRegistryW(LPCWSTR szRoot, LPCWSTR szKeyName,
-                            BOOL bDeleteEmpty);
+                            REGSAM samDesired, BOOL bDeleteEmptyRoot);
 
 #ifdef _UNICODE
 #define apxDeleteRegistry   apxDeleteRegistryW
@@ -133,7 +135,6 @@ DWORD   apxRegistryGetNumberW(APXHANDLE hRegistry, DWORD dwFrom,
 BOOL    apxRegistryDeleteW(APXHANDLE hRegistry, DWORD dwFrom,
                            LPCWSTR szSubkey, LPCWSTR szValueName);
 
-
 #ifdef _UNICODE
 #define apxRegistryDelete    apxRegistryDeleteW
 #else
diff --git a/src/native/nt/procrun/include/rprocess.h b/src/native/nt/procrun/include/rprocess.h
index db20821..f98e652 100644
--- a/src/native/nt/procrun/include/rprocess.h
+++ b/src/native/nt/procrun/include/rprocess.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/include/service.h b/src/native/nt/procrun/include/service.h
index 30d03fa..826fb1c 100644
--- a/src/native/nt/procrun/include/service.h
+++ b/src/native/nt/procrun/include/service.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -67,6 +68,8 @@ DWORD       apxServiceBrowse(APXHANDLE hService,
                              LPAPXFNCALLBACK fnDisplayCallback,
                              LPVOID lpCbData);
 
+DWORD       apxGetMaxServiceTimeout(APXHANDLE hPool);
+
 __APXEND_DECLS
 
 #endif /* _SERVICE_H_INCLUDED_ */
diff --git a/src/native/nt/procrun/java/Test.java b/src/native/nt/procrun/java/Test.java
deleted file mode 100644
index c1f0db3..0000000
--- a/src/native/nt/procrun/java/Test.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-import java.io.*;
-import java.lang.*;
-
-public class Test implements Runnable {
-    public static void main (String args[]) {
-        Thread t = new Thread( new Test());
-        t.run();
-    } 
-    public void run(){     
-        try {
-        System.out.println("Simple Stdout message");
-        System.err.println("Simple Stderr message");
-        Thread.sleep(5000);
-        } catch( Throwable t ) {
-            t.printStackTrace(System.err);
-        }         
-    }
-}
diff --git a/src/native/nt/procrun/libprocrun.amd64 b/src/native/nt/procrun/libprocrun.amd64
new file mode 100644
index 0000000..0111773
--- /dev/null
+++ b/src/native/nt/procrun/libprocrun.amd64
@@ -0,0 +1,158 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_amd64
+INTDIR=.\Release_amd64
+# Begin Custom Macros
+OutDir=.\Release_amd64
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libprocrun.lib"
+
+
+CLEAN :
+	- at erase "$(INTDIR)\cmdline.obj"
+	- at erase "$(INTDIR)\console.obj"
+	- at erase "$(INTDIR)\gui.obj"
+	- at erase "$(INTDIR)\handles.obj"
+	- at erase "$(INTDIR)\javajni.obj"
+	- at erase "$(INTDIR)\log.obj"
+	- at erase "$(INTDIR)\mclib.obj"
+	- at erase "$(INTDIR)\registry.obj"
+	- at erase "$(INTDIR)\rprocess.obj"
+	- at erase "$(INTDIR)\service.obj"
+	- at erase "$(INTDIR)\utils.obj"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\libprocrun.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_AMD64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
+BSC32_SBRS= \
+	
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
+LIB32_OBJS= \
+	"$(INTDIR)\cmdline.obj" \
+	"$(INTDIR)\console.obj" \
+	"$(INTDIR)\gui.obj" \
+	"$(INTDIR)\handles.obj" \
+	"$(INTDIR)\javajni.obj" \
+	"$(INTDIR)\log.obj" \
+	"$(INTDIR)\mclib.obj" \
+	"$(INTDIR)\registry.obj" \
+	"$(INTDIR)\rprocess.obj" \
+	"$(INTDIR)\service.obj" \
+	"$(INTDIR)\utils.obj"
+
+"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+    $(LIB32) @<<
+  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+SOURCE=.\src\cmdline.c
+
+"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\console.c
+
+"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\gui.c
+
+"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\handles.c
+
+"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\javajni.c
+
+"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\log.c
+
+"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\mclib.c
+
+"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\registry.c
+
+"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\rprocess.c
+
+"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\service.c
+
+"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\utils.c
+
+"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
diff --git a/src/native/nt/procrun/libprocrun.dsp b/src/native/nt/procrun/libprocrun.dsp
index eb679cb..e5dd6cd 100644
--- a/src/native/nt/procrun/libprocrun.dsp
+++ b/src/native/nt/procrun/libprocrun.dsp
@@ -65,8 +65,8 @@ LIB32=link.exe -lib
 # PROP Output_Dir "Debug"
 # PROP Intermediate_Dir "Debug"
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
 # ADD BASE RSC /l 0x41a /d "_DEBUG"
 # ADD RSC /l 0x41a /d "_DEBUG"
 BSC32=bscmake.exe
@@ -89,7 +89,7 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "Unicode Release"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_LIB" /YX /FD /c
 # ADD BASE RSC /l 0x41a /d "NDEBUG"
 # ADD RSC /l 0x41a /d "NDEBUG"
 BSC32=bscmake.exe
@@ -111,8 +111,8 @@ LIB32=link.exe -lib
 # PROP Output_Dir "Unicode Debug"
 # PROP Intermediate_Dir "Unicode Debug"
 # PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ  /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "_LIB" /YX /FD /GZ  /c
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "_LIB" /YX /FD /GZ /c
 # ADD BASE RSC /l 0x41a /d "_DEBUG"
 # ADD RSC /l 0x41a /d "_DEBUG"
 BSC32=bscmake.exe
diff --git a/src/native/nt/procrun/libprocrun.ia64 b/src/native/nt/procrun/libprocrun.ia64
new file mode 100644
index 0000000..c865612
--- /dev/null
+++ b/src/native/nt/procrun/libprocrun.ia64
@@ -0,0 +1,158 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_ia64
+INTDIR=.\Release_ia64
+# Begin Custom Macros
+OutDir=.\Release_ia64
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libprocrun.lib"
+
+
+CLEAN :
+	- at erase "$(INTDIR)\cmdline.obj"
+	- at erase "$(INTDIR)\console.obj"
+	- at erase "$(INTDIR)\gui.obj"
+	- at erase "$(INTDIR)\handles.obj"
+	- at erase "$(INTDIR)\javajni.obj"
+	- at erase "$(INTDIR)\log.obj"
+	- at erase "$(INTDIR)\mclib.obj"
+	- at erase "$(INTDIR)\registry.obj"
+	- at erase "$(INTDIR)\rprocess.obj"
+	- at erase "$(INTDIR)\service.obj"
+	- at erase "$(INTDIR)\utils.obj"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\libprocrun.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_IA64_=1" -DWIN64 /D "_WIN64" /Wp64 /FIPRE64PRA.H /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
+BSC32_SBRS= \
+	
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
+LIB32_OBJS= \
+	"$(INTDIR)\cmdline.obj" \
+	"$(INTDIR)\console.obj" \
+	"$(INTDIR)\gui.obj" \
+	"$(INTDIR)\handles.obj" \
+	"$(INTDIR)\javajni.obj" \
+	"$(INTDIR)\log.obj" \
+	"$(INTDIR)\mclib.obj" \
+	"$(INTDIR)\registry.obj" \
+	"$(INTDIR)\rprocess.obj" \
+	"$(INTDIR)\service.obj" \
+	"$(INTDIR)\utils.obj"
+
+"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+    $(LIB32) @<<
+  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+SOURCE=.\src\cmdline.c
+
+"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\console.c
+
+"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\gui.c
+
+"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\handles.c
+
+"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\javajni.c
+
+"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\log.c
+
+"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\mclib.c
+
+"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\registry.c
+
+"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\rprocess.c
+
+"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\service.c
+
+"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\utils.c
+
+"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
diff --git a/src/native/nt/procrun/libprocrun.x86 b/src/native/nt/procrun/libprocrun.x86
new file mode 100644
index 0000000..88a90f0
--- /dev/null
+++ b/src/native/nt/procrun/libprocrun.x86
@@ -0,0 +1,158 @@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE 
+NULL=nul
+!ENDIF 
+
+OUTDIR=.\Release_x86
+INTDIR=.\Release_x86
+# Begin Custom Macros
+OutDir=.\Release_x86
+# End Custom Macros
+
+ALL : "$(OUTDIR)\libprocrun.lib"
+
+
+CLEAN :
+	- at erase "$(INTDIR)\cmdline.obj"
+	- at erase "$(INTDIR)\console.obj"
+	- at erase "$(INTDIR)\gui.obj"
+	- at erase "$(INTDIR)\handles.obj"
+	- at erase "$(INTDIR)\javajni.obj"
+	- at erase "$(INTDIR)\log.obj"
+	- at erase "$(INTDIR)\mclib.obj"
+	- at erase "$(INTDIR)\registry.obj"
+	- at erase "$(INTDIR)\rprocess.obj"
+	- at erase "$(INTDIR)\service.obj"
+	- at erase "$(INTDIR)\utils.obj"
+	- at erase "$(INTDIR)\vc60.idb"
+	- at erase "$(OUTDIR)\libprocrun.lib"
+
+"$(OUTDIR)" :
+    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I ".\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Fp"$(INTDIR)\libprocrun.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
+
+.c{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.obj::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.c{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cpp{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+.cxx{$(INTDIR)}.sbr::
+   $(CPP) @<<
+   $(CPP_PROJ) $< 
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\libprocrun.bsc" 
+BSC32_SBRS= \
+	
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libprocrun.lib" 
+LIB32_OBJS= \
+	"$(INTDIR)\cmdline.obj" \
+	"$(INTDIR)\console.obj" \
+	"$(INTDIR)\gui.obj" \
+	"$(INTDIR)\handles.obj" \
+	"$(INTDIR)\javajni.obj" \
+	"$(INTDIR)\log.obj" \
+	"$(INTDIR)\mclib.obj" \
+	"$(INTDIR)\registry.obj" \
+	"$(INTDIR)\rprocess.obj" \
+	"$(INTDIR)\service.obj" \
+	"$(INTDIR)\utils.obj"
+
+"$(OUTDIR)\libprocrun.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+    $(LIB32) @<<
+  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+
+SOURCE=.\src\cmdline.c
+
+"$(INTDIR)\cmdline.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\console.c
+
+"$(INTDIR)\console.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\gui.c
+
+"$(INTDIR)\gui.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\handles.c
+
+"$(INTDIR)\handles.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\javajni.c
+
+"$(INTDIR)\javajni.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\log.c
+
+"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\mclib.c
+
+"$(INTDIR)\mclib.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\registry.c
+
+"$(INTDIR)\registry.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\rprocess.c
+
+"$(INTDIR)\rprocess.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\service.c
+
+"$(INTDIR)\service.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=.\src\utils.c
+
+"$(INTDIR)\utils.obj" : $(SOURCE) "$(INTDIR)"
+	$(CPP) $(CPP_PROJ) $(SOURCE)
+
diff --git a/src/native/nt/procrun/resources/apsvcmgr.ico b/src/native/nt/procrun/resources/apsvcmgr.ico
deleted file mode 100644
index ecc896b..0000000
Binary files a/src/native/nt/procrun/resources/apsvcmgr.ico and /dev/null differ
diff --git a/src/native/nt/procrun/resources/commons.bmp b/src/native/nt/procrun/resources/commons.bmp
new file mode 100644
index 0000000..6e6a006
Binary files /dev/null and b/src/native/nt/procrun/resources/commons.bmp differ
diff --git a/src/native/nt/procrun/resources/jakarta.bmp b/src/native/nt/procrun/resources/jakarta.bmp
deleted file mode 100644
index c78cb95..0000000
Binary files a/src/native/nt/procrun/resources/jakarta.bmp and /dev/null differ
diff --git a/src/native/nt/procrun/resources/license.rtf b/src/native/nt/procrun/resources/license.rtf
index 622e284..9510579 100644
--- a/src/native/nt/procrun/resources/license.rtf
+++ b/src/native/nt/procrun/resources/license.rtf
@@ -15,7 +15,7 @@
 {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain 
 \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid14358633 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\f1\insrsid16132583\charrsid12321742 The Apache Software License, Version 2.0
 \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs18\insrsid16132583\charrsid16132583 
-\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid9454304 {\f1\fs18\insrsid9454304   }{\f1\fs18\insrsid16132583\charrsid16132583 Copyright 2002-2004 The Apache Software Foundation.
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid9454304 {\f1\fs18\insrsid9454304   }{\f1\fs18\insrsid16132583\charrsid16132583 Copyright 2002-2010 The Apache Software Foundation.
 \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid1379267 {\f1\fs18\insrsid16132583\charrsid16132583    
 \par }{\f1\fs18\insrsid14358633   }{\f1\fs18\insrsid16132583\charrsid16132583 Licensed under the Apache License, Version 2.0 (the "License");
 \par }{\f1\fs18\insrsid14358633   }{\f1\fs18\insrsid16132583\charrsid16132583 you may not use this file except in compliance with the License.
diff --git a/src/native/nt/procrun/resources/sorterd.bmp b/src/native/nt/procrun/resources/sorterd.bmp
deleted file mode 100644
index 0dd6ccd..0000000
Binary files a/src/native/nt/procrun/resources/sorterd.bmp and /dev/null differ
diff --git a/src/native/nt/procrun/resources/sorteru.bmp b/src/native/nt/procrun/resources/sorteru.bmp
deleted file mode 100644
index 1f6723b..0000000
Binary files a/src/native/nt/procrun/resources/sorteru.bmp and /dev/null differ
diff --git a/src/native/nt/procrun/resources/sstatus.bmp b/src/native/nt/procrun/resources/sstatus.bmp
deleted file mode 100644
index 870c143..0000000
Binary files a/src/native/nt/procrun/resources/sstatus.bmp and /dev/null differ
diff --git a/src/native/nt/procrun/resources/toolbar.bmp b/src/native/nt/procrun/resources/toolbar.bmp
deleted file mode 100644
index 41dcf40..0000000
Binary files a/src/native/nt/procrun/resources/toolbar.bmp and /dev/null differ
diff --git a/src/native/nt/procrun/samples/cchild.c b/src/native/nt/procrun/samples/cchild.c
deleted file mode 100644
index 6a610ed..0000000
--- a/src/native/nt/procrun/samples/cchild.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-/* Simple console child */
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <conio.h>
-#include <time.h>
-#include <process.h>    /* _beginthread, _endthread */
-#include <fcntl.h>
-#include <io.h>
-
-#define STDIN_FILENO  0
-#define STDOUT_FILENO 1
-#define STDERR_FILENO 2
-
-#define STDO_MESSAGE "Simple STDOUT_FILENO message\n"
-#define STDE_MESSAGE "Simple STDERR_FILENO message\n"
-
-#define NLOOPS          5
-#define NTHREADS       10
-
-static int do_echo = 0;
-BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
-{
-   printf("\nCTRL Event %d ", dwCtrlType);
-   switch (dwCtrlType) {
-   case CTRL_BREAK_EVENT:
-      printf("CTRL+BREAK\n");
-      exit(1);
-      return TRUE;
-   case CTRL_C_EVENT:
-      printf("CTRL+C");
-      return TRUE;
-      break;
-
-   }
-   putch('\n');
-   return FALSE;
-}
-
-unsigned __stdcall threadfunc(void *args)
-{
-    int i, p , r;
-    p = (int)(size_t)args;
-    printf("Created thread %d %04x\n", p, GetCurrentThreadId());
-    srand((unsigned)time(NULL) + p);
-    for (i = 0; i < NLOOPS; i++) {
-        r = rand() % 1000;
-        Sleep(r);
-        printf("Thread %d message %d\n", p, i);
-    }
-    printf("Quiting thread %d %04x\n", p, GetCurrentThreadId());
-    _endthreadex(0);
-    return 0;
-}
-
-
-int main(int argc, char *argv[])
-{
-    int i, conio = 0, threads = 0;
-    char buf[256];
-    HANDLE htrd[NTHREADS];
-
-    OutputDebugString("cchild starting");
-    fprintf(stdout, "cchild starting %s\n", argv[0]);
-    fflush(stdout);
-    SetConsoleCtrlHandler(ControlHandler, TRUE);
-    Sleep(1000);
-    
-    for (i = 0; i < __argc; i++) {
-        fprintf(stdout, "argv[%d] %s\n", i, __argv[i]);
-        fflush(stdout);
-        if (strcmp(__argv[i], "--") == 0)
-            do_echo = 1;
-        else if (strcmp(__argv[i], "-c") == 0)
-            conio = 1;
-        else if (strcmp(__argv[i], "-t") == 0)
-            threads = 1;
-    }
-    fflush(stdout);
-    fprintf(stderr, "Simple stderr message\n");
-    fflush(stderr);
-    write(STDOUT_FILENO, STDO_MESSAGE, sizeof(STDO_MESSAGE) - 1);
-    write(STDERR_FILENO, STDE_MESSAGE, sizeof(STDE_MESSAGE) - 1);
-    
-    if (conio) {
-        cputs("Type 'Y' when finished typing keys...");
-        do {
-            i = getch();
-            i = toupper(i);
-        } while (i != 'Y');
-        putch('\n');
-    }
-    if (do_echo) {
-        cputs("Going to echo loop...\n");
-        while ((i = read(STDIN_FILENO, buf, 256)) > 0) {
-            buf[i] = '\0';
-            fputs(buf, stdout);
-            if (strcmp(buf, "quit\n") == 0)
-                break;
-        }
-    }
-    if (threads) {
-        for (i = 0; i < NTHREADS; i++) {
-            unsigned id;
-            htrd[i] = (HANDLE)_beginthreadex(NULL, 0, threadfunc, (void *)(size_t)i, 0, &id);
-        }
-        WaitForMultipleObjects(10, htrd, TRUE, INFINITE);
-    }
-
-    fprintf(stdout, "cchild finishing\n");
-    fprintf(stdout, "cchild finished\n");
-    Sleep(1000);
-    OutputDebugString("cchild Ended");
-    return 0;
-}
-
diff --git a/src/native/nt/procrun/samples/cchild.vcproj b/src/native/nt/procrun/samples/cchild.vcproj
deleted file mode 100644
index c3c4666..0000000
--- a/src/native/nt/procrun/samples/cchild.vcproj
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="cchild"
-	ProjectGUID="{E9ABF9C5-CCF7-4372-B42A-07584D2441D8}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="..\obj\Release"
-			IntermediateDirectory="..\obj\Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/cchild.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				EntryPointSymbol=""
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="..\obj\Debug"
-			IntermediateDirectory="..\obj\Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/cchildd.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/cchild.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Debug Unicode|Win32"
-			OutputDirectory="..\obj\$(ConfigurationName)"
-			IntermediateDirectory="..\obj\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="1">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/cchildud.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/cchild.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release Unicode|Win32"
-			OutputDirectory="..\obj\$(ConfigurationName)"
-			IntermediateDirectory="..\obj\$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="../bin/cchildu.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\cchild.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/src/cmdline.c b/src/native/nt/procrun/src/cmdline.c
index 62e70d6..fb0af39 100644
--- a/src/native/nt/procrun/src/cmdline.c
+++ b/src/native/nt/procrun/src/cmdline.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -19,6 +20,10 @@
 #define EXE_SUFFIX      L".EXE"
 #define EXE_SUFFIXLEN   (sizeof(EXE_SUFFIX) / sizeof(WCHAR) - 1)
 
+#define X86_SUFFIX      L".X86"
+#define X64_SUFFIX      L".X64"
+#define A64_SUFFIX      L".I64"
+
 /* Those two are declared in handles.c */
 extern LPWSTR   *_st_sys_argvw;
 extern int      _st_sys_argc;
@@ -83,6 +88,20 @@ LPAPXCMDLINE apxCmdlineParse(
     p = _st_sys_argvw[0] + l - EXE_SUFFIXLEN;
     if (lstrcmpiW(p, EXE_SUFFIX) == 0)
         *p = L'\0';
+    /* Strip CPU specific suffixes */
+    l = lstrlenW(_st_sys_argvw[0]);
+    if (l > EXE_SUFFIXLEN) {
+        p = _st_sys_argvw[0] + l - EXE_SUFFIXLEN;
+        if (lstrcmpiW(p, X86_SUFFIX) == 0) {
+            *p = L'\0';
+        }
+        else if (lstrcmpiW(p, X64_SUFFIX) == 0) {
+            *p = L'\0';
+        }
+        else if (lstrcmpiW(p, A64_SUFFIX) == 0) {
+            *p = L'\0';
+        }
+    }
     if (lpszCommands && _st_sys_argc > 1 && lstrlenW(_st_sys_argvw[1]) > 5) {
         if (_st_sys_argvw[1][0] == L'/' &&
             _st_sys_argvw[1][1] == L'/' &&
@@ -233,8 +252,8 @@ void apxCmdlineLoadEnvVars(
     while (lpCmdline->lpOptions[i].szName) {
         DWORD l;
         WCHAR szVar[SIZ_HUGLEN];
-        lstrcpyW(szEnv, L"PR_");
-        lstrcatW(szEnv, lpCmdline->lpOptions[i].szName);
+        lstrlcpyW(szEnv, SIZ_HUGLEN, L"PR_");
+        lstrlcatW(szEnv, SIZ_HUGLEN, lpCmdline->lpOptions[i].szName);
         l = GetEnvironmentVariableW(szEnv, szVar, SIZ_HUGMAX);
         if (l == 0 && GetLastError() !=  ERROR_ENVVAR_NOT_FOUND) {
             apxLogWrite(APXLOG_MARK_ERROR "Error geting environment variable %S",
@@ -246,14 +265,17 @@ void apxCmdlineLoadEnvVars(
             lpCmdline->lpOptions[i].szValue = apxPoolStrdupW(lpCmdline->hPool, szVar);
             lpCmdline->lpOptions[i].dwType |= APXCMDOPT_FOUND;
         }
+        else if (l && (lpCmdline->lpOptions[i].dwType & APXCMDOPT_INT)) {
+            lpCmdline->lpOptions[i].dwValue = (DWORD)apxAtoulW(szVar);
+            lpCmdline->lpOptions[i].dwType |= APXCMDOPT_FOUND;
+        }
         else if (l && (lpCmdline->lpOptions[i].dwType & APXCMDOPT_MSZ)) {
             LPWSTR pp;
             BOOL insquote = FALSE, indquote = FALSE;
             DWORD sp = 0;
+            lpCmdline->lpOptions[i].dwValue = (lstrlenW(szVar) + 2) * sizeof(WCHAR);
             lpCmdline->lpOptions[i].szValue = apxPoolCalloc(lpCmdline->hPool,
-                                                            (lstrlenW(szVar) + 2) *
-                                                            sizeof(WCHAR));
-            lstrcpyW(lpCmdline->lpOptions[i].szValue, szVar);
+                                                    lpCmdline->lpOptions[i].dwValue);
             pp = szVar;
             while(*pp) {
                 if (*pp == L'\'')
@@ -273,4 +295,4 @@ void apxCmdlineLoadEnvVars(
         ++i;
     }
 
-}
\ No newline at end of file
+}
diff --git a/src/native/nt/procrun/src/console.c b/src/native/nt/procrun/src/console.c
index 9ce8bee..5ecb991 100644
--- a/src/native/nt/procrun/src/console.c
+++ b/src/native/nt/procrun/src/console.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/src/gui.c b/src/native/nt/procrun/src/gui.c
index 6726f30..9cff3b1 100644
--- a/src/native/nt/procrun/src/gui.c
+++ b/src/native/nt/procrun/src/gui.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -608,7 +609,7 @@ LPSTR apxGetFileNameA(HWND hWnd, LPCSTR szTitle, LPCSTR szFilter,
     lpOf.lpstrInitialDir = szDefPath;
     lpOf.lpstrFile       = szFile;
     lpOf.nMaxFile        = SIZ_BUFMAX;
- 	lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+    lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
 
     if (bOpenOrSave)
         rv = GetOpenFileNameA(&lpOf);
@@ -643,7 +644,7 @@ LPWSTR apxGetFileNameW(HWND hWnd, LPCWSTR szTitle, LPCWSTR szFilter,
     lpOf.lpstrInitialDir = szDefPath;
     lpOf.lpstrFile       = szFile;
     lpOf.nMaxFile        = SIZ_BUFMAX;
- 	lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+    lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
 
     if (bOpenOrSave)
         rv = GetOpenFileNameW(&lpOf);
diff --git a/src/native/nt/procrun/src/handles.c b/src/native/nt/procrun/src/handles.c
index bae886c..ecec9ef 100644
--- a/src/native/nt/procrun/src/handles.c
+++ b/src/native/nt/procrun/src/handles.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -406,9 +407,12 @@ apxPoolWStrdupA(APXHANDLE hPool, LPCSTR szSource)
 {
     if (szSource) {
         LPWSTR szDest;
-        DWORD l = lstrlenA(szSource);
-        szDest = apxPoolAlloc(hPool, (l + 1) * sizeof(WCHAR));
-        AsciiToWide(szSource, szDest);
+        int cch = MultiByteToWideChar(CP_UTF8, 0, szSource, -1, NULL, 0);
+        szDest = (LPWSTR)apxPoolAlloc(hPool, cch * sizeof(WCHAR));
+        if (!MultiByteToWideChar(CP_UTF8, 0, szSource, -1, szDest, cch)) {
+            apxFree(szDest);
+            return NULL;
+        }
         return szDest;
     }
     else
diff --git a/src/native/nt/procrun/src/javajni.c b/src/native/nt/procrun/src/javajni.c
index 4f43f41..7fdcf97 100644
--- a/src/native/nt/procrun/src/javajni.c
+++ b/src/native/nt/procrun/src/javajni.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include "apxwin.h"
 #include "private.h"
 
@@ -20,7 +21,7 @@
 
 #ifndef JNI_VERSION_1_2
 #error -------------------------------------------------------
-#error JAVA 1.1 IS NO LONGER SUPPORTED 
+#error JAVA 1.1 IS NO LONGER SUPPORTED
 #error -------------------------------------------------------
 #endif
 
@@ -30,7 +31,7 @@
 #define JNI_VERSION_DEFAULT JNI_VERSION_1_2
 #endif
 
-/* Standard jvm.dll prototypes 
+/* Standard jvm.dll prototypes
  * since only single jvm can exist per process
  * make those global
  */
@@ -44,7 +45,11 @@ static DYNLOAD_FPTR_DECLARE(JNI_CreateJavaVM) = NULL;
 DYNOLAD_TYPE_DECLARE(JNI_GetCreatedJavaVMs, JNICALL, jint)(JavaVM **, jsize, jsize *);
 static DYNLOAD_FPTR_DECLARE(JNI_GetCreatedJavaVMs) = NULL;
 
-static HANDLE _st_sys_jvmDllHandle = NULL;
+static HANDLE  _st_sys_jvmDllHandle = NULL;
+static JavaVM *_st_sys_jvm = NULL;
+
+DYNOLAD_TYPE_DECLARE(SetDllDirectoryW, WINAPI, BOOL)(LPCWSTR);
+static DYNLOAD_FPTR_DECLARE(SetDllDirectoryW) = NULL;
 
 #define JVM_DELETE_CLAZZ(jvm, cl)                                               \
     APXMACRO_BEGIN                                                              \
@@ -76,7 +81,7 @@ static HANDLE _st_sys_jvmDllHandle = NULL;
 #endif
 
 #define JNI_LOCAL_UNREF(obj) \
-        (*(lpJava->lpEnv))->DeleteLocalRef(lpJava->lpEnv, obj)    
+        (*(lpJava->lpEnv))->DeleteLocalRef(lpJava->lpEnv, obj)
 
 #define JNICALL_0(fName)  \
         ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv))
@@ -94,20 +99,22 @@ static HANDLE _st_sys_jvmDllHandle = NULL;
         ((*(lpJava->lpEnv))->##fName(lpJava->lpEnv, (a1), (a2), (a3), (a4)))
 
 typedef struct APXJAVASTDCLAZZ {
+    CHAR        sClazz[1024];
+    CHAR        sMethod[512];
     jclass      jClazz;
     jmethodID   jMethod;
     jobject     jObject;
     jarray      jArgs;
 } APXJAVASTDCLAZZ, *LPAPXJAVASTDCLAZZ;
- 
+
 typedef struct APXJAVAVM {
     DWORD           dwOptions;
     APXJAVASTDCLAZZ clString;
     APXJAVASTDCLAZZ clWorker;
-    jint            iVersion; 
+    jint            iVersion;
     jsize           iVmCount;
-    JNIEnv          *lpEnv; 
-    JavaVM          *lpJvm; 
+    JNIEnv          *lpEnv;
+    JavaVM          *lpJvm;
     /* JVM worker thread info */
     HANDLE          hWorkerThread;
     DWORD           iWorkerThread;
@@ -116,12 +123,17 @@ typedef struct APXJAVAVM {
 } APXJAVAVM, *LPAPXJAVAVM;
 
 #define JAVA_CLASSPATH      "-Djava.class.path="
+#define JAVA_CLASSPATH_W    L"-Djava.class.path="
 #define JAVA_CLASSSTRING    "java/lang/String"
 
 static __inline BOOL __apxJvmAttach(LPAPXJAVAVM lpJava)
 {
-    jint _iStatus = (*(lpJava->lpJvm))->GetEnv(lpJava->lpJvm,
-                                          (void **)&(lpJava->lpEnv),                                            
+    jint _iStatus;
+
+    if (!_st_sys_jvm)
+      return FALSE;
+    _iStatus = (*(lpJava->lpJvm))->GetEnv(lpJava->lpJvm,
+                                          (void **)&(lpJava->lpEnv),
                                           lpJava->iVersion);
     if (_iStatus != JNI_OK) {
         if (_iStatus == JNI_EDETACHED)
@@ -138,8 +150,9 @@ static __inline BOOL __apxJvmAttach(LPAPXJAVAVM lpJava)
 
 static __inline BOOL __apxJvmDetach(LPAPXJAVAVM lpJava)
 {
-    jint _iStatus = (*(lpJava->lpJvm))->DetachCurrentThread(lpJava->lpJvm);
-    if (_iStatus != JNI_OK) {
+    if (!_st_sys_jvm)
+      return FALSE;
+    if ((*(lpJava->lpJvm))->DetachCurrentThread(lpJava->lpJvm) != JNI_OK) {
         lpJava->lpEnv = NULL;
         return FALSE;
     }
@@ -149,8 +162,9 @@ static __inline BOOL __apxJvmDetach(LPAPXJAVAVM lpJava)
 
 static BOOL __apxLoadJvmDll(LPCWSTR szJvmDllPath)
 {
-    UINT errMode; 
+    UINT errMode;
     LPWSTR dllJvmPath = (LPWSTR)szJvmDllPath;
+    DYNLOAD_FPTR_DECLARE(SetDllDirectoryW);
 
     if (!IS_INVALID_HANDLE(_st_sys_jvmDllHandle))
         return TRUE;    /* jvm.dll is already loaded */
@@ -158,25 +172,44 @@ static BOOL __apxLoadJvmDll(LPCWSTR szJvmDllPath)
     if (!dllJvmPath || *dllJvmPath == L'\0')
         dllJvmPath = apxGetJavaSoftRuntimeLib(NULL);
     if (!dllJvmPath)
-        return FALSE;    
+        return FALSE;
     /* Suppress the not found system popup message */
-    errMode = SetErrorMode(SEM_FAILCRITICALERRORS); 
-    
-    _st_sys_jvmDllHandle = LoadLibraryExW(dllJvmPath, NULL, 0);  
+    errMode = SetErrorMode(SEM_FAILCRITICALERRORS);
+
+    _st_sys_jvmDllHandle = LoadLibraryExW(dllJvmPath, NULL, 0);
     /* This shuldn't happen, but try to search in %PATH% */
     if (IS_INVALID_HANDLE(_st_sys_jvmDllHandle))
         _st_sys_jvmDllHandle = LoadLibraryExW(dllJvmPath, NULL,
-                                              LOAD_WITH_ALTERED_SEARCH_PATH);  
+                                              LOAD_WITH_ALTERED_SEARCH_PATH);
+
+    if (IS_INVALID_HANDLE(_st_sys_jvmDllHandle)) {
+        WCHAR  jreBinPath[1024];
+        DWORD  i, l = 0;
+
+        lstrlcpyW(jreBinPath, 1024, dllJvmPath);
+        DYNLOAD_FPTR_ADDRESS(SetDllDirectoryW, KERNEL32);
+        for (i = lstrlenW(jreBinPath); i > 0, l < 2; i--) {
+            if (jreBinPath[i] == L'\\' || jreBinPath[i] == L'/') {
+                jreBinPath[i] = L'\0';
+                DYNLOAD_CALL(SetDllDirectoryW)(jreBinPath);
+                l++;
+            }
+        }
+        _st_sys_jvmDllHandle = LoadLibraryExW(dllJvmPath, NULL, 0);
+        if (IS_INVALID_HANDLE(_st_sys_jvmDllHandle))
+            _st_sys_jvmDllHandle = LoadLibraryExW(dllJvmPath, NULL,
+                                                  LOAD_WITH_ALTERED_SEARCH_PATH);
+    }
     /* Restore the error mode signalization */
-    SetErrorMode(errMode); 
+    SetErrorMode(errMode);
     if (IS_INVALID_HANDLE(_st_sys_jvmDllHandle)) {
         apxLogWrite(APXLOG_MARK_SYSERR);
         return FALSE;
     }
-    DYNLOAD_FPTR_LOAD(JNI_GetDefaultJavaVMInitArgs, _st_sys_jvmDllHandle);        
-    DYNLOAD_FPTR_LOAD(JNI_CreateJavaVM,             _st_sys_jvmDllHandle);        
+    DYNLOAD_FPTR_LOAD(JNI_GetDefaultJavaVMInitArgs, _st_sys_jvmDllHandle);
+    DYNLOAD_FPTR_LOAD(JNI_CreateJavaVM,             _st_sys_jvmDllHandle);
     DYNLOAD_FPTR_LOAD(JNI_GetCreatedJavaVMs,        _st_sys_jvmDllHandle);
-    
+
     if (!DYNLOAD_FPTR(JNI_GetDefaultJavaVMInitArgs) ||
         !DYNLOAD_FPTR(JNI_CreateJavaVM) ||
         !DYNLOAD_FPTR(JNI_GetCreatedJavaVMs)) {
@@ -199,9 +232,9 @@ static BOOL __apxJavaJniCallback(APXHANDLE hObject, UINT uMsg,
     lpJava = APXHANDLE_DATA(hObject);
     switch (uMsg) {
         case WM_CLOSE:
-            if (lpJava->lpJvm) {
+            if (_st_sys_jvm && lpJava->lpJvm) {
                 if (!IS_INVALID_HANDLE(lpJava->hWorkerThread)) {
-                    if (GetExitCodeThread(lpJava->hWorkerThread, &dwJvmRet) && 
+                    if (GetExitCodeThread(lpJava->hWorkerThread, &dwJvmRet) &&
                         dwJvmRet == STILL_ACTIVE) {
                         TerminateThread(lpJava->hWorkerThread, 5);
                     }
@@ -213,11 +246,6 @@ static BOOL __apxJavaJniCallback(APXHANDLE hObject, UINT uMsg,
                 __apxJvmDetach(lpJava);
                 /* Check if this is the jvm loader */
                 if (!lpJava->iVmCount && _st_sys_jvmDllHandle) {
-#if 0
-                    /* Do not destroy if we terminated the worker thread */
-                    if (dwJvmRet != STILL_ACTIVE)
-                        (*(lpJava->lpJvm))->DestroyJavaVM(lpJava->lpJvm); 
-#endif
                     /* Unload JVM dll */
                     FreeLibrary(_st_sys_jvmDllHandle);
                     _st_sys_jvmDllHandle = NULL;
@@ -238,15 +266,15 @@ apxCreateJava(APXHANDLE hPool, LPCWSTR szJvmDllPath)
     APXHANDLE    hJava;
     LPAPXJAVAVM  lpJava;
     jsize        iVmCount;
-    JavaVM       *lpJvm = NULL; 
+    JavaVM       *lpJvm = NULL;
 
     if (!__apxLoadJvmDll(szJvmDllPath))
-        return NULL;    
+        return NULL;
     /*
      */
     if (DYNLOAD_FPTR(JNI_GetCreatedJavaVMs)(&lpJvm, 1, &iVmCount) != JNI_OK) {
         return NULL;
-    } 
+    }
     if (iVmCount && !lpJvm)
         return NULL;
 
@@ -259,9 +287,44 @@ apxCreateJava(APXHANDLE hPool, LPCWSTR szJvmDllPath)
     lpJava = APXHANDLE_DATA(hJava);
     lpJava->lpJvm = lpJvm;
     lpJava->iVmCount = iVmCount;
+    if (!_st_sys_jvm)
+        _st_sys_jvm = lpJvm;
     return hJava;
 }
 
+static DWORD WINAPI __apxJavaDestroyThread(LPVOID lpParameter)
+{
+    JavaVM *lpJvm = (JavaVM *)lpParameter;
+    (*lpJvm)->DestroyJavaVM(lpJvm);
+    return 0;
+}
+
+BOOL
+apxDestroyJvm(DWORD dwTimeout)
+{
+    if (_st_sys_jvm) {
+        DWORD  tid;
+        HANDLE hWaiter;
+        BOOL   rv = FALSE;
+        JavaVM *lpJvm = _st_sys_jvm;
+
+        _st_sys_jvm = NULL;
+        (*lpJvm)->DetachCurrentThread(lpJvm);
+        hWaiter = CreateThread(NULL, 0, __apxJavaDestroyThread,
+                               (void *)lpJvm, 0, &tid);
+        if (IS_INVALID_HANDLE(hWaiter)) {
+            apxLogWrite(APXLOG_MARK_SYSERR);
+            return FALSE;
+        }
+        if (WaitForSingleObject(hWaiter, dwTimeout) == WAIT_OBJECT_0)
+            rv = TRUE;
+        CloseHandle(hWaiter);
+        return rv;
+    }
+    else
+        return FALSE;
+}
+
 static DWORD __apxMultiSzToJvmOptions(APXHANDLE hPool,
                                       LPCSTR lpString,
                                       JavaVMOption **lppArray,
@@ -270,7 +333,7 @@ static DWORD __apxMultiSzToJvmOptions(APXHANDLE hPool,
     DWORD i, n = 0, l = 0;
     char *buff;
     LPSTR p;
-    
+
     if (lpString) {
         l = __apxGetMultiSzLengthA(lpString, &n);
     }
@@ -292,7 +355,7 @@ static DWORD __apxMultiSzToJvmOptions(APXHANDLE hPool,
         p++;
         p += qr;
     }
-    
+
     return n;
 }
 
@@ -302,10 +365,11 @@ static jint JNICALL __apxJniVfprintf(FILE *fp, const char *format, va_list args)
     jint rv;
     CHAR sBuf[1024+16];
     rv = wvsprintfA(sBuf, format, args);
-    apxLogWrite(APXLOG_MARK_INFO "%s", sBuf);
+    if (apxLogWrite(APXLOG_MARK_INFO "%s", sBuf) == 0)
+        fputs(sBuf, stdout);
     return rv;
 }
- 
+
 
 /* ANSI version only */
 BOOL
@@ -314,8 +378,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                   DWORD dwSs)
 {
     LPAPXJAVAVM     lpJava;
-    JDK1_1InitArgs  vmArgs11;
-    JavaVMInitArgs  vmArgs; 
+    JavaVMInitArgs  vmArgs;
     JavaVMOption    *lpJvmOptions;
     DWORD           i, nOptions, sOptions = 2;
     BOOL            rv = FALSE;
@@ -323,7 +386,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
         return FALSE;
 
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     if (lpJava->iVmCount) {
         if (!lpJava->lpEnv && !__apxJvmAttach(lpJava)) {
             if (lpJava->iVersion == JNI_VERSION_1_2) {
@@ -334,7 +397,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                 lpJava->iVersion = JNI_VERSION_1_2;
             if (!__apxJvmAttach(lpJava)) {
                 apxLogWrite(APXLOG_MARK_ERROR "Unable To Attach the JVM");
-                return FALSE; 
+                return FALSE;
             }
         }
         lpJava->iVersion = JNICALL_0(GetVersion);
@@ -347,22 +410,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
     else {
         CHAR  iB[3][64];
         LPSTR szCp;
-        vmArgs11.version = JNI_VERSION_DEFAULT;
-        if (DYNLOAD_FPTR(JNI_GetDefaultJavaVMInitArgs)(&vmArgs11) != JNI_OK) {
-            /* fall back to version 1.2 */
-            if (JNI_VERSION_DEFAULT != JNI_VERSION_1_2) {
-                vmArgs11.version = JNI_VERSION_1_2;
-                if (DYNLOAD_FPTR(JNI_GetDefaultJavaVMInitArgs)(&vmArgs11) != JNI_OK)
-                    return FALSE;
-            }
-            else
-                return FALSE;
-        }
-        /* we need at least 1.2 JNI */
-        if ((lpJava->iVersion = vmArgs11.version) < JNI_VERSION_1_2) {
-            apxLogWrite(APXLOG_MARK_ERROR "Unsupported JNI version %d", vmArgs11.version);
-            return FALSE; 
-        }
+        lpJava->iVersion = JNI_VERSION_DEFAULT;
         if (dwMs)
             ++sOptions;
         if (dwMx)
@@ -407,19 +455,22 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
                                            (void **)&(lpJava->lpEnv),
                                            &vmArgs) != JNI_OK) {
             apxLogWrite(APXLOG_MARK_ERROR "CreateJavaVM Failed");
-            rv = FALSE; 
+            rv = FALSE;
         }
-        else
+        else {
             rv = TRUE;
+            if (!_st_sys_jvm)
+                _st_sys_jvm = lpJava->lpJvm;
+        }
         apxFree(szCp);
         apxFree(lpJvmOptions);
-    }    
+    }
     /* Load standard classes */
     if (rv) {
         jclass jClazz = JNICALL_1(FindClass, JAVA_CLASSSTRING);
         if (!jClazz) {
             apxLogWrite(APXLOG_MARK_ERROR "FindClass "  JAVA_CLASSSTRING " failed");
-            goto cleanup; 
+            goto cleanup;
         }
         lpJava->clString.jClazz = JNICALL_1(NewGlobalRef, jClazz);
         JNI_LOCAL_UNREF(jClazz);
@@ -434,12 +485,106 @@ cleanup:
     return FALSE;
 }
 
+/* ANSI version only */
+DWORD
+apxJavaCmdInitialize(APXHANDLE hPool, LPCWSTR szClassPath, LPCWSTR szClass,
+                     LPCWSTR szOptions, DWORD dwMs, DWORD dwMx,
+                     DWORD dwSs, LPCWSTR szCmdArgs, LPWSTR **lppArray)
+{
+
+    DWORD i, nJVM, nCmd, nTotal, lJVM, lCmd;
+    LPWSTR p;
+
+    /* Calculate the number of all arguments */
+    nTotal = 0;
+    if (szClassPath)
+        ++nTotal;
+    if (szClass)
+        ++nTotal;
+    lJVM = __apxGetMultiSzLengthW(szOptions, &nJVM);
+    nTotal += nJVM;
+    lCmd = __apxGetMultiSzLengthW(szCmdArgs, &nCmd);
+    nTotal += nCmd;
+    if (dwMs)
+        ++nTotal;
+    if (dwMx)
+        ++nTotal;
+    if (dwSs)
+        ++nTotal;
+
+    if (nTotal == 0)
+        return 0;
+
+    /* Allocate the array to store all arguments' pointers
+     */
+    *lppArray = (LPWSTR *)apxPoolAlloc(hPool, (nTotal + 2) * sizeof(LPWSTR));
+
+    /* Process JVM options */
+    if (nJVM && lJVM) {
+        p = (LPWSTR)apxPoolAlloc(hPool, (lJVM + 1) * sizeof(WCHAR));
+        AplCopyMemory(p, szOptions, (lJVM + 1) * sizeof(WCHAR) + sizeof(WCHAR));
+        for (i = 0; i < nJVM; i++) {
+            (*lppArray)[i] = p;
+            while (*p)
+                p++;
+            p++;
+        }
+    }
+
+    /* Process the 3 extra JVM options */
+    if (dwMs) {
+        p = (LPWSTR)apxPoolAlloc(hPool, 64 * sizeof(WCHAR));
+        wsprintfW(p, L"-Xms%dm", dwMs);
+        (*lppArray)[i++] = p;
+    }
+    if (dwMx) {
+        p = (LPWSTR)apxPoolAlloc(hPool, 64 * sizeof(WCHAR));
+        wsprintfW(p, L"-Xmx%dm", dwMx);
+        (*lppArray)[i++] = p;
+    }
+    if (dwSs) {
+        p = (LPWSTR)apxPoolAlloc(hPool, 64 * sizeof(WCHAR));
+        wsprintfW(p, L"-Xss%dk", dwSs);
+        (*lppArray)[i++] = p;
+    }
+
+    /* Process the classpath and class */
+    if (szClassPath) {
+        p = (LPWSTR)apxPoolAlloc(hPool, (lstrlenW(JAVA_CLASSPATH_W) + lstrlenW(szClassPath)) * sizeof(WCHAR));
+        lstrcpyW(p, JAVA_CLASSPATH_W);
+        lstrcatW(p, szClassPath);
+        (*lppArray)[i++] = p;
+    }
+    if (szClass) {
+        p = (LPWSTR)apxPoolAlloc(hPool, (lstrlenW(szClass)) * sizeof(WCHAR));
+        lstrcpyW(p, szClass);
+        (*lppArray)[i++] = p;
+    }
+
+    /* Process command arguments */
+    if (nCmd && lCmd) {
+        p = (LPWSTR)apxPoolAlloc(hPool, (lCmd + 1) * sizeof(WCHAR));
+        AplCopyMemory(p, szCmdArgs, (lCmd + 1) * sizeof(WCHAR) + sizeof(WCHAR));
+        for (; i < nTotal; i++) {
+            (*lppArray)[i] = p;
+            while (*p)
+                p++;
+            p++;
+        }
+    }
+
+    (*lppArray)[++i] = NULL;
+
+    return nTotal;
+}
+
+
 BOOL
 apxJavaLoadMainClass(APXHANDLE hJava, LPCSTR szClassName,
                      LPCSTR szMethodName,
                      LPCVOID lpArguments)
 {
-    LPSTR       *lpArgs = NULL;
+    LPWSTR      *lpArgs = NULL;
     DWORD       nArgs;
     LPAPXJAVAVM lpJava;
     jclass      jClazz;
@@ -449,48 +594,46 @@ apxJavaLoadMainClass(APXHANDLE hJava, LPCSTR szClassName,
     lpJava = APXHANDLE_DATA(hJava);
     if (!__apxJvmAttach(lpJava))
         return FALSE;
-    
+
     /* Find the class */
     jClazz  = JNICALL_1(FindClass, szClassName);
     if (!jClazz) {
         JVM_EXCEPTION_CLEAR(lpJava);
         apxLogWrite(APXLOG_MARK_ERROR "FindClass %s failed", szClassName);
-        return FALSE; 
+        return FALSE;
     }
     /* Make the class global so that worker thread can attach */
     lpJava->clWorker.jClazz  = JNICALL_1(NewGlobalRef, jClazz);
     JNI_LOCAL_UNREF(jClazz);
 
-    if (szMethodName)
-        lpJava->clWorker.jMethod = JNICALL_3(GetStaticMethodID,
-                                             lpJava->clWorker.jClazz,
-                                             szMethodName, "([Ljava/lang/String;)V"); 
-    else
-        lpJava->clWorker.jMethod = JNICALL_3(GetStaticMethodID,
-                                             lpJava->clWorker.jClazz,
-                                             "main", "([Ljava/lang/String;)V"); 
+    if (!szMethodName)
+        szMethodName = "main";
+    lstrlcpyA(lpJava->clWorker.sClazz, 1024, szClassName);
+    lstrlcpyA(lpJava->clWorker.sMethod, 512, szMethodName);
+    lpJava->clWorker.jMethod = JNICALL_3(GetStaticMethodID,
+                                         lpJava->clWorker.jClazz,
+                                         szMethodName, "([Ljava/lang/String;)V");
     if (!lpJava->clWorker.jMethod) {
         JVM_EXCEPTION_CLEAR(lpJava);
         apxLogWrite(APXLOG_MARK_ERROR "Static method 'void main(String[])' in Class %s not found", szClassName);
         return FALSE;
     }
-    nArgs = apxMultiSzToArrayA(hJava->hPool, lpArguments, &lpArgs);
+    nArgs = apxMultiSzToArrayW(hJava->hPool, lpArguments, &lpArgs);
     if (nArgs) {
         DWORD i;
         lpJava->clWorker.jArgs = JNICALL_3(NewObjectArray, nArgs,
                                            lpJava->clString.jClazz, NULL);
         for (i = 0; i < nArgs; i++) {
-            jstring arg = JNICALL_1(NewStringUTF, lpArgs[i]);
+            jstring arg = JNICALL_2(NewString, lpArgs[i], lstrlenW(lpArgs[i]));
             JNICALL_3(SetObjectArrayElement, lpJava->clWorker.jArgs, i, arg);
-            apxLogWrite(APXLOG_MARK_DEBUG "argv[%d] = %s", i, lpArgs[i]);
+            apxLogWrite(APXLOG_MARK_DEBUG "argv[%d] = %S", i, lpArgs[i]);
         }
     }
     apxFree(lpArgs);
     return TRUE;
 }
 
-
-/* Main java application worker thread 
+/* Main java application worker thread
  * It will launch Java main and wait until
  * it finishes.
  */
@@ -509,6 +652,8 @@ static DWORD WINAPI __apxJavaWorkerThread(LPVOID lpParameter)
         WORKER_EXIT(2);
     if (!__apxJvmAttach(lpJava))
         WORKER_EXIT(3);
+    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread started %s:%s",
+                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod);
     lpJava->dwWorkerStatus = 1;
     JNICALL_3(CallStaticVoidMethod,
               lpJava->clWorker.jClazz,
@@ -517,9 +662,12 @@ static DWORD WINAPI __apxJavaWorkerThread(LPVOID lpParameter)
 
     JVM_EXCEPTION_CLEAR(lpJava);
     __apxJvmDetach(lpJava);
+    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread %s:%s finished",
+                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod);
 finished:
     lpJava->dwWorkerStatus = 0;
-    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished");
+    apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished %s:%s",
+                lpJava->clWorker.sClazz, lpJava->clWorker.sMethod);
     ExitThread(rv);
     /* never gets here but keep the compiler happy */
     return 0;
@@ -535,10 +683,10 @@ apxJavaStart(APXHANDLE hJava)
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return FALSE;
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     lpJava->hWorkerThread = CreateThread(NULL, 0, __apxJavaWorkerThread,
                                          hJava, CREATE_SUSPENDED,
-                                         &lpJava->iWorkerThread);     
+                                         &lpJava->iWorkerThread);
     if (IS_INVALID_HANDLE(lpJava->hWorkerThread)) {
         apxLogWrite(APXLOG_MARK_SYSERR);
         return FALSE;
@@ -550,6 +698,20 @@ apxJavaStart(APXHANDLE hJava)
 }
 
 DWORD
+apxJavaSetOptions(APXHANDLE hJava, DWORD dwOptions)
+{
+    DWORD dwOrgOptions;
+    LPAPXJAVAVM lpJava;
+
+    if (hJava->dwType != APXHANDLE_TYPE_JVM)
+        return 0;
+    lpJava = APXHANDLE_DATA(hJava);
+    dwOrgOptions = lpJava->dwOptions;
+    lpJava->dwOptions = dwOptions;
+    return dwOrgOptions;
+}
+
+DWORD
 apxJavaWait(APXHANDLE hJava, DWORD dwMilliseconds, BOOL bKill)
 {
     DWORD rv;
@@ -558,14 +720,14 @@ apxJavaWait(APXHANDLE hJava, DWORD dwMilliseconds, BOOL bKill)
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return FALSE;
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     if (!lpJava->dwWorkerStatus && lpJava->hWorkerThread)
         return WAIT_OBJECT_0;
     rv = WaitForSingleObject(lpJava->hWorkerThread, dwMilliseconds);
     if (rv == WAIT_TIMEOUT && bKill) {
         __apxJavaJniCallback(hJava, WM_CLOSE, 0, 0);
     }
-    
+
     return rv;
 }
 
@@ -583,14 +745,14 @@ apxJavaCreateClassV(APXHANDLE hJava, LPCSTR szClassName,
     lpJava = APXHANDLE_DATA(hJava);
     if (!__apxJvmAttach(lpJava))
         return NULL;
-    
+
     clazz = JNICALL_1(FindClass, szClassName);
     if (clazz == NULL || (JVM_EXCEPTION_CHECK(lpJava))) {
         JVM_EXCEPTION_CLEAR(lpJava);
         apxLogWrite(APXLOG_MARK_ERROR "Could not FindClass %s", szClassName);
         return NULL;
     }
-    
+
     ccont = JNICALL_3(GetMethodID, clazz, "<init>", szSignature);
     if (ccont == NULL || (JVM_EXCEPTION_CHECK(lpJava))) {
         JVM_EXCEPTION_CLEAR(lpJava);
@@ -616,7 +778,7 @@ apxJavaCreateClass(APXHANDLE hJava, LPCSTR szClassName,
 {
     LPVOID rv;
     va_list args;
-    
+
     va_start(args, szSignature);
     rv = apxJavaCreateClassV(hJava, szClassName, szSignature, args);
     va_end(args);
@@ -633,7 +795,7 @@ apxJavaCreateStringA(APXHANDLE hJava, LPCSTR szString)
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return NULL;
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     str = JNICALL_1(NewStringUTF, szString);
     if (str == NULL || (JVM_EXCEPTION_CHECK(lpJava))) {
         JVM_EXCEPTION_CLEAR(lpJava);
@@ -654,7 +816,7 @@ apxJavaCreateStringW(APXHANDLE hJava, LPCWSTR szString)
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return NULL;
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     str = JNICALL_2(NewString, szString, lstrlenW(szString));
     if (str == NULL || (JVM_EXCEPTION_CHECK(lpJava))) {
         JVM_EXCEPTION_CLEAR(lpJava);
@@ -678,7 +840,7 @@ apxJavaCallStaticMethodV(APXHANDLE hJava, jclass lpClass, LPCSTR szMethodName,
     if (hJava->dwType != APXHANDLE_TYPE_JVM)
         return rv;
     lpJava = APXHANDLE_DATA(hJava);
-    
+
     while (*s && *s != ')')
         ++s;
     if (*s != ')') {
@@ -724,7 +886,7 @@ apxJavaCallStaticMethodV(APXHANDLE hJava, jclass lpClass, LPCSTR szMethodName,
         break;
         case 'D':
             rv.d = JNICALL_3(CallStaticDoubleMethodV, lpClass, method, lpArgs);
-        break;        
+        break;
         default:
             apxLogWrite(APXLOG_MARK_ERROR "Invalid signature %s for method %s",
                         szSignature, szMethodName);
@@ -741,7 +903,7 @@ apxJavaCallStaticMethod(APXHANDLE hJava, jclass lpClass, LPCSTR szMethodName,
 {
     jvalue rv;
     va_list args;
-    
+
     va_start(args, szSignature);
     rv = apxJavaCallStaticMethodV(hJava, lpClass, szMethodName, szSignature, args);
     va_end(args);
@@ -750,7 +912,7 @@ apxJavaCallStaticMethod(APXHANDLE hJava, jclass lpClass, LPCSTR szMethodName,
 }
 
 /* Call the Java:
- * System.setOut(new PrintStream(new FileOutputStream(filename))); 
+ * System.setOut(new PrintStream(new FileOutputStream(filename)));
  */
 BOOL
 apxJavaSetOut(APXHANDLE hJava, BOOL setErrorOrOut, LPCWSTR szFilename)
@@ -796,3 +958,4 @@ apxJavaSetOut(APXHANDLE hJava, BOOL setErrorOrOut, LPCWSTR szFilename)
         return TRUE;
 
 }
+
diff --git a/src/native/nt/procrun/src/log.c b/src/native/nt/procrun/src/log.c
index 3b100c4..2070fc9 100644
--- a/src/native/nt/procrun/src/log.c
+++ b/src/native/nt/procrun/src/log.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -11,7 +12,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 
 #include "apxwin.h"
 #include "private.h"
@@ -56,39 +57,34 @@ LPWSTR apxLogFile(
     if (!szPath) {
         if (GetSystemDirectoryW(sPath, MAX_PATH) == 0)
             return INVALID_HANDLE_VALUE;
-        lstrcatW(sPath, L"\\LogFiles\\");
-        if (!szPrefix)
-            lstrcatW(sPath, L"Apache");
-        else
-            lstrcatW(sPath, szPrefix);
-        wsprintfW(sName, L"\\%s%04d%02d%02d.log",
-                  szName,
-                  sysTime.wYear,
-                  sysTime.wMonth,
-                  sysTime.wDay);
+        lstrlcatW(sPath, MAX_PATH, L"\\LogFiles\\Apache");
     }
     else {
-        lstrcpyW(sPath, szPath);
-        if (szPrefix)
-            wsprintfW(sName, L"\\%s", szPrefix);
-        else
-            wsprintfW(sName, L"\\%s%04d%02d%02d.log",
-                      szName,
-                      sysTime.wYear,
-                      sysTime.wMonth,
-                      sysTime.wDay);
+        lstrlcpyW(sPath, MAX_PATH, szPath);
     }
+    if (!szPrefix)
+        szPrefix = L"";
+    if (!szName)
+        szName   = L"";
+    wsprintfW(sName,
+              L"\\%s%s%04d%02d%02d.log",
+              szPrefix,
+              szName,
+              sysTime.wYear,
+              sysTime.wMonth,
+              sysTime.wDay);
+
     sRet = apxPoolAlloc(hPool, (MAX_PATH + 1) * sizeof(WCHAR));
     /* Set default level to info */
     CreateDirectoryW(sPath, NULL);
-    
-    lstrcpyW(sRet, sPath);
-    lstrcatW(sRet, sName);
+
+    lstrlcpyW(sRet, MAX_PATH, sPath);
+    lstrlcatW(sRet, MAX_PATH, sName);
 
     return sRet;
 }
 
-/* Open the log file 
+/* Open the log file
  * TODO: format like standard apache error.log
  * Add the EventLogger
  */
@@ -107,43 +103,34 @@ HANDLE apxLogOpen(
     if (!szPath) {
         if (GetSystemDirectoryW(sPath, MAX_PATH) == 0)
             return INVALID_HANDLE_VALUE;
-        lstrcatW(sPath, L"\\LogFiles\\");
-        if (!szPrefix)
-            lstrcatW(sPath, L"Apache");
-        else
-            lstrcatW(sPath, szPrefix);
-        wsprintfW(sName, L"\\%04d%02d%02d.log",
-                  sysTime.wYear,
-                  sysTime.wMonth,
-                  sysTime.wDay);
+        lstrlcatW(sPath, MAX_PATH, L"\\LogFiles\\Apache");
     }
     else {
-        lstrcpyW(sPath, szPath);
-        if (szPrefix)
-            wsprintfW(sName, L"\\%s", szPrefix);
-        else
-            wsprintfW(sName, L"\\jakarta_service_%04d%02d%02d.log",
-                      sysTime.wYear,
-                      sysTime.wMonth,
-                      sysTime.wDay);
+        lstrlcpyW(sPath, MAX_PATH, szPath);
     }
+    if (!szPrefix)
+        szPrefix = L"jakarta_service_";
+    wsprintfW(sName, L"\\%s%04d%02d%02d.log",
+              szPrefix,
+              sysTime.wYear,
+              sysTime.wMonth,
+              sysTime.wDay);
     if (!(h = (apx_logfile_st *)apxPoolCalloc(hPool, sizeof(apx_logfile_st))))
         return NULL;
     /* Set default level to info */
     h->dwLogLevel = APXLOG_LEVEL_INFO;
     CreateDirectoryW(sPath, NULL);
-    
+
     h->sysTime = sysTime;
-    lstrcpyW(h->szPath, sPath);
-    lstrcatW(sPath, sName);
-    if (szPrefix)
-        lstrcpyW(h->szPrefix, szPrefix);
+    lstrlcpyW(h->szPath, MAX_PATH, sPath);
+    lstrlcatW(sPath, MAX_PATH, sName);
+    lstrlcpyW(h->szPrefix, MAX_PATH, szPrefix);
 
     h->hFile =  CreateFileW(sPath,
                       GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                       NULL,
                       OPEN_ALWAYS,
-                      FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
+                      FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
                       NULL);
     /* Set this file as system log file */
     if (!_st_sys_loghandle)
@@ -198,12 +185,12 @@ static BOOL apx_log_rotate(apx_logfile_st *l,
                            LPSYSTEMTIME lpCtime)
 {
     WCHAR sPath[MAX_PATH+1];
-    
+
     /* rotate on daily basis */
     if (l->sysTime.wDay == lpCtime->wDay)
         return TRUE;
     FlushFileBuffers(l->hFile);
-    CloseHandle(l->hFile);    
+    CloseHandle(l->hFile);
     l->sysTime = *lpCtime;
 
     wsprintfW(sPath, L"%s\\%s%04d%02d%02d.log",
@@ -216,7 +203,7 @@ static BOOL apx_log_rotate(apx_logfile_st *l,
                       GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                       NULL,
                       OPEN_ALWAYS,
-                      FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
+                      FILE_FLAG_NO_BUFFERING | FILE_FLAG_SEQUENTIAL_SCAN,
                       NULL);
     if (IS_INVALID_HANDLE(l->hFile))
         return FALSE;
@@ -245,6 +232,7 @@ apxLogWrite(
     BOOL    dolock = TRUE;
     apx_logfile_st *lf = (apx_logfile_st *)hFile;
 
+    err = GetLastError(); /* save the last Error code */
     if (IS_INVALID_HANDLE(lf))
         lf = _st_sys_loghandle;
     if (IS_INVALID_HANDLE(lf)) {
@@ -254,20 +242,19 @@ apxLogWrite(
     }
     if (dwLevel < lf->dwLogLevel)
         return 0;
-    err = GetLastError(); /* save the last Error code */
     if (f) {
-        f = (szFile + lstrlenA(szFile) - 1);    
+        f = (szFile + lstrlenA(szFile) - 1);
         while(f != szFile && '\\' != *f && '/' != *f)
             f--;
         if(f != szFile)
             f++;
     }
-    lstrcpyA(buffer, _log_level[dwLevel]);
+    lstrlcpyA(buffer, 1056, _log_level[dwLevel]);
     if (!dolock)
-        lstrcatA(buffer, "\n");
+        lstrlcatA(buffer, 1056, "\n");
     szBp = &buffer[lstrlenA(buffer)];
     if (!szFormat) {
-        FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | 
+        FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
                        FORMAT_MESSAGE_IGNORE_INSERTS,
                        NULL,
                        err,
@@ -299,7 +286,7 @@ apxLogWrite(
                 APX_LOGLOCK(lf->hFile);
             }
             if (bTimeStamp) {
-                wsprintfA(sb, "[%d-%02d-%02d %02d:%02d:%02d] ", 
+                wsprintfA(sb, "[%d-%02d-%02d %02d:%02d:%02d] ",
                           t.wYear, t.wMonth, t.wDay,
                           t.wHour, t.wMinute, t.wSecond);
                 WriteFile(lf->hFile, sb, lstrlenA(sb), &wr, NULL);
@@ -310,7 +297,7 @@ apxLogWrite(
             }
 
             WriteFile(lf->hFile, buffer, len, &wr, NULL);
-            /* Terminate the line */            
+            /* Terminate the line */
             WriteFile(lf->hFile, LINE_SEP, sizeof(LINE_SEP) - 1, &wr, NULL);
 #ifdef _DEBUG_FULL
             FlushFileBuffers(lf->hFile);
@@ -322,7 +309,7 @@ apxLogWrite(
 #ifdef _DEBUG_FULL
         {
             char tid[1024 + 16];
-            wsprintfA(tid, "[%04X] %s", GetCurrentThreadId(), buffer);
+            wsprintfA(tid, "[%04d] %s", GetCurrentThreadId(), buffer);
             OutputDebugStringA(tid);
         }
 #endif
@@ -341,7 +328,7 @@ void apxLogClose(
         lf = _st_sys_loghandle;
     if (IS_INVALID_HANDLE(lf))
         return;
-    
+
     FlushFileBuffers(lf->hFile);
     CloseHandle(lf->hFile);
     if (lf == _st_sys_loghandle)
@@ -358,13 +345,13 @@ apxDisplayError(
     ...)
 {
     va_list args;
-    CHAR    buffer[1024+16];
+    CHAR    buffer[1024+32];
     CHAR    sysbuf[2048];
     int     len = 0, nRet;
     LPCSTR  f = szFile;
     DWORD   err = GetLastError(); /* save the last Error code */
     if (f) {
-        f = (szFile + lstrlenA(szFile) - 1);    
+        f = (szFile + lstrlenA(szFile) - 1);
         while(f != szFile && '\\' != *f && '/' != *f)
             f--;
         if(f != szFile)
@@ -372,7 +359,7 @@ apxDisplayError(
     }
     sysbuf[0] = '\0';
     if (err != ERROR_SUCCESS) {
-        len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | 
+        len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
                              FORMAT_MESSAGE_IGNORE_INSERTS,
                              NULL,
                              err,
@@ -391,15 +378,15 @@ apxDisplayError(
             wsprintfA(sb, "\n%s (%d)", f, dwLine);
             lstrcatA(sysbuf, sb);
         }
-        lstrcatA(sysbuf, "\n");
-        lstrcatA(sysbuf, buffer);
+        lstrlcatA(sysbuf, 2048, "\n");
+        lstrlcatA(sysbuf, 2048, buffer);
     }
     len = lstrlenA(sysbuf);
 #ifdef _DEBUG_FULL
     OutputDebugStringA(sysbuf);
 #endif
     if (len > 0 && bDisplay) {
-        nRet = MessageBoxA(NULL, sysbuf, 
+        nRet = MessageBoxA(NULL, sysbuf,
                            "Application System Error",
                            MB_ICONERROR | MB_OK | MB_SYSTEMMODAL);
     }
diff --git a/src/native/nt/procrun/src/mclib.c b/src/native/nt/procrun/src/mclib.c
index 881d8fc..dee50f9 100644
--- a/src/native/nt/procrun/src/mclib.c
+++ b/src/native/nt/procrun/src/mclib.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 /*
  * Copyright (c) 1994
  *  The Regents of the University of California.  All rights reserved.
@@ -53,7 +54,7 @@ typedef UINT    word;       /* "word" used for optimal copy speed */
 #define wmask   (wsize - 1)
 
 LPVOID AplFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill)
-{ 
+{
 
     SIZE_T t;
 #ifdef WIN64
@@ -118,11 +119,11 @@ LPVOID AplFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill)
         do {
             *dst++ = Fill;
         } while (--t != 0);
-    return (Destination); 
+    return (Destination);
 }
 
 void AplZeroMemory(PVOID Destination, SIZE_T Length)
-{ 
+{
 
     SIZE_T t;
     LPBYTE dst;
@@ -236,7 +237,7 @@ LPVOID AplCopyMemory(PVOID Destination, const VOID* Source, SIZE_T Length)
     }
 done:
     return (Destination);
-} 
+}
 
 
 INT
@@ -251,7 +252,7 @@ AplMemCmp(LPCVOID lpA, LPCVOID lpB, SIZE_T nBytes)
         } while (--nBytes != 0);
     }
     return 0;
-} 
+}
 
 /*
  * Find the first occurrence of lpFind in lpMem.
@@ -276,7 +277,7 @@ ApcMemSearch(LPCVOID lpMem, LPCVOID lpFind, SIZE_T dwLen, SIZE_T dwSize)
         s--;
     }
     return (LPBYTE)s;
-} 
+}
 
 LPSTR
 AplRindexA(LPCSTR lpStr, int ch)
@@ -288,6 +289,121 @@ AplRindexA(LPCSTR lpStr, int ch)
             save = (LPSTR)lpStr;
         if (!*lpStr)
             return save;
-    } 
+    }
     /* NOTREACHED */
-} 
+}
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left).  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+LPSTR
+lstrlcatA(LPSTR dst, int siz, LPCSTR src)
+{
+    LPSTR  d = dst;
+    LPCSTR s = src;
+    int n = siz;
+    int dlen;
+
+    /* Find the end of dst and adjust bytes left but don't go past end */
+    while (n-- != 0 && *d != '\0')
+        d++;
+    dlen = d - dst;
+    n = siz - dlen;
+
+    if (n == 0)
+        return NULL;
+    while (*s != '\0') {
+        if (n != 1) {
+            *d++ = *s;
+            n--;
+        }
+        s++;
+    }
+    *d = '\0';
+
+    return dst;
+}
+
+LPWSTR
+lstrlcatW(LPWSTR dst, int siz, LPCWSTR src)
+{
+    LPWSTR  d = dst;
+    LPCWSTR s = src;
+    int n = siz;
+    int dlen;
+
+    /* Find the end of dst and adjust bytes left but don't go past end */
+    while (n-- != 0 && *d != '\0')
+        d++;
+    dlen = d - dst;
+    n = siz - dlen;
+
+    if (n == 0)
+        return NULL;
+    while (*s != L'\0') {
+        if (n != 1) {
+            *d++ = *s;
+            n--;
+        }
+        s++;
+    }
+    *d = L'\0';
+
+    return dst;
+}
+
+LPSTR
+lstrlcpyA(LPSTR dst, int siz, LPCSTR src)
+{
+    LPSTR  d = dst;
+    LPCSTR s = src;
+    int    n = siz;
+
+    /* Copy as many bytes as will fit */
+    if (n != 0) {
+        while (--n != 0) {
+            if ((*d++ = *s++) == '\0')
+                break;
+        }
+    }
+
+    /* Not enough room in dst, add NUL and traverse rest of src */
+    if (n == 0) {
+        if (siz != 0)
+            *d = '\0';      /* NUL-terminate dst */
+        while (*s++)
+            ;
+    }
+
+    return d;
+}
+
+LPWSTR
+lstrlcpyW(LPWSTR dst, int siz, LPCWSTR src)
+{
+    LPWSTR  d = dst;
+    LPCWSTR s = src;
+    int    n = siz;
+
+    /* Copy as many bytes as will fit */
+    if (n != 0) {
+        while (--n != 0) {
+            if ((*d++ = *s++) == L'\0')
+                break;
+        }
+    }
+
+    /* Not enough room in dst, add NUL and traverse rest of src */
+    if (n == 0) {
+        if (siz != 0)
+            *d = L'\0';      /* NUL-terminate dst */
+        while (*s++)
+            ;
+    }
+
+    return d;
+}
diff --git a/src/native/nt/procrun/src/mclib.h b/src/native/nt/procrun/src/mclib.h
index 33fd310..848a58b 100644
--- a/src/native/nt/procrun/src/mclib.h
+++ b/src/native/nt/procrun/src/mclib.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/src/private.h b/src/native/nt/procrun/src/private.h
index 9a9a016..d95c752 100644
--- a/src/native/nt/procrun/src/private.h
+++ b/src/native/nt/procrun/src/private.h
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
diff --git a/src/native/nt/procrun/src/registry.c b/src/native/nt/procrun/src/registry.c
index bd07ffd..ab144b6 100644
--- a/src/native/nt/procrun/src/registry.c
+++ b/src/native/nt/procrun/src/registry.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include "apxwin.h"
 #include "private.h"
 
@@ -31,12 +32,14 @@ static LPCWSTR JAVA_CURRENT     = L"CurrentVersion";
 static LPCWSTR JAVA_RUNTIME     = L"RuntimeLib";
 static LPCWSTR JAVA_HOME        = L"JAVA_HOME";
 static LPCWSTR JAVAHOME         = L"JavaHome";
+static LPCWSTR CONTROL_REGKEY   = L"SYSTEM\\CurrentControlSet\\Control";
+static LPCWSTR REGTIMEOUT       = L"WaitToKillServiceTimeout";
 
 #define REG_CAN_CREATE(r)   \
-    ((r)->samOptions & KEY_CREATE_SUB_KEY)  
+    ((r)->samOptions & KEY_CREATE_SUB_KEY)
 
 #define REG_CAN_WRITE(r)   \
-    ((r)->samOptions & KEY_SET_VALUE)  
+    ((r)->samOptions & KEY_SET_VALUE)
 
 
 #define REG_GET_KEY(r, w, k)    \
@@ -57,7 +60,7 @@ typedef APXREGISTRY*        LPAPXREGISTRY;
 typedef struct APXREGSUBKEY APXREGSUBKEY;
 
 struct APXREGSUBKEY {
-    APXHANDLE   hRegistry;    
+    APXHANDLE   hRegistry;
     HKEY        hKey;
     LPCTSTR     syKeyName;
     TAILQ_ENTRY(APXREGSUBKEY);
@@ -73,7 +76,7 @@ struct APXREGISTRY {
     HKEY    hSparamKey; /* service\\Parameters */
     HKEY    hUparamKey; /* service\\Parameters */
     REGSAM  samOptions;
-    /** list enty for opened subkeys  */ 
+    /** list enty for opened subkeys  */
     TAILQ_HEAD(_lSubkeys, APXREGSUBKEY) lSubkeys;
 
 };
@@ -92,11 +95,11 @@ static BOOL __apxRegistryCallback(APXHANDLE hObject, UINT uMsg,
     lpReg = APXHANDLE_DATA(hObject);
     switch (uMsg) {
         case WM_CLOSE:
-        SAFE_CLOSE_KEY(lpReg->hCurrKey);    
+        SAFE_CLOSE_KEY(lpReg->hCurrKey);
         SAFE_CLOSE_KEY(lpReg->hRparamKey);
         SAFE_CLOSE_KEY(lpReg->hSparamKey);
         SAFE_CLOSE_KEY(lpReg->hUparamKey);
-        SAFE_CLOSE_KEY(lpReg->hRootKey);    
+        SAFE_CLOSE_KEY(lpReg->hRootKey);
         SAFE_CLOSE_KEY(lpReg->hServKey);
         SAFE_CLOSE_KEY(lpReg->hUserKey);
         break;
@@ -239,17 +242,17 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
         return NULL;
 
     /* make the HKLM\\SOFTWARE key */
-    lstrcpyW(buff, REGSOFTWARE_ROOT); 
+    lstrcpyW(buff, REGSOFTWARE_ROOT);
     if (szRoot)
         lstrcatW(buff, szRoot);
     else
-        lstrcatW(buff, REGAPACHE_ROOT);       
+        lstrcatW(buff, REGAPACHE_ROOT);
     lstrcatW(buff, REGSEPARATOR);
     lstrcatW(buff, szKeyName);
     /* Open or create the root key */
     if (dwOptions & APXREG_SOFTWARE) {
         if (samDesired & KEY_CREATE_SUB_KEY)
-            rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, buff, 0, NULL, 0, 
+            rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, buff, 0, NULL, 0,
                                  samDesired, NULL,
                                  &hRootKey, NULL);
         else
@@ -261,7 +264,7 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
         }
         /* Open or create the root parameters key */
         if (samDesired & KEY_CREATE_SUB_KEY)
-            rc = RegCreateKeyExW(hRootKey, REGPARAMS, 0, NULL, 0, 
+            rc = RegCreateKeyExW(hRootKey, REGPARAMS, 0, NULL, 0,
                                  samDesired, NULL,
                                  &hRparamKey, NULL);
         else
@@ -276,7 +279,7 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
     if (dwOptions & APXREG_USER) {
         /* Open or create the users root key */
         if (samDesired & KEY_CREATE_SUB_KEY)
-            rc = RegCreateKeyExW(HKEY_CURRENT_USER, buff, 0, NULL, 0, 
+            rc = RegCreateKeyExW(HKEY_CURRENT_USER, buff, 0, NULL, 0,
                                  samDesired, NULL,
                                  &hUserKey, NULL);
         else
@@ -288,7 +291,7 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
         }
         /* Open or create the users parameters key */
         if (samDesired & KEY_CREATE_SUB_KEY)
-            rc = RegCreateKeyExW(hUserKey, REGPARAMS, 0, NULL, 0, 
+            rc = RegCreateKeyExW(hUserKey, REGPARAMS, 0, NULL, 0,
                                  samDesired, NULL,
                              &hUparamKey, NULL);
         else
@@ -301,7 +304,7 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
     }
     /* Check if we need a service key */
     if (dwOptions & APXREG_SERVICE) {
-        lstrcpyW(buff, REGSERVICE_ROOT); 
+        lstrcpyW(buff, REGSERVICE_ROOT);
         lstrcatW(buff, szKeyName);
         /* Service has to be created allready */
         rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buff, 0,
@@ -312,7 +315,7 @@ apxCreateRegistryW(APXHANDLE hPool, REGSAM samDesired,
         }
         /* Open or create the root parameters key */
         if (samDesired & KEY_CREATE_SUB_KEY)
-            rc = RegCreateKeyExW(hServKey, REGPARAMS, 0, NULL, 0, 
+            rc = RegCreateKeyExW(hServKey, REGPARAMS, 0, NULL, 0,
                                  samDesired, NULL,
                                  &hSparamKey, NULL);
         else
@@ -349,7 +352,7 @@ cleanup:
     SAFE_CLOSE_KEY(hRootKey);
     SAFE_CLOSE_KEY(hServKey);
     SAFE_CLOSE_KEY(hUserKey);
-    
+
     SetLastError(rc);
     return NULL;
 }
@@ -377,7 +380,7 @@ apxRegistryGetStringA(APXHANDLE hRegistry, DWORD dwFrom,
 {
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return NULL;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -404,7 +407,7 @@ apxRegistryGetStringW(APXHANDLE hRegistry, DWORD dwFrom,
 {
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return NULL;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -432,7 +435,7 @@ apxRegistryGetBinaryA(APXHANDLE hRegistry, DWORD dwFrom,
 {
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return NULL;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -470,7 +473,7 @@ apxRegistryGetBinaryW(APXHANDLE hRegistry, DWORD dwFrom,
 {
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return NULL;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -509,7 +512,7 @@ apxRegistryGetNumberW(APXHANDLE hRegistry, DWORD dwFrom,
     DWORD         dwRval, rl;
     DWORD rc, dwType = REG_DWORD;
 
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return 0;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -540,7 +543,7 @@ apxRegistryGetMzStrW(APXHANDLE hRegistry, DWORD dwFrom,
 {
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return NULL;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -580,7 +583,7 @@ apxRegistrySetBinaryA(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_BINARY;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -613,7 +616,7 @@ apxRegistrySetBinaryW(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_BINARY;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -646,7 +649,7 @@ apxRegistrySetMzStrW(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_MULTI_SZ;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -679,7 +682,7 @@ apxRegistrySetStrA(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_SZ;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -699,7 +702,7 @@ apxRegistrySetStrA(APXHANDLE hRegistry, DWORD dwFrom,
     }
     if (!szValue || !lstrlenA(szValue)) {
         if (RegDeleteValueA(hKey, szValueName) != ERROR_SUCCESS)
-            return FALSE;        
+            return FALSE;
     }
     else if (RegSetValueExA(hKey, szValueName, 0, dwType,
                        (LPBYTE)szValue, lstrlenA(szValue)) != ERROR_SUCCESS)
@@ -716,7 +719,7 @@ apxRegistrySetStrW(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_SZ;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -736,7 +739,7 @@ apxRegistrySetStrW(APXHANDLE hRegistry, DWORD dwFrom,
     }
     if (!szValue || !lstrlenW(szValue)) {
         if (RegDeleteValueW(hKey, szValueName) != ERROR_SUCCESS)
-            return FALSE;        
+            return FALSE;
     }
     else if (RegSetValueExW(hKey, szValueName, 0, dwType,
                        (LPBYTE)szValue,
@@ -754,7 +757,7 @@ apxRegistrySetNumW(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_DWORD;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -788,7 +791,7 @@ apxRegistryDeleteW(APXHANDLE hRegistry, DWORD dwFrom,
     LPAPXREGISTRY lpReg;
     HKEY          hKey, hSub = NULL;
     DWORD         dwType = REG_SZ;
-    if (IS_INVALID_HANDLE(hRegistry) || 
+    if (IS_INVALID_HANDLE(hRegistry) ||
         hRegistry->dwType != APXHANDLE_TYPE_REGISTRY)
         return FALSE;
     lpReg = APXHANDLE_DATA(hRegistry);
@@ -812,39 +815,86 @@ apxRegistryDeleteW(APXHANDLE hRegistry, DWORD dwFrom,
 }
 
 
+LONG apxDeleteRegistryRecursive(HKEY hKeyRoot, LPCWSTR szSubKey) {
+    LONG rc = ERROR_SUCCESS;
+    DWORD dwSize = 0;
+    WCHAR szName[SIZ_BUFLEN];
+    HKEY hKey = NULL;
+
+    if (ERROR_SUCCESS == RegDeleteKey(hKeyRoot, szSubKey)) {
+        return ERROR_SUCCESS;
+    }
+
+    rc = RegOpenKeyExW(hKeyRoot, szSubKey, 0, KEY_ENUMERATE_SUB_KEYS | DELETE, &hKey);
+    if (rc != ERROR_SUCCESS) {
+        if (rc == ERROR_FILE_NOT_FOUND) {
+            return ERROR_SUCCESS;
+        } else {
+            return rc;
+        }
+    }
+    while (rc == ERROR_SUCCESS) {
+        dwSize = SIZ_BUFLEN;
+        rc = RegEnumKeyExW(hKey, 0, szName, &dwSize, NULL, NULL, NULL, NULL );
+       
+        if (rc == ERROR_NO_MORE_ITEMS) {           
+            rc = RegDeleteKeyW(hKeyRoot, szSubKey);
+            break;
+        } else {
+            rc = apxDeleteRegistryRecursive(hKey, szName);
+            if (rc != ERROR_SUCCESS) {
+                break;   // abort when we start failing
+            }
+        }
+    }    
+    RegCloseKey(hKey);
+    return rc;
+}
+
+
 BOOL
 apxDeleteRegistryW(LPCWSTR szRoot,
                    LPCWSTR szKeyName,
-                   BOOL bDeleteEmpty)
+                   REGSAM samDesired,
+                   BOOL bDeleteEmptyRoot)
 {
     WCHAR     buff[SIZ_BUFLEN];
-    BOOL      rv;
+    LONG      rc = ERROR_SUCCESS;
+    HKEY      hKey = NULL;
+    BOOL      rv = TRUE;
+    HKEY      hives[] = {HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, NULL}, *hive = NULL;
 
     if (!szKeyName || lstrlenW(szKeyName) > SIZ_RESMAX)
         return FALSE;
     if (szRoot && lstrlenW(szRoot) > SIZ_RESMAX)
         return FALSE;
 
-    lstrcpyW(buff, REGSOFTWARE_ROOT); 
     if (szRoot)
-        lstrcatW(buff, szRoot);
+        lstrcpyW(buff, szRoot);
     else
-        lstrcatW(buff, REGAPACHE_ROOT);       
+        lstrcpyW(buff, REGAPACHE_ROOT);
     lstrcatW(buff, REGSEPARATOR);
-    lstrcatW(buff, szKeyName);
-    
-    rv = SHDeleteKeyW(HKEY_LOCAL_MACHINE, buff);
-    rv += SHDeleteKeyW(HKEY_CURRENT_USER, buff);
-
-    if (bDeleteEmpty) {
-        lstrcpyW(buff, REGSOFTWARE_ROOT); 
-        if (szRoot)
-            lstrcatW(buff, szRoot);
-        else
-            lstrcatW(buff, REGAPACHE_ROOT); 
 
-        SHDeleteEmptyKeyW(HKEY_LOCAL_MACHINE, buff);
-        SHDeleteEmptyKeyW(HKEY_CURRENT_USER, buff);
+    for (hive = &hives[0]; *hive; hive++) {
+        HKEY hkeySoftware = NULL;
+
+        rc = RegOpenKeyExW(*hive, REGSOFTWARE_ROOT, 0, KEY_READ | samDesired, &hkeySoftware);
+        if (rc != ERROR_SUCCESS) {
+            rv = FALSE;
+        } else {
+            rc = RegOpenKeyExW(hkeySoftware, buff, 0, samDesired | KEY_ENUMERATE_SUB_KEYS | DELETE, &hKey);
+            if (rc == ERROR_SUCCESS) {
+                rc = apxDeleteRegistryRecursive(hKey, szKeyName);
+                RegCloseKey(hKey);
+                hKey = NULL;
+                rv |= (rc == ERROR_SUCCESS);
+            }
+            if (bDeleteEmptyRoot) {  
+                // will fail if there are subkeys, just like we want
+                RegDeleteKeyW(hkeySoftware, buff);
+            }
+            RegCloseKey(hkeySoftware);
+        } 
     }
     return rv;
 }
@@ -852,7 +902,8 @@ apxDeleteRegistryW(LPCWSTR szRoot,
 BOOL
 apxDeleteRegistryA(LPCSTR szRoot,
                    LPCSTR szKeyName,
-                   BOOL bDeleteEmpty)
+                   REGSAM samDesired,
+                   BOOL bDeleteEmptyRoot)
 {
     WCHAR    wcRoot[SIZ_RESLEN];
     WCHAR    wcKey[SIZ_RESLEN];
@@ -863,7 +914,7 @@ apxDeleteRegistryA(LPCSTR szRoot,
     }
     AsciiToWide(szKeyName, wcKey);
 
-    return apxDeleteRegistryW(wsRoot, wcKey, bDeleteEmpty);
+    return apxDeleteRegistryW(wsRoot, wcKey, samDesired, bDeleteEmptyRoot);
 }
 
 
@@ -890,12 +941,12 @@ LPWSTR apxGetJavaSoftHome(APXHANDLE hPool, BOOL bPreferJre)
                              0, KEY_READ, &hKey)) != ERROR_SUCCESS) {
         return NULL;
     }
-    if ((err = RegQueryValueExW(hKey, JAVA_CURRENT, NULL, NULL, 
+    if ((err = RegQueryValueExW(hKey, JAVA_CURRENT, NULL, NULL,
                                 (LPBYTE)off,
                                 &dwLen)) != ERROR_SUCCESS) {
         RegCloseKey(hKey);
         return NULL;
-    } 
+    }
     RegCloseKey(hKey);
     if ((err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wsBuf,
                              0, KEY_READ, &hKey)) != ERROR_SUCCESS) {
@@ -925,12 +976,12 @@ LPWSTR apxGetJavaSoftRuntimeLib(APXHANDLE hPool)
                              0, KEY_READ, &hKey)) != ERROR_SUCCESS) {
         return NULL;
     }
-    if ((err = RegQueryValueExW(hKey, JAVA_CURRENT, NULL, NULL, 
+    if ((err = RegQueryValueExW(hKey, JAVA_CURRENT, NULL, NULL,
                                 (LPBYTE)off,
                                 &dwLen)) != ERROR_SUCCESS) {
         RegCloseKey(hKey);
         return NULL;
-    } 
+    }
     RegCloseKey(hKey);
     if ((err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wsBuf,
                              0, KEY_READ, &hKey)) != ERROR_SUCCESS) {
@@ -947,8 +998,8 @@ LPWSTR apxGetJavaSoftRuntimeLib(APXHANDLE hPool)
 BOOL apxRegistryEnumServices(LPAPXREGENUM lpEnum, LPAPXSERVENTRY lpEntry)
 {
     DWORD rc, dwLength = SIZ_RESLEN;
-        
-    if (IS_INVALID_HANDLE(lpEnum->hServicesKey)) {    
+
+    if (IS_INVALID_HANDLE(lpEnum->hServicesKey)) {
         rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, REGSERVICE_ROOT, 0,
                        KEY_READ, &(lpEnum->hServicesKey));
         if (rc != ERROR_SUCCESS) {
@@ -1007,7 +1058,7 @@ BOOL apxRegistryEnumServices(LPAPXREGENUM lpEnum, LPAPXSERVENTRY lpEntry)
     return TRUE;
 }
 
-/* We could use the ChangeServiceConfig2 on WIN2K+ 
+/* We could use the ChangeServiceConfig2 on WIN2K+
  * For now use the registry.
  */
 BOOL apxSetServiceDescriptionW(LPCWSTR szServiceName, LPCWSTR szDescription)
@@ -1020,17 +1071,17 @@ BOOL apxSetServiceDescriptionW(LPCWSTR szServiceName, LPCWSTR szDescription)
         return FALSE;
     lstrcpyW(wcName, REGSERVICE_ROOT);
     lstrcatW(wcName, szServiceName);
- 
+
     rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wcName, 0, KEY_WRITE, &hKey);
     if (rc != ERROR_SUCCESS) {
         return FALSE;
     }
-    
+
     rc = RegSetValueExW(hKey, REGDESCRIPTION, 0, REG_SZ, (CONST BYTE *)szDescription,
                         lstrlenW(szDescription) * sizeof(WCHAR));
     SAFE_CLOSE_KEY(hKey);
 
-    return rc = ERROR_SUCCESS;
+    return rc == ERROR_SUCCESS;
 }
 
 BOOL apxGetServiceDescriptionW(LPCWSTR szServiceName, LPWSTR szDescription,
@@ -1044,7 +1095,7 @@ BOOL apxGetServiceDescriptionW(LPCWSTR szServiceName, LPWSTR szDescription,
         return FALSE;
     lstrcpyW(wcName, REGSERVICE_ROOT);
     lstrcatW(wcName, szServiceName);
- 
+
     rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wcName, 0, KEY_READ, &hKey);
     if (rc != ERROR_SUCCESS) {
         return FALSE;
@@ -1069,7 +1120,7 @@ BOOL apxGetServiceUserW(LPCWSTR szServiceName, LPWSTR szUser,
         return FALSE;
     lstrcpyW(wcName, REGSERVICE_ROOT);
     lstrcatW(wcName, szServiceName);
- 
+
     rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wcName, 0, KEY_READ, &hKey);
     if (rc != ERROR_SUCCESS) {
         return FALSE;
@@ -1082,3 +1133,28 @@ BOOL apxGetServiceUserW(LPCWSTR szServiceName, LPWSTR szUser,
     else
         return FALSE;
 }
+
+DWORD apxGetMaxServiceTimeout(APXHANDLE hPool)
+{
+    DWORD   maxTimeout  = 20000;
+    LPWSTR  wsMaxTimeout;
+    DWORD   err;
+    HKEY    hKey;
+    WCHAR   wsBuf[SIZ_BUFLEN];
+
+    lstrcpyW(wsBuf, CONTROL_REGKEY);
+
+    if ((err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wsBuf,
+                             0, KEY_READ, &hKey)) != ERROR_SUCCESS) {
+        return maxTimeout;
+    }
+    wsMaxTimeout = __apxGetRegistrySzW(hPool, hKey, REGTIMEOUT);
+    RegCloseKey(hKey);
+
+    if (wsMaxTimeout[0]) {
+        maxTimeout = (DWORD)apxAtoulW(wsMaxTimeout);
+    }
+    apxFree(wsMaxTimeout);
+
+    return maxTimeout;
+}
diff --git a/src/native/nt/procrun/src/rprocess.c b/src/native/nt/procrun/src/rprocess.c
index 2955aba..ed9cfa3 100644
--- a/src/native/nt/procrun/src/rprocess.c
+++ b/src/native/nt/procrun/src/rprocess.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -877,25 +878,23 @@ apxProcessRunning(APXHANDLE hProcess)
 static LPWSTR __apxStrQuote(LPWSTR lpDest, LPCWSTR szSrc)
 {
     LPWSTR p;
-    BOOL   q = FALSE;
+    BOOL   space = FALSE, quote = FALSE;
 
-    /* Find if string has embeded spaces 
+    /* Find if string has embeded spaces, add quotes only if no quotes found 
      */
     for (p = (LPWSTR)szSrc; *p; p++) {
-        if (*p == L' ' || *p == '\t' ||
-            *p == '"' || *p == '\\') {
-            q = TRUE;
-            break;
+        if (*p == L' ' || *p == '\t') {
+            space = TRUE;
+        } else if (*p == L'"') {
+            quote = TRUE;
         }
     }
     p = lpDest;
-    if (q) *p++ = L'"';
+    if (space && !quote) *p++ = L'"';
     while (*szSrc) {
-        if (*szSrc == '"' || *szSrc == '\\')
-            *p++ = L'\\';
         *p++ = *szSrc++;
     }
-    if (q) *p++ = L'"';
+    if (space && !quote) *p++ = L'"';
     return p;
 }
 
@@ -913,17 +912,9 @@ apxProcessSetCommandArgsW(APXHANDLE hProcess, LPCWSTR szTitle,
     apxFree(lpProc->szCommandLine);
     
     l = lstrlenW(szTitle) + 3;
-    for (i = 0; i < (DWORD)lstrlenW(szTitle); i++) {
-        if (szTitle[i] == L'"')
-            ++l;
-    }
     for (i = 0; i < dwArgc; i++) {
         int x, q = 0;
         l += (lstrlenW(lpArgs[i]) + 3);
-        for (x = 0; x < lstrlenW(lpArgs[i]); x++) {
-            if (lpArgs[i][x] == L'"')
-                ++q;
-        }
         l += q;
     }
     p = lpProc->szCommandLine = apxPoolAlloc(hProcess->hPool, l * sizeof(WCHAR));
@@ -936,3 +927,4 @@ apxProcessSetCommandArgsW(APXHANDLE hProcess, LPCWSTR szTitle,
     OutputDebugStringW(lpProc->szCommandLine);
     return lpProc->szCommandLine != NULL;
 }
+
diff --git a/src/native/nt/procrun/src/service.c b/src/native/nt/procrun/src/service.c
index 3c4b3ab..86bb665 100644
--- a/src/native/nt/procrun/src/service.c
+++ b/src/native/nt/procrun/src/service.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -12,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include "apxwin.h"
 #include "private.h"
 
@@ -33,7 +34,7 @@ typedef struct APXSERVICE {
     /* Handle to the current service */
     SC_HANDLE       hService;
     /* Handle of the Service manager */
-    SC_HANDLE       hManager;     
+    SC_HANDLE       hManager;
     APXSERVENTRY    stServiceEntry;
 
 } APXSERVICE, *LPAPXSERVICE;
@@ -73,7 +74,7 @@ apxCreateService(APXHANDLE hPool, DWORD dwOptions, BOOL bManagerMode)
 {
     APXHANDLE    hService;
     LPAPXSERVICE lpService;
-    SC_HANDLE    hManager; 
+    SC_HANDLE    hManager;
 
     if (!(hManager = OpenSCManager(NULL, NULL, dwOptions))) {
         apxLogWrite(APXLOG_MARK_SYSERR);
@@ -125,7 +126,7 @@ apxServiceOpen(APXHANDLE hService, LPCWSTR szServiceName, DWORD dwOptions)
         apxLogWrite(APXLOG_MARK_SYSERR);
         return FALSE;
     }
-    lstrcpyW(lpService->stServiceEntry.szServiceName, szServiceName);
+    lstrlcpyW(lpService->stServiceEntry.szServiceName, SIZ_RESLEN, szServiceName);
     if (!apxGetServiceDescriptionW(szServiceName,
                                    lpService->stServiceEntry.szServiceDescription,
                                    SIZ_DESLEN)) {
@@ -172,7 +173,7 @@ apxServiceEntry(APXHANDLE hService, BOOL bRequeryStatus)
     return &lpService->stServiceEntry;
 }
 
-/* Set the service names etc... 
+/* Set the service names etc...
  * If the ImagePath contains a space, it must be quoted
  */
 BOOL
@@ -195,12 +196,14 @@ apxServiceSetNames(APXHANDLE hService,
     /* Check if the ServiceOpen has been called */
     if (IS_INVALID_HANDLE(lpService->hService))
         return FALSE;
-    if (szDisplayName &&!CHANGE_SERVICE(lpService->hService,
+    if (!CHANGE_SERVICE(lpService->hService,
                                         szImagePath,
                                         szUsername,
                                         szPassword,
-                                        szDisplayName))
+                                        szDisplayName)) {
+        apxLogWrite(APXLOG_MARK_SYSERR);
         return FALSE;
+    }
     if (szDescription) {
         return apxSetServiceDescriptionW(lpService->stServiceEntry.szServiceName,
                                          szDescription);
@@ -295,7 +298,7 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
                 break;
             default:
                 break;
-        }     
+        }
     }
     if (!dwPending && !dwState)
         return FALSE;
@@ -307,7 +310,7 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
     /* signal that we are about to control the service */
     if (fnControlCallback)
         (*fnControlCallback)(lpCbData, uMsg, (WPARAM)1, (LPARAM)dwState);
-    if (dwControl == SERVICE_CONTROL_CONTINUE && 
+    if (dwControl == SERVICE_CONTROL_CONTINUE &&
         stStatus.dwCurrentState != SERVICE_PAUSED)
         bStatus = StartService(lpService->hService, 0, NULL);
     else
@@ -318,9 +321,9 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
         Sleep(100); /* Initial Sleep period */
         while (QueryServiceStatus(lpService->hService, &stStatus)) {
             if (stStatus.dwCurrentState == dwPending) {
-                /* Do not wait longer than the wait hint. A good interval is 
-                 * one tenth the wait hint, but no less than 1 second and no 
-                 * more than 10 seconds. 
+                /* Do not wait longer than the wait hint. A good interval is
+                 * one tenth the wait hint, but no less than 1 second and no
+                 * more than 10 seconds.
                  */
                 dwWait = stStatus.dwWaitHint / 10;
 
@@ -351,7 +354,7 @@ apxServiceControl(APXHANDLE hService, DWORD dwControl, UINT uMsg,
             }
             else
                 break;
-        }         
+        }
     }
     /* signal that we are done with controling the service */
     if (fnControlCallback)
@@ -420,7 +423,8 @@ apxServiceInstall(APXHANDLE hService, LPCWSTR szServiceName,
         return FALSE;
     }
     else {
-        lstrcpyW(lpService->stServiceEntry.szServiceName, szServiceName);
+        lstrlcpyW(lpService->stServiceEntry.szServiceName,
+                  SIZ_RESLEN, szServiceName);
         lpService->stServiceEntry.dwStart = dwStartType;
         return TRUE;
     }
@@ -448,7 +452,7 @@ apxServiceDelete(APXHANDLE hService)
         rv = DeleteService(lpService->hService);
         SAFE_CLOSE_SCH(lpService->hService);
         SAFE_CLOSE_SCH(lpService->hManager);
-     
+
         return rv;
     }
     return FALSE;
@@ -456,7 +460,7 @@ apxServiceDelete(APXHANDLE hService)
 
 /* Browse the services */
 DWORD
-apxServiceBrowse(APXHANDLE hService, 
+apxServiceBrowse(APXHANDLE hService,
                  LPCWSTR szIncludeNamePattern,
                  LPCWSTR szIncludeImagePattern,
                  LPCWSTR szExcludeNamePattern,
@@ -536,7 +540,7 @@ apxServiceBrowse(APXHANDLE hService,
                         if (_st_apx_oslevel >= 4) {
                             DWORD dwNeed;
                             QueryServiceStatusEx(hSrv, SC_STATUS_PROCESS_INFO,
-                                                 (LPBYTE)(&(stEntry.stStatusProcess)), 
+                                                 (LPBYTE)(&(stEntry.stStatusProcess)),
                                                  sizeof(SERVICE_STATUS_PROCESS),
                                                  &dwNeed);
                         }
diff --git a/src/native/nt/procrun/src/utils.c b/src/native/nt/procrun/src/utils.c
index bc46aca..5a64474 100644
--- a/src/native/nt/procrun/src/utils.c
+++ b/src/native/nt/procrun/src/utils.c
@@ -1,8 +1,9 @@
-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -76,7 +77,7 @@ LPWSTR __apxGetEnvironmentVariableW(APXHANDLE hPool, LPCWSTR wsName)
     rc = GetEnvironmentVariableW(wsName, NULL, 0);
     if (rc == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
         return NULL;
-    
+
     if (!(wsRet = apxPoolAlloc(hPool, (rc + 1) * sizeof(WCHAR))))
         return NULL;
     if (!GetEnvironmentVariableW(wsName, wsRet, rc)) {
@@ -95,7 +96,7 @@ LPSTR __apxGetEnvironmentVariableA(APXHANDLE hPool, LPCSTR szName)
     rc = GetEnvironmentVariableA(szName, NULL, 0);
     if (rc == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
         return NULL;
-    
+
     if (!(szRet = apxPoolAlloc(hPool, rc + 1)))
         return NULL;
     if (!GetEnvironmentVariableA(szName, szRet, rc)) {
@@ -135,6 +136,32 @@ LPSTR WideToAscii(LPCWSTR ws, LPSTR s)
     return pszSave;
 }
 
+LPSTR WideToUTF8(LPCWSTR ws)
+{
+
+    LPSTR s;
+    int cch = WideCharToMultiByte(CP_UTF8, 0, ws, -1, NULL, 0, NULL, NULL);
+    s = (LPSTR)apxAlloc(cch);
+    if (!WideCharToMultiByte(CP_UTF8, 0, ws, -1, s, cch, NULL, NULL)) {
+        apxFree(s);
+        return NULL;
+    }
+    return s;
+}
+
+LPWSTR UTF8ToWide(LPCSTR cs)
+{
+
+    LPWSTR s;
+    int cch = MultiByteToWideChar(CP_UTF8, 0, cs, -1, NULL, 0);
+    s = (LPWSTR)apxAlloc(cch * sizeof(WCHAR));
+    if (!MultiByteToWideChar(CP_UTF8, 0, cs, -1, s, cch)) {
+        apxFree(s);
+        return NULL;
+    }
+    return s;
+}
+
 LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s)
 {
     LPSTR pszSave = s;
@@ -151,6 +178,38 @@ LPSTR MzWideToAscii(LPCWSTR ws, LPSTR s)
     return pszSave;
 }
 
+LPSTR MzWideToUTF8(LPCWSTR ws)
+{
+    LPSTR str;
+    LPSTR s;
+    LPCWSTR p = ws;
+    int cch = 0;
+
+    for ( ; p && *p; p++) {
+        int len = WideCharToMultiByte(CP_UTF8, 0, p, -1, NULL, 0, NULL, NULL);
+        if (len > 0)
+            cch += len;
+        while (*p)
+            p++;
+    }
+    cch ++;
+    str = s = (LPSTR)apxAlloc(cch + 1);
+
+    p = ws;
+    for ( ; p && *p; p++) {
+        int len = WideCharToMultiByte(CP_UTF8, 0, p, -1, s, cch, NULL, NULL);
+        if (len > 0) {
+            s = s + len;
+            cch -= len;
+        }
+        while (*p)
+            p++;
+    }
+    /* double terminate */
+    *s = '\0';
+    return str;
+}
+
 #ifdef _DEBUG
 
 void ErrorMessage(LPCTSTR szError, BOOL bFatal)
@@ -170,18 +229,18 @@ void ErrorMessage(LPCTSTR szError, BOOL bFatal)
         FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                       FORMAT_MESSAGE_FROM_SYSTEM |
                       FORMAT_MESSAGE_IGNORE_INSERTS,
-                      NULL, 
-                      dwErr, 
+                      NULL,
+                      dwErr,
                       MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
                       (LPTSTR) &lpMsgBuf, 0, NULL);
-        nRet = MessageBox(NULL, (LPCTSTR)lpMsgBuf, 
+        nRet = MessageBox(NULL, (LPCTSTR)lpMsgBuf,
                           TEXT("Application System Error"), nType);
         LocalFree(lpMsgBuf);
     }
     if (bFatal && (nRet == IDCANCEL || nRet == IDABORT)) {
         ExitProcess(dwErr);
     }
-} 
+}
 #endif /* _DEBUG */
 
 DWORD __apxGetMultiSzLengthA(LPCSTR lpStr, LPDWORD lpdwCount)
@@ -219,10 +278,10 @@ LPWSTR apxMultiSzCombine(APXHANDLE hPool, LPCWSTR lpStrA, LPCWSTR lpStrB,
     DWORD  la = 0, lb = 0;
     if (!lpStrA && !lpStrB)
         return NULL;    /* Nothing to do if both are NULL */
-    
+
     la = __apxGetMultiSzLengthW(lpStrA, NULL);
     lb = __apxGetMultiSzLengthW(lpStrB, NULL);
-    
+
     rv = apxPoolCalloc(hPool, (la + lb + 1) * sizeof(WCHAR));
     if (la) {
         AplMoveMemory(rv, lpStrA, la * sizeof(WCHAR));
@@ -289,7 +348,7 @@ apxMultiSzToArrayW(APXHANDLE hPool, LPCWSTR lpString, LPWSTR **lppArray)
         p++;
     }
     (*lppArray)[++i] = NULL;
-    
+
     return n;
 }
 
@@ -318,7 +377,7 @@ apxMultiSzToArrayA(APXHANDLE hPool, LPCSTR lpString, LPSTR **lppArray)
         p++;
     }
     (*lppArray)[++i] = NULL;
-    
+
     return n;
 }
 
@@ -356,7 +415,7 @@ LPTSTR  apxMultiSzStrcat(LPAPXMULTISZ lpmSz, LPCTSTR szSrc)
 {
     DWORD l = lstrlen(szSrc);
     LPTSTR p;
-    
+
     if (lpmSz->dwInsert + l + 2 > lpmSz->dwAllocated) {
         if ((lpmSz = (LPAPXMULTISZ )apxRealloc(lpmSz, QSTR_ALIGN(lpmSz->dwInsert + l))) == NULL)
             return NULL;
@@ -386,7 +445,7 @@ LPCTSTR apxMultiSzGet(LPAPXMULTISZ lpmSz)
 }
 #endif
 
-LPTSTR apxStrCharRemove(LPTSTR szString, TCHAR chSkip) 
+LPTSTR apxStrCharRemove(LPTSTR szString, TCHAR chSkip)
 {
   LPTSTR p = szString;
   LPTSTR q = szString;
@@ -398,9 +457,9 @@ LPTSTR apxStrCharRemove(LPTSTR szString, TCHAR chSkip)
   *q = TEXT('\0');
 
   return szString;
-} 
+}
 
-DWORD apxStrCharRemoveA(LPSTR szString, CHAR chSkip) 
+DWORD apxStrCharRemoveA(LPSTR szString, CHAR chSkip)
 {
   LPSTR p = szString;
   LPSTR q = szString;
@@ -415,9 +474,9 @@ DWORD apxStrCharRemoveA(LPSTR szString, CHAR chSkip)
   *q = '\0';
 
   return c;
-} 
+}
 
-DWORD apxStrCharRemoveW(LPWSTR szString, WCHAR chSkip) 
+DWORD apxStrCharRemoveW(LPWSTR szString, WCHAR chSkip)
 {
   LPWSTR p = szString;
   LPWSTR q = szString;
@@ -432,37 +491,37 @@ DWORD apxStrCharRemoveW(LPWSTR szString, WCHAR chSkip)
   *q = L'\0';
 
   return c;
-} 
+}
 
 void
-apxStrCharReplaceA(LPSTR szString, CHAR chReplace, CHAR chReplaceWith) 
+apxStrCharReplaceA(LPSTR szString, CHAR chReplace, CHAR chReplaceWith)
 {
   LPSTR p = szString;
   LPSTR q = szString;
   while (*p) {
     if(*p == chReplace)
       *q++ = chReplaceWith;
-    else 
+    else
       *q++ = *p;
     ++p;
   }
   *q = '\0';
-} 
+}
 
 void
-apxStrCharReplaceW(LPWSTR szString, WCHAR chReplace, WCHAR chReplaceWith) 
+apxStrCharReplaceW(LPWSTR szString, WCHAR chReplace, WCHAR chReplaceWith)
 {
   LPWSTR p = szString;
   LPWSTR q = szString;
   while (*p) {
     if(*p == chReplace)
       *q++ = chReplaceWith;
-    else 
+    else
       *q++ = *p;
     ++p;
   }
   *q = L'\0';
-} 
+}
 
 static const LPCTSTR _st_hex = TEXT("0123456789abcdef");
 #define XTOABUFFER_SIZE (sizeof(ULONG) * 2 + 2)
@@ -505,7 +564,7 @@ BOOL apxUptohex(ULONG_PTR n, LPTSTR lpBuff, DWORD dwBuffLength)
     return TRUE;
 }
 
-ULONG apxStrToul(LPCTSTR szNum) 
+ULONG apxStrToul(LPCTSTR szNum)
 {
     ULONG rv = 0;
     DWORD sh = 0;
@@ -517,7 +576,7 @@ ULONG apxStrToul(LPCTSTR szNum)
         return 0;
     /* go to the last digit */
     while (*(p + 1)) p++;
-    
+
     /* go back to 'x' */
     while (*p != TEXT('x')) {
         ULONG v = 0;
@@ -538,8 +597,8 @@ ULONG apxStrToul(LPCTSTR szNum)
             case TEXT('d'): case TEXT('D'): v = 13UL; break;
             case TEXT('e'): case TEXT('E'): v = 14UL; break;
             case TEXT('f'): case TEXT('F'): v = 15UL; break;
-            default: 
-                return 0; 
+            default:
+                return 0;
             break;
         }
         rv |= rv + (v << sh);
@@ -548,7 +607,7 @@ ULONG apxStrToul(LPCTSTR szNum)
     return rv;
 }
 
-ULONG apxStrToulW(LPCWSTR szNum) 
+ULONG apxStrToulW(LPCWSTR szNum)
 {
     ULONG rv = 0;
     DWORD sh = 0;
@@ -560,7 +619,7 @@ ULONG apxStrToulW(LPCWSTR szNum)
         return 0;
     /* go to the last digit */
     while (*(p + 1)) p++;
-    
+
     /* go back to 'x' */
     while (*p != L'x') {
         ULONG v = 0;
@@ -581,8 +640,8 @@ ULONG apxStrToulW(LPCWSTR szNum)
             case L'd': case L'D': v = 13UL; break;
             case L'e': case L'E': v = 14UL; break;
             case L'f': case L'F': v = 15UL; break;
-            default: 
-                return 0; 
+            default:
+                return 0;
             break;
         }
         rv |= rv + (v << sh);
@@ -591,7 +650,7 @@ ULONG apxStrToulW(LPCWSTR szNum)
     return rv;
 }
 
-ULONG apxAtoulW(LPCWSTR szNum) 
+ULONG apxAtoulW(LPCWSTR szNum)
 {
     ULONG rv = 0;
     DWORD sh = 1;
@@ -606,7 +665,7 @@ ULONG apxAtoulW(LPCWSTR szNum)
         ++p;
     }
     while (*(p + 1)) p++;
-    
+
     /* go back */
     while (p >= szNum) {
         ULONG v = 0;
@@ -621,8 +680,8 @@ ULONG apxAtoulW(LPCWSTR szNum)
             case L'7': v = 7UL; break;
             case L'8': v = 8UL; break;
             case L'9': v = 9UL; break;
-            default: 
-                return rv * s; 
+            default:
+                return rv * s;
             break;
         }
         rv = rv + (v * sh);
@@ -631,13 +690,13 @@ ULONG apxAtoulW(LPCWSTR szNum)
     return rv * s;
 }
 
-/* Make the unique system resource name from prefix and process id 
- * 
+/* Make the unique system resource name from prefix and process id
+ *
  */
 BOOL
 apxMakeResourceName(LPCTSTR szPrefix, LPTSTR lpBuff, DWORD dwBuffLength)
 {
-    DWORD pl = lstrlen(szPrefix);        
+    DWORD pl = lstrlen(szPrefix);
     if (dwBuffLength < (pl + 11))
         return FALSE;
     lstrcpy(lpBuff, szPrefix);
@@ -679,7 +738,7 @@ INT apxStrMatchA(LPCSTR szString, LPCSTR szPattern, BOOL bIgnoreCase)
         }
     }
     return (szString[x] != '\0');
-} 
+}
 
 INT apxStrMatchW(LPCWSTR szString, LPCWSTR szPattern, BOOL bIgnoreCase)
 {
@@ -713,7 +772,7 @@ INT apxStrMatchW(LPCWSTR szString, LPCWSTR szPattern, BOOL bIgnoreCase)
         }
     }
     return (szString[x] != L'\0');
-} 
+}
 
 INT apxMultiStrMatchW(LPCWSTR szString, LPCWSTR szPattern,
                       WCHAR chSeparator, BOOL bIgnoreCase)
@@ -847,18 +906,19 @@ apxMszToCRLFW(APXHANDLE hPool, LPCWSTR szStr)
     LPWSTR rv, b;
     LPCWSTR p = szStr;
 
-    l = __apxGetMultiSzLengthW(szStr, &c);    
+    l = __apxGetMultiSzLengthW(szStr, &c);
     b = rv = apxPoolCalloc(hPool, (l + c + 2) * sizeof(WCHAR));
-    do {
+
+    while (c > 0) {
         if (*p)
             *b++ = *p;
         else {
             *b++ = L'\r';
             *b++ = L'\n';
+            c--;
         }
         p++;
-    } while( *p || *(p + 1));
- 
+    }
     return rv;
 }
 
@@ -868,7 +928,7 @@ apxCRLFToMszW(APXHANDLE hPool, LPCWSTR szStr, LPDWORD lpdwBytes)
     DWORD l, c, n = 0;
     LPWSTR rv, b;
 
-    l = lstrlenW(szStr);    
+    l = lstrlenW(szStr);
     b = rv = apxPoolCalloc(hPool, (l + 2) * sizeof(WCHAR));
     for (c = 0; c < l; c++) {
         if (szStr[c] == L'\r') {
@@ -964,13 +1024,13 @@ PSECURITY_ATTRIBUTES GetNullACL()
     }
     SetLastError(0);
     if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
-	|| GetLastError()) {
+    || GetLastError()) {
         LocalFree( pSD );
         LocalFree( sa );
         return NULL;
     }
     if (!SetSecurityDescriptorDacl(pSD, TRUE, (PACL) NULL, FALSE)
-	|| GetLastError()) {
+    || GetLastError()) {
         LocalFree( pSD );
         LocalFree( sa );
         return NULL;
@@ -981,7 +1041,7 @@ PSECURITY_ATTRIBUTES GetNullACL()
 }
 
 
-void CleanNullACL(void *sa) 
+void CleanNullACL(void *sa)
 {
     if (sa) {
         LocalFree(((PSECURITY_ATTRIBUTES)sa)->lpSecurityDescriptor);
diff --git a/src/native/nt/procrun/testchild/testchild.c b/src/native/nt/procrun/testchild/testchild.c
deleted file mode 100644
index fc45da5..0000000
--- a/src/native/nt/procrun/testchild/testchild.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *  Copyright 2002-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/* ====================================================================
- * testchild.c
- *
- * Contributed by Mladen Turk <mturk at mappingsoft.com>
- *
- * 05 Aug 2002
- * ==================================================================== 
- */
-
-#ifndef STRICT
-#define STRICT
-#endif
-#ifndef OEMRESOURCE
-#define OEMRESOURCE
-#endif
-
-#include <windows.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <io.h>
-#include <fcntl.h>
-#include <process.h>
-#include <time.h>
-#include <stdarg.h>
-
-BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
-{
-   switch (dwCtrlType) {
-   case CTRL_BREAK_EVENT:
-      printf("got CTRL+BREAK Event\n");
-      exit(1);
-      return TRUE;
-   case CTRL_C_EVENT:
-      printf("got CTRL+C Event\n");
-      exit(2);
-      return TRUE;
-      break;
-
-   }
-   return FALSE;
-}
-
-//int main(int argc, char **argv, char **envp)
-void __cdecl main(int argc, char **argv)
-
-{
-    int i;
-    char **envp = _environ;
-    SetConsoleCtrlHandler(ControlHandler, TRUE);
-
-    printf("Testing child\n");
-    printf("ARGV:\n");
-    for (i = 0; i < argc; i++)
-        printf("\t%d %s\n", i, argv[i]);
-    printf("ENVP:\n");
-    for (i = 0; envp[i]; i++)
-        printf("\t%d %s\n", i, envp[i]);
-    
-    printf("\nChild done...\n");
-    fflush(stdout);
-    for (i = 0; i < 1000; i++)
-        Sleep(100);
-}
diff --git a/src/native/nt/procrun/testchild/testchild.dsp b/src/native/nt/procrun/testchild/testchild.dsp
deleted file mode 100644
index 2d85bcb..0000000
--- a/src/native/nt/procrun/testchild/testchild.dsp
+++ /dev/null
@@ -1,106 +0,0 @@
-# Microsoft Developer Studio Project File - Name="testchild" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=testchild - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "testchild.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "testchild.mak" CFG="testchild - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "testchild - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "testchild - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "testchild - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /ZI /W3 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm PRECOMP_VC7_TOBEREMOVED /GZ /c /GX 
-# ADD CPP /nologo /MDd /ZI /W3 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm PRECOMP_VC7_TOBEREMOVED /GZ /c /GX 
-# ADD BASE MTL /nologo /win32 
-# ADD MTL /nologo /win32 
-# ADD BASE RSC /l 1033 
-# ADD RSC /l 1033 
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo 
-# ADD BSC32 /nologo 
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /out:"Debug\testchild.exe" /incremental:yes /debug /pdb:"Debug\testchild.pdb" /pdbtype:sept /subsystem:console /machine:ix86 
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /out:"Debug\testchild.exe" /incremental:yes /debug /pdb:"Debug\testchild.pdb" /pdbtype:sept /subsystem:console /machine:ix86 
-
-!ELSEIF  "$(CFG)" == "testchild - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /Zi /W3 /O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /GF /Gy PRECOMP_VC7_TOBEREMOVED /c /GX 
-# ADD CPP /nologo /MD /Zi /W3 /O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /GF /Gy PRECOMP_VC7_TOBEREMOVED /c /GX 
-# ADD BASE MTL /nologo /win32 
-# ADD MTL /nologo /win32 
-# ADD BASE RSC /l 1033 
-# ADD RSC /l 1033 
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo 
-# ADD BSC32 /nologo 
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /out:"Release\testchild.exe" /incremental:no /debug /pdbtype:sept /subsystem:console /opt:ref /opt:icf /machine:ix86 
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /out:"Release\testchild.exe" /incremental:no /debug /pdbtype:sept /subsystem:console /opt:ref /opt:icf /machine:ix86 
-
-!ENDIF
-
-# Begin Target
-
-# Name "testchild - Win32 Debug"
-# Name "testchild - Win32 Release"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;def;odl;idl;hpj;bat;asm"
-# Begin Source File
-
-SOURCE=testchild.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;inc"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
-
diff --git a/src/native/nt/procrun/testchild/testchild.vcproj b/src/native/nt/procrun/testchild/testchild.vcproj
deleted file mode 100644
index 998f4c9..0000000
--- a/src/native/nt/procrun/testchild/testchild.vcproj
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding = "windows-1250"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.00"
-	Name="testchild"
-	ProjectGUID="{C815B005-1292-47F7-9052-F46676CE2879}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/testchild.exe"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/testchild.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				OmitFramePointers="TRUE"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="TRUE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/testchild.exe"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-		</Configuration>
-	</Configurations>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
-			<File
-				RelativePath="testchild.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/src/native/nt/procrun/xdocs/index.xml b/src/native/nt/procrun/xdocs/index.xml
index 622080a..46fc181 100644
--- a/src/native/nt/procrun/xdocs/index.xml
+++ b/src/native/nt/procrun/xdocs/index.xml
@@ -1,5 +1,20 @@
 <?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
 
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 <document>
  <properties>
   <title>Daemon : Procrun</title>
diff --git a/src/native/nt/service/instmain.c b/src/native/nt/service/instmain.c
index 7206684..9693249 100644
--- a/src/native/nt/service/instmain.c
+++ b/src/native/nt/service/instmain.c
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: instmain.c 232844 2005-08-15 18:16:16Z jfclere $ */
+/* @version $Id: instmain.c 480469 2006-11-29 08:22:04Z bayard $ */
 
 /*
  * jsvc.exe install program, create the service JavaService
diff --git a/src/native/nt/signals/kills.c b/src/native/nt/signals/kills.c
index d4563fe..295ba60 100644
--- a/src/native/nt/signals/kills.c
+++ b/src/native/nt/signals/kills.c
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: kills.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: kills.c 480469 2006-11-29 08:22:04Z bayard $ */
 
 /*
  * as Windows does not support signal, jsvc uses events to emulate them.
diff --git a/src/native/nt/supcalls_nt/vdenv.c b/src/native/nt/supcalls_nt/vdenv.c
index 9b33554..6628da1 100644
--- a/src/native/nt/supcalls_nt/vdenv.c
+++ b/src/native/nt/supcalls_nt/vdenv.c
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: vdenv.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: vdenv.c 897078 2010-01-08 01:52:47Z sebb $ */
 
 /* Read the Win-NT register and set the jsvc environment variable. */
 /* XXX We should use a property file instead  registry */
@@ -51,12 +52,12 @@ char Variable[ENVSIZE];
 int OnServeSetEnv ()
 {
 HKEY    hKey=NULL;
-DWORD	Type;
-char	jakarta_home[ENVSIZE]; /* for the path */
-char	cygwin[ENVSIZE]; /* for the path */
-char	Data[ENVSIZE];
-DWORD	LData;
-int	qreturn=0;
+DWORD   Type;
+char    jakarta_home[ENVSIZE]; /* for the path */
+char    cygwin[ENVSIZE]; /* for the path */
+char    Data[ENVSIZE];
+DWORD   LData;
+int     qreturn=0;
 
 
     /* Read the registry and set environment. */
@@ -121,7 +122,7 @@ int	qreturn=0;
  */
 int BuildCommand(char *data)
 {
-    int	i;
+    int  i;
     LONG lRet;
     DWORD dwIndex;
     char name[128];
@@ -129,7 +130,7 @@ int BuildCommand(char *data)
     char value[256];
     DWORD lvalue;
     DWORD nvalue;
-    DWORD	Type;
+    DWORD   Type;
     HKEY    hKey=NULL;
 
 
diff --git a/src/native/unix/CHANGES.txt b/src/native/unix/CHANGES.txt
index fc15c5c..6fac876 100644
--- a/src/native/unix/CHANGES.txt
+++ b/src/native/unix/CHANGES.txt
@@ -1,5 +1,19 @@
 JAKARTA COMMONS DAEMON (UNIX) CHANGELOG:
-Last modified at [$Date: 2006-04-27 12:38:15 +0200 (tor, 27 apr 2006) $]
+Last modified at [$Date: 2010-02-18 10:09:07 +0100 (Thu, 18 Feb 2010) $]
+
+Changes with 1.0.2
+  * Allow support for OS/X 10.6 (DAEMON-129)
+  * Prunmgr shows wrong default logging level (DAEMON-132)
+  * Allon non ASCII characters in classpath (DAEMON-130)
+  * Log on tab of Prunmgr ignores current settings (DAEMON-126)
+  * Unable to open directory /proc/self/fd (DAEMON-120)
+  * Read Java parameters for Java mode in the same way as JVM mode (DAEMON-119)
+  * Allow running jsvc should as non root (DAEMON-93)
+  * Support all the standard Java 5 launcher options (DAEMON-84)
+  * Support compilation on Cygwin (DAEMON-40)
+  * Add Support for AIX (DAEMON-123)
+  * Fix default log path (DAEMON-116)
+  * Wait for JVM clean exit (DAEMON-97)
 
 Changes with 1.0.1
   * Allow enableassertions -ea (PR 304310).
@@ -14,17 +28,3 @@ Changes with 1.0.1
   * fix 34851.
   * Don't break when set_caps() failed and the user is unchanged (linux).
 
-Changes with next-unreleased-yet version.
-  * Add support for hp-ux.
-  * fix 35017.
-  * fix 36051.
-  * fix 35318.
-  * fix 35340.
-  * fix 36030. (using /proc/self/exe and readlink).
-  * fix 35403.
-  * fix 35659.
-  * fix 36031.
-  * fix 36058. (mask used for pid/log and load: 0077).
-  * fix 38992.
-  * Improve support of Mac OS X Server 10.4
-  * Restart when JVM process is killed (abort is not alway called).
diff --git a/src/native/unix/INSTALL.txt b/src/native/unix/INSTALL.txt
index 5e1425f..f1a5917 100644
--- a/src/native/unix/INSTALL.txt
+++ b/src/native/unix/INSTALL.txt
@@ -45,3 +45,25 @@ for the jsvc binary simply do
 Note: On Linux the module capabilities should be loaded, when using -user root
 make sure you REALLY understand what capabilities does (for example for
 files access: the downgraded root may not be able to read some files!).
+
+Making 64-bit binaries
+
+To be able to build the 64-binaries for supported platforms enter the
+specific parameters before calling configure
+
+   export CFLAGS=-m64
+   export LDFLAGS=-m64
+   ./configure
+   make
+
+Making Universal binaries
+
+Some platforms like Mac OSX allow universal or fat binaries that allow
+both 32 and 64 binaries inside the same executable. To be able to build
+the fat binaries enter the specific parameters before calling configure
+
+   export CFLAGS="-arch i386 -arch x86_64"
+   export LDFLAGS="-arch i386 -arch x86_64"
+   ./configure
+   make
+
diff --git a/src/native/unix/Makedefs b/src/native/unix/Makedefs
new file mode 100644
index 0000000..effac54
--- /dev/null
+++ b/src/native/unix/Makedefs
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
+# @version $Id: Makedefs.in 480475 2006-11-29 08:31:47Z bayard $
+
+CC = gcc
+JAVAC = /opt/java6/bin/javac
+JAR = /opt/java6/bin/jar
+CFLAGS = -g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\"i386\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes
+LDFLAGS = 
+LIBS =  -ldl -lpthread
+JAVACFLAGS = 
+RANLIB = ranlib
+LDCMD = gcc
+
+.c.o:
+	$(CC) $(CFLAGS) -c $< -o $@
diff --git a/src/native/unix/Makedefs.in b/src/native/unix/Makedefs.in
index 1859972..07fb502 100644
--- a/src/native/unix/Makedefs.in
+++ b/src/native/unix/Makedefs.in
@@ -1,21 +1,22 @@
 #
-#   Copyright 1999-2004 The Apache Software Foundation
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 
 # @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makedefs.in 410153 2006-05-29 21:05:17Z jfclere $
+# @version $Id: Makedefs.in 480475 2006-11-29 08:31:47Z bayard $
 
 CC = @CC@
 JAVAC = @JAVAC@
diff --git a/src/native/unix/Makefile b/src/native/unix/Makefile
new file mode 100644
index 0000000..c8c48da
--- /dev/null
+++ b/src/native/unix/Makefile
@@ -0,0 +1,40 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
+# @version $Id: Makefile.in 480475 2006-11-29 08:31:47Z bayard $
+
+SUBDIRS = native
+
+all: native/all
+
+native/all:
+	(cd native; $(MAKE)  all)
+
+clean:
+	(cd native; $(MAKE)  clean)
+
+distclean: clean
+	rm -f config.cache
+	rm -f config.log
+	rm -f config.status
+	rm -f native/Makefile
+	rm -f Makefile
+	rm -f Makedefs
+
+realclean: distclean
+	rm -f configure
diff --git a/src/native/unix/Makefile.in b/src/native/unix/Makefile.in
index 39ab867..c8c48da 100644
--- a/src/native/unix/Makefile.in
+++ b/src/native/unix/Makefile.in
@@ -1,21 +1,22 @@
 #
-#   Copyright 1999-2004 The Apache Software Foundation
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 
 # @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makefile.in 208816 2005-07-02 02:08:43Z billbarker $
+# @version $Id: Makefile.in 480475 2006-11-29 08:31:47Z bayard $
 
 SUBDIRS = native
 
diff --git a/src/native/unix/config.log b/src/native/unix/config.log
new file mode 100644
index 0000000..55472f9
--- /dev/null
+++ b/src/native/unix/config.log
@@ -0,0 +1,264 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by configure, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ ./configure --prefix=/home/mturk/Workplace/daemon/src/native/unix/release --with-java=/opt/java6
+
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = fc12x32m0.jboss.hr
+uname -m = i686
+uname -r = 2.6.31.12-174.2.3.fc12.i686.PAE
+uname -s = Linux
+uname -v = #1 SMP Mon Jan 18 20:06:44 UTC 2010
+
+/usr/bin/uname -p = unknown
+/bin/uname -X     = unknown
+
+/bin/arch              = i686
+/usr/bin/arch -k       = unknown
+/usr/convex/getsysinfo = unknown
+/usr/bin/hostinfo      = unknown
+/bin/machine           = unknown
+/usr/bin/oslevel       = unknown
+/bin/universe          = unknown
+
+PATH: /opt/java6/bin
+PATH: /opt/ant/bin
+PATH: /usr/lib/qt-3.3/bin
+PATH: /usr/kerberos/sbin
+PATH: /usr/kerberos/bin
+PATH: /usr/lib/ccache
+PATH: /usr/local/bin
+PATH: /usr/bin
+PATH: /bin
+PATH: /usr/local/sbin
+PATH: /usr/sbin
+PATH: /sbin
+PATH: /home/mturk/local/bin
+PATH: /opt/maven/bin
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+configure:1793: checking build system type
+configure:1811: result: i686-pc-linux-gnu
+configure:1833: checking host system type
+configure:1848: result: i686-pc-linux-gnu
+configure:1871: checking cached host system type
+configure:1882: result: ok
+configure:1941: checking for gcc
+configure:1957: found /usr/lib/ccache/gcc
+configure:1968: result: gcc
+configure:2200: checking for C compiler version
+configure:2208: gcc --version >&5
+gcc (GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)
+Copyright (C) 2010 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+configure:2212: $? = 0
+configure:2219: gcc -v >&5
+Using built-in specs.
+Target: i686-redhat-linux
+Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre  [...]
+Thread model: posix
+gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) 
+configure:2223: $? = 0
+configure:2230: gcc -V >&5
+gcc: '-V' option must have argument
+configure:2234: $? = 1
+configure:2257: checking for C compiler default output file name
+configure:2279: gcc    conftest.c  >&5
+configure:2283: $? = 0
+configure:2321: result: a.out
+configure:2340: checking whether the C compiler works
+configure:2350: ./a.out
+configure:2354: $? = 0
+configure:2373: result: yes
+configure:2380: checking whether we are cross compiling
+configure:2382: result: no
+configure:2385: checking for suffix of executables
+configure:2392: gcc -o conftest    conftest.c  >&5
+configure:2396: $? = 0
+configure:2422: result: 
+configure:2428: checking for suffix of object files
+configure:2454: gcc -c   conftest.c >&5
+configure:2458: $? = 0
+configure:2483: result: o
+configure:2487: checking whether we are using the GNU C compiler
+configure:2516: gcc -c   conftest.c >&5
+configure:2523: $? = 0
+configure:2540: result: yes
+configure:2549: checking whether gcc accepts -g
+configure:2579: gcc -c -g  conftest.c >&5
+configure:2586: $? = 0
+configure:2687: result: yes
+configure:2704: checking for gcc option to accept ISO C89
+configure:2778: gcc  -c -g -O2  conftest.c >&5
+configure:2785: $? = 0
+configure:2808: result: none needed
+configure:2869: checking for ranlib
+configure:2885: found /usr/bin/ranlib
+configure:2896: result: ranlib
+configure:2924: checking C flags dependant on host system type
+configure:3037: result: ok
+configure:3070: checking JAVA_HOME
+configure:3075: result: /opt/java6
+configure:3100: checking for sablevm
+configure:3131: result: NONE
+configure:3159: checking for kaffe
+configure:3190: result: NONE
+configure:3259: checking for javac
+configure:3277: found /opt/java6/bin/javac
+configure:3290: result: /opt/java6/bin/javac
+configure:3341: result: /opt/java6/bin/javac
+configure:3350: checking wether the Java compiler (/opt/java6/bin/javac) works
+configure:3372: result: yes
+configure:3431: checking for jar
+configure:3449: found /opt/java6/bin/jar
+configure:3462: result: /opt/java6/bin/jar
+configure:3530: result: gcc flags added
+configure:3683: creating ./config.status
+
+## ---------------------- ##
+## Running config.status. ##
+## ---------------------- ##
+
+This file was extended by config.status, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = 
+  CONFIG_HEADERS  = 
+  CONFIG_LINKS    = 
+  CONFIG_COMMANDS = 
+  $ ./config.status 
+
+on fc12x32m0.jboss.hr
+
+config.status:660: creating Makefile
+config.status:660: creating Makedefs
+config.status:660: creating native/Makefile
+configure:4662: result: Now you can issue "make"
+
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+
+ac_cv_build=i686-pc-linux-gnu
+ac_cv_c_compiler_gnu=yes
+ac_cv_env_CC_set=
+ac_cv_env_CC_value=
+ac_cv_env_CFLAGS_set=
+ac_cv_env_CFLAGS_value=
+ac_cv_env_CPPFLAGS_set=
+ac_cv_env_CPPFLAGS_value=
+ac_cv_env_LDFLAGS_set=
+ac_cv_env_LDFLAGS_value=
+ac_cv_env_LIBS_set=
+ac_cv_env_LIBS_value=
+ac_cv_env_build_alias_set=
+ac_cv_env_build_alias_value=
+ac_cv_env_host_alias_set=
+ac_cv_env_host_alias_value=
+ac_cv_env_target_alias_set=
+ac_cv_env_target_alias_value=
+ac_cv_host=i686-pc-linux-gnu
+ac_cv_host_system_type=i686-pc-linux-gnu
+ac_cv_objext=o
+ac_cv_path_JAR=/opt/java6/bin/jar
+ac_cv_path_JAVAC=/opt/java6/bin/javac
+ac_cv_path_KAFFEVM=NONE
+ac_cv_path_SABLEVM=NONE
+ac_cv_prog_ac_ct_CC=gcc
+ac_cv_prog_ac_ct_RANLIB=ranlib
+ac_cv_prog_cc_c89=
+ac_cv_prog_cc_g=yes
+ap_cv_prog_javac_works=yes
+
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+
+CC='gcc'
+CFLAGS='-g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\"i386\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes'
+CPPFLAGS=''
+DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"'
+ECHO_C=''
+ECHO_N='-n'
+ECHO_T=''
+EXEEXT=''
+JAR='/opt/java6/bin/jar'
+JARSABLE='NONE'
+JAVAC='/opt/java6/bin/javac'
+JAVACFLAGS=''
+JAVACSABLE='NONE'
+JAVA_HOME='/opt/java6'
+KAFFEVM='NONE'
+LDCMD='gcc'
+LDFLAGS=''
+LIBOBJS=''
+LIBS=' -ldl -lpthread'
+LTLIBOBJS=''
+OBJEXT='o'
+PACKAGE_BUGREPORT=''
+PACKAGE_NAME=''
+PACKAGE_STRING=''
+PACKAGE_TARNAME=''
+PACKAGE_VERSION=''
+PATH_SEPARATOR=':'
+RANLIB='ranlib'
+SABLEVM='NONE'
+SHELL='/bin/sh'
+ac_ct_CC='gcc'
+bindir='${exec_prefix}/bin'
+build='i686-pc-linux-gnu'
+build_alias=''
+build_cpu='i686'
+build_os='linux-gnu'
+build_vendor='pc'
+datadir='${datarootdir}'
+datarootdir='${prefix}/share'
+docdir='${datarootdir}/doc/${PACKAGE}'
+dvidir='${docdir}'
+exec_prefix='${prefix}'
+host='i686-pc-linux-gnu'
+host_alias=''
+host_cpu='i686'
+host_os='linux-gnu'
+host_vendor='pc'
+htmldir='${docdir}'
+includedir='${prefix}/include'
+infodir='${datarootdir}/info'
+libdir='${exec_prefix}/lib'
+libexecdir='${exec_prefix}/libexec'
+localedir='${datarootdir}/locale'
+localstatedir='${prefix}/var'
+mandir='${datarootdir}/man'
+oldincludedir='/usr/include'
+pdfdir='${docdir}'
+prefix='/home/mturk/Workplace/daemon/src/native/unix/release'
+program_transform_name='s,x,x,'
+psdir='${docdir}'
+sbindir='${exec_prefix}/sbin'
+sharedstatedir='${prefix}/com'
+sysconfdir='${prefix}/etc'
+target_alias=''
+
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+
+#define PACKAGE_NAME ""
+#define PACKAGE_TARNAME ""
+#define PACKAGE_VERSION ""
+#define PACKAGE_STRING ""
+#define PACKAGE_BUGREPORT ""
+
+configure: exit 0
diff --git a/src/native/unix/config.status b/src/native/unix/config.status
new file mode 100755
index 0000000..7d0023a
--- /dev/null
+++ b/src/native/unix/config.status
@@ -0,0 +1,866 @@
+#! /bin/sh
+# Generated by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=${CONFIG_SHELL-/bin/sh}
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+# Files that config.status was made for.
+config_files=" Makefile Makedefs native/Makefile"
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+ac_cs_version="\
+config.status
+configured by ./configure, generated by GNU Autoconf 2.63,
+  with options \"'--prefix=/home/mturk/Workplace/daemon/src/native/unix/release' '--with-java=/opt/java6'\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='/home/mturk/Workplace/daemon/src/native/unix'
+srcdir='.'
+test -n "$AWK" || AWK=awk
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+if $ac_cs_recheck; then
+  set X '/bin/sh' './configure'  '--prefix=/home/mturk/Workplace/daemon/src/native/unix/release' '--with-java=/opt/java6' $ac_configure_extra_args --no-create --no-recursion
+  shift
+  $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
+  CONFIG_SHELL='/bin/sh'
+  export CONFIG_SHELL
+  exec "$@"
+fi
+
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
+    "native/Makefile") CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+cat >>"$tmp/subs1.awk" <<\_ACAWK &&
+S["LTLIBOBJS"]=""
+S["LIBOBJS"]=""
+S["LDCMD"]="gcc"
+S["JAR"]="/opt/java6/bin/jar"
+S["JARSABLE"]="NONE"
+S["JAVACFLAGS"]=""
+S["JAVAC"]="/opt/java6/bin/javac"
+S["JAVACSABLE"]="NONE"
+S["KAFFEVM"]="NONE"
+S["SABLEVM"]="NONE"
+S["JAVA_HOME"]="/opt/java6"
+S["RANLIB"]="ranlib"
+S["OBJEXT"]="o"
+S["EXEEXT"]=""
+S["ac_ct_CC"]="gcc"
+S["CPPFLAGS"]=""
+S["LDFLAGS"]=""
+S["CFLAGS"]="-g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\\\"i386\\\" -I/opt/java6/include -I/opt/java6/include/linux -Wall -Wstrict-prototypes"
+S["CC"]="gcc"
+S["host_os"]="linux-gnu"
+S["host_vendor"]="pc"
+S["host_cpu"]="i686"
+S["host"]="i686-pc-linux-gnu"
+S["build_os"]="linux-gnu"
+S["build_vendor"]="pc"
+S["build_cpu"]="i686"
+S["build"]="i686-pc-linux-gnu"
+S["target_alias"]=""
+S["host_alias"]=""
+S["build_alias"]=""
+S["LIBS"]=" -ldl -lpthread"
+S["ECHO_T"]=""
+S["ECHO_N"]="-n"
+S["ECHO_C"]=""
+S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\""
+S["mandir"]="${datarootdir}/man"
+S["localedir"]="${datarootdir}/locale"
+S["libdir"]="${exec_prefix}/lib"
+S["psdir"]="${docdir}"
+S["pdfdir"]="${docdir}"
+S["dvidir"]="${docdir}"
+S["htmldir"]="${docdir}"
+S["infodir"]="${datarootdir}/info"
+S["docdir"]="${datarootdir}/doc/${PACKAGE}"
+S["oldincludedir"]="/usr/include"
+S["includedir"]="${prefix}/include"
+S["localstatedir"]="${prefix}/var"
+S["sharedstatedir"]="${prefix}/com"
+S["sysconfdir"]="${prefix}/etc"
+S["datadir"]="${datarootdir}"
+S["datarootdir"]="${prefix}/share"
+S["libexecdir"]="${exec_prefix}/libexec"
+S["sbindir"]="${exec_prefix}/sbin"
+S["bindir"]="${exec_prefix}/bin"
+S["program_transform_name"]="s,x,x,"
+S["prefix"]="/home/mturk/Workplace/daemon/src/native/unix/release"
+S["exec_prefix"]="${prefix}"
+S["PACKAGE_BUGREPORT"]=""
+S["PACKAGE_STRING"]=""
+S["PACKAGE_VERSION"]=""
+S["PACKAGE_TARNAME"]=""
+S["PACKAGE_NAME"]=""
+S["PATH_SEPARATOR"]=":"
+S["SHELL"]="/bin/sh"
+_ACAWK
+cat >>"$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  ac_datarootdir_hack='
+  s&@datadir@&${datarootdir}&g
+  s&@docdir@&${datarootdir}/doc/${PACKAGE}&g
+  s&@infodir@&${datarootdir}/info&g
+  s&@localedir@&${datarootdir}/locale&g
+  s&@mandir@&${datarootdir}/man&g
+    s&\${datarootdir}&${prefix}/share&g' ;;
+esac
+ac_sed_extra="/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}
+
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+
+
+
+  esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
diff --git a/src/native/unix/configure b/src/native/unix/configure
new file mode 100755
index 0000000..8674972
--- /dev/null
+++ b/src/native/unix/configure
@@ -0,0 +1,4663 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="configure.in"
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+LDCMD
+JAR
+JARSABLE
+JAVACFLAGS
+JAVAC
+JAVACSABLE
+KAFFEVM
+SABLEVM
+JAVA_HOME
+RANLIB
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_java
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-java=DIR         Specify the location of your JDK installation
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_aux_dir=
+for ac_dir in ./support "$srcdir"/./support; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ./support \"$srcdir\"/./support" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in ./support \"$srcdir\"/./support" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+
+  printf "*** %s ***\n" "Current host" 1>&2
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+  { $as_echo "$as_me:$LINENO: checking cached host system type" >&5
+$as_echo_n "checking cached host system type... " >&6; }
+  if { test x"${ac_cv_host_system_type+set}" = x"set"  &&
+       test x"$ac_cv_host_system_type" != x"$host" ; }
+  then
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_host_system_type" >&5
+$as_echo "$ac_cv_host_system_type" >&6; }
+    { { $as_echo "$as_me:$LINENO: error: remove the \"$cache_file\" file and re-run configure" >&5
+$as_echo "$as_me: error: remove the \"$cache_file\" file and re-run configure" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+    ac_cv_host_system_type="$host"
+  fi
+
+
+
+
+  printf "*** %s ***\n" "C-Language compilation tools" 1>&2
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+  printf "*** %s ***\n" "Host support" 1>&2
+
+
+
+  { $as_echo "$as_me:$LINENO: checking C flags dependant on host system type" >&5
+$as_echo_n "checking C flags dependant on host system type... " >&6; }
+
+  case $host_os in
+  darwin*)
+    CFLAGS="$CFLAGS -DOS_DARWIN -DDSO_DLFCN"
+    supported_os="darwin"
+    ;;
+  solaris*)
+    CFLAGS="$CFLAGS -DOS_SOLARIS -DDSO_DLFCN"
+    supported_os="solaris"
+    LIBS="$LIBS -ldl -lthread"
+    ;;
+  linux*)
+    CFLAGS="$CFLAGS -DOS_LINUX -DDSO_DLFCN"
+    supported_os="linux"
+    LIBS="$LIBS -ldl -lpthread"
+    ;;
+  cygwin)
+    CFLAGS="$CFLAGS -DOS_CYGWIN -DDSO_DLFCN -DNO_SETSID"
+    supported_os="win32"
+    ;;
+  sysv)
+    CFLAGS="$CFLAGS -DOS_SYSV -DDSO_DLFCN"
+    LIBS="$LIBS -ldl"
+    ;;
+  sysv4)
+    CFLAGS="$CFLAGS -DOS_SYSV -DDSO_DLFCN -Kthread"
+    LDFLAGS="-Kthread $LDFLAGS"
+    LIBS="$LIBS -ldl"
+    ;;
+  freebsd*)
+    CFLAGS="$CFLAGS -DOS_FREEBSD -DDSO_DLFCN -D_THREAD_SAFE -pthread"
+    LDFLAGS="-pthread $LDFLAGS"
+    supported_os="freebsd"
+    ;;
+  osf5*)
+    CFLAGS="$CFLAGS -pthread -DOS_TRU64 -DDSO_DLFCN -D_XOPEN_SOURCE_EXTENDED"
+    LDFLAGS="$LDFLAGS -pthread"
+    ;;
+  hpux11*)
+    CFLAGS="$CFLAGS -pthread -DOS_HPUX -DDSO_DLFCN"
+    LDFLAGS="$LDFLAGS -pthread"
+    LIBS="$LIBS -lpthread"
+    ;;
+  aix5*)
+    CFLAGS="$CFLAGS -DOS_AIX -DDSO_DLFCN"
+    LDFLAGS="$LDFLAGS -ldl"
+    ;;
+  *)
+    { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+    { { $as_echo "$as_me:$LINENO: error: Unsupported operating system \"$host_os\"" >&5
+$as_echo "$as_me: error: Unsupported operating system \"$host_os\"" >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+  esac
+  case $host_cpu in
+  powerpc)
+    CFLAGS="$CFLAGS -DCPU=\\\"$host_cpu\\\""
+    HOST_CPU=$host_cpu;;
+  sparc*)
+    CFLAGS="$CFLAGS -DCPU=\\\"$host_cpu\\\""
+    HOST_CPU=$host_cpu;;
+  i?86)
+    CFLAGS="$CFLAGS -DCPU=\\\"i386\\\""
+    HOST_CPU=i386;;
+  x86_64)
+    CFLAGS="$CFLAGS -DCPU=\\\"amd64\\\""
+    HOST_CPU=amd64;;
+  bs2000)
+    CFLAGS="$CFLAGS -DCPU=\\\"osd\\\" -DCHARSET_EBCDIC -DOSD_POSIX"
+    supported_os="osd"
+    LDFLAGS="-Kno_link_stdlibs -B llm4"
+    LIBS="$LIBS -lBLSLIB"
+    LDCMD="/opt/C/bin/cc"
+    HOST_CPU=osd;;
+  mips)
+    CFLAGS="$CFLAGS -DCPU=\\\"mips\\\""
+    supported_os="mips"
+    HOST_CPU=mips;;
+  alpha*)
+    CFLAGS="$CFLAGS -DCPU=\\\"alpha\\\""
+    supported_os="alpha"
+    HOST_CPU=alpha;;
+  hppa2.0w)
+    CFLAGS="$CFLAGS -DCPU=\\\"PA_RISC2.0W\\\""
+    supported_os="hp-ux"
+    HOST_CPU=PA_RISC2.0W;;
+  hppa2.0)
+    CFLAGS="$CFLAGS -DCPU=\\\"PA_RISC2.0\\\""
+    supported_os="hp-ux"
+    HOST_CPU=PA_RISC2.0;;
+  mipsel)
+    CFLAGS="$CFLAGS -DCPU=\\\"mipsel\\\""
+    supported_os="mipsel"
+    HOST_CPU=mipsel;;
+  ia64)
+    CFLAGS="$CFLAGS -DCPU=\\\"ia64\\\""
+    supported_os="ia64"
+    HOST_CPU=ia64;;
+  s390)
+    CFLAGS="$CFLAGS -DCPU=\\\"s390\\\""
+    supported_os="s390"
+    HOST_CPU=s390;;
+  *)
+    { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+    { { $as_echo "$as_me:$LINENO: error: Unsupported CPU architecture \"$host_cpu\"" >&5
+$as_echo "$as_me: error: Unsupported CPU architecture \"$host_cpu\"" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+
+
+
+if test "$supported_os" = "darwin"
+then
+  if test -z "$JAVA_HOME" -a -d /System/Library/Frameworks/JavaVM.framework/Home; then
+  	JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+  fi
+
+  _prevdir=`/bin/pwd`
+  if test -n "$JAVA_HOME" -a -d "$JAVA_HOME/include"; then
+    cd "$JAVA_HOME/include"
+  elif test -n "$JAVA_HOME" -a -d "$JAVA_HOME/../Headers"; then
+    cd "$JAVA_HOME/../Headers"
+  else
+    cd /System/Library/Frameworks/JavaVM.framework/Headers
+  fi
+  CFLAGS="$CFLAGS -I`/bin/pwd -P`"
+  cd $_prevdir
+  unset _prevdir
+fi
+
+
+  printf "*** %s ***\n" "Java compilation tools" 1>&2
+
+
+
+
+# Check whether --with-java was given.
+if test "${with_java+set}" = set; then
+  withval=$with_java;
+    { $as_echo "$as_me:$LINENO: checking JAVA_HOME" >&5
+$as_echo_n "checking JAVA_HOME... " >&6; }
+    if test -d "$withval"
+    then
+      JAVA_HOME="$withval"
+      { $as_echo "$as_me:$LINENO: result: $JAVA_HOME" >&5
+$as_echo "$JAVA_HOME" >&6; }
+    else
+      { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+      { { $as_echo "$as_me:$LINENO: error: $withval is not a directory" >&5
+$as_echo "$as_me: error: $withval is not a directory" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+
+fi
+
+  if test x"$JAVA_HOME" = x
+  then
+    { { $as_echo "$as_me:$LINENO: error: Java Home not defined. Rerun with --with-java=... parameter" >&5
+$as_echo "$as_me: error: Java Home not defined. Rerun with --with-java=... parameter" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+
+  if test x"$JAVA_HOME" != x
+  then
+    # Extract the first word of "sablevm", so it can be a program name with args.
+set dummy sablevm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SABLEVM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $SABLEVM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SABLEVM="$SABLEVM" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SABLEVM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_SABLEVM" && ac_cv_path_SABLEVM="NONE"
+  ;;
+esac
+fi
+SABLEVM=$ac_cv_path_SABLEVM
+if test -n "$SABLEVM"; then
+  { $as_echo "$as_me:$LINENO: result: $SABLEVM" >&5
+$as_echo "$SABLEVM" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test "$SABLEVM" = "NONE"
+    then
+            if $JAVA_HOME/bin/java -version 2> /dev/null | grep SableVM > /dev/null
+      then
+        SABLEVM=$JAVA_HOME/bin/java
+      fi
+    fi
+    if test "$SABLEVM" != "NONE"
+    then
+      { $as_echo "$as_me:$LINENO: result: Using sableVM: $SABLEVM" >&5
+$as_echo "Using sableVM: $SABLEVM" >&6; }
+      CFLAGS="$CFLAGS -DHAVE_SABLEVM"
+    fi
+  fi
+
+
+  if test x"$JAVA_HOME" != x
+  then
+    # Extract the first word of "kaffe", so it can be a program name with args.
+set dummy kaffe; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_KAFFEVM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $KAFFEVM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_KAFFEVM="$KAFFEVM" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_KAFFEVM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_KAFFEVM" && ac_cv_path_KAFFEVM="NONE"
+  ;;
+esac
+fi
+KAFFEVM=$ac_cv_path_KAFFEVM
+if test -n "$KAFFEVM"; then
+  { $as_echo "$as_me:$LINENO: result: $KAFFEVM" >&5
+$as_echo "$KAFFEVM" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if test "$KAFFEVM" != "NONE"
+    then
+      { $as_echo "$as_me:$LINENO: result: Using kaffe: $KAFFEVM" >&5
+$as_echo "Using kaffe: $KAFFEVM" >&6; }
+      CFLAGS="$CFLAGS -DHAVE_KAFFEVM"
+      LDFLAGS="$LDFLAGS -Wl,-rpath $JAVA_HOME/jre/lib/$HOST_CPU -L $JAVA_HOME/jre/lib/$HOST_CPU -lkaffevm"
+    fi
+  fi
+
+
+  if test "$SABLEVM" != "NONE"
+  then
+    # Extract the first word of "javac-sablevm", so it can be a program name with args.
+set dummy javac-sablevm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAVACSABLE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JAVACSABLE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAVACSABLE="$JAVACSABLE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JAVACSABLE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JAVACSABLE" && ac_cv_path_JAVACSABLE="NONE"
+  ;;
+esac
+fi
+JAVACSABLE=$ac_cv_path_JAVACSABLE
+if test -n "$JAVACSABLE"; then
+  { $as_echo "$as_me:$LINENO: result: $JAVACSABLE" >&5
+$as_echo "$JAVACSABLE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    JAVACSABLE="NONE"
+  fi
+  if test "$JAVACSABLE" = "NONE"
+  then
+    XPATH="$JAVA_HOME/bin:$JAVA_HOME/Commands:$PATH"
+    # Extract the first word of "javac", so it can be a program name with args.
+set dummy javac; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAVAC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JAVAC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $XPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="NONE"
+  ;;
+esac
+fi
+JAVAC=$ac_cv_path_JAVAC
+if test -n "$JAVAC"; then
+  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
+$as_echo "$JAVAC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    # Extract the first word of "javac-sablevm", so it can be a program name with args.
+set dummy javac-sablevm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAVAC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JAVAC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="NONE"
+  ;;
+esac
+fi
+JAVAC=$ac_cv_path_JAVAC
+if test -n "$JAVAC"; then
+  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
+$as_echo "$JAVAC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+  { $as_echo "$as_me:$LINENO: result: $JAVAC" >&5
+$as_echo "$JAVAC" >&6; }
+  if test "$JAVAC" = "NONE"
+  then
+    { { $as_echo "$as_me:$LINENO: error: javac not found" >&5
+$as_echo "$as_me: error: javac not found" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+  { $as_echo "$as_me:$LINENO: checking wether the Java compiler ($JAVAC) works" >&5
+$as_echo_n "checking wether the Java compiler ($JAVAC) works... " >&6; }
+if test "${ap_cv_prog_javac_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+    echo "public class Test {}" > Test.java
+    $JAVAC $JAVACFLAGS Test.java > /dev/null 2>&1
+    if test $? -eq 0
+    then
+      rm -f Test.java Test.class
+      ap_cv_prog_javac_works=yes
+    else
+      rm -f Test.java Test.class
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+      { { $as_echo "$as_me:$LINENO: error: installation or configuration problem: javac cannot compile" >&5
+$as_echo "$as_me: error: installation or configuration problem: javac cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ap_cv_prog_javac_works" >&5
+$as_echo "$ap_cv_prog_javac_works" >&6; }
+
+
+
+
+
+
+  if test "$SABLEVM" != "NONE"
+  then
+    # Extract the first word of "jar-sablevm", so it can be a program name with args.
+set dummy jar-sablevm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JARSABLE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JARSABLE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JARSABLE="$JARSABLE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JARSABLE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JARSABLE" && ac_cv_path_JARSABLE="NONE"
+  ;;
+esac
+fi
+JARSABLE=$ac_cv_path_JARSABLE
+if test -n "$JARSABLE"; then
+  { $as_echo "$as_me:$LINENO: result: $JARSABLE" >&5
+$as_echo "$JARSABLE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    JARSABLE="NONE"
+  fi
+  if test "$JARSABLE" = "NONE"
+  then
+    XPATH="$JAVA_HOME/bin:$JAVA_HOME/Commands:$PATH"
+    # Extract the first word of "jar", so it can be a program name with args.
+set dummy jar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAR="$JAR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $XPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JAR" && ac_cv_path_JAR="NONE"
+  ;;
+esac
+fi
+JAR=$ac_cv_path_JAR
+if test -n "$JAR"; then
+  { $as_echo "$as_me:$LINENO: result: $JAR" >&5
+$as_echo "$JAR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    # Extract the first word of "jar-sablevm", so it can be a program name with args.
+set dummy jar-sablevm; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $JAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAR="$JAR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $JAVA_HOME/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_JAR" && ac_cv_path_JAR="NONE"
+  ;;
+esac
+fi
+JAR=$ac_cv_path_JAR
+if test -n "$JAR"; then
+  { $as_echo "$as_me:$LINENO: result: $JAR" >&5
+$as_echo "$JAR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+  if test "$JAR" = "NONE"
+  then
+    { { $as_echo "$as_me:$LINENO: error: jar not found" >&5
+$as_echo "$as_me: error: jar not found" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+
+
+if test "$supported_os" != "darwin"
+then
+  CFLAGS="$CFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/$supported_os"
+fi
+
+if test "$GCC" = "yes"
+then
+   CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
+   { $as_echo "$as_me:$LINENO: result: gcc flags added" >&5
+$as_echo "gcc flags added" >&6; }
+fi
+if test -z "$LDCMD"
+then
+   LDCMD="$CC"
+fi
+
+
+
+  printf "*** %s ***\n" "Writing output files" 1>&2
+
+
+ac_config_files="$ac_config_files Makefile Makedefs native/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+	g
+	s/^\n//
+	s/\n/ /g
+	p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
+    "native/Makefile") CONFIG_FILES="$CONFIG_FILES native/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+
+
+
+  esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+
+  printf "*** %s ***\n" "All done" 1>&2
+
+
+{ $as_echo "$as_me:$LINENO: result: Now you can issue \"make\"" >&5
+$as_echo "Now you can issue \"make\"" >&6; }
diff --git a/src/native/unix/configure.in b/src/native/unix/configure.in
index 71180a7..ee5cf75 100644
--- a/src/native/unix/configure.in
+++ b/src/native/unix/configure.in
@@ -1,9 +1,10 @@
 dnl
-dnl Copyright 1999-2004 The Apache Software Foundation
-dnl
-dnl Licensed under the Apache License, Version 2.0 (the "License");
-dnl you may not use this file except in compliance with the License.
-dnl You may obtain a copy of the License at
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
 dnl
 dnl     http://www.apache.org/licenses/LICENSE-2.0
 dnl
@@ -16,7 +17,7 @@ dnl
 
 dnl -------------------------------------------------------------------------
 dnl Author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-dnl Version $Id: configure.in 292274 2005-09-28 19:26:12Z jfclere $
+dnl Version $Id: configure.in 480469 2006-11-29 08:22:04Z bayard $
 dnl -------------------------------------------------------------------------
 
 dnl -------------------------------------------------------------------------
diff --git a/src/native/unix/man/fetch.sh b/src/native/unix/man/fetch.sh
index e950064..6d93567 100644
--- a/src/native/unix/man/fetch.sh
+++ b/src/native/unix/man/fetch.sh
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 mkdir -p ent
 rm -f JSVC.1
 while true
diff --git a/src/native/unix/man/jsvc.1.xml b/src/native/unix/man/jsvc.1.xml
index 677e430..14ff957 100644
--- a/src/native/unix/man/jsvc.1.xml
+++ b/src/native/unix/man/jsvc.1.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
 <refentry id='jsvc1'>
@@ -164,7 +180,7 @@
   </refsect1>
 
   <refsect1 id='author'><title>AUTHOR</title>
-    <para>JSVC is part of the Jakarta Commons Daemon project. Authors are 
+    <para>JSVC is part of the Apache Commons Daemon project. Authors are 
       Jean-Frederic Clere, Remy Maucherat, Yoav Shapira, Bill Barker. JSVC is 
       under the Apache License Version 2.0.</para>
   </refsect1>
diff --git a/src/native/unix/native/Makefile b/src/native/unix/native/Makefile
new file mode 100644
index 0000000..346fffb
--- /dev/null
+++ b/src/native/unix/native/Makefile
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
+# @version $Id: Makefile.in 909069 2010-02-11 16:43:36Z mturk $
+
+include ../Makedefs
+
+OBJS =  arguments.o \
+	debug.o \
+	dso-dlfcn.o \
+	dso-dyld.o \
+	help.o \
+	home.o \
+	java.o \
+	location.o \
+	replace.o \
+	locks.o \
+	signals.o
+
+all: jsvc libservice.a
+
+libservice.a: $(OBJS)
+	ar cr libservice.a $(OBJS)
+	$(RANLIB) libservice.a
+
+jsvc: jsvc-unix.o libservice.a
+	$(LDCMD) $(LDFLAGS) jsvc-unix.o libservice.a $(LIBS) -o ../jsvc
+
+clean:
+	rm -f $(OBJS) ../jsvc jsvc-unix.o libservice.a
+
diff --git a/src/native/unix/native/Makefile.in b/src/native/unix/native/Makefile.in
index 80bb58f..346fffb 100644
--- a/src/native/unix/native/Makefile.in
+++ b/src/native/unix/native/Makefile.in
@@ -1,20 +1,21 @@
 #
-#   Copyright 2001-2004 The Apache Software Foundation.
-# 
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-# 
-#       http://www.apache.org/licenses/LICENSE-2.0
-# 
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 # @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: Makefile.in 410153 2006-05-29 21:05:17Z jfclere $
+# @version $Id: Makefile.in 909069 2010-02-11 16:43:36Z mturk $
 
 include ../Makedefs
 
@@ -27,6 +28,7 @@ OBJS =  arguments.o \
 	java.o \
 	location.o \
 	replace.o \
+	locks.o \
 	signals.o
 
 all: jsvc libservice.a
diff --git a/src/native/unix/native/Tomcat.sh b/src/native/unix/native/Tomcat.sh
index c4333c7..3765fb4 100755
--- a/src/native/unix/native/Tomcat.sh
+++ b/src/native/unix/native/Tomcat.sh
@@ -1,19 +1,20 @@
 #!/bin/sh
 ##############################################################################
 #
-#   Copyright 2001-2004 The Apache Software Foundation.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 ##############################################################################
 #
diff --git a/src/native/unix/native/Tomcat5.sh b/src/native/unix/native/Tomcat5.sh
index 1f631ed..a2b3460 100755
--- a/src/native/unix/native/Tomcat5.sh
+++ b/src/native/unix/native/Tomcat5.sh
@@ -1,19 +1,20 @@
 #!/bin/sh
 ##############################################################################
 #
-#   Copyright 2004 The Apache Software Foundation.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 ##############################################################################
 #
 # Small shell script to show how to start/stop Tomcat using jsvc
diff --git a/src/native/unix/native/arguments.c b/src/native/unix/native/arguments.c
index 72f5ec5..8ecf039 100644
--- a/src/native/unix/native/arguments.c
+++ b/src/native/unix/native/arguments.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: arguments.c 396993 2006-04-25 21:50:36Z jfclere $ */
+/* @version $Id: arguments.c 909069 2010-02-11 16:43:36Z mturk $ */
 #include "jsvc.h"
 
 /* Return the argument of a command line option */
@@ -55,6 +56,7 @@ static arg_data *parse(int argc, char *argv[]) {
     args->anum=0;               /* Zero class specific arguments but make room*/
     args->outfile="/dev/null";   /* Swallow by default */
     args->errfile="/dev/null";   /* Swallow by default */
+    args->redirectstdin=true;    /* Redirect stdin to /dev/null by default */
     args->args=(char **)malloc(argc*sizeof(char *));
     args->procname = "jsvc.exec";
     /* Set up the command name */
@@ -134,6 +136,9 @@ static arg_data *parse(int argc, char *argv[]) {
         } else if (strcmp(argv[x],"-nodetach")==0) {
             args->dtch=false;
 
+        } else if (strcmp(argv[x], "-keepstdin")==0) {
+           args->redirectstdin = false;
+
         } else if (strcmp(argv[x],"-service")==0) {
             args->service=true;
 
@@ -181,9 +186,6 @@ static arg_data *parse(int argc, char *argv[]) {
 
         } else if (strstr(argv[x],"-D")==argv[x]) {
             temp=strchr(argv[x],'=');
-            if (temp==NULL) {
-                log_debug("Parameter -D must contain one '=' character");
-            }
             if (temp==argv[x]+2) {
                 log_error("A property name must be specified before '='");
                 return(NULL);
@@ -198,21 +200,21 @@ static arg_data *parse(int argc, char *argv[]) {
 
         } else if (strcmp(argv[x],"-procname") == 0) {
             args->procname = optional(argc, argv, x++);
-            if( args->procname == NULL) {
+            if (args->procname == NULL) {
               log_error("Invalid process name specified");
               return (NULL);
             }
 
-	/* -agentlib: -agentpath: -javaagent: 1.5.x JVM */
+    /* -agentlib: -agentpath: -javaagent: 1.5.x JVM */
         } else if (strstr(argv[x],"-agentlib:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-agentpath:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-javaagent:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-")==argv[x]) {
             log_error("Invalid option %s",argv[x]);
             return(NULL);
@@ -269,8 +271,6 @@ arg_data *arguments(int argc, char *argv[]) {
     }
 
     if (log_debug_flag==true) {
-        char *temp;
-
         log_debug("+-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------");
 
         log_debug("| Detach:          %s",IsTrueFalse(args->dtch));
diff --git a/src/native/unix/native/arguments.h b/src/native/unix/native/arguments.h
index 60886b6..e240382 100644
--- a/src/native/unix/native/arguments.h
+++ b/src/native/unix/native/arguments.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: arguments.h 165124 2005-04-28 09:36:02Z jfclere $ */
+/* @version $Id: arguments.h 897073 2010-01-08 01:10:29Z sebb $ */
 #ifndef __JSVC_ARGUMENTS_H__
 #define __JSVC_ARGUMENTS_H__
 
@@ -67,6 +68,8 @@ typedef struct {
     char *errfile;
     /** Program name for Linux **/
     char *procname;
+    /** Whether to redirect stdin to /dev/null or not. Defaults to true **/
+    bool redirectstdin;
 } arg_data;
 
 /**
diff --git a/src/native/unix/native/arguments.o b/src/native/unix/native/arguments.o
new file mode 100644
index 0000000..a331600
Binary files /dev/null and b/src/native/unix/native/arguments.o differ
diff --git a/src/native/unix/native/debug.c b/src/native/unix/native/debug.c
index 32dc8cb..7f19705 100644
--- a/src/native/unix/native/debug.c
+++ b/src/native/unix/native/debug.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: debug.c 165119 2005-04-28 09:00:08Z jfclere $ */
+/* @version $Id: debug.c 480469 2006-11-29 08:22:04Z bayard $ */
 #include "jsvc.h"
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/src/native/unix/native/debug.h b/src/native/unix/native/debug.h
index a8fd994..e450b07 100644
--- a/src/native/unix/native/debug.h
+++ b/src/native/unix/native/debug.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: debug.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: debug.h 480469 2006-11-29 08:22:04Z bayard $ */
 #ifndef __JSVC_DEBUG_H__
 #define __JSVC_DEBUG_H__
 
diff --git a/src/native/unix/native/debug.o b/src/native/unix/native/debug.o
new file mode 100644
index 0000000..1bd0bfd
Binary files /dev/null and b/src/native/unix/native/debug.o differ
diff --git a/src/native/unix/native/dso-dlfcn.c b/src/native/unix/native/dso-dlfcn.c
index 827abd1..d6569db 100644
--- a/src/native/unix/native/dso-dlfcn.c
+++ b/src/native/unix/native/dso-dlfcn.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso-dlfcn.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: dso-dlfcn.c 909069 2010-02-11 16:43:36Z mturk $ */
 #include "jsvc.h"
 
 #ifdef DSO_DLFCN
@@ -25,7 +26,7 @@ bool ld_library_path_set=false;
 #endif /* ifdef OS_LINUX */
 
 /* Initialize all DSO stuff */
-bool dso_init() {
+bool dso_init(void) {
     return(true);
 }
 
@@ -48,7 +49,7 @@ void *dso_symbol(dso_handle hdl, const char *nam) {
 }
 
 /* Return the error message from dlopen */
-char *dso_error() {
+char *dso_error(void) {
     return(dlerror());
 }
 
diff --git a/src/native/unix/native/dso-dlfcn.o b/src/native/unix/native/dso-dlfcn.o
new file mode 100644
index 0000000..c58762e
Binary files /dev/null and b/src/native/unix/native/dso-dlfcn.o differ
diff --git a/src/native/unix/native/dso-dyld.c b/src/native/unix/native/dso-dyld.c
index 649ad82..c697fde 100644
--- a/src/native/unix/native/dso-dyld.c
+++ b/src/native/unix/native/dso-dyld.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso-dyld.c 351602 2005-12-02 05:28:57Z billbarker $ */
+/* @version $Id: dso-dyld.c 480469 2006-11-29 08:22:04Z bayard $ */
 #include "jsvc.h"
 
 #ifdef DSO_DYLD
diff --git a/src/native/unix/native/dso-dyld.o b/src/native/unix/native/dso-dyld.o
new file mode 100644
index 0000000..226898f
Binary files /dev/null and b/src/native/unix/native/dso-dyld.o differ
diff --git a/src/native/unix/native/dso.h b/src/native/unix/native/dso.h
index 4023cec..ab17f49 100644
--- a/src/native/unix/native/dso.h
+++ b/src/native/unix/native/dso.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,15 +14,25 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: dso.h 909069 2010-02-11 16:43:36Z mturk $ */
+#ifndef __JSVC_DSO_H__
+#define __JSVC_DSO_H__
+
 #include "jsvc.h"
 
 /**
  * A library handle represents a unique pointer to its location in memory.
  */
+#ifdef DSO_DYLD
+#include <mach-o/dyld.h>
+#endif
 typedef void *dso_handle;
 
 bool dso_init(void);
 dso_handle dso_link(const char *pth);
 bool dso_unlink(dso_handle lib);
 void *dso_symbol(dso_handle lib, const char *nam);
+char *dso_error(void);
+
+#endif /* __JSVC_DSO_H__ */
+
diff --git a/src/native/unix/native/help.c b/src/native/unix/native/help.c
index f5c444d..699a812 100644
--- a/src/native/unix/native/help.c
+++ b/src/native/unix/native/help.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: help.c 232775 2005-08-15 08:50:17Z jfclere $ */
+/* @version $Id: help.c 911007 2010-02-17 14:58:48Z mturk $ */
 #include "jsvc.h"
 
 void help(home_data *data) {
@@ -89,5 +90,12 @@ void help(home_data *data) {
     printf("    -stop\n");
     printf("        stop the service using the file given in the -pidfile option\n");
 
+    printf("    -keepstdin\n");
+    printf("        does not redirect stdin to /dev/null\n");
+
+    printf("\njsvc (Apache Commons Daemon) " JSVC_VERSION_STRING "\n");
+    printf("Copyright (c) 1999-2010 Apache Software Foundation.\n");
+
     printf("\n");
 }
+
diff --git a/src/native/unix/native/help.h b/src/native/unix/native/help.h
index 2c46c64..e71b3e3 100644
--- a/src/native/unix/native/help.h
+++ b/src/native/unix/native/help.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,5 +14,11 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: help.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: help.h 909069 2010-02-11 16:43:36Z mturk $ */
+#ifndef __JSVC_HELP_H__
+#define __JSVC_HELP_H__
+
 void help(home_data *data);
+
+#endif /* __JSVC_HELP_H__ */
+
diff --git a/src/native/unix/native/help.o b/src/native/unix/native/help.o
new file mode 100644
index 0000000..ee3c49d
Binary files /dev/null and b/src/native/unix/native/help.o differ
diff --git a/src/native/unix/native/home.c b/src/native/unix/native/home.c
index f57131c..4591a47 100644
--- a/src/native/unix/native/home.c
+++ b/src/native/unix/native/home.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: home.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: home.c 480469 2006-11-29 08:22:04Z bayard $ */
 #include "jsvc.h"
 
 /* Check if a path is a directory */
diff --git a/src/native/unix/native/home.h b/src/native/unix/native/home.h
index 6415f28..131fbf5 100644
--- a/src/native/unix/native/home.h
+++ b/src/native/unix/native/home.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: home.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: home.h 480469 2006-11-29 08:22:04Z bayard $ */
 #ifndef __JSVC_HOME_H__
 #define __JSVC_HOME_H__
 
diff --git a/src/native/unix/native/home.o b/src/native/unix/native/home.o
new file mode 100644
index 0000000..ffb817c
Binary files /dev/null and b/src/native/unix/native/home.o differ
diff --git a/src/native/unix/native/java.c b/src/native/unix/native/java.c
index 678a1f8..de94312 100644
--- a/src/native/unix/native/java.c
+++ b/src/native/unix/native/java.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: java.c 354472 2005-12-06 16:48:47Z jfclere $ */
+/* @version $Id: java.c 909069 2010-02-11 16:43:36Z mturk $ */
 #include "jsvc.h"
 
 #ifdef OS_CYGWIN
@@ -44,8 +45,8 @@ static void shutdown(JNIEnv *env, jobject source, jboolean reload) {
     if (reload==TRUE) main_reload();
     else main_shutdown();
 }
-/* Automaticly restart when the JVM crashes */
-static void java_abort123()
+/* Automatically restart when the JVM crashes */
+static void java_abort123(void)
 {
     exit(123);
 }
@@ -130,9 +131,10 @@ bool java_init(arg_data *args, home_data *data) {
        MacOS/X actually has two libraries, one with the REAL vm, and one for
        the VM startup.
        before JVM 1.4.1 The first one (libappshell.dyld) contains CreateVM
-       after JVM 1.4.1 The library name is libjvm_compat.dylib.
+       JVM 1.4.1 through 1.5.* The library name is libjvm_compat.dylib
+       starting with JVM 1.6 on OS X 10.6 the library name is libverify.dylib.
     */
-    if (replace(appf,1024,"$JAVA_HOME/../Libraries/libappshell.dylib",
+        if (replace(appf,1024,"$JAVA_HOME/../Libraries/libappshell.dylib",
                  "$JAVA_HOME",data->path)!=0) {
         log_error("Cannot replace values in loader library");
         return(false);
@@ -144,6 +146,13 @@ bool java_init(arg_data *args, home_data *data) {
             return(false);
         }
     }
+    if (stat(appf, &sb)) {
+        if (replace(appf,1024,"$JAVA_HOME/../Libraries/libverify.dylib",
+                    "$JAVA_HOME",data->path)!=0) {
+            log_error("Cannot replace values in loader library");
+            return(false);
+        }
+    }
     apph=dso_link(appf);
     if (apph==NULL) {
         log_error("Cannot load required shell library %s",appf);
@@ -172,8 +181,8 @@ bool java_init(arg_data *args, home_data *data) {
     /* Prepare the VM initialization arguments */
     
     /*
-    	Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
-    	is specified. So use JNI_VERSION_1_4 if we can.
+        Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
+        is specified. So use JNI_VERSION_1_4 if we can.
     */
     #if defined(JNI_VERSION_1_4)
         arg.version=JNI_VERSION_1_4;
diff --git a/src/native/unix/native/java.h b/src/native/unix/native/java.h
index 75d0bb1..c2bcb73 100644
--- a/src/native/unix/native/java.h
+++ b/src/native/unix/native/java.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,9 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: java.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: java.h 909069 2010-02-11 16:43:36Z mturk $ */
+#ifndef __JSVC_JAVA_H__
+#define __JSVC_JAVA_H__
 
 #define LOADER "org/apache/commons/daemon/support/DaemonLoader"
 
@@ -26,3 +29,6 @@ bool java_stop(void);
 bool java_version(void);
 bool java_check(arg_data *args);
 bool JVM_destroy(int exit);
+
+#endif /* __JSVC_JAVA_H__ */
+
diff --git a/src/native/unix/native/java.o b/src/native/unix/native/java.o
new file mode 100644
index 0000000..096d3fe
Binary files /dev/null and b/src/native/unix/native/java.o differ
diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c
index 8fb222e..6f39365 100644
--- a/src/native/unix/native/jsvc-unix.c
+++ b/src/native/unix/native/jsvc-unix.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: jsvc-unix.c 397516 2006-04-27 10:36:27Z jfclere $ */
+/* @version $Id: jsvc-unix.c 909380 2010-02-12 12:21:15Z mturk $ */
 #include "jsvc.h"
 
 #include <signal.h>
@@ -43,7 +44,7 @@ extern char **environ;
 
 static mode_t envmask; /* mask to create the files */
 
-pid_t controlled=0; /* the son process pid */
+pid_t controlled=0; /* the child process pid */
 static bool stopping=false;
 static bool doreload=false;
 static void (*handler_int)(int)=NULL;
@@ -132,10 +133,10 @@ static int set_user_group(char *user, int uid, int gid)
             } else
                 log_debug("Cannot set supplement group list for user '%s'",user);
         }
-	if (getuid() == uid) {
+        if (getuid() == uid) {
             log_debug("No need to change user to '%s'!",user);
-            return(0);
-	}
+             return(0);
+        }
         if (setuid(uid)!=0) {
             log_error("Cannot set user id for user '%s'",user);
             return(-1);
@@ -157,10 +158,13 @@ static int set_user_group(char *user, int uid, int gid)
                 (1 << CAP_DAC_OVERRIDE)
 /* That a more reasonable configuration */
 #define CAPS    (1 << CAP_NET_BIND_SERVICE)+ \
+                (1 << CAP_DAC_READ_SEARCH)+ \
                 (1 << CAP_SETUID)+ \
                 (1 << CAP_SETGID)
 /* probably the only one Java could use */
-#define CAPSMIN (1 << CAP_NET_BIND_SERVICE)
+#define CAPSMIN (1 << CAP_NET_BIND_SERVICE)+ \
+                (1 << CAP_DAC_READ_SEARCH)
+
 static int set_caps(int caps)
 {
     struct __user_cap_header_struct caphead;
@@ -181,19 +185,22 @@ static int set_caps(int caps)
 }
 static int linuxset_user_group(char *user, int uid, int gid)
 {
+    int caps_set = 0;
     /* set capabilities enough for binding port 80 setuid/getuid */
-    if (set_caps(CAPS)!=0) {
-        if (getuid()!= uid) {
-            log_error("set_caps(CAPS) failed");
+    if (getuid() == 0) {
+        if (set_caps(CAPS)!=0) {
+            if (getuid()!= uid) {
+                log_error("set_caps(CAPS) failed");
+                return(-1);
+            }
+            log_debug("set_caps(CAPS) failed");
+        }
+        /* make sure they are kept after setuid */ 
+        if (prctl(PR_SET_KEEPCAPS,1,0,0,0) < 0) {
+            log_error("prctl failed in linuxset_user_group");
             return(-1);
         }
-        log_debug("set_caps(CAPS) failed");
-    }
-
-    /* make sure they are kept after setuid */ 
-    if (prctl(PR_SET_KEEPCAPS,1,0,0,0) < 0) {
-        log_error("prctl failed in linuxset_user_group");
-        return(-1);
+        caps_set = 1;
     }
 
     /* set setuid/getuid */
@@ -202,13 +209,15 @@ static int linuxset_user_group(char *user, int uid, int gid)
         return(-1);
     }
 
-    /* set capability to binding port 80 read conf */
-    if (set_caps(CAPSMIN)!=0) {
-        if (getuid()!= uid) {
-            log_error("set_caps(CAPSMIN) failed");
-            return(-1);
+    if (caps_set) {
+        /* set capability to binding port 80 read conf */
+        if (set_caps(CAPSMIN)!=0) {
+            if (getuid()!= uid) {
+                log_error("set_caps(CAPSMIN) failed");
+                return(-1);
+            }
+            log_debug("set_caps(CAPSMIN) failed");
         }
-        log_debug("set_caps(CAPSMIN) failed");
     }
 
     return(0);
@@ -266,7 +275,7 @@ static bool checkuser(char *user, uid_t *uid, gid_t *gid) {
 }
 
 #ifdef OS_CYGWIN
-static void cygwincontroller() {
+static void cygwincontroller(void) {
     raise(SIGTERM);
 }
 #endif
@@ -377,8 +386,8 @@ static int get_pidf(arg_data *args) {
  * /tmp/pid.jsvc_up
  * Notes:
  * we fork several times
- * 1 - to be a daemon before the setsid(), the son is the controler process.
- * 2 - to start the JVM in the son process. (whose pid is stored in pidfile).
+ * 1 - to be a daemon before the setsid(), the child is the controler process.
+ * 2 - to start the JVM in the child process. (whose pid is stored in pidfile).
  */
 static int check_tmp_file(arg_data *args) {
     int pid;
@@ -491,7 +500,7 @@ static int stop_child(arg_data *args) {
 }
 
 /*
- * son process logic.
+ * child process logic.
  */
 
 static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid) {
@@ -516,7 +525,7 @@ static int child(arg_data *args, home_data *data, uid_t uid, gid_t gid) {
 #ifdef OS_LINUX
     /* setuid()/setgid() only apply the current thread so we must do it now */
     if (linuxset_user_group(args->user,uid,gid)!=0)
-            return(4);
+        return(4);
 #endif
     /* Initialize the Java VM */
     if (java_init(args,data)!=true) {
@@ -618,8 +627,11 @@ static FILE *loc_freopen(char *outfile, char *mode, FILE *stream)
 /**
  *  Redirect stdin, stdout, stderr.
  */
-static void set_output(char *outfile, char *errfile) {
-    freopen("/dev/null", "r", stdin); 
+static void set_output(char *outfile, char *errfile, bool redirectstdin) {
+    if (redirectstdin==true) {
+        freopen("/dev/null", "r", stdin);
+    }
+
     log_debug("redirecting stdout to %s and stderr to %s",outfile,errfile);
 
     /* make sure the debug goes out */
@@ -750,7 +762,7 @@ int main(int argc, char *argv[]) {
     }
 
     envmask = umask(0077);
-    set_output(args->outfile, args->errfile);
+    set_output(args->outfile, args->errfile, args->redirectstdin);
 
     /* We have to fork: this process will become the controller and the other
        will be the child */
diff --git a/src/native/unix/native/jsvc-unix.o b/src/native/unix/native/jsvc-unix.o
new file mode 100644
index 0000000..ad73d52
Binary files /dev/null and b/src/native/unix/native/jsvc-unix.o differ
diff --git a/src/native/unix/native/jsvc.h b/src/native/unix/native/jsvc.h
index 0117179..696ca98 100644
--- a/src/native/unix/native/jsvc.h
+++ b/src/native/unix/native/jsvc.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: jsvc.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: jsvc.h 911007 2010-02-17 14:58:48Z mturk $ */
 #ifndef __JSVC_H__
 #define __JSVC_H__
 
@@ -25,11 +26,16 @@
 #include <sys/stat.h>
 
 /* Definitions for booleans */
+#ifdef OS_DARWIN
+#include <stdbool.h>
+#else
 typedef enum {
     false,
     true
 } bool;
+#endif
 
+#include "version.h"
 #include "debug.h"
 #include "arguments.h"
 #include "home.h"
@@ -38,9 +44,12 @@ typedef enum {
 #include "dso.h"
 #include "java.h"
 #include "help.h"
+#include "signals.h"
+#include "locks.h"
 
 int main(int argc, char *argv[]);
 void main_reload(void);
 void main_shutdown(void);
 
 #endif /* ifndef __JSVC_H__ */
+
diff --git a/src/native/unix/native/libservice.a b/src/native/unix/native/libservice.a
new file mode 100644
index 0000000..e58c1fd
Binary files /dev/null and b/src/native/unix/native/libservice.a differ
diff --git a/src/native/unix/native/location.c b/src/native/unix/native/location.c
index 7dcbb69..93ea1c8 100644
--- a/src/native/unix/native/location.c
+++ b/src/native/unix/native/location.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: location.c 410151 2006-05-29 20:45:22Z jfclere $ */
+/* @version $Id: location.c 480469 2006-11-29 08:22:04Z bayard $ */
 #include "jsvc.h"
 
 /* Locations of various JVM files. We have to deal with all this madness since
diff --git a/src/native/unix/native/location.h b/src/native/unix/native/location.h
index 43ed596..77327a4 100644
--- a/src/native/unix/native/location.h
+++ b/src/native/unix/native/location.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,10 +14,16 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: location.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: location.h 909069 2010-02-11 16:43:36Z mturk $ */
+#ifndef __JSVC_LOCATION_H__
+#define __JSVC_LOCATION_H__
+
 #include "jsvc.h"
 
 extern char *location_home[];
 extern char *location_jvm_cfg[];
 extern char *location_jvm_default[];
 extern char *location_jvm_configured[];
+
+#endif /* __JSVC_LOCATION_H__ */
+
diff --git a/src/native/unix/native/location.o b/src/native/unix/native/location.o
new file mode 100644
index 0000000..2208d93
Binary files /dev/null and b/src/native/unix/native/location.o differ
diff --git a/src/native/unix/native/dso.h b/src/native/unix/native/locks.c
similarity index 54%
copy from src/native/unix/native/dso.h
copy to src/native/unix/native/locks.c
index 4023cec..e123d1a 100644
--- a/src/native/unix/native/dso.h
+++ b/src/native/unix/native/locks.c
@@ -13,15 +13,37 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id$ */
+
+/*
+ * as Cygwin does not support lockf, jsvc uses fcntl to emulate it.
+ */
+#ifdef OS_CYGWIN
 #include "jsvc.h"
+#include <sys/fcntl.h>
 
-/**
- * A library handle represents a unique pointer to its location in memory.
+/*
+ * File locking routine
  */
-typedef void *dso_handle;
+int lockf(int fildes, int function, off_t size)
+{
+    struct flock buf;
+
+    switch (function) {
+    case F_LOCK:
+        buf.l_type = F_WRLCK;
+        break;
+    case F_ULOCK:
+        buf.l_type = F_UNLCK;
+        break;
+    default:
+        return -1;
+    }
+    buf.l_whence = 0;
+    buf.l_start = 0;
+    buf.l_len = size;
+
+    return fcntl(fildes, F_SETLK, &buf);
+}
 
-bool dso_init(void);
-dso_handle dso_link(const char *pth);
-bool dso_unlink(dso_handle lib);
-void *dso_symbol(dso_handle lib, const char *nam);
+#endif
diff --git a/src/native/unix/native/locks.h b/src/native/unix/native/locks.h
new file mode 100644
index 0000000..7cbb9cf
--- /dev/null
+++ b/src/native/unix/native/locks.h
@@ -0,0 +1,39 @@
+/*
+   Copyright 2001-2004 The Apache Software Foundation.
+ 
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+ 
+       http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+/* @version $Id$ */
+#ifndef __JSVC_LOCKS_H__
+#define __JSVC_LOCKS_H__
+
+/*
+ * as Cygwin does not support locks, jsvc use NT API to emulate them.
+ */
+#ifdef OS_CYGWIN
+
+#define F_ULOCK 0       /* Unlock a previously locked region */
+#define F_LOCK  1       /* Lock a region for exclusive use */
+
+/*
+ * allow a file to be locked
+ * @param fildes an open file descriptor
+ * @param function a control value that specifies  the action to be taken
+ * @param size number of bytes to lock
+ * @return Zero on success, a value less than 0 if an error was encountered
+ */
+int lockf(int fildes, int function, off_t size);
+
+#endif
+#endif /* __JSVC_LOCKS_H__ */
+
diff --git a/src/native/unix/native/locks.o b/src/native/unix/native/locks.o
new file mode 100644
index 0000000..23a3f05
Binary files /dev/null and b/src/native/unix/native/locks.o differ
diff --git a/src/native/unix/native/replace.c b/src/native/unix/native/replace.c
index bae7154..1ba722d 100644
--- a/src/native/unix/native/replace.c
+++ b/src/native/unix/native/replace.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: replace.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: replace.c 480469 2006-11-29 08:22:04Z bayard $ */
 #include "jsvc.h"
 
 /* Replace all occurrences of a string in another */
diff --git a/src/native/unix/native/replace.h b/src/native/unix/native/replace.h
index 8f310a2..e239e53 100644
--- a/src/native/unix/native/replace.h
+++ b/src/native/unix/native/replace.h
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: replace.h 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: replace.h 480469 2006-11-29 08:22:04Z bayard $ */
 #ifndef __JSVC_REPLACE_H__
 #define __JSVC_REPLACE_H__
 
diff --git a/src/native/unix/native/replace.o b/src/native/unix/native/replace.o
new file mode 100644
index 0000000..c807036
Binary files /dev/null and b/src/native/unix/native/replace.o differ
diff --git a/src/native/unix/native/signals.c b/src/native/unix/native/signals.c
index 162cff7..1c03d32 100644
--- a/src/native/unix/native/signals.c
+++ b/src/native/unix/native/signals.c
@@ -1,9 +1,10 @@
 /*
-   Copyright 2001-2004 The Apache Software Foundation.
- 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
@@ -13,17 +14,17 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: signals.c 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: signals.c 909069 2010-02-11 16:43:36Z mturk $ */
 
 /*
- * as Windows does not support signal, jsvc use event to emulate them.
+ * as Windows does not support signal, jsvc uses events to emulate them.
  * The supported signal is SIGTERM.
  * The kills.c contains the kill logic.
  */
 #ifdef OS_CYGWIN
 #include <windows.h>
 #include <stdio.h>
-static void (*HandleTerm)()=NULL; /* address of the handler routine. */
+static void (*HandleTerm)(void)=NULL; /* address of the handler routine. */
 
 /*
  * Event handling routine
@@ -50,7 +51,7 @@ HANDLE hevint; /* make a local copy because the parameter is shared! */
  * set a routine handler for the signal
  * note that it cannot be used to change the signal handler
  */
-int SetTerm(void (*func)())
+int SetTerm(void (*func)(void))
 {
 char Name[256];
 HANDLE hevint, hthread;
@@ -80,7 +81,7 @@ SECURITY_DESCRIPTOR sd;
   /*  It works also with NULL instead &sa!! */
   hevint = CreateEvent(&sa,FALSE, FALSE,Name);
 
-  HandleTerm = (int (*)()) func;
+  HandleTerm = func;
 
   if (hevint == NULL) return(-1); /* failed */
 
diff --git a/src/native/unix/native/dso.h b/src/native/unix/native/signals.h
similarity index 54%
copy from src/native/unix/native/dso.h
copy to src/native/unix/native/signals.h
index 4023cec..fcf982c 100644
--- a/src/native/unix/native/dso.h
+++ b/src/native/unix/native/signals.h
@@ -13,15 +13,22 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 */
-/* @version $Id: dso.h 155409 2005-02-26 12:57:06Z dirkv $ */
-#include "jsvc.h"
+/* @version $Id$ */
+#ifndef __JSVC_SIGNALS_H__
+#define __JSVC_SIGNALS_H__
 
-/**
- * A library handle represents a unique pointer to its location in memory.
+/*
+ * as Windows does not support signal, jsvc use event to emulate them.
+ * The supported signal is SIGTERM.
+ */
+#ifdef OS_CYGWIN
+/*
+ * set a routine handler for the signal
+ * note that it cannot be used to change the signal handler
+ * @param func The function to call on termination
+ * @return Zero on success, a value less than 0 if an error was encountered
  */
-typedef void *dso_handle;
+int SetTerm(void (*func)(void));
 
-bool dso_init(void);
-dso_handle dso_link(const char *pth);
-bool dso_unlink(dso_handle lib);
-void *dso_symbol(dso_handle lib, const char *nam);
+#endif
+#endif /* ifndef __JSVC_SIGNALS_H__ */
diff --git a/src/native/unix/native/signals.o b/src/native/unix/native/signals.o
new file mode 100644
index 0000000..1926287
Binary files /dev/null and b/src/native/unix/native/signals.o differ
diff --git a/src/native/unix/native/version.h b/src/native/unix/native/version.h
new file mode 100644
index 0000000..82540ad
--- /dev/null
+++ b/src/native/unix/native/version.h
@@ -0,0 +1,63 @@
+/*
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+ 
+       http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+#ifndef __VERSION_H__
+#define __VERSION_H__
+
+/**
+ * Major API changes that could cause compatibility problems for older
+ * programs such as structure size changes.  No binary compatibility is
+ * possible across a change in the major version.
+ */
+#define JSVC_MAJOR_VERSION      1
+
+/**
+ * Minor API changes that do not cause binary compatibility problems.
+ * Should be reset to 0 when upgrading JSVC_MAJOR_VERSION
+ */
+#define JSVC_MINOR_VERSION      0
+
+/** patch level */
+#define JSVC_PATCH_VERSION      2
+
+/**
+ *  This symbol is defined for internal, "development" copies of JSVC.
+ *  This symbol will be #undef'd for releases.
+ */
+#define JSVC_IS_DEV_VERSION     0
+
+/** Properly quote a value as a string in the C preprocessor */
+#define JSVC_STRINGIFY(n) JSVC_STRINGIFY_HELPER(n)
+/** Helper macro for JSVC_STRINGIFY */
+#define JSVC_STRINGIFY_HELPER(n) #n
+
+
+/** The formatted string of APU's version */
+#define JSVC_VERSION_STRING \
+     JSVC_STRINGIFY(JSVC_MAJOR_VERSION) "."   \
+     JSVC_STRINGIFY(JSVC_MINOR_VERSION) "."   \
+     JSVC_STRINGIFY(JSVC_PATCH_VERSION)       \
+     JSVC_IS_DEV_STRING
+
+/** Internal: string form of the "is dev" flag */
+#if JSVC_IS_DEV_VERSION
+#define JSVC_IS_DEV_STRING "-dev"
+#else
+#define JSVC_IS_DEV_STRING ""
+#endif
+
+#endif /* __VERSION_H__ */
+
diff --git a/src/native/unix/support/apfunctions.m4 b/src/native/unix/support/apfunctions.m4
index 703f09f..1d8dd74 100644
--- a/src/native/unix/support/apfunctions.m4
+++ b/src/native/unix/support/apfunctions.m4
@@ -1,9 +1,10 @@
 dnl
-dnl Copyright 1999-2004 The Apache Software Foundation
-dnl
-dnl Licensed under the Apache License, Version 2.0 (the "License");
-dnl you may not use this file except in compliance with the License.
-dnl You may obtain a copy of the License at
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
 dnl
 dnl     http://www.apache.org/licenses/LICENSE-2.0
 dnl
@@ -16,7 +17,7 @@ dnl
 
 dnl -------------------------------------------------------------------------
 dnl Author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-dnl Version $Id: apfunctions.m4 140756 2004-02-27 08:40:46Z jfclere $
+dnl Version $Id: apfunctions.m4 480469 2006-11-29 08:22:04Z bayard $
 dnl -------------------------------------------------------------------------
 
 AC_DEFUN(AP_MSG_HEADER,[
diff --git a/src/native/unix/support/apjava.m4 b/src/native/unix/support/apjava.m4
index 4e3070e..eafda99 100644
--- a/src/native/unix/support/apjava.m4
+++ b/src/native/unix/support/apjava.m4
@@ -1,9 +1,10 @@
 dnl
-dnl Copyright 1999-2004 The Apache Software Foundation
-dnl
-dnl Licensed under the Apache License, Version 2.0 (the "License");
-dnl you may not use this file except in compliance with the License.
-dnl You may obtain a copy of the License at
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
 dnl
 dnl     http://www.apache.org/licenses/LICENSE-2.0
 dnl
@@ -16,7 +17,7 @@ dnl
 
 dnl -------------------------------------------------------------------------
 dnl Author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-dnl Version $Id: apjava.m4 396916 2006-04-25 17:04:38Z jfclere $
+dnl Version $Id: apjava.m4 480469 2006-11-29 08:22:04Z bayard $
 dnl -------------------------------------------------------------------------
 
 AC_DEFUN([AP_PROG_JAVAC_WORKS],[
diff --git a/src/native/unix/support/apsupport.m4 b/src/native/unix/support/apsupport.m4
index ddd30e8..0787c11 100644
--- a/src/native/unix/support/apsupport.m4
+++ b/src/native/unix/support/apsupport.m4
@@ -1,9 +1,10 @@
 dnl
-dnl Copyright 1999-2004 The Apache Software Foundation
-dnl
-dnl Licensed under the Apache License, Version 2.0 (the "License");
-dnl you may not use this file except in compliance with the License.
-dnl You may obtain a copy of the License at
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
 dnl
 dnl     http://www.apache.org/licenses/LICENSE-2.0
 dnl
@@ -16,7 +17,7 @@ dnl
 
 dnl -------------------------------------------------------------------------
 dnl Author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-dnl Version $Id: apsupport.m4 410153 2006-05-29 21:05:17Z jfclere $
+dnl Version $Id: apsupport.m4 751284 2009-03-07 15:41:45Z markt $
 dnl -------------------------------------------------------------------------
 
 AC_DEFUN(AP_SUPPORTED_HOST,[
@@ -24,7 +25,7 @@ AC_DEFUN(AP_SUPPORTED_HOST,[
 
   case $host_os in
   darwin*)
-    CFLAGS="$CFLAGS -DOS_DARWIN -DDSO_DYLD"
+    CFLAGS="$CFLAGS -DOS_DARWIN -DDSO_DLFCN"
     supported_os="darwin"
     ;;
   solaris*)
@@ -64,6 +65,10 @@ AC_DEFUN(AP_SUPPORTED_HOST,[
     LDFLAGS="$LDFLAGS -pthread"
     LIBS="$LIBS -lpthread"
     ;;
+  aix5*)
+    CFLAGS="$CFLAGS -DOS_AIX -DDSO_DLFCN"
+    LDFLAGS="$LDFLAGS -ldl"
+    ;;
   *)
     AC_MSG_RESULT([failed])
     AC_MSG_ERROR([Unsupported operating system "$host_os"])
diff --git a/src/native/unix/support/buildconf.sh b/src/native/unix/support/buildconf.sh
index 839c21c..81aae6b 100755
--- a/src/native/unix/support/buildconf.sh
+++ b/src/native/unix/support/buildconf.sh
@@ -1,22 +1,22 @@
 #!/bin/sh
 # 
-#   Copyright 1999-2004 The Apache Software Foundation
-# 
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-# 
-#       http://www.apache.org/licenses/LICENSE-2.0
-# 
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 # @author  Pier Fumagalli <mailto:pier.fumagalli at eng.sun.com>
-# @version $Id: buildconf.sh 191365 2005-06-19 21:57:53Z billbarker $
+# @version $Id: buildconf.sh 480475 2006-11-29 08:31:47Z bayard $
 
 # The cache of automake always brings problems when changing *.m4 files.
 rm -rf autom4te.cache
diff --git a/src/native/unix/support/install.sh b/src/native/unix/support/install.sh
index 6c4d358..bd23820 100755
--- a/src/native/unix/support/install.sh
+++ b/src/native/unix/support/install.sh
@@ -1,18 +1,19 @@
 #!/bin/sh
 #
-#   Copyright 1999-2004 The Apache Software Foundation
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 ##
 ##  install.sh -- install a program, script or datafile
diff --git a/src/samples/AloneDaemon.sh b/src/samples/AloneDaemon.sh
index b3f9c9b..d0ba86e 100755
--- a/src/samples/AloneDaemon.sh
+++ b/src/samples/AloneDaemon.sh
@@ -1,19 +1,19 @@
 #!/bin/sh
 # 
-#   Copyright 1999-2004 The Apache Software Foundation
-# 
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-# 
-#       http://www.apache.org/licenses/LICENSE-2.0
-# 
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 # Small shell script to show how to start the sample services.
 # That is for linux, if your are using cygwin look to ServiceDaemon.sh.
diff --git a/src/samples/AloneService.java b/src/samples/AloneService.java
index 1f54687..2d766aa 100644
--- a/src/samples/AloneService.java
+++ b/src/samples/AloneService.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: AloneService.java 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: AloneService.java 897078 2010-01-08 01:52:47Z sebb $ */
 
 import java.io.*;
 import java.net.*;
@@ -55,7 +56,7 @@ public class AloneService {
         prop = new ExtendedProperties("startfile");
 
         /* create an array to store the processes */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
             e.next();
             i++;
@@ -79,7 +80,7 @@ public class AloneService {
         System.err.println("ServiceDaemon: starting");
 
         /* Start */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
            String name = (String) e.next();
            System.err.println("ServiceDaemon: starting: " + name + " : " + prop.getString(name));
diff --git a/src/samples/Native.c b/src/samples/Native.c
index 540254a..953539f 100644
--- a/src/samples/Native.c
+++ b/src/samples/Native.c
@@ -1,9 +1,9 @@
-/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -31,10 +31,10 @@ extern "C" {
  */
 JNIEXPORT void JNICALL Java_SimpleDaemon_toto
   (JNIEnv *env, jclass class) {
-	int i;
-	i = -1;
-	memcpy(&i, &i, i);
-	memset(&i, ' ', 1024);
+    int i;
+    i = -1;
+    memcpy(&i, &i, i);
+    memset(&i, ' ', 1024);
 }
  
 #ifdef __cplusplus
diff --git a/src/samples/Native.sh b/src/samples/Native.sh
index afce3e5..79eb3ec 100644
--- a/src/samples/Native.sh
+++ b/src/samples/Native.sh
@@ -1,9 +1,9 @@
-## Copyright 2000-2005 The Apache Software Foundation or its licensors, as
-## applicable.
-##
-## Licensed under the Apache License, Version 2.0 (the "License");
-## you may not use this file except in compliance with the License.
-## You may obtain a copy of the License at
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
 ##
 ##     http://www.apache.org/licenses/LICENSE-2.0
 ##
diff --git a/src/samples/README.txt b/src/samples/README.txt
index 804a072..1cf23ac 100644
--- a/src/samples/README.txt
+++ b/src/samples/README.txt
@@ -18,7 +18,7 @@ services support under win NT/2000/XP.
 (See in ../native/nt/README how to install jsvc as a service in win32).
 
 It uses jakarta Commons Collections:
-http://jakarta.apache.org/commons/collections/
+http://commons.apache.org/collections/
 To use it you need at least commons-collections-1.0
 Check in build.xml that the property commons-collections.jar correspond to thei
 location of your commons-collections.jar file.
diff --git a/src/samples/ServiceDaemon.java b/src/samples/ServiceDaemon.java
index e1dd758..3a3ebf1 100644
--- a/src/samples/ServiceDaemon.java
+++ b/src/samples/ServiceDaemon.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: ServiceDaemon.java 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: ServiceDaemon.java 897078 2010-01-08 01:52:47Z sebb $ */
 
 import java.io.*;
 import java.net.*;
@@ -61,7 +62,7 @@ public class ServiceDaemon implements Daemon {
         prop = new ExtendedProperties("startfile");
 
         /* create an array to store the processes */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
             e.next();
             i++;
@@ -85,7 +86,7 @@ public class ServiceDaemon implements Daemon {
         System.err.println("ServiceDaemon: starting");
 
         /* Start */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
            String name = (String) e.next();
            System.err.println("ServiceDaemon: starting: " + name + " : " + prop.getString(name));
diff --git a/src/samples/ServiceDaemon.sh b/src/samples/ServiceDaemon.sh
index 86f166b..0576955 100755
--- a/src/samples/ServiceDaemon.sh
+++ b/src/samples/ServiceDaemon.sh
@@ -1,19 +1,19 @@
 #!/bin/sh
 # 
-#   Copyright 1999-2004 The Apache Software Foundation
-# 
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-# 
-#       http://www.apache.org/licenses/LICENSE-2.0
-# 
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 # Small shell script to show how to start the sample services.
 #
diff --git a/src/samples/ServiceDaemonReadThread.java b/src/samples/ServiceDaemonReadThread.java
index 79299ad..05e6ba2 100644
--- a/src/samples/ServiceDaemonReadThread.java
+++ b/src/samples/ServiceDaemonReadThread.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: ServiceDaemonReadThread.java 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: ServiceDaemonReadThread.java 480469 2006-11-29 08:22:04Z bayard $ */
 import java.io.InputStream;
 import java.io.IOException;
 import java.lang.Thread;
diff --git a/src/samples/SimpleDaemon.java b/src/samples/SimpleDaemon.java
index 846e136..d902951 100644
--- a/src/samples/SimpleDaemon.java
+++ b/src/samples/SimpleDaemon.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: SimpleDaemon.java 397480 2006-04-27 08:58:27Z jfclere $ */
+/* @version $Id: SimpleDaemon.java 480469 2006-11-29 08:22:04Z bayard $ */
 
 import java.io.*;
 import java.net.*;
diff --git a/src/samples/SimpleDaemon.sh b/src/samples/SimpleDaemon.sh
index 3747c62..480da8f 100755
--- a/src/samples/SimpleDaemon.sh
+++ b/src/samples/SimpleDaemon.sh
@@ -1,19 +1,19 @@
 #!/bin/sh
 #
-#   Copyright 1999-2005 The Apache Software Foundation
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
 # Small shell script to show how to start the sample services.
 #
diff --git a/src/samples/build.xml b/src/samples/build.xml
index 8587a4b..eb2eb20 100644
--- a/src/samples/build.xml
+++ b/src/samples/build.xml
@@ -1,3 +1,20 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
 <project name="daemons samples" default="jars" basedir=".">
 
 <!-- ========== Initialize Properties ===================================== -->
diff --git a/xdocs/images/logo.gif b/src/site/resources/images/logo.gif
similarity index 100%
rename from xdocs/images/logo.gif
rename to src/site/resources/images/logo.gif
diff --git a/xdocs/images/logo.png b/src/site/resources/images/logo.png
similarity index 100%
rename from xdocs/images/logo.png
rename to src/site/resources/images/logo.png
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644
index 0000000..b506693
--- /dev/null
+++ b/src/site/site.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project name="Daemon">
+    <bannerRight>
+        <name>Commons Daemon</name>
+        <src>/images/logo.png</src>
+        <href>/index.html</href>
+    </bannerRight>
+
+    <body>
+        <menu name="Daemon">
+            <item name="Overview"                href="/index.html"/>
+            <item name="Download"                href="http://commons.apache.org/downloads/download_daemon.cgi"/>
+            <item name="Procrun"                 href="/procrun.html"/>
+            <item name="Jsvc"                    href="/jsvc.html"/>
+            <item name="Native binaries"         href="/binaries.html"/>
+            <item name="FAQ"                     href="/faq.html"/>
+            <item name="Wiki"                    href="http://wiki.apache.org/commons/Daemon"/>
+        </menu>
+
+        <menu name="Development">
+            <item name="Mailing Lists"           href="/mail-lists.html"/>
+            <item name="Issue Tracking"          href="/issue-tracking.html"/>
+            <item name="Source Repository"       href="/source-repository.html"/>
+            <item name="Javadoc (SVN latest)"    href="apidocs/index.html"/>
+        </menu>
+
+    </body>
+
+</project>
diff --git a/src/site/xdoc/binaries.xml b/src/site/xdoc/binaries.xml
new file mode 100644
index 0000000..9954de6
--- /dev/null
+++ b/src/site/xdoc/binaries.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+
+ <properties>
+  <title>Daemon : binaries</title>
+  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
+ </properties>
+
+<body>
+<section name="What to download?">
+<p>
+In the directory
+<a href="http://www.apache.org/dist/commons/daemon/binaries/">binaries</a>
+you will find subdirectories containing executables
+corresponding to your operating system. If your machine is not in the list,
+please mail us and we will try to make it available, or you can try to build it on your own.
+The files are compressed tar files. They are named <code>jvm_name-os_name</code>.
+For example: In the directory <code>freebsd</code> we have <code>jdk1.4.1-FreeBSD_4.9.tar.gz</code>
+That is a file built on FreeBSD 4.9 using the FreeBSD JVM 1.4.1.
+</p>
+</section>
+
+<section name="How do I get the executable?">
+<subsection name="jsvc">
+<p>
+Do the following:
+<ul>
+  <li>Find the tar file corresponding to your configuration.</li>
+  <li>Download it.</li>
+  <li>Uncompress the tar file and extract it (better with gnu tar).</li>
+  <li>Copy the executable to the location where you want to run it.</li>
+  <li>Write an rc shell
+     (see in <code>src/samples</code> and <code>src/native/unix/native/Tomcat.sh</code>)
+     to get your java application started as a daemon.
+  </li>
+</ul>
+</p>
+</subsection>
+<subsection name="procrun">
+<p>
+The <code>procrun.exe</code> has to be installed as a service
+(see <a href="procrun.html">procrun</a> for more information).
+</p>
+</subsection>
+</section>
+
+</body>
+</document>
diff --git a/src/site/xdoc/download_daemon.xml b/src/site/xdoc/download_daemon.xml
new file mode 100644
index 0000000..11f03f6
--- /dev/null
+++ b/src/site/xdoc/download_daemon.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+ +======================================================================+
+ |****                                                              ****|
+ |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
+ |****                    DO NOT EDIT DIRECTLY                      ****|
+ |****                                                              ****|
+ +======================================================================+
+ | TEMPLATE FILE: download-page-template.xml                            |
+ | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ |                                                                      |
+ | 1) Re-generate using: mvn commons:download-page                      |
+ |                                                                      |
+ | 2) Set the following properties in the component's pom:              |
+ |    - commons.componentid (required, alphabetic, lower case)          |
+ |    - commons.release.version (required)                              |
+ |    - commons.binary.suffix (optional)                                |
+ |      (defaults to "-bin", set to "" for pre-maven2 releases)         |
+ |                                                                      |
+ | 3) Example Properties                                                |
+ |                                                                      |
+ |  <properties>                                                        |
+ |    <commons.componentid>math</commons.componentid>                   |
+ |    <commons.release.version>1.2</commons.release.version>            |
+ |  </properties>                                                       |
+ |                                                                      |
+ +======================================================================+
+-->
+<document>
+  <properties>
+    <title>Download Commons Daemon</title>
+    <author email="dev at commons.apache.org">Commons Documentation Team</author>
+  </properties>
+  <body>
+    <section name="Download Commons Daemon">
+      <p>
+        We recommend you use a mirror to download our release
+        builds, but you <strong>must</strong> verify the integrity of
+        the downloaded files using signatures downloaded from our main 
+        distribution directories. Recent releases (48 hours) may not yet
+        be available from the mirrors.
+      </p>
+
+      <p>
+        You are currently using <b>[preferred]</b>.  If you
+        encounter a problem with this mirror, please select another
+        mirror.  If all mirrors are failing, there are <i>backup</i>
+        mirrors (at the end of the mirrors list) that should be
+        available.
+        <br></br>
+        [if-any logo]<a href="[link]"><img align="right" src="[logo]" border="0"></img></a>[end]
+      </p>
+
+      <form action="[location]" method="get" id="SelectMirror">
+        <p>
+          Other mirrors: 
+          <select name="Preferred">
+          [if-any http]
+            [for http]<option value="[http]">[http]</option>[end]
+          [end]
+          [if-any ftp]
+            [for ftp]<option value="[ftp]">[ftp]</option>[end]
+          [end]
+          [if-any backup]
+            [for backup]<option value="[backup]">[backup] (backup)</option>[end]
+          [end]
+          </select>
+          <input type="submit" value="Change"></input>
+        </p>
+      </form>
+
+      <p>
+        The <code>KEYS</code> link links to the code signing keys used to sign the product.
+        The <code>PGP</code> link downloads the OpenPGP compatible signature from our main site. 
+        The <code>MD5</code> link downloads the checksum from the main site.
+      </p>
+
+      <p>
+        For more information concerning Commons Daemon, see the 
+        <a href="index.html" class="name">Commons Daemon</a> web site.
+      </p>
+
+      <p>
+        <div class="links"><span class="link"><a href="http://www.apache.org/dist/commons/KEYS">KEYS</a></span></div>
+        <ul class="downloads">
+          <li class="group"><div class="links"><span class="label">Binary</span></div>
+            <ul>
+              <li class="download"><a href="[preferred]/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz">1.0.2.tar.gz</a>
+                <ul class="attributes">
+                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz.md5">md5</a>]</span>
+                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.tar.gz.asc">pgp</a>]</span>
+                  </li>
+                </ul>
+              </li>
+              <li class="download"><a href="[preferred]/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip">1.0.2.zip</a>
+                <ul class="attributes">
+                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip.md5">md5</a>]</span>
+                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.2-bin.zip.asc">pgp</a>]</span>
+                  </li>
+                </ul>
+              </li>
+            </ul>
+          </li>
+          <li class="group"><div class="links"><span class="label">Source</span></div>
+            <ul>
+              <li class="download"><a href="[preferred]/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz">1.0.2.tar.gz</a>
+                <ul class="attributes">
+                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz.md5">md5</a>]</span>
+                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.tar.gz.asc">pgp</a>]</span>
+                  </li>
+                </ul>
+              </li>
+              <li class="download"><a href="[preferred]/commons/daemon/source/commons-daemon-1.0.2-src.zip">1.0.2.zip</a>
+                <ul class="attributes">
+                  <li><span class="md5">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.zip.md5">md5</a>]</span>
+                      <span class="pgp">[<a href="http://www.apache.org/dist/commons/daemon/source/commons-daemon-1.0.2-src.zip.asc">pgp</a>]</span>
+                  </li>
+                </ul>
+              </li>
+            </ul>
+          </li>
+          <li class="download"><a href="[preferred]/commons/daemon/">browse download area</a></li>
+          <li><a href="http://archive.apache.org/dist/commons/daemon/">archives...</a></li>
+        </ul>
+      </p>
+    </section>
+  </body>
+</document>
diff --git a/xdocs/faq.xml b/src/site/xdoc/faq.xml
similarity index 77%
rename from xdocs/faq.xml
rename to src/site/xdoc/faq.xml
index 5cd55ba..c1f2f2d 100644
--- a/xdocs/faq.xml
+++ b/src/site/xdoc/faq.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
  
 <document>
  
diff --git a/xdocs/index.xml b/src/site/xdoc/index.xml
similarity index 62%
rename from xdocs/index.xml
rename to src/site/xdoc/index.xml
index bcc4683..409dca3 100644
--- a/xdocs/index.xml
+++ b/src/site/xdoc/index.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
  
 <document>
  
@@ -11,8 +27,8 @@
 <section name="Introduction">
 <p>
       Since 1994, the Java programming language evolved and became a
-      valid tool to develop, other than applets and client applications,
-      reliable and performant server applications. The major disadvantage of
+      valid tool to develop reliable and performant server applications as 
+      opposed to just applets and client applications. The major disadvantage of
       the Java platform is that still today the only portable way to
       start a Java application relies on a single point of entry: the
       <CODE><EM CLASS="key">public static void</EM>
@@ -40,19 +56,25 @@
       message to be issued. When the message is received, all operations
       required to shut down the server applications are performed and at the
       end the <CODE><EM CLASS="ref">System</EM>.exit</CODE> method is called
-      to terminate the Virtual Machine process. This method, however, implies
-      several disadvantages and risks: for example in case of a system-wide
-      shutdown, it might happen that the Virtual Machine process will be shut
-      down directly by the operating system, without notifying the running
-      server application. Or, for example, if an attacker finds out what is
-      the required message to send to the server, and discovers a way to send
-      this message to the running server application, he can easily interrupt
-      the operation of a server, bypassing all the security restrictions
+      to terminate the Virtual Machine process. This method however, has
+      several disadvantages and risks:
+      <ul>
+      <li>
+      In case of a system-wide shutdown, the Virtual Machine process may be
+      shut down directly by the operating system without notifying the running
+      server application.
+      </li>
+      <li>
+      If an attacker finds out the shutdown message to send to the server 
+      and discovers a way to send this message, he can easily interrupt
+      the server's operation, bypassing all the security restrictions
       implemented in the operating system.
+      </li>
+      </ul>
 </p>
 <p>
       Most multi-user operating systems already have a way in which server
-      applications are started and stopped, under Unix based operating systems
+      applications are started and stopped. Under Unix based operating systems
       non interactive server applications are called <em>daemons</em> and are
       controlled by the operating system with a set of specified
       <em>signals</em>. Under Windows such programs are called <em>services</em>
@@ -75,16 +97,16 @@
 
 <section name="Platforms">
 <p>
-      Actually win32 and the UNIX like platforms are supported.
-      For win32 platfroms use <a href="procrun.html">procrun</a>.
+      Both win32 and UNIX like platforms are supported.
+      For win32 platforms use <a href="procrun.html">procrun</a>.
       For UNIX like platforms use <a href="jsvc.html">jsvc</a>.
 </p>
 </section>
 <section name="Initial Source of the Package">
 
-<p>The original Java classes come from the Jakarta Tomcat 4.0 project.</p>
+<p>The original Java classes came from the Jakarta Tomcat 4.0 project.</p>
 
-<p>The proposed package name for the Daemon component is
+<p>The package name for the Daemon component is
 <code>org.apache.commons.daemon</code>.
 </p>
 </section>
diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml
new file mode 100644
index 0000000..2ad9465
--- /dev/null
+++ b/src/site/xdoc/issue-tracking.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+ +======================================================================+
+ |****                                                              ****|
+ |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
+ |****                    DO NOT EDIT DIRECTLY                      ****|
+ |****                                                              ****|
+ +======================================================================+
+ | TEMPLATE FILE: issue-tracking-template.xml                           |
+ | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ |                                                                      |
+ | 1) Re-generate using: mvn commons:jira-page                          |
+ |                                                                      |
+ | 2) Set the following properties in the component's pom:              |
+ |    - commons.jira.id  (required, alphabetic, upper case)             |
+ |    - commons.jira.pid (required, numeric)                            |
+ |                                                                      |
+ | 3) Example Properties                                                |
+ |                                                                      |
+ |  <properties>                                                        |
+ |    <commons.jira.id>MATH</commons.jira.id>                           |
+ |    <commons.jira.pid>12310485</commons.jira.pid>                     |
+ |  </properties>                                                       |
+ |                                                                      |
+ +======================================================================+
+-->
+<document>
+  <properties>
+    <title>Commons Daemon Issue tracking</title>
+    <author email="dev at commons.apache.org">Commons Documentation Team</author>
+  </properties>
+  <body>
+
+    <section name="Commons Daemon Issue tracking">
+      <p>
+      Commons Daemon uses <a href="http://issues.apache.org/jira/">ASF JIRA</a> for tracking issues.
+      See the <a href="http://issues.apache.org/jira/browse/DAEMON">Commons Daemon JIRA project page</a>.
+      </p>
+
+      <p>
+      To use JIRA you may need to <a href="http://issues.apache.org/jira/secure/Signup!default.jspa">create an account</a>
+      (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically
+      created and you can use the <a href="http://issues.apache.org/jira/secure/ForgotPassword!default.jspa">Forgot Password</a>
+      page to get a new password).
+      </p>
+
+      <p>
+      If you would like to report a bug, or raise an enhancement request with
+      Commons Daemon please do the following:
+      <ol>
+        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">Search existing open bugs</a>.
+            If you find your issue listed then please add a comment with your details.</li>
+        <li><a href="mail-lists.html">Search the mailing list archive(s)</a>.
+            You may find your issue or idea has already been discussed.</li>
+        <li>Decide if your issue is a bug or an enhancement.</li>
+        <li>Submit either a <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310468&issuetype=1&priority=4&assignee=-1">bug report</a>
+            or <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310468&issuetype=4&priority=4&assignee=-1">enhancement request</a>.</li>
+      </ol>
+      </p>
+
+      <p>
+      Please also remember these points:
+      <ul>
+        <li>the more information you provide, the better we can help you</li>
+        <li>test cases are vital, particularly for any proposed enhancements</li>
+        <li>the developers of Commons Daemon are all unpaid volunteers</li>
+      </ul>
+      </p>
+
+      <p>
+      For more information on subversion and creating patches see the
+      <a href="http://www.apache.org/dev/contributors.html">Apache Contributors Guide</a>.
+      </p>
+
+      <p>
+      You may also find these links useful:
+      <ul>
+        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">All Open Commons Daemon bugs</a></li>
+        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC&status=5&status=6">All Resolved Commons Daemon bugs</a></li>
+        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310468&sorter/field=issuekey&sorter/order=DESC">All Commons Daemon bugs</a></li>
+      </ul>
+      </p>
+    </section>
+  </body>
+</document>
diff --git a/xdocs/jsvc.xml b/src/site/xdoc/jsvc.xml
similarity index 64%
rename from xdocs/jsvc.xml
rename to src/site/xdoc/jsvc.xml
index 0989e00..7383935 100644
--- a/xdocs/jsvc.xml
+++ b/src/site/xdoc/jsvc.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 
 <document>
 
@@ -10,21 +26,25 @@
 <body>
 <section name="Introduction">
 <p>
-      Actualy only the UNIX like platforms are supported.
-      The sources are located in the src/native/unix subdirectory of the
-      project sources.
-      For win32 platfroms the cygwin emulation layer is used. See
-      <a href="http://www.cygwin.com/"> cygwin</a> for more informations.
+      Jsvc is a set of libraries and applications for making Java
+      applications run on UNIX more easily. It can run on win32 via
+      the cygwin emulation layer (see 
+      <a href="http://www.cygwin.com/"> cygwin</a> for more information),
+      however win32 users may prefer to use <a href="procrun.html"> procrun</a>
+      instead.
+</p>
+<p>
+      The sources are located in the src/native/unix subdirectory.
 </p>
 <p>
-      In the futur <a href="http://apr.apache.org/"> APR </a> may be used
-      to provide more convinient platform support.
+      In the future <a href="http://apr.apache.org/"> APR </a> may be used
+      to provide more portable platform support.
 </p>
 </section>
 
-<section name="Building from cvs">
+<section name="Building from source">
 <p>
-To build under an UNIX operating system you will need:
+To build under a UNIX operating system you will need:
 <ul>
   <li>GNU AutoConf (at least version 2.53)</li>
   <li>An ANSI-C compliant compiler (GCC is good)</li>
@@ -35,7 +55,10 @@ To build under an UNIX operating system you will need:
 
 You need to build the "configure" program with:
 
-   sh support/buildconf.sh
+<source>
+sh support/buildconf.sh
+</source>
+
 (Note it is possible to replace sh by any compatible shell like bash, ksh).
 
 The result should be something like:
@@ -47,35 +70,35 @@ Once the configure script is generated, follow the next section.
 </p>
 </section>
 
-<section name="Building for a release tarball">
+<section name="Building from a release tarball">
 <p>
-To build the binary under an UNIX operating system you will need:
+To build the binary under a UNIX operating system you will need:
 <ul>
   <li>An ANSI-C compliant compiler (GCC is good)</li>
   <li>GNU Make</li>
   <li>A Java Platform 2 compliant SDK</li>
 </ul>
 
-You have to specify the JAVA_HOME of the SDK
-either the --with-java=<dir> parameter or set the JAVA_HOME environment
+You have to specify the <code>JAVA_HOME</code> of the SDK
+either with the <code>--with-java=<dir></code> parameter or set the <code>JAVA_HOME</code> environment
 to point to your SDK installation. For example:
 <source>
-  ./configure --with-java=/usr/java
+./configure --with-java=/usr/java
 </source>
 or
 <source>
-  export JAVA_HOME
-  ./configure
+export JAVA_HOME
+./configure
 </source>
 
-If your operating system is supported, configure will go thru cleanly,
+If your operating system is supported, configure will go through cleanly,
 otherwise it will report an error (please send us the details of your
 OS/JDK, or a patch against the sources). To build the binaries and
 libraries simply do:
 <source>
-  make
+make
 </source>
-This will generate the executable file jsvc.
+This will generate the executable file <code>jsvc</code>.
 </p>
 </section>
 
@@ -124,6 +147,8 @@ Where options include:
         set a Java system property
     -X<option>
         set Virtual Machine specific option
+    -procname <process name>
+        Allows the process name to be configured on Linux
     -wait <waittime>
         wait waittime seconds for the service to start
         waittime should multiple of 10 (min=10)
@@ -137,19 +162,19 @@ Where options include:
 <section name="Using jsvc">
 <p>
 There two ways to use jsvc: via a Class that implements the Daemon interface or
-via  calling a Class that have the required methods.
+via calling a Class that has the required methods.
 For example Tomcat-4.1.x uses the Daemon interface
-and Tomcat-5.0.x provide a Class whose methods are called by jsvc directly.
+whereas Tomcat-5.0.x provides a Class whose methods are called by jsvc directly.
 </p>
 <subsection name="Via Daemon interface">
 <p>
-You have to do the following.
+Do the following:
 <ul>
   <li>Write a Class that implements the Daemon interface (MyClass).</li>
-  <li>Put it in the jarfile (my.jar).</li>
+  <li>Put it in a jarfile (my.jar).</li>
   <li>Call jsvc like:
   <source>
-    ./jsvc -cp commons-daemon.jar:my.jar MyClass
+./jsvc -cp commons-daemon.jar:my.jar MyClass
   </source>
   </li>
 </ul>
@@ -157,17 +182,17 @@ You have to do the following.
 </subsection>
 <subsection name="Directly">
 <p>
-You have to write a Class (MyClass) that implements the following methods:
+Write a Class (MyClass) that implements the following methods:
 <ul>
-  <li>void load(String[] arguments): Here open the configuration files, create the trace file, create
-      the ServerSockets, the Threads</li>
-  <li>void start(): Start the Thread, accept incomming connections</li>
-  <li>void stop(): Inform the Thread to live the run(), close the ServerSockets</li>
-  <li>void destroy(): Destroy any object created in init()</li>
+  <li>void init(String[] arguments): Here open configuration files, create a trace file, create
+      ServerSockets, Threads</li>
+  <li>void start(): Start the Thread, accept incoming connections</li>
+  <li>void stop(): Inform the Thread to terminate the run(), close the ServerSockets</li>
+  <li><code>void destroy()</code>: Destroy any object created in init()</li>
 </ul>
 Store it in a jarfile and use as above:
 <source>
-  ./jsvc -cp commons-daemon.jar:my.jar MyClass
+./jsvc -cp commons-daemon.jar:my.jar MyClass
 </source>
 </p>
 </subsection>
@@ -177,13 +202,13 @@ Store it in a jarfile and use as above:
 Jsvc uses 3 processes: a launcher process, a controller process and a controlled process.
 The controlled process is also the main java thread, if the JVM crashes
 the controller will restart it in the next minute.
-Jsvc is a daemon process so it should be started as root and the -user parameter
+Jsvc is a daemon process so it should be started as root and the <code>-user</code> parameter
 allows to downgrade to an unprivilegded user.
-When -wait parameter is used, the launcher process waits until the controller says
+When the <code>-wait</code> parameter is used, the launcher process waits until the controller says
 "I am ready", otherwise it returns after creating the controller process.
 </p>
 
-<subsection name="Forks in jakarta-daemon">
+<subsection name="Forks in commons-daemon">
 <p>
 Launcher process:
 <source>
@@ -224,9 +249,9 @@ Note: The controller process uses signals to stop the controlled process.
 
 <subsection name="Downgrading user">
 <p>
-On linux setuid()/setgid() + capabilities are used on other unix setgid/initgroups are used.
+On linux <code>setuid()</code>/<code>setgid()</code> + capabilities are used. On other unix <code>setgid</code>/<code>initgroups</code> are used.
 
-we have something like:
+We have something like:
 <source>
 /* as root */
 init_JVM().
diff --git a/xdocs/procrun.xml b/src/site/xdoc/procrun.xml
similarity index 83%
rename from xdocs/procrun.xml
rename to src/site/xdoc/procrun.xml
index 7d3fdd2..1727fc2 100644
--- a/xdocs/procrun.xml
+++ b/src/site/xdoc/procrun.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
 
 <document>
  <properties>
@@ -10,7 +26,7 @@
 <section name="Introduction">
 <p>
     Procrun is a set of libraries and applications for making Java
-    applications to run on WIN32 much easier.    
+    applications run on WIN32 more easily.
 </p> 
 <subsection name="Procrun service application">
 <p>
@@ -116,6 +132,12 @@
     <td>Service startup mode can be either <b>auto</b> or <b>manual</b></td>
     </tr>
     <tr>
+    <td>--Type</td>
+    <td></td>
+    <td>Service type can be <b>interactive</b> to Allow service to interact with desktop.
+    Use this option only with Local system accounts.</td>
+    </tr>
+    <tr>
     <td>--DependsOn</td>
     <td></td>
     <td>List of services that this service depend on. Dependent services
@@ -141,6 +163,20 @@
     <td>Password for user account set by --User parameter</td>
     </tr>
     <tr>
+    <td>--ServiceUser</td>
+    <td></td>
+    <td>Specifies the name of the account under which the service should run.
+        Use an account name in the form <i>DomainName\UserName</i>.
+        The service process will be logged on as this user.
+        if the account belongs to the built-in domain, you can specify <i>.\UserName</i> 
+    </td>
+    </tr>
+    <tr>
+    <td>--ServicePassword</td>
+    <td></td>
+    <td>Password for user account set by --ServiceUser parameter</td>
+    </tr>
+    <tr>
     <td>--JavaHome</td>
     <td>JAVA_HOME</td>
     <td>Set a different JAVA_HOME then defined by JAVA_HOME environment
@@ -157,7 +193,8 @@
     <td>-Xrs</td>
     <td>List of options in the form of <b>-D</b> or <b>-X</b> that will be
         passed to the JVM. The options are separated using either
-        <b>#</b> or <b>;</b> characters.</td>
+        <b>#</b> or <b>;</b> characters. if you need to embed either # or ;
+        character put them inside single quotes.</td>
     </tr>
     <tr>
     <td>--Classpath</td>
@@ -251,12 +288,12 @@
     </tr>
     <tr>
     <td>--LogPath</td>
-    <td>working path</td>
+    <td>%SystemRoot%\System\LogFiles\Apache</td>
     <td>Defines the path for logging</td>
     </tr>
     <tr>
     <td>--LogPrefix</td>
-    <td>jakarta_service</td>
+    <td>jakarta_service_</td>
     <td>Defines the service log filename</td>
     </tr>
     <tr>
diff --git a/src/test/org/apache/commons/daemon/SimpleDaemon.java b/src/test/org/apache/commons/daemon/SimpleDaemon.java
index bccbdf8..dd59008 100644
--- a/src/test/org/apache/commons/daemon/SimpleDaemon.java
+++ b/src/test/org/apache/commons/daemon/SimpleDaemon.java
@@ -1,9 +1,10 @@
 /*
- *  Copyright 1999-2004 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -14,7 +15,7 @@
  *  limitations under the License.
  */
 
-/* @version $Id: SimpleDaemon.java 155409 2005-02-26 12:57:06Z dirkv $ */
+/* @version $Id: SimpleDaemon.java 914997 2010-02-22 18:08:51Z sebb $ */
 
 package org.apache.commons.daemon;
 
@@ -33,7 +34,7 @@ public class SimpleDaemon implements Daemon, Runnable {
     private ServerSocket server=null;
     private Thread thread=null;
     private DaemonController controller=null;
-    private boolean stopping=false;
+    private volatile boolean stopping=false;
     private String directory=null;
     private Vector handlers=null;
 
diff --git a/xdocs/binaries.xml b/xdocs/binaries.xml
deleted file mode 100644
index 2afc143..0000000
--- a/xdocs/binaries.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
- 
-<document>
- 
- <properties>
-  <title>Daemon : binaries</title>
-  <author email="jfrederic.clere at fujitsu-siemens.con">Jean-Frederic Clere</author>
- </properties>
-
-<body>
-<section name="What to download">
-<p>
-In the directory
-<a href="http://www.apache.org/dist/jakarta/commons/daemon/binaries/">binaries</a>
-you found subdirectories containing executables
-corresponding to your operating system. If your machine is not in the list
-mail us we will try to make it available or try to build it on your own.
-The files are compressed tar files. They are named jvm_name-os_name.
-For example: In the directory freebsd we have jdk1.4.1-FreeBSD_4.9.tar.gz
-That a file build on FreeBSD 4.9 using the FreeBSD JVM 1.4.1.
-</p>
-</section>
-
-<section name="What to do to get the excutable">
-<subsection name="jsvc">
-<p>
-You have to do the following:
-<ul>
-  <li>Find the nearest tar file corresponding to our configuration.</li>
-  <li>Download it.</li>
-  <li>Uncompress the tar file and extract it (better with a gnu tar).</li>
-  <li>Copy the executable in the location where you want to run it.</li>
-  <li>Write a rc shell
-     (see in src/samples and src/native/unix/native/Tomcat.sh)
-     to get your java application started as a daemon.
-  </li>
-</ul>
-</p>
-</subsection>
-<subsection name="procrun">
-<p>
-The procrun.exe has to be installed as a service.
-(See  <a href="procrun.html">procrun</a> for more information.
-</p>
-</subsection>
-</section>
-
-</body>
-</document>
diff --git a/xdocs/navigation.xml b/xdocs/navigation.xml
deleted file mode 100644
index aa8ae0f..0000000
--- a/xdocs/navigation.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE org.apache.commons.menus SYSTEM '../../commons-build/menus/menus.dtd'>
-<project name="Daemon">
-
-  <title>Daemon</title>
-  <organizationLogo href="/images/jakarta-logo-blue.gif">
-   Jakarta
-  </organizationLogo>
-
-  <body>
-    <links>
-      <item name="Jakarta Commons"                   
-            href="http://jakarta.apache.org/commons/"/>
-    </links>
-
-    <menu name="Commons Daemon">
-      <item name="Overview"
-            href="/index.html"/>
-      <item name="Procrun"
-            href="/procrun.html"/>
-      <item name="Jsvc"
-            href="/jsvc.html"/>
-      <item name="Native binaries"
-            href="/binaries.html"/>
-      <item name="FAQ"
-            href="/faq.html"/>
-          
-    </menu>
-    
-    &common-menus;
-
-  </body>
-</project>
diff --git a/xdocs/style/project.css b/xdocs/style/project.css
deleted file mode 100644
index 031480c..0000000
--- a/xdocs/style/project.css
+++ /dev/null
@@ -1,5 +0,0 @@
-#banner, #banner td { 
- background: #fff;
- color: #000;
-}
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/commons-daemon.git



More information about the pkg-java-commits mailing list