java_md.c revision 1892
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include <windows.h>
#include <io.h>
#include <process.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <jni.h>
#include "java.h"
#ifndef GAMMA
#include "version_comp.h"
#endif
#define JVM_DLL "jvm.dll"
#define JAVA_DLL "java.dll"
#define CRT_DLL "msvcr71.dll"
/*
* Prototypes.
*/
static void EnsureJreInstallation(const char *jrepath);
/* We supports warmup for UI stack that is performed in parallel
* to VM initialization.
* This helps to improve startup of UI application as warmup phase
* might be long due to initialization of OS or hardware resources.
* It is not CPU bound and therefore it does not interfere with VM init.
* Obviously such warmup only has sense for UI apps and therefore it needs
* to be explicitly requested by passing -Dsun.awt.warmup=true property
*
* Implementation launches new thread after VM starts and use it to perform
* warmup code (platform dependent).
* This thread is later reused as AWT toolkit thread as graphics toolkit
* often assume that they are used from the same thread they were launched on.
*
* At the moment we only support warmup for D3D. It only possible on windows
* and only if other flags do not prohibit this (e.g. OpenGL support requested).
*/
#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */
#ifdef _X86_ /* for now disable AWT preloading for 64bit */
#define ENABLE_AWT_PRELOAD
#endif
#endif
#ifdef ENABLE_AWT_PRELOAD
/* "AWT was preloaded" flag;
* Turned on by AWTPreload().
*/
int awtPreloaded = 0;
/* Calls a function with the name specified.
* The function must be int(*fn)(void).
*/
int AWTPreload(const char *funcName);
/* Stops AWT preloading. */
void AWTPreloadStop();
/* D3D preloading */
/* -1: not initialized; 0: OFF, 1: ON */
int awtPreloadD3D = -1;
/* Command line parameter to swith D3D preloading on. */
#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup"
#define PARAM_NODDRAW "-Dsun.java2d.noddraw"
#define PARAM_OPENGL "-Dsun.java2d.opengl"
#define D3D_PRELOAD_FUNC "preloadD3D"
/* Extracts value of a parameter with the specified name
* from command line argument (returns pointer in the argument).
* Returns NULL if the argument does not contains the parameter.
* e.g.:
* GetParamValue("theParam", "theParam=value") returns pointer to "value".
*/
// arg[nameLen] is valid (may contain final NULL)
}
}
return NULL;
}
/* Checks if commandline argument contains property specified
* Returns -1 if the argument does not contain the parameter;
* Returns 1 if the argument contains the parameter and its value is "true";
* Returns 0 if the argument contains the parameter and its value is "false".
*/
if (paramValue != NULL) {
return 1;
}
return 0;
}
}
return -1;
}
#endif /* ENABLE_AWT_PRELOAD */
const char *
GetArch()
{
#ifdef _M_AMD64
return "amd64";
return "ia64";
#else
return "i386";
#endif
}
/*
*
*/
void
char ***_argv,
char jrepath[],
char jvmpath[],
char **original_argv) {
#ifndef GAMMA
char * jvmtype;
/* Find out where the JRE is that we will be using. */
ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
JNI_TRUE);
exit(2);
}
/* Do this before we read jvm.cfg */
/* Find the specified JVM type */
ReportErrorMessage("Error: no known VMs. (check for corrupt jvm.cfg file)",
JNI_TRUE);
exit(1);
}
jvmpath[0] = '\0';
const char * format = "Error: no `%s' JVM at `%s'.";
exit(4);
}
/* If we got here, jvmpath has been correctly initialized. */
#else /* ifndef GAMMA */
/*
* gamma launcher is simpler in that it doesn't handle VM flavors, data
* model, etc. Assuming everything is set-up correctly
* all we need to do here is to return correct path names. See also
* GetJVMPath() and GetApplicationHome().
*/
{
ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
JNI_TRUE);
exit(2);
}
const char * format = "Error: no JVM at `%s'.";
exit(4);
}
}
#endif /* ifndef GAMMA */
}
static jboolean
{
// Only do this once
static int loaded = 0;
char crtpath[MAXPATHLEN];
if (!loaded) {
/*
* The Microsoft C Runtime Library needs to be loaded first. A copy is
* assumed to be present in the "JRE path" directory. If it is not found
* there (or "JRE path" fails to resolve), skip the explicit load and let
* nature take its course, which is likely to be a failure to execute.
*/
if (_launcher_debug) {
}
if (LoadLibrary(crtpath) == 0) {
return JNI_FALSE;
}
}
}
loaded = 1;
}
return JNI_TRUE;
}
/*
* The preJVMStart is a function in the jkernel.dll, which
* performs the final step of synthesizing back the decomposed
* modules (partial install) to the full JRE. Any tool which
* uses the JRE must peform this step to ensure the complete synthesis.
* The EnsureJreInstallation function calls preJVMStart based on
* the conditions outlined below, noting that the operation
* will fail silently if any of conditions are not met.
* NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg
* is read, since jvm.cfg will be modified by the preJVMStart.
* 1. Are we on a supported platform.
* 2. Find the location of the JRE or the Kernel JRE.
* 4. check jkernel.dll and invoke the entry-point
*/
static void
EnsureJreInstallation(const char* jrepath)
{
char tmpbuf[MAXPATHLEN];
struct stat s;
/* 32 bit windows only please */
if (_launcher_debug) {
printf("EnsureJreInstallation:unsupported platform\n");
}
return;
}
/* Does our bundle directory exist ? */
if (_launcher_debug) {
}
return;
}
/* Does our jkernel dll exist ? */
if (_launcher_debug) {
}
return;
}
/* The Microsoft C Runtime Library needs to be loaded first. */
if (!LoadMSVCRT()) {
if (_launcher_debug) {
printf("EnsureJreInstallation:could not load C runtime DLL\n");
}
return;
}
/* Load the jkernel.dll */
if (_launcher_debug) {
}
return;
}
/* Get the function address */
if (PreJVMStart == NULL) {
if (_launcher_debug) {
printf("EnsureJreInstallation:preJVMStart:function lookup failed\n");
}
return;
}
PreJVMStart();
if (_launcher_debug) {
printf("EnsureJreInstallation:preJVMStart:called\n");
}
return;
}
/*
* Find path to JRE based on .exe's location or registry settings.
*/
{
char javadll[MAXPATHLEN];
struct stat s;
/* Is JRE co-located with the application? */
goto found;
}
/* Does this app ship a private JRE in <apphome>\jre directory? */
goto found;
}
}
#ifndef GAMMA
/* Look for a public JRE on this machine. */
goto found;
}
#endif
return JNI_FALSE;
if (_launcher_debug)
return JNI_TRUE;
}
/*
* Given a JRE location and a JVM type, construct what the name the
* JVM shared library will be. Return true, if such a library
* exists, false otherwise.
*/
static jboolean
{
struct stat s;
#ifndef GAMMA
} else {
}
#else
/*
* For gamma launcher, JVM is either built-in or in the same directory.
* Either way we return "<exe_path>/jvm.dll" where <exe_path> is the
* directory where gamma launcher is located.
*/
char *p;
if (p) {
/* replace executable name with libjvm.so */
} else {
/* this case shouldn't happen */
}
#endif /* ifndef GAMMA */
return JNI_TRUE;
} else {
return JNI_FALSE;
}
}
/*
* Load a jvm from "jvmpath" and initialize the invocation functions.
*/
{
#ifdef GAMMA
/* JVM is directly linked with gamma launcher; no Loadlibrary() */
return JNI_TRUE;
#else
if (_launcher_debug) {
}
/* The Microsoft C Runtime Library needs to be loaded first. */
LoadMSVCRT();
/* Load the Java VM DLL */
return JNI_FALSE;
}
/* Now get the function addresses */
ifn->CreateJavaVM =
ReportErrorMessage2("Error: can't find JNI interfaces in: %s",
return JNI_FALSE;
}
return JNI_TRUE;
#endif /* ifndef GAMMA */
}
/*
* If app is "c:\foo\bin\javac", then put "c:\foo" into buf.
*/
{
#ifndef GAMMA
char *cp;
/* This happens if the application is in a drive root, and
* there is no bin directory. */
buf[0] = '\0';
return JNI_FALSE;
}
return JNI_TRUE;
#else /* ifndef GAMMA */
if (java_home_var == NULL) {
}
if (java_home_var == NULL) {
return JNI_FALSE;
}
return JNI_TRUE;
#endif /* ifndef GAMMA */
}
#ifdef JAVAW
int WINAPI
{
int ret;
return ret;
}
#endif
#ifndef GAMMA
/*
* Helpers to look in the registry for a public JRE.
*/
/* Same for 1.5.0, 1.5.1, 1.5.2 etc. */
#define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment"
static jboolean
{
return JNI_TRUE;
}
}
return JNI_FALSE;
}
static jboolean
{
char version[MAXPATHLEN];
/*
* Note: There is a very similar implementation of the following
* registry reading code in the Windows java control panel (javacp.cpl).
* If there are bugs here, a similar bug probably exists there. Hence,
* changes here require inspection there.
*/
/* Find the current version of the JRE */
return JNI_FALSE;
}
JRE_KEY "\\CurrentVersion\n");
return JNI_FALSE;
}
return JNI_FALSE;
}
/* Find directory where the current version is installed. */
return JNI_FALSE;
}
return JNI_FALSE;
}
if (_launcher_debug) {
char micro[MAXPATHLEN];
sizeof(micro))) {
printf("Warning: Can't read MicroVersion\n");
micro[0] = '\0';
}
}
return JNI_TRUE;
}
#endif /* ifndef GAMMA */
/*
* Support for doing cheap, accurate interval timing.
*/
static LARGE_INTEGER counterFrequency;
{
if (!counterInitialized) {
}
if (!counterAvailable) {
return 0;
}
}
{
if (!counterAvailable || !counterInitialized) {
return 0;
}
}
#ifdef JAVAW
}
#else
if (always) {
}
#endif
}
/*
* The format argument must be a printf format string with one %s
* argument, which is passed the string argument.
*/
#ifdef JAVAW
char * message;
}
#else
if (always) {
}
#endif
}
/*
* As ReportErrorMessage2 (above) except the system message (if any)
* associated with this error is written to a second %s format specifier
* in the format argument.
*/
int save_errno = errno;
int freeit = 0;
int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|
errtext = "";
n = 0;
} else {
freeit = 1;
if (n > 2) { /* Drop final CR, LF */
errtext[n] = '\0';
}
}
} else /* C runtime error that has no corresponding DOS error code */
#ifdef JAVAW
{
char * message;
}
}
#else
if (always) {
}
#endif
if (freeit)
}
#ifdef JAVAW
/*
* This code should be replaced by code which opens a window with
* the exception detail message.
*/
#else
#endif
}
/*
* Return JNI_TRUE for an option string that has no effect but should
* _not_ be passed on to the vm; return JNI_FALSE otherwise. On
* windows, there are no options that should be screened in this
* manner.
*/
#ifdef ENABLE_AWT_PRELOAD
if (awtPreloadD3D < 0) {
/* Tests the command line parameter only if not set yet. */
awtPreloadD3D = 1;
}
}
if (awtPreloadD3D != 0) {
/* Don't test the command line parameters if already disabled. */
{
awtPreloadD3D = 0;
}
}
#endif /* ENABLE_AWT_PRELOAD */
return JNI_FALSE;
}
void PrintMachineDependentOptions() {
return;
}
#ifndef GAMMA
#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
#endif
return result;
}
/*
* Determine if there is an acceptable JRE in the registry directory top_key.
* Upon locating the "best" one, return a fully qualified path to it.
* "Best" is defined as the most advanced JRE meeting the constraints
* contained in the manifest_info. If no JRE in this directory meets the
* constraints, return NULL.
*
* It doesn't matter if we get an error reading the registry, or we just
* don't find anything interesting in the directory. We just return NULL
* in either case.
*/
static char *
char name[MAXNAMELEN];
int len;
/*
* searching for the best available version.
*/
index++;
}
}
/*
* Extract "JavaHome" from the "best" registry directory and return
* that path. If no appropriate version was located, or there is an
* error in extracting the "JavaHome" string, return null.
*/
return (NULL);
else {
!= ERROR_SUCCESS) {
return (NULL);
}
len = MAXNAMELEN;
!= ERROR_SUCCESS) {
return (NULL);
}
return (JLI_StringDup(name));
}
}
/*
* This is the global entry point. It examines the host for the optimal
* JRE to be used by scanning a set of registry entries. This set of entries
* is hardwired on Windows as "Software\JavaSoft\Java Runtime Environment"
* under the set of roots "{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }".
*
* This routine simply opens each of these registry directories before passing
* control onto ProcessDir().
*/
char *
char *path;
int key_index;
== ERROR_SUCCESS)
return (path);
}
}
return NULL;
}
/*
* Local helper routine to isolate a single token (option or argument)
* from the command line.
*
* This routine accepts a pointer to a character pointer. The first
* token (as defined by MSDN command-line argument syntax) is isolated
* from that string.
*
* Upon return, the input character pointer pointed to by the parameter s
* is updated to point to the remainding, unscanned, portion of the string,
* or to a null character if the entire string has been consummed.
*
* This function returns a pointer to a null-terminated string which
* contains the isolated first token, or to the null character if no
* token could be isolated.
*
* Note the side effect of modifying the input string s by the insertion
* of a null character, making it two strings.
*
* See "Parsing C Command-Line Arguments" in the MSDN Library for the
* parsing rule details. The rule summary from that specification is:
*
* * Arguments are delimited by white space, which is either a space or a tab.
*
* * A string surrounded by double quotation marks is interpreted as a single
* argument, regardless of white space contained within. A quoted string can
* be embedded in an argument. Note that the caret (^) is not recognized as
* an escape character or delimiter.
*
* * A double quotation mark preceded by a backslash, \", is interpreted as a
* literal double quotation mark (").
*
* * Backslashes are interpreted literally, unless they immediately precede a
* double quotation mark.
*
* * If an even number of backslashes is followed by a double quotation mark,
* then one backslash (\) is placed in the argv array for every pair of
* backslashes (\\), and the double quotation mark (") is interpreted as a
* string delimiter.
*
* * If an odd number of backslashes is followed by a double quotation mark,
* then one backslash (\) is placed in the argv array for every pair of
* backslashes (\\) and the double quotation mark is interpreted as an
* escape sequence by the remaining backslash, causing a literal double
* quotation mark (") to be placed in argv.
*/
static char*
nextarg(char** s) {
char *p = *s;
char *head;
int slashes = 0;
int inquote = 0;
/*
* Strip leading whitespace, which MSDN defines as only space or tab.
* (Hence, no locale specific "isspace" here.)
*/
while (*p != (char)0 && (*p == ' ' || *p == '\t'))
p++;
head = p; /* Save the start of the token to return */
/*
* Isolate a token from the command line.
*/
p++;
else if (*p == '"')
}
/*
* If the token isolated isn't already terminated in a "char zero",
* then replace the whitespace character with one and move to the
* next character.
*/
if (*p != (char)0)
*p++ = (char)0;
/*
* Update the parameter to point to the head of the remaining string
* reflecting the command line and return a pointer to the leading
* token which was isolated from the command line.
*/
*s = p;
return (head);
}
/*
* Local helper routine to return a string equivalent to the input string
* s, but with quotes removed so the result is a string as would be found
* in argv[]. The returned string should be freed by a call to JLI_MemFree().
*
* The rules for quoting (and escaped quotes) are:
*
* 1 A double quotation mark preceded by a backslash, \", is interpreted as a
* literal double quotation mark (").
*
* 2 Backslashes are interpreted literally, unless they immediately precede a
* double quotation mark.
*
* 3 If an even number of backslashes is followed by a double quotation mark,
* then one backslash (\) is placed in the argv array for every pair of
* backslashes (\\), and the double quotation mark (") is interpreted as a
* string delimiter.
*
* 4 If an odd number of backslashes is followed by a double quotation mark,
* then one backslash (\) is placed in the argv array for every pair of
* backslashes (\\) and the double quotation mark is interpreted as an
* escape sequence by the remaining backslash, causing a literal double
* quotation mark (") to be placed in argv.
*/
static char*
unquote(const char *s) {
const char *p = s; /* Pointer to the tail of the original string */
while (*p != '\0') {
if (*p == '"') {
p++;
} else if (*p == '\\') {
const char *q = p + strspn(p,"\\");
if (*q == '"')
do {
*pun++ = '\\';
p += 2;
} while (*p == '\\' && p < q);
else
while (p < q)
*pun++ = *p++;
} else {
*pun++ = *p++;
}
}
*pun = '\0';
return un;
}
/*
* Given a path to a jre to execute, this routine checks if this process
* is indeed that jre. If not, it exec's that jre.
*
* We want to actually check the paths rather than just the version string
* built into the executable, so that given version specification will yield
* the exact same Java environment, regardless of the version of the arbitrary
* launcher we start with.
*/
void
int len;
char *progname;
/*
* Determine the executable we are building (or in the rare case, running).
*/
#ifdef JAVA_ARGS /* javac, jar and friends. */
progname = "java";
#else /* java, oldjava, javaw and friends */
#ifdef PROGNAME
#else
{
char *s;
progname = s + 1;
}
}
#endif /* PROGNAME */
#endif /* JAVA_ARGS */
/*
* Resolve the real path to the currently running launcher.
*/
"Unable to resolve path to current %s executable: %s",
exit(1);
}
if (_launcher_debug) {
}
/*
* If the path to the selected JRE directory is a match to the initial
* portion of the path to the currently executing JRE, we have a winner!
* If so, just return. (strnicmp() is the Windows equiv. of strncasecmp().)
*/
return; /* I am the droid you were looking for */
/*
* If this isn't the selected version, exec the selected version.
*/
/*
* Although Windows has an execv() entrypoint, it doesn't actually
* overlay a process: it can only create a new process and terminate
* the old process. Therefore, any processes waiting on the initial
* process wake up and they shouldn't. Hence, a chain of pseudo-zombie
* processes must be retained to maintain the proper wait semantics.
* Fortunately the image size of the launcher isn't too large at this
* time.
*
* If it weren't for this semantic flaw, the code below would be ...
*
* execv(path, argv);
* ReportErrorMessage2("Exec of %s failed\n", path, JNI_TRUE);
* exit(1);
*
* The incorrect exec semantics could be addressed by:
*
* exit((int)spawnv(_P_WAIT, path, argv));
*
* this from completely working. All the Windows POSIX process creation
* interfaces are implemented as wrappers around the native Windows
* function CreateProcess(). CreateProcess() takes a single string
* to specify command line options and arguments, so the POSIX routine
* wrappers build a single string from the argv[] array and in the
* process, any quoting information is lost.
*
* The solution to this to get the original command line, to process it
* to remove the new multiple JRE options (if any) as was done for argv
* in the common SelectVersion() routine and finally to pass it directly
* to the native CreateProcess() Windows process control interface.
*/
{
char *cmdline;
char *p;
char *np;
char *ocl;
char *ccl;
char *unquoted;
/*
* The following code block gets and processes the original command
* line, replacing the argv[0] equivalent in the command line with
* the path to the new executable and removing the appropriate
* Multiple JRE support options. Note that similar logic exists
* in the platform independent SelectVersion routine, but is
* replicated here due to the syntax of CreateProcess().
*
* The magic "+ 4" characters added to the command line length are
* 2 possible quotes around the path (argv[0]), a space after the
* path and a terminating null character.
*/
ocl = GetCommandLine();
else
while (*np != (char)0) { /* While more command-line */
if (*p != (char)0) { /* If a token was isolated */
if (*p != (char)0) /* If a token was isolated */
}
} else { /* End of options */
JLI_MemFree((void *)unquoted);
break;
}
JLI_MemFree((void *)unquoted);
}
}
JLI_MemFree((void *)ccl);
if (_launcher_debug) {
JLI_MemFree((void *)ccl);
}
/*
* The following code is modeled after a model presented in the
* Microsoft Technical Article "Moving Unix Applications to
* Windows NT" (March 6, 1994) and "Creating Processes" on MSDN
* (Februrary 2005). It approximates UNIX spawn semantics with
* the parent waiting for termination of the child.
*/
(DWORD)0, /* creation flags */
ReportSysErrorMessage2("CreateProcess(%s, ...) failed: %s",
exit(1);
}
exitCode = 1;
} else {
exitCode = 1;
}
}
}
#endif /* ifndef GAMMA */
/*
* Wrapper for platform dependent unsetenv function.
*/
int
{
int ret;
return (ret);
}
/* --- Splash Screen shared library support --- */
static const char* SPLASHSCREEN_SO = "\\bin\\splashscreen.dll";
void* SplashProcAddress(const char* name) {
return NULL;
}
return NULL;
}
if (!hSplashLib) {
}
if (hSplashLib) {
} else {
return NULL;
}
}
void SplashFreeLibrary() {
if (hSplashLib) {
hSplashLib = NULL;
}
}
const char *
return "%I64d";
}
/*
* Block current thread and continue execution in a new thread
*/
int
int rslt = 0;
unsigned thread_id;
#define STACK_SIZE_PARAM_IS_A_RESERVATION (0x10000)
#endif
/*
* STACK_SIZE_PARAM_IS_A_RESERVATION is what we want, but it's not
* supported on older version of Windows. Try first with the flag; and
* if that fails try again without the flag. See MSDN document or HotSpot
* source (os_win32.cpp) for details.
*/
(unsigned)stack_size,
args,
&thread_id);
if (thread_handle == NULL) {
(unsigned)stack_size,
args,
0,
&thread_id);
}
/* AWT preloading (AFTER main thread start) */
#ifdef ENABLE_AWT_PRELOAD
/* D3D preloading */
if (awtPreloadD3D != 0) {
char *envValue;
/* D3D routines checks env.var J2D_D3D if no appropriate
* command line params was specified
*/
awtPreloadD3D = 0;
}
/* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */
awtPreloadD3D = 0;
}
if (awtPreloadD3D < 0) {
/* If awtPreloadD3D is still undefined (-1), test
* if it is turned on by J2D_D3D_PRELOAD env.var.
* By default it's turned OFF.
*/
awtPreloadD3D = 0;
awtPreloadD3D = 1;
}
}
}
if (awtPreloadD3D) {
}
#endif /* ENABLE_AWT_PRELOAD */
if (thread_handle) {
} else {
}
#ifdef ENABLE_AWT_PRELOAD
if (awtPreloaded) {
}
#endif /* ENABLE_AWT_PRELOAD */
return rslt;
}
/* Linux only, empty on windows. */
void SetJavaLauncherPlatformProps() {}
//==============================
// AWT preloading
#ifdef ENABLE_AWT_PRELOAD
typedef int FnPreloadStart(void);
typedef void FnPreloadStop(void);
/*
* Starts AWT preloading
*/
int AWTPreload(const char *funcName)
{
int result = -1;
// load AWT library once (if several preload function should be called)
if (hPreloadAwt == NULL) {
// awt.dll is not loaded yet
char libraryPath[MAXPATHLEN];
int jrePathLen = 0;
while (1) {
// awt.dll depends on jvm.dll & java.dll;
// jvm.dll is already loaded, so we need only java.dll;
// java.dll depends on MSVCRT lib & verify.dll.
break;
}
// save path length
// load msvcrt 1st
LoadMSVCRT();
// load verify.dll
break;
}
// restore jrePath
libraryPath[jrePathLen] = 0;
// load java.dll
break;
}
// restore jrePath
libraryPath[jrePathLen] = 0;
// load awt.dll
if (hPreloadAwt == NULL) {
break;
}
// get "preloadStop" func ptr
break;
}
}
if (hPreloadAwt != NULL) {
// don't forget to stop preloading
awtPreloaded = 1;
}
}
return result;
}
/*
* Terminates AWT preloading
*/
void AWTPreloadStop() {
if (fnPreloadStop != NULL) {
}
}
#endif /* ENABLE_AWT_PRELOAD */