JVM crashed after execution

Ruedi S <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
Hello
Can somebody help me. I have a problem with the Java Virtual Machine. After
Execution the following program the the JVM shut down with an error.


import java.io.IOException;

import org.jawin.COMException;
import org.jawin.FuncPtr;
import org.jawin.io.LittleEndianOutputStream;
import org.jawin.io.NakedByteStream;
import org.jawin.marshal.GenericStub;
import org.jawin.marshal.StructConverter;

public class HelloDll {
    public static void main(String[] args) {
        try {
            System.out.println(
                    createProcessWithLogonW("user", "domain", "password", 2,
                            "C:\\Programme\\Internet Explorer\\iexplore.exe
\"http://mucbvkapp1.muc.sdm.de:8888/Futura_GZ\"")
            );
        } catch (IOException e) {
            e.printStackTrace();
        } catch (COMException e) {
            e.printStackTrace();
        }
    }

    public static boolean createProcessWithLogonW(String user, String domain,
            String passwd, int logonFlags, String appname)
            throws IOException, COMException {
        FuncPtr fp = new FuncPtr("advapi32.dll", "CreateProcessWithLogonW");

        NakedByteStream nbs = new NakedByteStream();
        LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs);
        leos.writeStringUnicode(user);
        leos.writeStringUnicode(domain);
        leos.writeStringUnicode(passwd);
        leos.writeInt(logonFlags);
        leos.writeStringUnicode(appname);

        byte[] result = GenericStub.win32Invoke(fp.getPeer(),
                "GGGIkGkkkk:B1:I", 44,
                leos.size(), nbs.getInternalBuffer(), null);
        if ( result != null ) {
            for ( int i = 0; i<result.length; ++i ) {
                System.out.println("result[" + i + "] == " + result[i]);
            }
        }
        return StructConverter.bytesIntoBoolean(result, 0);
    } // method
}

//The ouput is:



An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at
PC=0x77DE692C
Function=CreateProcessWithLogonW+0xC8F
Library=C:\WINDOWS\system32\ADVAPI32.dll

Current Java thread:
 at org.jawin.marshal.GenericStub.win32Invoke0(Native Method)
 at org.jawin.marshal.GenericStub.win32Invoke(GenericStub.java:66)
 at HelloDll.createProcessWithLogonW(HelloDll.java:41)
 at HelloDll.main(HelloDll.java:18)

Dynamic libraries:
0x00400000 - 0x0040B000  C:\j2sdk1.4.2_06\bin\javaw.exe
0x7C910000 - 0x7C9C7000  C:\WINDOWS\system32\ntdll.dll
0x7C800000 - 0x7C906000  C:\WINDOWS\system32\kernel32.dll
0x77DA0000 - 0x77E4A000  C:\WINDOWS\system32\ADVAPI32.dll
0x77E50000 - 0x77EE1000  C:\WINDOWS\system32\RPCRT4.dll
0x77D10000 - 0x77DA0000  C:\WINDOWS\system32\USER32.dll
0x77EF0000 - 0x77F36000  C:\WINDOWS\system32\GDI32.dll
0x77BE0000 - 0x77C38000  C:\WINDOWS\system32\MSVCRT.dll
0x10000000 - 0x10009000  C:\PROGRA~1\NetInst\NiAMH.dll
0x08000000 - 0x08139000  C:\j2sdk1.4.2_06\jre\bin\client\jvm.dll
0x76AF0000 - 0x76B1E000  C:\WINDOWS\system32\WINMM.dll
0x00390000 - 0x00397000  C:\j2sdk1.4.2_06\jre\bin\hpi.dll
0x003B0000 - 0x003BE000  C:\j2sdk1.4.2_06\jre\bin\verify.dll
0x003C0000 - 0x003D9000  C:\j2sdk1.4.2_06\jre\bin\java.dll
0x003E0000 - 0x003ED000  C:\j2sdk1.4.2_06\jre\bin\zip.dll
0x02D00000 - 0x02D2F000  C:\WINDOWS\system32\jawin.dll
0x774B0000 - 0x775ED000  C:\WINDOWS\system32\ole32.dll
0x770F0000 - 0x7717C000  C:\WINDOWS\system32\OLEAUT32.dll
0x76C50000 - 0x76C78000  C:\WINDOWS\system32\imagehlp.dll
0x59DD0000 - 0x59E71000  C:\WINDOWS\system32\DBGHELP.dll
0x77BD0000 - 0x77BD8000  C:\WINDOWS\system32\VERSION.dll
0x76BB0000 - 0x76BBB000  C:\WINDOWS\system32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 576K, used 339K [0x10010000, 0x100b0000, 0x104f0000)
  eden space 512K,  66% used [0x10010000, 0x10064d30, 0x10090000)
  from space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
  to   space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
 tenured generation   total 1408K, used 0K [0x104f0000, 0x10650000, 0x14010000)
   the space 1408K,   0% used [0x104f0000, 0x104f0000, 0x104f0200, 0x10650000)
 compacting perm gen  total 4096K, used 1189K [0x14010000, 0x14410000,
0x18010000)
   the space 4096K,  29% used [0x14010000, 0x14139460, 0x14139600, 0x14410000)

Local Time = Fri Mar 04 09:47:20 2005
Elapsed Time = 1
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
#
# An error report file has been saved as hs_err_pid2196.log.
# Please refer to the file for further information.
#
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.