Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 71137 invoked from network); 21 Sep 2007 18:34:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Sep 2007 18:34:49 -0000 Received: (qmail 70566 invoked by uid 500); 21 Sep 2007 18:34:41 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 70479 invoked by uid 500); 21 Sep 2007 18:34:40 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 70470 invoked by uid 99); 21 Sep 2007 18:34:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Sep 2007 11:34:40 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Sep 2007 18:36:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 515E71A9832; Fri, 21 Sep 2007 11:34:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r578221 - in /harmony/enhanced/jdktools/trunk/modules/samsa: build.xml src/main/native/samsa/windows/javaw.c src/main/native/samsa/windows/makefile src/main/native/samsa/windows/makefile.javae src/main/native/samsa/windows/makefile.javaw Date: Fri, 21 Sep 2007 18:34:24 -0000 To: commits@harmony.apache.org From: apetrenko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070921183425.515E71A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrenko Date: Fri Sep 21 11:34:24 2007 New Revision: 578221 URL: http://svn.apache.org/viewvc?rev=578221&view=rev Log: Patch for HARMONY-4831 "[tools] jdk/bin/javaw.exe must be a windows application" Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c (with props) harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae (with props) harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw (with props) Modified: harmony/enhanced/jdktools/trunk/modules/samsa/build.xml harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile Modified: harmony/enhanced/jdktools/trunk/modules/samsa/build.xml URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/build.xml?rev=578221&r1=578220&r2=578221&view=diff ============================================================================== --- harmony/enhanced/jdktools/trunk/modules/samsa/build.xml (original) +++ harmony/enhanced/jdktools/trunk/modules/samsa/build.xml Fri Sep 21 11:34:24 2007 @@ -41,7 +41,7 @@ - + @@ -63,9 +63,6 @@ - - - @@ -83,14 +80,25 @@ + + + + + + + + + - + Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c?rev=578221&view=auto ============================================================================== --- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c (added) +++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c Fri Sep 21 11:34:24 2007 @@ -0,0 +1,60 @@ +/* + * 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. + */ + +#include +#include + +#define WEXE_POSTFIX "\\jre\\bin\\javaw.exe\" " + +char *getJDKRoot(); + +int WINAPI +WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, + int nShowCmd) +{ + PROCESS_INFORMATION procInfo; + STARTUPINFO startInfo; + DWORD res = 0; + char *jdkRoot = getJDKRoot(); + + char *exePath = (char *)malloc((strlen(jdkRoot)+strlen(WEXE_POSTFIX)+strlen(lpCmdLine)+2)*sizeof(char)); + exePath[0] = '\"'; + strcpy(exePath+1, jdkRoot); + strcat(exePath, WEXE_POSTFIX); + strcat(exePath, lpCmdLine); + + // create child process + memset(&procInfo, 0, sizeof(PROCESS_INFORMATION)); + memset(&startInfo, 0, sizeof(STARTUPINFO)); + startInfo.cb = sizeof(STARTUPINFO); + startInfo.wShowWindow = nShowCmd; + + if (!CreateProcess(NULL, exePath, NULL, NULL, TRUE, 0, NULL, NULL, &startInfo, &procInfo)) { + free(exePath); + return -1; + } + + free(exePath); + + WaitForSingleObject(procInfo.hProcess, INFINITE); + GetExitCodeProcess(procInfo.hProcess, &res); + + CloseHandle(procInfo.hProcess); + CloseHandle(procInfo.hThread); + + return (int)res; +} \ No newline at end of file Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile?rev=578221&r1=578220&r2=578221&view=diff ============================================================================== --- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile (original) +++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile Fri Sep 21 11:34:24 2007 @@ -17,15 +17,10 @@ # Makefile for module samsa # -!include <$(HY_HDK)\build\make\defines.mak> +all: + $(MAKE) /NOLOGO -f makefile.javae + $(MAKE) /NOLOGO -f makefile.javaw -EXENAME = samsa.exe -BUILDFILES = ..\samsa.obj -EXEFLAGS=$(conlflags) -subsystem:console -EXEDLLFILES=$(conlibsdll) - -VIRTFILES = -SYSLIBFILES = -MDLLIBFILES = - -!include <$(HY_HDK)\build\make\rules.mak> +clean: + $(MAKE) /NOLOGO -f makefile.javae clean + $(MAKE) /NOLOGO -f makefile.javaw clean Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae?rev=578221&view=auto ============================================================================== --- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae (added) +++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae Fri Sep 21 11:34:24 2007 @@ -0,0 +1,31 @@ +# 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. + +# +# Makefile for module samsa +# + +!include <$(HY_HDK)\build\make\defines.mak> + +EXENAME = samsa.exe +BUILDFILES = ..\samsa.obj +EXEFLAGS=$(conlflags) -subsystem:console +EXEDLLFILES=$(conlibsdll) + +VIRTFILES = +SYSLIBFILES = +MDLLIBFILES = + +!include <$(HY_HDK)\build\make\rules.mak> Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae ------------------------------------------------------------------------------ svn:eol-style = native Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw?rev=578221&view=auto ============================================================================== --- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw (added) +++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw Fri Sep 21 11:34:24 2007 @@ -0,0 +1,31 @@ +# 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. + +# +# Makefile for javaw +# + +!include <$(HY_HDK)\build\make\defines.mak> + +EXENAME = javaw.exe +BUILDFILES = javaw.obj ..\samsa.obj +EXEFLAGS=$(conlflags) -subsystem:windows +EXEDLLFILES=$(guilibsdll) + +VIRTFILES = +SYSLIBFILES = +MDLLIBFILES = + +!include <$(HY_HDK)\build\make\rules.mak> Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw ------------------------------------------------------------------------------ svn:eol-style = native