diff --git a/jdk/make/java/jli/Makefile b/jdk/make/java/jli/Makefile index fb8868fd37dab991f1730a8e7e9ebdd70866fc71..236654fd4a9bd1d1eedabf46bf877efa580bd973 100644 --- a/jdk/make/java/jli/Makefile +++ b/jdk/make/java/jli/Makefile @@ -107,6 +107,7 @@ endif # PLATFORM ifeq ($(PLATFORM), windows) EXTRA_LIBS = advapi32.lib \ + comctl32.lib \ user32.lib JAVALIB = diff --git a/jdk/make/java/main/java/Makefile b/jdk/make/java/main/java/Makefile index ad924f6663e72df28eee5bb346e418381f6ff846..5c876294c98da4ea5aa0749fbb73483e1b25d2fd 100644 --- a/jdk/make/java/main/java/Makefile +++ b/jdk/make/java/main/java/Makefile @@ -43,7 +43,7 @@ include $(BUILDDIR)/common/Defs.gmk # Override the default version info with our own resource file (see 5106536) ifeq ($(PLATFORM), windows) -LDLIBS_COMMON += user32.lib +LDLIBS_COMMON += user32.lib comctl32.lib ifdef OPENJDK RC_FLAGS += -i "$(PLATFORM_SRC)/resource/icons" else diff --git a/jdk/make/java/main/javaw/Makefile b/jdk/make/java/main/javaw/Makefile index 9afb5d0133db74a76aedfc492b4591690c2e969f..1c03b23fab73e07d7436aa4ba1a44828257d0425 100644 --- a/jdk/make/java/main/javaw/Makefile +++ b/jdk/make/java/main/javaw/Makefile @@ -46,7 +46,7 @@ STATIC_JLI = true include $(BUILDDIR)/common/Defs.gmk OTHER_CPPFLAGS += -DJAVAW -LDLIBS_COMMON += user32.lib +LDLIBS_COMMON += user32.lib comctl32.lib # Override the default version info with our own resource file (see 5106536) ifeq ($(PLATFORM), windows) diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index 2e86de9a401a4e2b1cc08c8b434b71d449e4eee3..47c2fc17cd0cfd0fb5a19f19bef68e84fe1cf9f9 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -205,9 +205,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ _wc_enabled = cpwildcard; _ergo_policy = ergo; - if (javaw == JNI_TRUE) - SetJavaw(); - + InitLauncher(javaw); DumpState(); /* diff --git a/jdk/src/share/bin/java.h b/jdk/src/share/bin/java.h index c86c5d107db40bc68c6d096c40e6866886ef07e7..291b6755690bf836deffd7216cb1752e2c79da21 100644 --- a/jdk/src/share/bin/java.h +++ b/jdk/src/share/bin/java.h @@ -172,7 +172,6 @@ const char* GetDotVersion(); const char* GetFullVersion(); jboolean IsJavaArgs(); jboolean IsJavaw(); -void SetJavaw(); jint GetErgoPolicy(); jboolean ServerClassMachine(); @@ -180,5 +179,9 @@ jboolean ServerClassMachine(); static int ContinueInNewThread(InvocationFunctions* ifn, int argc, char** argv, char* jarfile, char* classname, int ret); +/* + * Initialize platform specific settings + */ +void InitLauncher(jboolean javaw); #endif /* _JAVA_H_ */ diff --git a/jdk/src/share/bin/main.c b/jdk/src/share/bin/main.c index 7052159f2672d7a4f12c69bf208c9aa011651ce1..88d9190a555eb86c99bd2c43bd2a3a60187db2b8 100644 --- a/jdk/src/share/bin/main.c +++ b/jdk/src/share/bin/main.c @@ -64,8 +64,6 @@ main(int argc, char ** argv) margv = argv; #endif /* JAVAW */ - JLI_SetTraceLauncher(); - return JLI_Launch(margc, margv, sizeof(const_jargs) / sizeof(char *), const_jargs, sizeof(const_appclasspath) / sizeof(char *), const_appclasspath, diff --git a/jdk/src/solaris/bin/java_md.c b/jdk/src/solaris/bin/java_md.c index 5d96c2780f009aa702428faca964fd4a0068a5d6..74dd1a3ef8ea4b07221ea5ee9bf0dbbdbe9a517e 100644 --- a/jdk/src/solaris/bin/java_md.c +++ b/jdk/src/solaris/bin/java_md.c @@ -1299,12 +1299,6 @@ void SetJavaLauncherPlatformProps() { AddOption(pid_prop_str, NULL); #endif } -void -SetJavaw() -{ - /* noop on UNIX */ - return; -} jboolean IsJavaw() @@ -1312,3 +1306,9 @@ IsJavaw() /* noop on UNIX */ return JNI_FALSE; } + +void +InitLauncher(jboolean javaw) +{ + JLI_SetTraceLauncher(); +} diff --git a/jdk/src/windows/bin/java_md.c b/jdk/src/windows/bin/java_md.c index 2e1c787838d1d1956fab5a8569352889fd0ee069..f252e0b1b3821815d3612a689ccb71fa5efabebe 100644 --- a/jdk/src/windows/bin/java_md.c +++ b/jdk/src/windows/bin/java_md.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "java.h" @@ -52,11 +53,6 @@ static jboolean GetJREPath(char *path, jint pathsize); static jboolean _isjavaw = JNI_FALSE; -void -SetJavaw() -{ - _isjavaw = JNI_TRUE; -} jboolean IsJavaw() @@ -999,3 +995,20 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void /* Linux only, empty on windows. */ void SetJavaLauncherPlatformProps() {} + +void +InitLauncher(boolean javaw) +{ + INITCOMMONCONTROLSEX icx; + + /* + * Required for javaw mode MessageBox output as well as for + * HotSpot -XX:+ShowMessageBoxOnError in java mode, an empty + * flag field is sufficient to perform the basic UI initialization. + */ + memset(&icx, 0, sizeof(INITCOMMONCONTROLSEX)); + icx.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitCommonControlsEx(&icx); + _isjavaw = javaw; + JLI_SetTraceLauncher(); +}