Nativecall toegevoegd om te kunnen communiceren met windows applicaties.

This commit is contained in:
2011-02-19 15:33:26 +00:00
parent 0213172bc5
commit 9828e15d53
42 changed files with 5717 additions and 8121 deletions

View File

@@ -10,8 +10,8 @@ Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=copy.mak
Compiler=_@@_
CppCompiler=_@@_
Compiler=-DBUILDING_DLL=1_@@_
CppCompiler=-DBUILDING_DLL=1_@@_
Linker=--no-export-all-symbols --add-stdcall-alias_@@_
IsCpp=0
Icon=

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -228,7 +228,7 @@ JNIEXPORT jint JNICALL Java_com_eaio_nativecall_IntCall_executeCall0
}
delete [] arrays;
env->SetIntField(obj, fieldLastErrorCode, GetLastError());
return outVal;

View File

@@ -144,7 +144,7 @@ JNIEXPORT jboolean JNICALL Java_com_eaio_nativecall_NativeCall_initHandles
#ifdef _WINDOWS
HMODULE mod = LoadLibrary(moduleName);
HMODULE mod = LoadLibrary((LPCWSTR) moduleName);
if (mod == NULL) {
/* no such module or DllMain returned FALSE */
@@ -194,7 +194,7 @@ JNIEXPORT jstring JNICALL Java_com_eaio_nativecall_NativeCall_getLastError
LPVOID msgBufPtr = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL, lastError, 0,
(LPSTR) &msgBufPtr, 0, NULL);
(LPWSTR) &msgBufPtr, 0, NULL);
out = env->NewStringUTF((char*) msgBufPtr);

View File

@@ -1,132 +0,0 @@
# Microsoft Developer Studio Project File - Name="NativeCall" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=NativeCall - Win32 Debug
!MESSAGE Dies ist kein g<>ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f<>hren Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "NativeCall.mak".
!MESSAGE
!MESSAGE Sie k<>nnen beim Ausf<73>hren von NMAKE eine Konfiguration angeben
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "NativeCall.mak" CFG="NativeCall - Win32 Debug"
!MESSAGE
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
!MESSAGE
!MESSAGE "NativeCall - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE "NativeCall - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "NativeCall - 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 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NATIVECALL_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G5 /MD /W3 /Oa /Og /Os /Oy /Ob2 /Gf /I "C:\Program Files\IBMJava13\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NATIVECALL_EXPORTS" /D "WIN32_LEAN_AND_MEAN" /FAs /FR /YX /FD /c
# SUBTRACT CPP /Ox /Ot /Gy
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /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 /dll /machine:I386
# ADD LINK32 kernel32.lib libctiny.lib "C:\Program Files\Microsoft Visual Studio\VC98\Lib\libcmt.lib" "C:\Program Files\Microsoft Visual Studio\VC98\Lib\msvcrt.lib" /nologo /subsystem:console /dll /map /machine:I386 /nodefaultlib /MERGE:".rdata=.text" /OPT:REF /OPT:NOWIN98
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "NativeCall - 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 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NATIVECALL_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "C:\Program Files\IBMJava13\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NATIVECALL_EXPORTS" /FAs /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /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 /dll /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 /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "NativeCall - Win32 Release"
# Name "NativeCall - Win32 Debug"
# Begin Group "Quellcodedateien"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\IntCall.cpp
# End Source File
# Begin Source File
SOURCE=.\NativeCall.cpp
# End Source File
# Begin Source File
SOURCE=.\version.rc
# End Source File
# Begin Source File
SOURCE=.\VoidCall.cpp
# End Source File
# End Group
# Begin Group "Header-Dateien"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\com_eaio_nativecall_IntCall.h
# End Source File
# Begin Source File
SOURCE=.\com_eaio_nativecall_NativeCall.h
# End Source File
# Begin Source File
SOURCE=.\com_eaio_nativecall_VoidCall.h
# End Source File
# End Group
# Begin Group "Ressourcendateien"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GEL<45>SCHT WERDEN!
###############################################################################
Project: "NativeCall"=".\NativeCall.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,943 +0,0 @@
TITLE C:\Documents and Settings\Administrator\My Documents\Software\NativeCall\src\cpp\IntCall.cpp
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
; COMDAT ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?FindClass@JNIEnv_@@QAEPAV_jclass@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ThrowNew@JNIEnv_@@QAEJPAV_jclass@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?IsInstanceOf@JNIEnv_@@QAEEPAV_jobject@@PAV_jclass@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetObjectField@JNIEnv_@@QAEPAV_jobject@@PAV2@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetIntField@JNIEnv_@@QAEJPAV_jobject@@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetObjectField@JNIEnv_@@QAEXPAV_jobject@@PAU_jfieldID@@0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetIntField@JNIEnv_@@QAEXPAV_jobject@@PAU_jfieldID@@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetArrayLength@JNIEnv_@@QAEJPAV_jarray@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetObjectArrayElement@JNIEnv_@@QAEPAV_jobject@@PAV_jobjectArray@@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetPrimitiveArrayCritical@JNIEnv_@@QAEPAXPAV_jarray@@PAE@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ReleasePrimitiveArrayCritical@JNIEnv_@@QAEXPAV_jarray@@PAXJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC _Java_com_eaio_nativecall_IntCall_executeCall@8
EXTRN ?fieldFunctionHandle@@3PAU_jfieldID@@A:DWORD ; fieldFunctionHandle
EXTRN ?fieldLastErrorCode@@3PAU_jfieldID@@A:DWORD ; fieldLastErrorCode
EXTRN __imp__GetLastError@0:NEAR
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_functionHandle$ = 8
_outVal$ = -4
_Java_com_eaio_nativecall_IntCall_executeCall@8 PROC NEAR
; 79 : (JNIEnv *env, jobject obj) {
push ebp
mov ebp, esp
push ecx
; 80 :
; 81 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov eax, DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
push esi
mov esi, DWORD PTR _env$[ebp]
push eax
push DWORD PTR _obj$[ebp]
mov ecx, DWORD PTR [esi]
push esi
call DWORD PTR [ecx+400]
mov DWORD PTR _functionHandle$[ebp], eax
; 82 : jint outVal;
; 83 :
; 84 : #ifdef _WINDOWS
; 85 : #ifdef _X86_
; 86 :
; 87 : __asm {
; 88 :
; 89 : call functionHandle
call DWORD PTR _functionHandle$[ebp]
; 90 : mov outVal, eax
mov DWORD PTR _outVal$[ebp], eax
; 91 :
; 92 : }
; 93 :
; 94 : #endif
; 95 : #endif
; 96 :
; 97 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+436]
; 98 :
; 99 : return outVal;
mov eax, DWORD PTR _outVal$[ebp]
; 100 :
; 101 : }
pop esi
leave
ret 8
_Java_com_eaio_nativecall_IntCall_executeCall@8 ENDP
_TEXT ENDS
PUBLIC ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ ; `string'
PUBLIC _Java_com_eaio_nativecall_IntCall_executeCall0@12
PUBLIC ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ; JNIEnv_::NewObject
PUBLIC ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
PUBLIC ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
EXTRN ?fieldHolderO@@3PAU_jfieldID@@A:DWORD ; fieldHolderO
EXTRN ?classBoolean@@3PAV_jclass@@A:DWORD ; classBoolean
EXTRN ?classInteger@@3PAV_jclass@@A:DWORD ; classInteger
EXTRN ?classByteArray@@3PAV_jclass@@A:DWORD ; classByteArray
EXTRN ?classCharArray@@3PAV_jclass@@A:DWORD ; classCharArray
EXTRN ?classHolder@@3PAV_jclass@@A:DWORD ; classHolder
EXTRN ?methodBooleanValue@@3PAU_jmethodID@@A:DWORD ; methodBooleanValue
EXTRN ?methodIntValue@@3PAU_jmethodID@@A:DWORD ; methodIntValue
EXTRN ?newIntegerInt@@3PAU_jmethodID@@A:DWORD ; newIntegerInt
EXTRN ?newBooleanBoolean@@3PAU_jmethodID@@A:DWORD ; newBooleanBoolean
EXTRN ??2@YAPAXI@Z:NEAR ; operator new
EXTRN ??3@YAXPAX@Z:NEAR ; operator delete
EXTRN _memset:NEAR
; COMDAT ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@
; File C:\Program Files\IBMJava13\include\jni.h
_DATA SEGMENT
??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ DB 'java/lang/OutOfMemor'
DB 'yError', 00H ; `string'
_DATA ENDS
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_params$ = 16
_len$ = -28
_arrays$ = -20
_param$ = -24
_i$ = 8
_intArg$27770 = -24
_byteArrayArg$27773 = -4
_charArrayArg$27779 = -8
_tempArg$27786 = -24
_intPtr$27791 = -24
_byteArrayArg$27797 = -12
_charArrayArg$27803 = -16
_tempPtr$27810 = -24
_functionHandle$ = 8
_outVal$ = -32
_j$ = 8
_Java_com_eaio_nativecall_IntCall_executeCall0@12 PROC NEAR
; 109 : (JNIEnv *env, jobject obj, jobjectArray params) {
push ebp
mov ebp, esp
sub esp, 32 ; 00000020H
push ebx
push esi
; 110 :
; 111 : const int len = env->GetArrayLength(params);
mov esi, DWORD PTR _env$[ebp]
push edi
push DWORD PTR _params$[ebp]
mov eax, DWORD PTR [esi]
push esi
call DWORD PTR [eax+684]
mov ebx, eax
; 112 :
; 113 : int* arrays = NULL;
; 114 : if (!(arrays = new int[len])) {
mov edi, ebx
mov DWORD PTR _len$[ebp], ebx
shl edi, 2
push edi
call ??2@YAPAXI@Z ; operator new
test eax, eax
pop ecx
mov DWORD PTR _arrays$[ebp], eax
jne SHORT $L27759
; 115 : env->ThrowNew(env->FindClass("java/lang/OutOfMemoryError"), NULL);
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push 0
push eax
push esi
call DWORD PTR [ecx+56]
; 116 : return 0;
xor eax, eax
jmp $L27754
$L27759:
; 117 : }
; 118 : memset(arrays, 0, (sizeof(int) * len));
push edi
push 0
push eax
call _memset
; 119 :
; 120 : jobject param;
; 121 :
; 122 : for (int i = len - 1; i >= 0; i--) {
lea eax, DWORD PTR [ebx-1]
add esp, 12 ; 0000000cH
test eax, eax
mov DWORD PTR _i$[ebp], eax
jl $L27766
mov ecx, DWORD PTR _arrays$[ebp]
lea edi, DWORD PTR [ecx+eax*4]
jmp SHORT $L27764
$L28030:
; 117 : }
; 118 : memset(arrays, 0, (sizeof(int) * len));
mov eax, DWORD PTR _i$[ebp]
$L27764:
; 123 :
; 124 : param = env->GetObjectArrayElement(params, i);
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR _params$[ebp]
push esi
call DWORD PTR [ecx+692]
mov ebx, eax
; 125 :
; 126 : if (param == NULL) {
test ebx, ebx
jne SHORT $L27767
; 127 : _push(0);
push 0
; 128 : }
; 129 : else if (env->IsInstanceOf(param, classInteger)) {
jmp $L27765
$L27767:
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27769
; 130 : int intArg = env->CallIntMethod(param, methodIntValue);
push DWORD PTR ?methodIntValue@@3PAU_jmethodID@@A ; methodIntValue
push ebx
push esi
call ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
add esp, 12 ; 0000000cH
mov DWORD PTR _intArg$27770[ebp], eax
; 131 : _push(intArg)
push DWORD PTR _intArg$27770[ebp]
; 132 : }
; 133 : else if (env->IsInstanceOf(param, classByteArray)) {
jmp $L27765
$L27769:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27772
; 134 : char* byteArrayArg = (char*) env->GetPrimitiveArrayCritical((jarray) param, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _byteArrayArg$27773[ebp], eax
; 135 : arrays[i] = (int) &byteArrayArg;
lea eax, DWORD PTR _byteArrayArg$27773[ebp]
mov DWORD PTR [edi], eax
; 136 : _push(byteArrayArg)
push DWORD PTR _byteArrayArg$27773[ebp]
; 137 : }
; 138 : else if (env->IsInstanceOf(param, classCharArray)) {
jmp $L27765
$L27772:
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27778
; 139 : unsigned short* charArrayArg = (unsigned short*) env->GetPrimitiveArrayCritical(
; 140 : (jarray) param, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _charArrayArg$27779[ebp], eax
; 141 : arrays[i] = (int) &charArrayArg;
lea eax, DWORD PTR _charArrayArg$27779[ebp]
mov DWORD PTR [edi], eax
; 142 : _push(charArrayArg)
push DWORD PTR _charArrayArg$27779[ebp]
; 143 : }
; 144 : else if (env->IsInstanceOf(param, classBoolean)) {
jmp $L27765
$L27778:
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27784
; 145 : jboolean booleanArg = env->CallBooleanMethod(param, methodBooleanValue);
push DWORD PTR ?methodBooleanValue@@3PAU_jmethodID@@A ; methodBooleanValue
push ebx
push esi
call ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
add esp, 12 ; 0000000cH
; 146 : int tempArg = (booleanArg == JNI_FALSE ? 0 : 1);
neg al
sbb eax, eax
neg eax
mov DWORD PTR _tempArg$27786[ebp], eax
; 147 : _push(tempArg)
push DWORD PTR _tempArg$27786[ebp]
; 148 : }
; 149 : else if (env->IsInstanceOf(param, classHolder)) {
jmp $L27765
$L27784:
mov eax, DWORD PTR ?classHolder@@3PAV_jclass@@A ; classHolder
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je $L27765
; 150 :
; 151 : /* Holder */
; 152 :
; 153 : jobject o = env->GetObjectField(param, fieldHolderO);
mov eax, DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+380]
; 154 :
; 155 : if (env->IsInstanceOf(o, classInteger)) {
mov ecx, DWORD PTR [esi]
mov ebx, eax
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27790
; 156 : int *intPtr = new int;
push 4
call ??2@YAPAXI@Z ; operator new
pop ecx
mov DWORD PTR _intPtr$27791[ebp], eax
; 157 : *intPtr = env->CallIntMethod(o, methodIntValue);
push DWORD PTR ?methodIntValue@@3PAU_jmethodID@@A ; methodIntValue
push ebx
push esi
call ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
mov ecx, DWORD PTR _intPtr$27791[ebp]
add esp, 12 ; 0000000cH
; 158 : arrays[i] = (int) intPtr;
mov DWORD PTR [edi], ecx
mov DWORD PTR [ecx], eax
; 159 : _push(intPtr);
push DWORD PTR _intPtr$27791[ebp]
; 160 : }
; 161 : else if (env->IsInstanceOf(o, classByteArray)) {
jmp $L27765
$L27790:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27796
; 162 : char* byteArrayArg = (char*) env->GetPrimitiveArrayCritical((jarray) o, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _byteArrayArg$27797[ebp], eax
; 163 : arrays[i] = (int) &byteArrayArg;
lea eax, DWORD PTR _byteArrayArg$27797[ebp]
mov DWORD PTR [edi], eax
; 164 : _push(byteArrayArg)
push DWORD PTR _byteArrayArg$27797[ebp]
; 165 : }
; 166 : else if (env->IsInstanceOf(o, classCharArray)) {
jmp SHORT $L27765
$L27796:
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27802
; 167 : unsigned short* charArrayArg = (unsigned short*) env->GetPrimitiveArrayCritical(
; 168 : (jarray) o, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _charArrayArg$27803[ebp], eax
; 169 : arrays[i] = (int) &charArrayArg;
lea eax, DWORD PTR _charArrayArg$27803[ebp]
mov DWORD PTR [edi], eax
; 170 : _push(charArrayArg)
push DWORD PTR _charArrayArg$27803[ebp]
; 171 : }
; 172 : else if (env->IsInstanceOf(o, classBoolean)) {
jmp SHORT $L27765
$L27802:
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27765
; 173 : jboolean booleanArg = env->CallBooleanMethod(o, methodBooleanValue);
push DWORD PTR ?methodBooleanValue@@3PAU_jmethodID@@A ; methodBooleanValue
push ebx
push esi
call ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
; 174 : int *tempPtr = new int;
push 4
mov bl, al
call ??2@YAPAXI@Z ; operator new
add esp, 16 ; 00000010H
; 175 : *tempPtr = (booleanArg == JNI_FALSE ? 0 : 1);
xor ecx, ecx
test bl, bl
setne cl
mov DWORD PTR _tempPtr$27810[ebp], eax
mov DWORD PTR [eax], ecx
; 176 : arrays[i] = (int) tempPtr;
mov DWORD PTR [edi], eax
; 177 : _push(tempPtr);
push DWORD PTR _tempPtr$27810[ebp]
; 176 : arrays[i] = (int) tempPtr;
$L27765:
dec DWORD PTR _i$[ebp]
sub edi, 4
cmp DWORD PTR _i$[ebp], 0
jge $L28030
; 119 :
; 120 : jobject param;
; 121 :
; 122 : for (int i = len - 1; i >= 0; i--) {
mov ebx, DWORD PTR _len$[ebp]
$L27766:
; 178 : }
; 179 :
; 180 : /* end Holder */
; 181 :
; 182 : }
; 183 :
; 184 : }
; 185 :
; 186 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov eax, DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+400]
mov DWORD PTR _functionHandle$[ebp], eax
; 187 : jint outVal;
; 188 :
; 189 : #ifdef _WINDOWS
; 190 : #ifdef _X86_
; 191 :
; 192 : __asm {
; 193 :
; 194 : call functionHandle
call DWORD PTR _functionHandle$[ebp]
; 195 : mov outVal, eax
mov DWORD PTR _outVal$[ebp], eax
; 196 :
; 197 : }
; 198 :
; 199 : #endif
; 200 : #endif
; 201 :
; 202 : for (int j = 0; j < len; ++j) {
and DWORD PTR _j$[ebp], 0
test ebx, ebx
jle $L27819
; 178 : }
; 179 :
; 180 : /* end Holder */
; 181 :
; 182 : }
; 183 :
; 184 : }
; 185 :
; 186 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov ebx, DWORD PTR _arrays$[ebp]
$L27817:
; 203 : param = env->GetObjectArrayElement(params, j);
push DWORD PTR _j$[ebp]
mov eax, DWORD PTR [esi]
push DWORD PTR _params$[ebp]
push esi
call DWORD PTR [eax+692]
mov edi, eax
; 204 : if (param == NULL) {}
test edi, edi
mov DWORD PTR _param$[ebp], edi
je $L27818
; 205 : else if (env->IsInstanceOf(param, classByteArray) || env->IsInstanceOf(param, classCharArray)) {
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne $L27835
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne $L27835
; 207 : }
; 208 : else if (env->IsInstanceOf(param, classHolder)) {
mov eax, DWORD PTR ?classHolder@@3PAV_jclass@@A ; classHolder
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je $L27818
; 209 :
; 210 : jobject o = env->GetObjectField(param, fieldHolderO);
mov eax, DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+380]
; 211 :
; 212 : if (env->IsInstanceOf(o, classInteger)) {
mov ecx, DWORD PTR [esi]
mov edi, eax
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27829
; 213 : int* out = (int*) arrays[j];
mov edi, DWORD PTR [ebx]
; 214 : env->SetObjectField(param, fieldHolderO, env->NewObject(classInteger, newIntegerInt, *out));
push DWORD PTR [edi]
push DWORD PTR ?newIntegerInt@@3PAU_jmethodID@@A ; newIntegerInt
push DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
$L28033:
push esi
call ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ; JNIEnv_::NewObject
add esp, 16 ; 00000010H
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
push DWORD PTR _param$[ebp]
push esi
call DWORD PTR [ecx+416]
; 215 : delete out;
push edi
call ??3@YAXPAX@Z ; operator delete
pop ecx
; 216 : }
; 217 : else if (env->IsInstanceOf(o, classByteArray) || env->IsInstanceOf(o, classCharArray)) {
jmp SHORT $L27818
$L27829:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne SHORT $L27835
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne SHORT $L27835
; 218 : env->ReleasePrimitiveArrayCritical((jarray) o, (void*) arrays[j], 0);
; 219 : }
; 220 : else if (env->IsInstanceOf(o, classBoolean)) {
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27818
; 221 : int* out = (int*) arrays[j];
mov edi, DWORD PTR [ebx]
; 222 : env->SetObjectField(param, fieldHolderO, env->NewObject(classBoolean, newBooleanBoolean, (*out == 0 ? JNI_FALSE : JNI_TRUE)));
xor eax, eax
cmp DWORD PTR [edi], eax
setne al
push eax
push DWORD PTR ?newBooleanBoolean@@3PAU_jmethodID@@A ; newBooleanBoolean
push DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
; 223 : delete out;
jmp SHORT $L28033
$L27835:
; 206 : env->ReleasePrimitiveArrayCritical((jarray) param, (void*) arrays[j], 0);
mov eax, DWORD PTR [esi]
push 0
push DWORD PTR [ebx]
push edi
push esi
call DWORD PTR [eax+892]
$L27818:
inc DWORD PTR _j$[ebp]
mov eax, DWORD PTR _j$[ebp]
add ebx, 4
cmp eax, DWORD PTR _len$[ebp]
jl $L27817
$L27819:
; 224 : }
; 225 :
; 226 : }
; 227 :
; 228 : }
; 229 :
; 230 : delete [] arrays;
push DWORD PTR _arrays$[ebp]
call ??3@YAXPAX@Z ; operator delete
pop ecx
; 231 :
; 232 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+436]
; 233 :
; 234 : return outVal;
mov eax, DWORD PTR _outVal$[ebp]
$L27754:
; 235 :
; 236 : }
pop edi
pop esi
pop ebx
leave
ret 12 ; 0000000cH
_Java_com_eaio_nativecall_IntCall_executeCall0@12 ENDP
_TEXT ENDS
; COMDAT ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_clazz$ = 12
_methodID$ = 16
?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::NewObject, COMDAT
; 835 : va_list args;
; 836 : jobject result;
; 837 : va_start(args, methodID);
; 838 : result = functions->NewObjectV(this,clazz,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _clazz$[esp+4]
push eax
call DWORD PTR [ecx+116]
; 839 : va_end(args);
; 840 : return result;
; 841 : }
ret 0
?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::NewObject
_TEXT ENDS
; COMDAT ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_obj$ = 12
_methodID$ = 16
?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::CallBooleanMethod, COMDAT
; 882 : va_list args;
; 883 : jboolean result;
; 884 : va_start(args,methodID);
; 885 : result = functions->CallBooleanMethodV(this,obj,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _obj$[esp+4]
push eax
call DWORD PTR [ecx+152]
; 886 : va_end(args);
; 887 : return result;
; 888 : }
ret 0
?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::CallBooleanMethod
_TEXT ENDS
; COMDAT ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_obj$ = 12
_methodID$ = 16
?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::CallIntMethod, COMDAT
; 950 : va_list args;
; 951 : jint result;
; 952 : va_start(args,methodID);
; 953 : result = functions->CallIntMethodV(this,obj,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _obj$[esp+4]
push eax
call DWORD PTR [ecx+200]
; 954 : va_end(args);
; 955 : return result;
; 956 : }
ret 0
?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::CallIntMethod
_TEXT ENDS
END

Binary file not shown.

View File

@@ -1,859 +0,0 @@
TITLE C:\Documents and Settings\Administrator\My Documents\Software\NativeCall\src\cpp\NativeCall.cpp
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
; COMDAT ??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_08JJOG@function?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_06CODG@module?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_01FLOP@I?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0P@LKIL@functionHandle?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0N@EFAA@moduleHandle?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0O@OMHL@lastErrorCode?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_01PGHN@o?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0BC@FBKL@java?1lang?1Integer?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0BB@LLFN@java?1lang?1String?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_02LOEJ@?$FLB?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_02BENO@?$FLC?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_03KJOK@?$CI?$CJZ?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_0N@KEBP@booleanValue?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_03PPCD@?$CI?$CJI?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_08JCMA@intValue?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_04ECLF@?$CII?$CJV?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_06KILP@?$DMinit?$DO?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ??_C@_04JFOE@?$CIZ?$CJV?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?FindClass@JNIEnv_@@QAEPAV_jclass@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?NewGlobalRef@JNIEnv_@@QAEPAV_jobject@@PAV2@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetMethodID@JNIEnv_@@QAEPAU_jmethodID@@PAV_jclass@@PBD1@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetFieldID@JNIEnv_@@QAEPAU_jfieldID@@PAV_jclass@@PBD1@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetObjectField@JNIEnv_@@QAEPAV_jobject@@PAV2@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetIntField@JNIEnv_@@QAEJPAV_jobject@@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetIntField@JNIEnv_@@QAEXPAV_jobject@@PAU_jfieldID@@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?NewStringUTF@JNIEnv_@@QAEPAV_jstring@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetStringUTFChars@JNIEnv_@@QAEPBDPAV_jstring@@PAE@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ReleaseStringUTFChars@JNIEnv_@@QAEXPAV_jstring@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC ?fieldFunction@@3PAU_jfieldID@@A ; fieldFunction
PUBLIC ?fieldModule@@3PAU_jfieldID@@A ; fieldModule
PUBLIC ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
PUBLIC ?fieldModuleHandle@@3PAU_jfieldID@@A ; fieldModuleHandle
PUBLIC ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
PUBLIC ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
PUBLIC ?classBoolean@@3PAV_jclass@@A ; classBoolean
PUBLIC ?classInteger@@3PAV_jclass@@A ; classInteger
PUBLIC ?classString@@3PAV_jclass@@A ; classString
PUBLIC ?classByteArray@@3PAV_jclass@@A ; classByteArray
PUBLIC ?classCharArray@@3PAV_jclass@@A ; classCharArray
PUBLIC ?classHolder@@3PAV_jclass@@A ; classHolder
PUBLIC ?methodBooleanValue@@3PAU_jmethodID@@A ; methodBooleanValue
PUBLIC ?methodIntValue@@3PAU_jmethodID@@A ; methodIntValue
PUBLIC ?newIntegerInt@@3PAU_jmethodID@@A ; newIntegerInt
PUBLIC ?newBooleanBoolean@@3PAU_jmethodID@@A ; newBooleanBoolean
_BSS SEGMENT
?fieldFunction@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldFunction
?fieldModule@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldModule
?fieldFunctionHandle@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldFunctionHandle
?fieldModuleHandle@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldModuleHandle
?fieldLastErrorCode@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldLastErrorCode
?fieldHolderO@@3PAU_jfieldID@@A DD 01H DUP (?) ; fieldHolderO
?classBoolean@@3PAV_jclass@@A DD 01H DUP (?) ; classBoolean
?classInteger@@3PAV_jclass@@A DD 01H DUP (?) ; classInteger
?classString@@3PAV_jclass@@A DD 01H DUP (?) ; classString
?classByteArray@@3PAV_jclass@@A DD 01H DUP (?) ; classByteArray
?classCharArray@@3PAV_jclass@@A DD 01H DUP (?) ; classCharArray
?classHolder@@3PAV_jclass@@A DD 01H DUP (?) ; classHolder
?methodBooleanValue@@3PAU_jmethodID@@A DD 01H DUP (?) ; methodBooleanValue
?methodIntValue@@3PAU_jmethodID@@A DD 01H DUP (?) ; methodIntValue
?newIntegerInt@@3PAU_jmethodID@@A DD 01H DUP (?) ; newIntegerInt
?newBooleanBoolean@@3PAU_jmethodID@@A DD 01H DUP (?) ; newBooleanBoolean
_BSS ENDS
PUBLIC ??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@ ; `string'
PUBLIC ??_C@_08JJOG@function?$AA@ ; `string'
PUBLIC ??_C@_06CODG@module?$AA@ ; `string'
PUBLIC ??_C@_01FLOP@I?$AA@ ; `string'
PUBLIC ??_C@_0P@LKIL@functionHandle?$AA@ ; `string'
PUBLIC ??_C@_0N@EFAA@moduleHandle?$AA@ ; `string'
PUBLIC ??_C@_0O@OMHL@lastErrorCode?$AA@ ; `string'
PUBLIC ??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@ ; `string'
PUBLIC ??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@ ; `string'
PUBLIC ??_C@_01PGHN@o?$AA@ ; `string'
PUBLIC ??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@ ; `string'
PUBLIC ??_C@_0BC@FBKL@java?1lang?1Integer?$AA@ ; `string'
PUBLIC ??_C@_0BB@LLFN@java?1lang?1String?$AA@ ; `string'
PUBLIC ??_C@_02LOEJ@?$FLB?$AA@ ; `string'
PUBLIC ??_C@_02BENO@?$FLC?$AA@ ; `string'
PUBLIC ??_C@_03KJOK@?$CI?$CJZ?$AA@ ; `string'
PUBLIC ??_C@_0N@KEBP@booleanValue?$AA@ ; `string'
PUBLIC ??_C@_03PPCD@?$CI?$CJI?$AA@ ; `string'
PUBLIC ??_C@_08JCMA@intValue?$AA@ ; `string'
PUBLIC ??_C@_04ECLF@?$CII?$CJV?$AA@ ; `string'
PUBLIC ??_C@_06KILP@?$DMinit?$DO?$AA@ ; `string'
PUBLIC ??_C@_04JFOE@?$CIZ?$CJV?$AA@ ; `string'
PUBLIC _Java_com_eaio_nativecall_NativeCall_initIDs@8
; COMDAT ??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@
; File C:\Program Files\IBMJava13\include\jni.h
_DATA SEGMENT
??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@ DB 'Ljava/lang/String;', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_08JJOG@function?$AA@
_DATA SEGMENT
??_C@_08JJOG@function?$AA@ DB 'function', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_06CODG@module?$AA@
_DATA SEGMENT
??_C@_06CODG@module?$AA@ DB 'module', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_01FLOP@I?$AA@
_DATA SEGMENT
??_C@_01FLOP@I?$AA@ DB 'I', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0P@LKIL@functionHandle?$AA@
_DATA SEGMENT
??_C@_0P@LKIL@functionHandle?$AA@ DB 'functionHandle', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0N@EFAA@moduleHandle?$AA@
_DATA SEGMENT
??_C@_0N@EFAA@moduleHandle?$AA@ DB 'moduleHandle', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0O@OMHL@lastErrorCode?$AA@
_DATA SEGMENT
??_C@_0O@OMHL@lastErrorCode?$AA@ DB 'lastErrorCode', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@
_DATA SEGMENT
??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@ DB 'com/eaio/nativecall'
DB '/Holder', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@
_DATA SEGMENT
??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@ DB 'Ljava/lang/Object;', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_01PGHN@o?$AA@
_DATA SEGMENT
??_C@_01PGHN@o?$AA@ DB 'o', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@
_DATA SEGMENT
??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@ DB 'java/lang/Boolean', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0BC@FBKL@java?1lang?1Integer?$AA@
_DATA SEGMENT
??_C@_0BC@FBKL@java?1lang?1Integer?$AA@ DB 'java/lang/Integer', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0BB@LLFN@java?1lang?1String?$AA@
_DATA SEGMENT
??_C@_0BB@LLFN@java?1lang?1String?$AA@ DB 'java/lang/String', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_02LOEJ@?$FLB?$AA@
_DATA SEGMENT
??_C@_02LOEJ@?$FLB?$AA@ DB '[B', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_02BENO@?$FLC?$AA@
_DATA SEGMENT
??_C@_02BENO@?$FLC?$AA@ DB '[C', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_03KJOK@?$CI?$CJZ?$AA@
_DATA SEGMENT
??_C@_03KJOK@?$CI?$CJZ?$AA@ DB '()Z', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_0N@KEBP@booleanValue?$AA@
_DATA SEGMENT
??_C@_0N@KEBP@booleanValue?$AA@ DB 'booleanValue', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_03PPCD@?$CI?$CJI?$AA@
_DATA SEGMENT
??_C@_03PPCD@?$CI?$CJI?$AA@ DB '()I', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_08JCMA@intValue?$AA@
_DATA SEGMENT
??_C@_08JCMA@intValue?$AA@ DB 'intValue', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_04ECLF@?$CII?$CJV?$AA@
_DATA SEGMENT
??_C@_04ECLF@?$CII?$CJV?$AA@ DB '(I)V', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_06KILP@?$DMinit?$DO?$AA@
_DATA SEGMENT
??_C@_06KILP@?$DMinit?$DO?$AA@ DB '<init>', 00H ; `string'
_DATA ENDS
; COMDAT ??_C@_04JFOE@?$CIZ?$CJV?$AA@
_DATA SEGMENT
??_C@_04JFOE@?$CIZ?$CJV?$AA@ DB '(Z)V', 00H ; `string'
_DATA ENDS
_TEXT SEGMENT
_env$ = 8
_cls$ = 12
_Java_com_eaio_nativecall_NativeCall_initIDs@8 PROC NEAR
; 71 : (JNIEnv *env, jclass cls) {
push ebx
; 72 :
; 73 : // NativeCall fields
; 74 :
; 75 : fieldFunction = env->GetFieldID(cls, "function", "Ljava/lang/String;");
mov ebx, DWORD PTR _cls$[esp]
push esi
mov esi, DWORD PTR _env$[esp+4]
push edi
mov edi, OFFSET FLAT:??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@ ; `string'
mov eax, DWORD PTR [esi]
push edi
push OFFSET FLAT:??_C@_08JJOG@function?$AA@ ; `string'
push ebx
push esi
call DWORD PTR [eax+376]
; 76 : fieldModule = env->GetFieldID(cls, "module", "Ljava/lang/String;");
push edi
mov DWORD PTR ?fieldFunction@@3PAU_jfieldID@@A, eax ; fieldFunction
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_06CODG@module?$AA@ ; `string'
push ebx
push esi
call DWORD PTR [eax+376]
; 77 :
; 78 : fieldFunctionHandle = env->GetFieldID(cls, "functionHandle", "I");
mov edi, OFFSET FLAT:??_C@_01FLOP@I?$AA@ ; `string'
mov DWORD PTR ?fieldModule@@3PAU_jfieldID@@A, eax ; fieldModule
mov eax, DWORD PTR [esi]
push edi
push OFFSET FLAT:??_C@_0P@LKIL@functionHandle?$AA@ ; `string'
push ebx
push esi
call DWORD PTR [eax+376]
; 79 : fieldModuleHandle = env-> GetFieldID(cls, "moduleHandle", "I");
push edi
mov DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A, eax ; fieldFunctionHandle
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0N@EFAA@moduleHandle?$AA@ ; `string'
push ebx
push esi
call DWORD PTR [eax+376]
; 80 :
; 81 : fieldLastErrorCode = env->GetFieldID(cls, "lastErrorCode", "I");
push edi
mov DWORD PTR ?fieldModuleHandle@@3PAU_jfieldID@@A, eax ; fieldModuleHandle
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0O@OMHL@lastErrorCode?$AA@ ; `string'
push ebx
push esi
call DWORD PTR [eax+376]
mov DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A, eax ; fieldLastErrorCode
; 82 :
; 83 : // Holder fields
; 84 :
; 85 : classHolder = (jclass) env->NewGlobalRef(env->FindClass("com/eaio/nativecall/Holder"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
; 86 : fieldHolderO = env->GetFieldID(classHolder, "o", "Ljava/lang/Object;");
mov ecx, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@ ; `string'
push OFFSET FLAT:??_C@_01PGHN@o?$AA@ ; `string'
push eax
push esi
mov DWORD PTR ?classHolder@@3PAV_jclass@@A, eax ; classHolder
call DWORD PTR [ecx+376]
mov DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A, eax ; fieldHolderO
; 87 :
; 88 : // Other classes
; 89 :
; 90 : classBoolean = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Boolean"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
mov DWORD PTR ?classBoolean@@3PAV_jclass@@A, eax ; classBoolean
; 91 : /*classByte = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Byte"));
; 92 : classCharacter = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Character"));
; 93 : classShort = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Short"));*/
; 94 : classInteger = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Integer"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BC@FBKL@java?1lang?1Integer?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
mov DWORD PTR ?classInteger@@3PAV_jclass@@A, eax ; classInteger
; 95 : /*classLong = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Long"));
; 96 : classFloat = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Float"));
; 97 : classDouble = (jclass) env->NewGlobalRef(env->FindClass("java/lang/Double"));*/
; 98 : classString = (jclass) env->NewGlobalRef(env->FindClass("java/lang/String"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BB@LLFN@java?1lang?1String?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
mov DWORD PTR ?classString@@3PAV_jclass@@A, eax ; classString
; 99 : classByteArray = (jclass) env->NewGlobalRef(env->FindClass("[B"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_02LOEJ@?$FLB?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
mov DWORD PTR ?classByteArray@@3PAV_jclass@@A, eax ; classByteArray
; 100 : classCharArray = (jclass) env->NewGlobalRef(env->FindClass("[C"));
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_02BENO@?$FLC?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push eax
push esi
call DWORD PTR [ecx+84]
; 101 : /*classIntArray = (jclass) env->NewGlobalRef(env->FindClass("[I"));*/
; 102 :
; 103 : // Wrapper class methods
; 104 :
; 105 : methodBooleanValue = env->GetMethodID(classBoolean,
; 106 : "booleanValue", "()Z");
mov ecx, DWORD PTR [esi]
mov DWORD PTR ?classCharArray@@3PAV_jclass@@A, eax ; classCharArray
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
push OFFSET FLAT:??_C@_03KJOK@?$CI?$CJZ?$AA@ ; `string'
push OFFSET FLAT:??_C@_0N@KEBP@booleanValue?$AA@ ; `string'
push eax
push esi
call DWORD PTR [ecx+132]
; 107 : /*methodByteValue = env->GetMethodID(classByte,
; 108 : "byteValue", "()B");
; 109 : methodCharValue = env->GetMethodID(classCharacter,
; 110 : "charValue", "()C");
; 111 : methodShortValue = env->GetMethodID(classShort,
; 112 : "shortValue", "()S");*/
; 113 : methodIntValue = env->GetMethodID(classInteger,
; 114 : "intValue", "()I");
mov ecx, DWORD PTR [esi]
mov DWORD PTR ?methodBooleanValue@@3PAU_jmethodID@@A, eax ; methodBooleanValue
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
push OFFSET FLAT:??_C@_03PPCD@?$CI?$CJI?$AA@ ; `string'
push OFFSET FLAT:??_C@_08JCMA@intValue?$AA@ ; `string'
push eax
push esi
call DWORD PTR [ecx+132]
; 115 : /*methodLongValue = env->GetMethodID(classLong,
; 116 : "longValue", "()J");
; 117 : methodFloatValue = env->GetMethodID(classFloat,
; 118 : "floatValue", "()F");
; 119 : methodDoubleValue = env->GetMethodID(classDouble,
; 120 : "doubleValue", "()D");*/
; 121 :
; 122 : // Constructors
; 123 :
; 124 : newIntegerInt = env->GetMethodID(classInteger, "<init>", "(I)V");
mov ecx, DWORD PTR [esi]
mov DWORD PTR ?methodIntValue@@3PAU_jmethodID@@A, eax ; methodIntValue
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
mov edi, OFFSET FLAT:??_C@_06KILP@?$DMinit?$DO?$AA@ ; `string'
push OFFSET FLAT:??_C@_04ECLF@?$CII?$CJV?$AA@ ; `string'
push edi
push eax
push esi
call DWORD PTR [ecx+132]
; 125 : newBooleanBoolean = env->GetMethodID(classBoolean, "<init>", "(Z)V");
mov ecx, DWORD PTR [esi]
mov DWORD PTR ?newIntegerInt@@3PAU_jmethodID@@A, eax ; newIntegerInt
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
push OFFSET FLAT:??_C@_04JFOE@?$CIZ?$CJV?$AA@ ; `string'
push edi
push eax
push esi
call DWORD PTR [ecx+132]
pop edi
pop esi
mov DWORD PTR ?newBooleanBoolean@@3PAU_jmethodID@@A, eax ; newBooleanBoolean
pop ebx
; 126 :
; 127 : }
ret 8
_Java_com_eaio_nativecall_NativeCall_initIDs@8 ENDP
_TEXT ENDS
PUBLIC _Java_com_eaio_nativecall_NativeCall_initHandles@8
EXTRN __imp__LoadLibraryA@4:NEAR
EXTRN __imp__GetLastError@0:NEAR
EXTRN __imp__FreeLibrary@4:NEAR
EXTRN __imp__GetProcAddress@8:NEAR
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_out$ = -1
_moduleNameS$ = 12
_functionNameS$ = -12
_moduleName$ = 8
_functionName$ = -8
_addr$27794 = -16
_Java_com_eaio_nativecall_NativeCall_initHandles@8 PROC NEAR
; 135 : (JNIEnv *env, jobject obj) {
push ebp
mov ebp, esp
sub esp, 16 ; 00000010H
; 136 :
; 137 : bool out = JNI_TRUE;
; 138 :
; 139 : jstring moduleNameS = (jstring) env->GetObjectField(obj, fieldModule);
mov eax, DWORD PTR ?fieldModule@@3PAU_jfieldID@@A ; fieldModule
push ebx
push esi
mov esi, DWORD PTR _env$[ebp]
push edi
mov edi, DWORD PTR _obj$[ebp]
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
mov BYTE PTR _out$[ebp], 1
call DWORD PTR [ecx+380]
; 140 : jstring functionNameS = (jstring) env->GetObjectField(obj, fieldFunction);
mov ecx, DWORD PTR [esi]
mov DWORD PTR _moduleNameS$[ebp], eax
mov eax, DWORD PTR ?fieldFunction@@3PAU_jfieldID@@A ; fieldFunction
push eax
push edi
push esi
call DWORD PTR [ecx+380]
; 141 :
; 142 : const char* moduleName = env->GetStringUTFChars(moduleNameS, 0);
push 0
mov DWORD PTR _functionNameS$[ebp], eax
push DWORD PTR _moduleNameS$[ebp]
mov eax, DWORD PTR [esi]
push esi
call DWORD PTR [eax+676]
; 143 : const char* functionName = env->GetStringUTFChars(functionNameS, 0);
push 0
mov DWORD PTR _moduleName$[ebp], eax
push DWORD PTR _functionNameS$[ebp]
mov eax, DWORD PTR [esi]
push esi
call DWORD PTR [eax+676]
; 144 :
; 145 : #ifdef _WINDOWS
; 146 :
; 147 : HMODULE mod = LoadLibrary(moduleName);
push DWORD PTR _moduleName$[ebp]
mov DWORD PTR _functionName$[ebp], eax
call DWORD PTR __imp__LoadLibraryA@4
mov ebx, eax
; 148 :
; 149 : if (mod == NULL) {
test ebx, ebx
jne SHORT $L27792
$L27990:
; 150 : /* no such module or DllMain returned FALSE */
; 151 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push edi
push esi
call DWORD PTR [ecx+436]
; 152 : out = JNI_FALSE;
and BYTE PTR _out$[ebp], 0
; 153 : }
; 154 : else {
jmp SHORT $L27982
$L27792:
; 155 : FARPROC addr = GetProcAddress(mod, functionName);
push DWORD PTR _functionName$[ebp]
push ebx
call DWORD PTR __imp__GetProcAddress@8
; 156 : if (addr == NULL) {
test eax, eax
mov DWORD PTR _addr$27794[ebp], eax
jne SHORT $L27795
; 157 : /* function not found */
; 158 : FreeLibrary(mod);
push ebx
call DWORD PTR __imp__FreeLibrary@4
; 159 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
; 160 : out = JNI_FALSE;
; 161 : }
; 162 : else {
jmp SHORT $L27990
$L27795:
; 163 : /* all ok */
; 164 : env->SetIntField(obj, fieldModuleHandle, (jint) mod);
mov eax, DWORD PTR [esi]
push ebx
push DWORD PTR ?fieldModuleHandle@@3PAU_jfieldID@@A ; fieldModuleHandle
push edi
push esi
call DWORD PTR [eax+436]
; 165 : env->SetIntField(obj, fieldFunctionHandle, (jint) addr);
push DWORD PTR _addr$27794[ebp]
mov eax, DWORD PTR [esi]
push DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
push edi
push esi
call DWORD PTR [eax+436]
$L27982:
; 166 : }
; 167 : }
; 168 :
; 169 : #endif
; 170 :
; 171 : env->ReleaseStringUTFChars(moduleNameS, moduleName);
push DWORD PTR _moduleName$[ebp]
mov eax, DWORD PTR [esi]
push DWORD PTR _moduleNameS$[ebp]
push esi
call DWORD PTR [eax+680]
; 172 : env->ReleaseStringUTFChars(functionNameS, functionName);
push DWORD PTR _functionName$[ebp]
mov eax, DWORD PTR [esi]
push DWORD PTR _functionNameS$[ebp]
push esi
call DWORD PTR [eax+680]
; 173 :
; 174 : return out;
mov al, BYTE PTR _out$[ebp]
pop edi
pop esi
pop ebx
; 175 :
; 176 : }
leave
ret 8
_Java_com_eaio_nativecall_NativeCall_initHandles@8 ENDP
_TEXT ENDS
PUBLIC _Java_com_eaio_nativecall_NativeCall_getLastError@8
EXTRN __imp__FormatMessageA@28:NEAR
EXTRN __imp__LocalFree@4:NEAR
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_msgBufPtr$ = 8
_Java_com_eaio_nativecall_NativeCall_getLastError@8 PROC NEAR
; 184 : (JNIEnv *env, jobject obj) {
push ebp
mov ebp, esp
; 185 :
; 186 : jint lastError = env->GetIntField(obj, fieldLastErrorCode);
mov eax, DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push esi
mov esi, DWORD PTR _env$[ebp]
push eax
push DWORD PTR _obj$[ebp]
mov ecx, DWORD PTR [esi]
push esi
call DWORD PTR [ecx+400]
; 187 :
; 188 : if (lastError == 0) return NULL;
xor ecx, ecx
cmp eax, ecx
jne SHORT $L27804
xor eax, eax
jmp SHORT $L27802
$L27804:
; 189 :
; 190 : jstring out = NULL;
; 191 :
; 192 : #ifdef _WINDOWS
; 193 :
; 194 : LPVOID msgBufPtr = NULL;
; 195 : FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
; 196 : FORMAT_MESSAGE_FROM_SYSTEM, NULL, lastError, 0,
; 197 : (LPSTR) &msgBufPtr, 0, NULL);
push ecx
lea edx, DWORD PTR _msgBufPtr$[ebp]
push ecx
push edx
push ecx
push eax
push ecx
push 4352 ; 00001100H
mov DWORD PTR _msgBufPtr$[ebp], ecx
call DWORD PTR __imp__FormatMessageA@28
; 198 :
; 199 : out = env->NewStringUTF((char*) msgBufPtr);
push DWORD PTR _msgBufPtr$[ebp]
mov eax, DWORD PTR [esi]
push esi
call DWORD PTR [eax+668]
; 200 :
; 201 : LocalFree(msgBufPtr);
push DWORD PTR _msgBufPtr$[ebp]
mov esi, eax
call DWORD PTR __imp__LocalFree@4
; 202 :
; 203 : #endif
; 204 :
; 205 : return out;
mov eax, esi
$L27802:
pop esi
; 206 :
; 207 : }
pop ebp
ret 8
_Java_com_eaio_nativecall_NativeCall_getLastError@8 ENDP
_TEXT ENDS
PUBLIC _Java_com_eaio_nativecall_NativeCall_destroy@8
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_Java_com_eaio_nativecall_NativeCall_destroy@8 PROC NEAR
; 216 :
; 217 : jint module = env->GetIntField(obj, fieldModuleHandle);
mov eax, DWORD PTR ?fieldModuleHandle@@3PAU_jfieldID@@A ; fieldModuleHandle
push esi
mov esi, DWORD PTR _env$[esp]
push edi
mov edi, DWORD PTR _obj$[esp+4]
push eax
mov ecx, DWORD PTR [esi]
push edi
push esi
call DWORD PTR [ecx+400]
; 218 :
; 219 : if (module == 0) return;
test eax, eax
je SHORT $L28016
; 220 :
; 221 : #ifdef _WINDOWS
; 222 :
; 223 : if (FreeLibrary((HMODULE) module) == 0) {
push eax
call DWORD PTR __imp__FreeLibrary@4
test eax, eax
jne SHORT $L28007
; 224 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push edi
push esi
call DWORD PTR [ecx+436]
$L28007:
; 225 : }
; 226 :
; 227 : #endif
; 228 :
; 229 : env->SetIntField(obj, fieldModuleHandle, 0);
mov eax, DWORD PTR [esi]
push 0
push DWORD PTR ?fieldModuleHandle@@3PAU_jfieldID@@A ; fieldModuleHandle
push edi
push esi
call DWORD PTR [eax+436]
; 230 : env->SetIntField(obj, fieldFunctionHandle, 0);
mov eax, DWORD PTR [esi]
push 0
push DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
push edi
push esi
call DWORD PTR [eax+436]
$L28016:
pop edi
pop esi
; 231 :
; 232 : return;
; 233 :
; 234 : }
ret 8
_Java_com_eaio_nativecall_NativeCall_destroy@8 ENDP
_TEXT ENDS
END

View File

@@ -1,101 +0,0 @@
NativeCall
Timestamp is 44472064 (Thu Apr 20 07:47:16 2006)
Preferred load address is 10000000
Start Length Name Class
0001:00000000 00000028H .idata$5 CODE
0001:00000030 00000d1eH .text CODE
0001:00000d50 00000014H .idata$2 CODE
0001:00000d64 00000014H .idata$3 CODE
0001:00000d78 00000028H .idata$4 CODE
0001:00000da0 00000096H .idata$6 CODE
0001:00000e40 00000212H .edata CODE
0002:00000000 00000004H .CRT$XCA DATA
0002:00000004 00000004H .CRT$XCZ DATA
0002:00000010 00000130H .data DATA
0002:00000140 0000004cH .bss DATA
0003:00000000 00000058H .rsrc$01 DATA
0003:00000060 000002b0H .rsrc$02 DATA
Address Publics by Value Rva+Base Lib:Object
0001:00000000 __imp__FormatMessageA@28 10001000 kernel32:KERNEL32.dll
0001:00000004 __imp__FreeLibrary@4 10001004 kernel32:KERNEL32.dll
0001:00000008 __imp__GetProcAddress@8 10001008 kernel32:KERNEL32.dll
0001:0000000c __imp__LoadLibraryA@4 1000100c kernel32:KERNEL32.dll
0001:00000010 __imp__LocalFree@4 10001010 kernel32:KERNEL32.dll
0001:00000014 __imp__GetLastError@0 10001014 kernel32:KERNEL32.dll
0001:00000018 __imp__HeapAlloc@12 10001018 kernel32:KERNEL32.dll
0001:0000001c __imp__GetProcessHeap@0 1000101c kernel32:KERNEL32.dll
0001:00000020 __imp__HeapFree@12 10001020 kernel32:KERNEL32.dll
0001:00000024 \177KERNEL32_NULL_THUNK_DATA 10001024 kernel32:KERNEL32.dll
0001:00000030 _Java_com_eaio_nativecall_IntCall_executeCall@8 10001030 f IntCall.obj
0001:00000074 _Java_com_eaio_nativecall_IntCall_executeCall0@12 10001074 f IntCall.obj
0001:0000045e ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ 1000145e f i IntCall.obj
0001:00000476 ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ 10001476 f i IntCall.obj
0001:00000491 ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ 10001491 f i IntCall.obj
0001:000004ac _Java_com_eaio_nativecall_NativeCall_initIDs@8 100014ac f NativeCall.obj
0001:00000648 _Java_com_eaio_nativecall_NativeCall_initHandles@8 10001648 f NativeCall.obj
0001:00000735 _Java_com_eaio_nativecall_NativeCall_getLastError@8 10001735 f NativeCall.obj
0001:0000078d _Java_com_eaio_nativecall_NativeCall_destroy@8 1000178d f NativeCall.obj
0001:000007f6 _Java_com_eaio_nativecall_VoidCall_executeCall@8 100017f6 f VoidCall.obj
0001:00000833 _Java_com_eaio_nativecall_VoidCall_executeCall0@12 10001833 f VoidCall.obj
0001:00000c15 ??2@YAPAXI@Z 10001c15 f libctiny:NEWDEL.OBJ
0001:00000c29 ??3@YAXPAX@Z 10001c29 f libctiny:NEWDEL.OBJ
0001:00000c3d __DllMainCRTStartup@12 10001c3d f libctiny:DLLCRT0.OBJ
0001:00000c7f ?_initterm@@YAXPAP6AXXZ0@Z 10001c7f f libctiny:INITTERM.OBJ
0001:00000c99 ?_atexit_init@@YAXXZ 10001c99 f libctiny:INITTERM.OBJ
0001:00000cb1 ?_DoExit@@YAXXZ 10001cb1 f libctiny:INITTERM.OBJ
0001:00000ccd _calloc 10001ccd f libctiny:ALLOC2.OBJ
0001:00000cf0 _memset 10001cf0 f libcmt:memset.obj
0001:00000d48 _DllMain@12 10001d48 f libcmt:dllmain.obj
0001:00000d50 __IMPORT_DESCRIPTOR_KERNEL32 10001d50 kernel32:KERNEL32.dll
0001:00000d64 __NULL_IMPORT_DESCRIPTOR 10001d64 kernel32:KERNEL32.dll
0002:00000000 ?__xc_a@@3PAP6AXXZA 10003000 libctiny:INITTERM.OBJ
0002:00000004 ?__xc_z@@3PAP6AXXZA 10003004 libctiny:INITTERM.OBJ
0002:00000010 ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ 10003010 IntCall.obj
0002:0000002c ??_C@_04JFOE@?$CIZ?$CJV?$AA@ 1000302c NativeCall.obj
0002:00000034 ??_C@_04ECLF@?$CII?$CJV?$AA@ 10003034 NativeCall.obj
0002:0000003c ??_C@_06KILP@?$DMinit?$DO?$AA@ 1000303c NativeCall.obj
0002:00000044 ??_C@_08JCMA@intValue?$AA@ 10003044 NativeCall.obj
0002:00000050 ??_C@_03PPCD@?$CI?$CJI?$AA@ 10003050 NativeCall.obj
0002:00000054 ??_C@_0N@KEBP@booleanValue?$AA@ 10003054 NativeCall.obj
0002:00000064 ??_C@_03KJOK@?$CI?$CJZ?$AA@ 10003064 NativeCall.obj
0002:00000068 ??_C@_02BENO@?$FLC?$AA@ 10003068 NativeCall.obj
0002:0000006c ??_C@_02LOEJ@?$FLB?$AA@ 1000306c NativeCall.obj
0002:00000070 ??_C@_0BB@LLFN@java?1lang?1String?$AA@ 10003070 NativeCall.obj
0002:00000084 ??_C@_0BC@FBKL@java?1lang?1Integer?$AA@ 10003084 NativeCall.obj
0002:00000098 ??_C@_0BC@IGNJ@java?1lang?1Boolean?$AA@ 10003098 NativeCall.obj
0002:000000ac ??_C@_01PGHN@o?$AA@ 100030ac NativeCall.obj
0002:000000b0 ??_C@_0BD@GEDI@Ljava?1lang?1Object?$DL?$AA@ 100030b0 NativeCall.obj
0002:000000c4 ??_C@_0BL@DALH@com?1eaio?1nativecall?1Holder?$AA@ 100030c4 NativeCall.obj
0002:000000e0 ??_C@_0O@OMHL@lastErrorCode?$AA@ 100030e0 NativeCall.obj
0002:000000f0 ??_C@_0N@EFAA@moduleHandle?$AA@ 100030f0 NativeCall.obj
0002:00000100 ??_C@_0P@LKIL@functionHandle?$AA@ 10003100 NativeCall.obj
0002:00000110 ??_C@_01FLOP@I?$AA@ 10003110 NativeCall.obj
0002:00000114 ??_C@_06CODG@module?$AA@ 10003114 NativeCall.obj
0002:0000011c ??_C@_08JJOG@function?$AA@ 1000311c NativeCall.obj
0002:00000128 ??_C@_0BD@DFD@Ljava?1lang?1String?$DL?$AA@ 10003128 NativeCall.obj
0002:00000140 ?classString@@3PAV_jclass@@A 10003140 NativeCall.obj
0002:00000144 ?fieldFunctionHandle@@3PAU_jfieldID@@A 10003144 NativeCall.obj
0002:00000148 ?newIntegerInt@@3PAU_jmethodID@@A 10003148 NativeCall.obj
0002:0000014c ?classCharArray@@3PAV_jclass@@A 1000314c NativeCall.obj
0002:00000150 ?fieldFunction@@3PAU_jfieldID@@A 10003150 NativeCall.obj
0002:00000154 ?classInteger@@3PAV_jclass@@A 10003154 NativeCall.obj
0002:00000158 ?newBooleanBoolean@@3PAU_jmethodID@@A 10003158 NativeCall.obj
0002:0000015c ?classBoolean@@3PAV_jclass@@A 1000315c NativeCall.obj
0002:00000160 ?fieldModule@@3PAU_jfieldID@@A 10003160 NativeCall.obj
0002:00000164 ?fieldModuleHandle@@3PAU_jfieldID@@A 10003164 NativeCall.obj
0002:00000168 ?classHolder@@3PAV_jclass@@A 10003168 NativeCall.obj
0002:0000016c ?fieldLastErrorCode@@3PAU_jfieldID@@A 1000316c NativeCall.obj
0002:00000170 ?classByteArray@@3PAV_jclass@@A 10003170 NativeCall.obj
0002:00000174 ?fieldHolderO@@3PAU_jfieldID@@A 10003174 NativeCall.obj
0002:00000178 ?methodBooleanValue@@3PAU_jmethodID@@A 10003178 NativeCall.obj
0002:0000017c ?methodIntValue@@3PAU_jmethodID@@A 1000317c NativeCall.obj
entry point at 0001:00000c3d
Static symbols

Binary file not shown.

View File

@@ -1,919 +0,0 @@
TITLE C:\Documents and Settings\Administrator\My Documents\Software\NativeCall\src\cpp\VoidCall.cpp
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
; COMDAT ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
; COMDAT ?FindClass@JNIEnv_@@QAEPAV_jclass@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ThrowNew@JNIEnv_@@QAEJPAV_jclass@@PBD@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?IsInstanceOf@JNIEnv_@@QAEEPAV_jobject@@PAV_jclass@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetObjectField@JNIEnv_@@QAEPAV_jobject@@PAV2@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetIntField@JNIEnv_@@QAEJPAV_jobject@@PAU_jfieldID@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetObjectField@JNIEnv_@@QAEXPAV_jobject@@PAU_jfieldID@@0@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?SetIntField@JNIEnv_@@QAEXPAV_jobject@@PAU_jfieldID@@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetArrayLength@JNIEnv_@@QAEJPAV_jarray@@@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetObjectArrayElement@JNIEnv_@@QAEPAV_jobject@@PAV_jobjectArray@@J@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?GetPrimitiveArrayCritical@JNIEnv_@@QAEPAXPAV_jarray@@PAE@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT ?ReleasePrimitiveArrayCritical@JNIEnv_@@QAEXPAV_jarray@@PAXJ@Z
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC _Java_com_eaio_nativecall_VoidCall_executeCall@8
EXTRN ?fieldFunctionHandle@@3PAU_jfieldID@@A:DWORD ; fieldFunctionHandle
EXTRN ?fieldLastErrorCode@@3PAU_jfieldID@@A:DWORD ; fieldLastErrorCode
EXTRN __imp__GetLastError@0:NEAR
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_functionHandle$ = 8
_Java_com_eaio_nativecall_VoidCall_executeCall@8 PROC NEAR
; 79 : (JNIEnv *env, jobject obj) {
push ebp
mov ebp, esp
; 80 :
; 81 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov eax, DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
push esi
mov esi, DWORD PTR _env$[ebp]
push eax
push DWORD PTR _obj$[ebp]
mov ecx, DWORD PTR [esi]
push esi
call DWORD PTR [ecx+400]
mov DWORD PTR _functionHandle$[ebp], eax
; 82 :
; 83 : #ifdef _WINDOWS
; 84 : #ifdef _X86_
; 85 :
; 86 : __asm {
; 87 :
; 88 : call functionHandle
call DWORD PTR _functionHandle$[ebp]
; 89 :
; 90 : }
; 91 :
; 92 : #endif
; 93 : #endif
; 94 :
; 95 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+436]
; 96 :
; 97 : }
pop esi
pop ebp
ret 8
_Java_com_eaio_nativecall_VoidCall_executeCall@8 ENDP
_TEXT ENDS
PUBLIC ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ ; `string'
PUBLIC _Java_com_eaio_nativecall_VoidCall_executeCall0@12
PUBLIC ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ; JNIEnv_::NewObject
PUBLIC ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
PUBLIC ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
EXTRN ?fieldHolderO@@3PAU_jfieldID@@A:DWORD ; fieldHolderO
EXTRN ?classBoolean@@3PAV_jclass@@A:DWORD ; classBoolean
EXTRN ?classInteger@@3PAV_jclass@@A:DWORD ; classInteger
EXTRN ?classByteArray@@3PAV_jclass@@A:DWORD ; classByteArray
EXTRN ?classCharArray@@3PAV_jclass@@A:DWORD ; classCharArray
EXTRN ?classHolder@@3PAV_jclass@@A:DWORD ; classHolder
EXTRN ?methodBooleanValue@@3PAU_jmethodID@@A:DWORD ; methodBooleanValue
EXTRN ?methodIntValue@@3PAU_jmethodID@@A:DWORD ; methodIntValue
EXTRN ?newIntegerInt@@3PAU_jmethodID@@A:DWORD ; newIntegerInt
EXTRN ?newBooleanBoolean@@3PAU_jmethodID@@A:DWORD ; newBooleanBoolean
EXTRN ??2@YAPAXI@Z:NEAR ; operator new
EXTRN ??3@YAXPAX@Z:NEAR ; operator delete
EXTRN _memset:NEAR
; COMDAT ??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@
; File C:\Program Files\IBMJava13\include\jni.h
_DATA SEGMENT
??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ DB 'java/lang/OutOfMemor'
DB 'yError', 00H ; `string'
_DATA ENDS
_TEXT SEGMENT
_env$ = 8
_obj$ = 12
_params$ = 16
_len$ = -28
_arrays$ = -20
_param$ = -24
_i$ = 8
_intArg$27769 = -24
_byteArrayArg$27772 = -4
_charArrayArg$27778 = -8
_tempArg$27785 = -24
_intPtr$27790 = -24
_byteArrayArg$27796 = -12
_charArrayArg$27802 = -16
_tempPtr$27809 = -24
_functionHandle$ = 8
_j$ = 8
_Java_com_eaio_nativecall_VoidCall_executeCall0@12 PROC NEAR
; 105 : (JNIEnv *env, jobject obj, jobjectArray params) {
push ebp
mov ebp, esp
sub esp, 28 ; 0000001cH
push ebx
push esi
; 106 :
; 107 : const int len = env->GetArrayLength(params);
mov esi, DWORD PTR _env$[ebp]
push edi
push DWORD PTR _params$[ebp]
mov eax, DWORD PTR [esi]
push esi
call DWORD PTR [eax+684]
mov ebx, eax
; 108 :
; 109 : int* arrays = NULL;
; 110 : if (!(arrays = new int[len])) {
mov edi, ebx
mov DWORD PTR _len$[ebp], ebx
shl edi, 2
push edi
call ??2@YAPAXI@Z ; operator new
test eax, eax
pop ecx
mov DWORD PTR _arrays$[ebp], eax
jne SHORT $L27758
; 111 : env->ThrowNew(env->FindClass("java/lang/OutOfMemoryError"), NULL);
mov eax, DWORD PTR [esi]
push OFFSET FLAT:??_C@_0BL@NKOM@java?1lang?1OutOfMemoryError?$AA@ ; `string'
push esi
call DWORD PTR [eax+24]
mov ecx, DWORD PTR [esi]
push 0
push eax
push esi
call DWORD PTR [ecx+56]
; 112 : return;
jmp $L28021
$L27758:
; 113 : }
; 114 : memset(arrays, 0, (sizeof(int) * len));
push edi
push 0
push eax
call _memset
; 115 :
; 116 : jobject param;
; 117 :
; 118 : for (int i = len - 1; i >= 0; i--) {
lea eax, DWORD PTR [ebx-1]
add esp, 12 ; 0000000cH
test eax, eax
mov DWORD PTR _i$[ebp], eax
jl $L27765
mov ecx, DWORD PTR _arrays$[ebp]
lea edi, DWORD PTR [ecx+eax*4]
jmp SHORT $L27763
$L28028:
; 113 : }
; 114 : memset(arrays, 0, (sizeof(int) * len));
mov eax, DWORD PTR _i$[ebp]
$L27763:
; 119 :
; 120 : param = env->GetObjectArrayElement(params, i);
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR _params$[ebp]
push esi
call DWORD PTR [ecx+692]
mov ebx, eax
; 121 :
; 122 : if (param == NULL) {
test ebx, ebx
jne SHORT $L27766
; 123 : _push(0);
push 0
; 124 : }
; 125 : else if (env->IsInstanceOf(param, classInteger)) {
jmp $L27764
$L27766:
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27768
; 126 : int intArg = env->CallIntMethod(param, methodIntValue);
push DWORD PTR ?methodIntValue@@3PAU_jmethodID@@A ; methodIntValue
push ebx
push esi
call ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
add esp, 12 ; 0000000cH
mov DWORD PTR _intArg$27769[ebp], eax
; 127 : _push(intArg)
push DWORD PTR _intArg$27769[ebp]
; 128 : }
; 129 : else if (env->IsInstanceOf(param, classByteArray)) {
jmp $L27764
$L27768:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27771
; 130 : char* byteArrayArg = (char*) env->GetPrimitiveArrayCritical((jarray) param, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _byteArrayArg$27772[ebp], eax
; 131 : arrays[i] = (int) &byteArrayArg;
lea eax, DWORD PTR _byteArrayArg$27772[ebp]
mov DWORD PTR [edi], eax
; 132 : _push(byteArrayArg)
push DWORD PTR _byteArrayArg$27772[ebp]
; 133 : }
; 134 : else if (env->IsInstanceOf(param, classCharArray)) {
jmp $L27764
$L27771:
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27777
; 135 : unsigned short* charArrayArg = (unsigned short*) env->GetPrimitiveArrayCritical(
; 136 : (jarray) param, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _charArrayArg$27778[ebp], eax
; 137 : arrays[i] = (int) &charArrayArg;
lea eax, DWORD PTR _charArrayArg$27778[ebp]
mov DWORD PTR [edi], eax
; 138 : _push(charArrayArg)
push DWORD PTR _charArrayArg$27778[ebp]
; 139 : }
; 140 : else if (env->IsInstanceOf(param, classBoolean)) {
jmp $L27764
$L27777:
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27783
; 141 : jboolean booleanArg = env->CallBooleanMethod(param, methodBooleanValue);
push DWORD PTR ?methodBooleanValue@@3PAU_jmethodID@@A ; methodBooleanValue
push ebx
push esi
call ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
add esp, 12 ; 0000000cH
; 142 : int tempArg = (booleanArg == JNI_FALSE ? 0 : 1);
neg al
sbb eax, eax
neg eax
mov DWORD PTR _tempArg$27785[ebp], eax
; 143 : _push(tempArg)
push DWORD PTR _tempArg$27785[ebp]
; 144 : }
; 145 : else if (env->IsInstanceOf(param, classHolder)) {
jmp $L27764
$L27783:
mov eax, DWORD PTR ?classHolder@@3PAV_jclass@@A ; classHolder
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je $L27764
; 146 :
; 147 : /* Holder */
; 148 :
; 149 : jobject o = env->GetObjectField(param, fieldHolderO);
mov eax, DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+380]
; 150 :
; 151 : if (env->IsInstanceOf(o, classInteger)) {
mov ecx, DWORD PTR [esi]
mov ebx, eax
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27789
; 152 : int *intPtr = new int;
push 4
call ??2@YAPAXI@Z ; operator new
pop ecx
mov DWORD PTR _intPtr$27790[ebp], eax
; 153 : *intPtr = env->CallIntMethod(o, methodIntValue);
push DWORD PTR ?methodIntValue@@3PAU_jmethodID@@A ; methodIntValue
push ebx
push esi
call ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallIntMethod
mov ecx, DWORD PTR _intPtr$27790[ebp]
add esp, 12 ; 0000000cH
; 154 : arrays[i] = (int) intPtr;
mov DWORD PTR [edi], ecx
mov DWORD PTR [ecx], eax
; 155 : _push(intPtr);
push DWORD PTR _intPtr$27790[ebp]
; 156 : }
; 157 : else if (env->IsInstanceOf(o, classByteArray)) {
jmp $L27764
$L27789:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27795
; 158 : char* byteArrayArg = (char*) env->GetPrimitiveArrayCritical((jarray) o, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _byteArrayArg$27796[ebp], eax
; 159 : arrays[i] = (int) &byteArrayArg;
lea eax, DWORD PTR _byteArrayArg$27796[ebp]
mov DWORD PTR [edi], eax
; 160 : _push(byteArrayArg)
push DWORD PTR _byteArrayArg$27796[ebp]
; 161 : }
; 162 : else if (env->IsInstanceOf(o, classCharArray)) {
jmp SHORT $L27764
$L27795:
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27801
; 163 : unsigned short* charArrayArg = (unsigned short*) env->GetPrimitiveArrayCritical(
; 164 : (jarray) o, 0);
mov eax, DWORD PTR [esi]
push 0
push ebx
push esi
call DWORD PTR [eax+888]
mov DWORD PTR _charArrayArg$27802[ebp], eax
; 165 : arrays[i] = (int) &charArrayArg;
lea eax, DWORD PTR _charArrayArg$27802[ebp]
mov DWORD PTR [edi], eax
; 166 : _push(charArrayArg)
push DWORD PTR _charArrayArg$27802[ebp]
; 167 : }
; 168 : else if (env->IsInstanceOf(o, classBoolean)) {
jmp SHORT $L27764
$L27801:
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push ebx
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27764
; 169 : jboolean booleanArg = env->CallBooleanMethod(o, methodBooleanValue);
push DWORD PTR ?methodBooleanValue@@3PAU_jmethodID@@A ; methodBooleanValue
push ebx
push esi
call ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ; JNIEnv_::CallBooleanMethod
; 170 : int *tempPtr = new int;
push 4
mov bl, al
call ??2@YAPAXI@Z ; operator new
add esp, 16 ; 00000010H
; 171 : *tempPtr = (booleanArg == JNI_FALSE ? 0 : 1);
xor ecx, ecx
test bl, bl
setne cl
mov DWORD PTR _tempPtr$27809[ebp], eax
mov DWORD PTR [eax], ecx
; 172 : arrays[i] = (int) tempPtr;
mov DWORD PTR [edi], eax
; 173 : _push(tempPtr);
push DWORD PTR _tempPtr$27809[ebp]
; 172 : arrays[i] = (int) tempPtr;
$L27764:
dec DWORD PTR _i$[ebp]
sub edi, 4
cmp DWORD PTR _i$[ebp], 0
jge $L28028
; 115 :
; 116 : jobject param;
; 117 :
; 118 : for (int i = len - 1; i >= 0; i--) {
mov ebx, DWORD PTR _len$[ebp]
$L27765:
; 174 : }
; 175 :
; 176 : /* end Holder */
; 177 :
; 178 : }
; 179 :
; 180 : }
; 181 :
; 182 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov eax, DWORD PTR ?fieldFunctionHandle@@3PAU_jfieldID@@A ; fieldFunctionHandle
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+400]
mov DWORD PTR _functionHandle$[ebp], eax
; 183 :
; 184 : #ifdef _WINDOWS
; 185 : #ifdef _X86_
; 186 :
; 187 : __asm {
; 188 :
; 189 : call functionHandle
call DWORD PTR _functionHandle$[ebp]
; 190 :
; 191 : }
; 192 :
; 193 : #endif
; 194 : #endif
; 195 :
; 196 : for (int j = 0; j < len; ++j) {
and DWORD PTR _j$[ebp], 0
test ebx, ebx
jle $L27817
; 174 : }
; 175 :
; 176 : /* end Holder */
; 177 :
; 178 : }
; 179 :
; 180 : }
; 181 :
; 182 : jint functionHandle = env->GetIntField(obj, fieldFunctionHandle);
mov ebx, DWORD PTR _arrays$[ebp]
$L27815:
; 197 : param = env->GetObjectArrayElement(params, j);
push DWORD PTR _j$[ebp]
mov eax, DWORD PTR [esi]
push DWORD PTR _params$[ebp]
push esi
call DWORD PTR [eax+692]
mov edi, eax
; 198 : if (param == NULL) {}
test edi, edi
mov DWORD PTR _param$[ebp], edi
je $L27816
; 199 : else if (env->IsInstanceOf(param, classByteArray) || env->IsInstanceOf(param, classCharArray)) {
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne $L27833
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne $L27833
; 201 : }
; 202 : else if (env->IsInstanceOf(param, classHolder)) {
mov eax, DWORD PTR ?classHolder@@3PAV_jclass@@A ; classHolder
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je $L27816
; 203 :
; 204 : jobject o = env->GetObjectField(param, fieldHolderO);
mov eax, DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+380]
; 205 :
; 206 : if (env->IsInstanceOf(o, classInteger)) {
mov ecx, DWORD PTR [esi]
mov edi, eax
mov eax, DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27827
; 207 : int* out = (int*) arrays[j];
mov edi, DWORD PTR [ebx]
; 208 : env->SetObjectField(param, fieldHolderO, env->NewObject(classInteger, newIntegerInt, *out));
push DWORD PTR [edi]
push DWORD PTR ?newIntegerInt@@3PAU_jmethodID@@A ; newIntegerInt
push DWORD PTR ?classInteger@@3PAV_jclass@@A ; classInteger
$L28031:
push esi
call ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ; JNIEnv_::NewObject
add esp, 16 ; 00000010H
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldHolderO@@3PAU_jfieldID@@A ; fieldHolderO
push DWORD PTR _param$[ebp]
push esi
call DWORD PTR [ecx+416]
; 209 : delete out;
push edi
call ??3@YAXPAX@Z ; operator delete
pop ecx
; 210 : }
; 211 : else if (env->IsInstanceOf(o, classByteArray) || env->IsInstanceOf(o, classCharArray)) {
jmp SHORT $L27816
$L27827:
mov eax, DWORD PTR ?classByteArray@@3PAV_jclass@@A ; classByteArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne SHORT $L27833
mov eax, DWORD PTR ?classCharArray@@3PAV_jclass@@A ; classCharArray
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
jne SHORT $L27833
; 212 : env->ReleasePrimitiveArrayCritical((jarray) o, (void*) arrays[j], 0);
; 213 : }
; 214 : else if (env->IsInstanceOf(o, classBoolean)) {
mov eax, DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
mov ecx, DWORD PTR [esi]
push eax
push edi
push esi
call DWORD PTR [ecx+128]
test al, al
je SHORT $L27816
; 215 : int* out = (int*) arrays[j];
mov edi, DWORD PTR [ebx]
; 216 : env->SetObjectField(param, fieldHolderO, env->NewObject(classBoolean, newBooleanBoolean, (*out == 0 ? JNI_FALSE : JNI_TRUE)));
xor eax, eax
cmp DWORD PTR [edi], eax
setne al
push eax
push DWORD PTR ?newBooleanBoolean@@3PAU_jmethodID@@A ; newBooleanBoolean
push DWORD PTR ?classBoolean@@3PAV_jclass@@A ; classBoolean
; 217 : delete out;
jmp SHORT $L28031
$L27833:
; 200 : env->ReleasePrimitiveArrayCritical((jarray) param, (void*) arrays[j], 0);
mov eax, DWORD PTR [esi]
push 0
push DWORD PTR [ebx]
push edi
push esi
call DWORD PTR [eax+892]
$L27816:
inc DWORD PTR _j$[ebp]
mov eax, DWORD PTR _j$[ebp]
add ebx, 4
cmp eax, DWORD PTR _len$[ebp]
jl $L27815
$L27817:
; 218 : }
; 219 :
; 220 : }
; 221 :
; 222 : }
; 223 :
; 224 : delete [] arrays;
push DWORD PTR _arrays$[ebp]
call ??3@YAXPAX@Z ; operator delete
pop ecx
; 225 :
; 226 : env->SetIntField(obj, fieldLastErrorCode, GetLastError());
call DWORD PTR __imp__GetLastError@0
mov ecx, DWORD PTR [esi]
push eax
push DWORD PTR ?fieldLastErrorCode@@3PAU_jfieldID@@A ; fieldLastErrorCode
push DWORD PTR _obj$[ebp]
push esi
call DWORD PTR [ecx+436]
$L28021:
; 227 :
; 228 : }
pop edi
pop esi
pop ebx
leave
ret 12 ; 0000000cH
_Java_com_eaio_nativecall_VoidCall_executeCall0@12 ENDP
_TEXT ENDS
; COMDAT ?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_clazz$ = 12
_methodID$ = 16
?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::NewObject, COMDAT
; 835 : va_list args;
; 836 : jobject result;
; 837 : va_start(args, methodID);
; 838 : result = functions->NewObjectV(this,clazz,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _clazz$[esp+4]
push eax
call DWORD PTR [ecx+116]
; 839 : va_end(args);
; 840 : return result;
; 841 : }
ret 0
?NewObject@JNIEnv_@@QAAPAV_jobject@@PAV_jclass@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::NewObject
_TEXT ENDS
; COMDAT ?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_obj$ = 12
_methodID$ = 16
?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::CallBooleanMethod, COMDAT
; 882 : va_list args;
; 883 : jboolean result;
; 884 : va_start(args,methodID);
; 885 : result = functions->CallBooleanMethodV(this,obj,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _obj$[esp+4]
push eax
call DWORD PTR [ecx+152]
; 886 : va_end(args);
; 887 : return result;
; 888 : }
ret 0
?CallBooleanMethod@JNIEnv_@@QAAEPAV_jobject@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::CallBooleanMethod
_TEXT ENDS
; COMDAT ?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ
_TEXT SEGMENT
_this$ = 8
_obj$ = 12
_methodID$ = 16
?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ PROC NEAR ; JNIEnv_::CallIntMethod, COMDAT
; 950 : va_list args;
; 951 : jint result;
; 952 : va_start(args,methodID);
; 953 : result = functions->CallIntMethodV(this,obj,methodID,args);
mov eax, DWORD PTR _this$[esp-4]
lea edx, DWORD PTR _methodID$[esp]
push edx
push DWORD PTR _methodID$[esp]
mov ecx, DWORD PTR [eax]
push DWORD PTR _obj$[esp+4]
push eax
call DWORD PTR [ecx+200]
; 954 : va_end(args);
; 955 : return result;
; 956 : }
ret 0
?CallIntMethod@JNIEnv_@@QAAJPAV_jobject@@PAU_jmethodID@@ZZ ENDP ; JNIEnv_::CallIntMethod
_TEXT ENDS
END

Binary file not shown.

View File

@@ -0,0 +1,523 @@
/*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*/
#ifndef CLASSFILE_CONSTANTS_H
#define CLASSFILE_CONSTANTS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Flags */
enum {
JVM_ACC_PUBLIC = 0x0001,
JVM_ACC_PRIVATE = 0x0002,
JVM_ACC_PROTECTED = 0x0004,
JVM_ACC_STATIC = 0x0008,
JVM_ACC_FINAL = 0x0010,
JVM_ACC_SYNCHRONIZED = 0x0020,
JVM_ACC_SUPER = 0x0020,
JVM_ACC_VOLATILE = 0x0040,
JVM_ACC_BRIDGE = 0x0040,
JVM_ACC_TRANSIENT = 0x0080,
JVM_ACC_VARARGS = 0x0080,
JVM_ACC_NATIVE = 0x0100,
JVM_ACC_INTERFACE = 0x0200,
JVM_ACC_ABSTRACT = 0x0400,
JVM_ACC_STRICT = 0x0800,
JVM_ACC_SYNTHETIC = 0x1000,
JVM_ACC_ANNOTATION = 0x2000,
JVM_ACC_ENUM = 0x4000
};
/* Used in newarray instruction. */
enum {
JVM_T_BOOLEAN = 4,
JVM_T_CHAR = 5,
JVM_T_FLOAT = 6,
JVM_T_DOUBLE = 7,
JVM_T_BYTE = 8,
JVM_T_SHORT = 9,
JVM_T_INT = 10,
JVM_T_LONG = 11
};
/* Constant Pool Entries */
enum {
JVM_CONSTANT_Utf8 = 1,
JVM_CONSTANT_Unicode = 2, /* unused */
JVM_CONSTANT_Integer = 3,
JVM_CONSTANT_Float = 4,
JVM_CONSTANT_Long = 5,
JVM_CONSTANT_Double = 6,
JVM_CONSTANT_Class = 7,
JVM_CONSTANT_String = 8,
JVM_CONSTANT_Fieldref = 9,
JVM_CONSTANT_Methodref = 10,
JVM_CONSTANT_InterfaceMethodref = 11,
JVM_CONSTANT_NameAndType = 12
};
/* StackMapTable type item numbers */
enum {
JVM_ITEM_Top = 0,
JVM_ITEM_Integer = 1,
JVM_ITEM_Float = 2,
JVM_ITEM_Double = 3,
JVM_ITEM_Long = 4,
JVM_ITEM_Null = 5,
JVM_ITEM_UninitializedThis = 6,
JVM_ITEM_Object = 7,
JVM_ITEM_Uninitialized = 8
};
/* Type signatures */
enum {
JVM_SIGNATURE_ARRAY = '[',
JVM_SIGNATURE_BYTE = 'B',
JVM_SIGNATURE_CHAR = 'C',
JVM_SIGNATURE_CLASS = 'L',
JVM_SIGNATURE_ENDCLASS = ';',
JVM_SIGNATURE_ENUM = 'E',
JVM_SIGNATURE_FLOAT = 'F',
JVM_SIGNATURE_DOUBLE = 'D',
JVM_SIGNATURE_FUNC = '(',
JVM_SIGNATURE_ENDFUNC = ')',
JVM_SIGNATURE_INT = 'I',
JVM_SIGNATURE_LONG = 'J',
JVM_SIGNATURE_SHORT = 'S',
JVM_SIGNATURE_VOID = 'V',
JVM_SIGNATURE_BOOLEAN = 'Z'
};
/* Opcodes */
enum {
JVM_OPC_nop = 0,
JVM_OPC_aconst_null = 1,
JVM_OPC_iconst_m1 = 2,
JVM_OPC_iconst_0 = 3,
JVM_OPC_iconst_1 = 4,
JVM_OPC_iconst_2 = 5,
JVM_OPC_iconst_3 = 6,
JVM_OPC_iconst_4 = 7,
JVM_OPC_iconst_5 = 8,
JVM_OPC_lconst_0 = 9,
JVM_OPC_lconst_1 = 10,
JVM_OPC_fconst_0 = 11,
JVM_OPC_fconst_1 = 12,
JVM_OPC_fconst_2 = 13,
JVM_OPC_dconst_0 = 14,
JVM_OPC_dconst_1 = 15,
JVM_OPC_bipush = 16,
JVM_OPC_sipush = 17,
JVM_OPC_ldc = 18,
JVM_OPC_ldc_w = 19,
JVM_OPC_ldc2_w = 20,
JVM_OPC_iload = 21,
JVM_OPC_lload = 22,
JVM_OPC_fload = 23,
JVM_OPC_dload = 24,
JVM_OPC_aload = 25,
JVM_OPC_iload_0 = 26,
JVM_OPC_iload_1 = 27,
JVM_OPC_iload_2 = 28,
JVM_OPC_iload_3 = 29,
JVM_OPC_lload_0 = 30,
JVM_OPC_lload_1 = 31,
JVM_OPC_lload_2 = 32,
JVM_OPC_lload_3 = 33,
JVM_OPC_fload_0 = 34,
JVM_OPC_fload_1 = 35,
JVM_OPC_fload_2 = 36,
JVM_OPC_fload_3 = 37,
JVM_OPC_dload_0 = 38,
JVM_OPC_dload_1 = 39,
JVM_OPC_dload_2 = 40,
JVM_OPC_dload_3 = 41,
JVM_OPC_aload_0 = 42,
JVM_OPC_aload_1 = 43,
JVM_OPC_aload_2 = 44,
JVM_OPC_aload_3 = 45,
JVM_OPC_iaload = 46,
JVM_OPC_laload = 47,
JVM_OPC_faload = 48,
JVM_OPC_daload = 49,
JVM_OPC_aaload = 50,
JVM_OPC_baload = 51,
JVM_OPC_caload = 52,
JVM_OPC_saload = 53,
JVM_OPC_istore = 54,
JVM_OPC_lstore = 55,
JVM_OPC_fstore = 56,
JVM_OPC_dstore = 57,
JVM_OPC_astore = 58,
JVM_OPC_istore_0 = 59,
JVM_OPC_istore_1 = 60,
JVM_OPC_istore_2 = 61,
JVM_OPC_istore_3 = 62,
JVM_OPC_lstore_0 = 63,
JVM_OPC_lstore_1 = 64,
JVM_OPC_lstore_2 = 65,
JVM_OPC_lstore_3 = 66,
JVM_OPC_fstore_0 = 67,
JVM_OPC_fstore_1 = 68,
JVM_OPC_fstore_2 = 69,
JVM_OPC_fstore_3 = 70,
JVM_OPC_dstore_0 = 71,
JVM_OPC_dstore_1 = 72,
JVM_OPC_dstore_2 = 73,
JVM_OPC_dstore_3 = 74,
JVM_OPC_astore_0 = 75,
JVM_OPC_astore_1 = 76,
JVM_OPC_astore_2 = 77,
JVM_OPC_astore_3 = 78,
JVM_OPC_iastore = 79,
JVM_OPC_lastore = 80,
JVM_OPC_fastore = 81,
JVM_OPC_dastore = 82,
JVM_OPC_aastore = 83,
JVM_OPC_bastore = 84,
JVM_OPC_castore = 85,
JVM_OPC_sastore = 86,
JVM_OPC_pop = 87,
JVM_OPC_pop2 = 88,
JVM_OPC_dup = 89,
JVM_OPC_dup_x1 = 90,
JVM_OPC_dup_x2 = 91,
JVM_OPC_dup2 = 92,
JVM_OPC_dup2_x1 = 93,
JVM_OPC_dup2_x2 = 94,
JVM_OPC_swap = 95,
JVM_OPC_iadd = 96,
JVM_OPC_ladd = 97,
JVM_OPC_fadd = 98,
JVM_OPC_dadd = 99,
JVM_OPC_isub = 100,
JVM_OPC_lsub = 101,
JVM_OPC_fsub = 102,
JVM_OPC_dsub = 103,
JVM_OPC_imul = 104,
JVM_OPC_lmul = 105,
JVM_OPC_fmul = 106,
JVM_OPC_dmul = 107,
JVM_OPC_idiv = 108,
JVM_OPC_ldiv = 109,
JVM_OPC_fdiv = 110,
JVM_OPC_ddiv = 111,
JVM_OPC_irem = 112,
JVM_OPC_lrem = 113,
JVM_OPC_frem = 114,
JVM_OPC_drem = 115,
JVM_OPC_ineg = 116,
JVM_OPC_lneg = 117,
JVM_OPC_fneg = 118,
JVM_OPC_dneg = 119,
JVM_OPC_ishl = 120,
JVM_OPC_lshl = 121,
JVM_OPC_ishr = 122,
JVM_OPC_lshr = 123,
JVM_OPC_iushr = 124,
JVM_OPC_lushr = 125,
JVM_OPC_iand = 126,
JVM_OPC_land = 127,
JVM_OPC_ior = 128,
JVM_OPC_lor = 129,
JVM_OPC_ixor = 130,
JVM_OPC_lxor = 131,
JVM_OPC_iinc = 132,
JVM_OPC_i2l = 133,
JVM_OPC_i2f = 134,
JVM_OPC_i2d = 135,
JVM_OPC_l2i = 136,
JVM_OPC_l2f = 137,
JVM_OPC_l2d = 138,
JVM_OPC_f2i = 139,
JVM_OPC_f2l = 140,
JVM_OPC_f2d = 141,
JVM_OPC_d2i = 142,
JVM_OPC_d2l = 143,
JVM_OPC_d2f = 144,
JVM_OPC_i2b = 145,
JVM_OPC_i2c = 146,
JVM_OPC_i2s = 147,
JVM_OPC_lcmp = 148,
JVM_OPC_fcmpl = 149,
JVM_OPC_fcmpg = 150,
JVM_OPC_dcmpl = 151,
JVM_OPC_dcmpg = 152,
JVM_OPC_ifeq = 153,
JVM_OPC_ifne = 154,
JVM_OPC_iflt = 155,
JVM_OPC_ifge = 156,
JVM_OPC_ifgt = 157,
JVM_OPC_ifle = 158,
JVM_OPC_if_icmpeq = 159,
JVM_OPC_if_icmpne = 160,
JVM_OPC_if_icmplt = 161,
JVM_OPC_if_icmpge = 162,
JVM_OPC_if_icmpgt = 163,
JVM_OPC_if_icmple = 164,
JVM_OPC_if_acmpeq = 165,
JVM_OPC_if_acmpne = 166,
JVM_OPC_goto = 167,
JVM_OPC_jsr = 168,
JVM_OPC_ret = 169,
JVM_OPC_tableswitch = 170,
JVM_OPC_lookupswitch = 171,
JVM_OPC_ireturn = 172,
JVM_OPC_lreturn = 173,
JVM_OPC_freturn = 174,
JVM_OPC_dreturn = 175,
JVM_OPC_areturn = 176,
JVM_OPC_return = 177,
JVM_OPC_getstatic = 178,
JVM_OPC_putstatic = 179,
JVM_OPC_getfield = 180,
JVM_OPC_putfield = 181,
JVM_OPC_invokevirtual = 182,
JVM_OPC_invokespecial = 183,
JVM_OPC_invokestatic = 184,
JVM_OPC_invokeinterface = 185,
JVM_OPC_xxxunusedxxx = 186,
JVM_OPC_new = 187,
JVM_OPC_newarray = 188,
JVM_OPC_anewarray = 189,
JVM_OPC_arraylength = 190,
JVM_OPC_athrow = 191,
JVM_OPC_checkcast = 192,
JVM_OPC_instanceof = 193,
JVM_OPC_monitorenter = 194,
JVM_OPC_monitorexit = 195,
JVM_OPC_wide = 196,
JVM_OPC_multianewarray = 197,
JVM_OPC_ifnull = 198,
JVM_OPC_ifnonnull = 199,
JVM_OPC_goto_w = 200,
JVM_OPC_jsr_w = 201,
JVM_OPC_MAX = 201
};
/* Opcode length initializer, use with something like:
* unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
*/
#define JVM_OPCODE_LENGTH_INITIALIZER { \
1, /* nop */ \
1, /* aconst_null */ \
1, /* iconst_m1 */ \
1, /* iconst_0 */ \
1, /* iconst_1 */ \
1, /* iconst_2 */ \
1, /* iconst_3 */ \
1, /* iconst_4 */ \
1, /* iconst_5 */ \
1, /* lconst_0 */ \
1, /* lconst_1 */ \
1, /* fconst_0 */ \
1, /* fconst_1 */ \
1, /* fconst_2 */ \
1, /* dconst_0 */ \
1, /* dconst_1 */ \
2, /* bipush */ \
3, /* sipush */ \
2, /* ldc */ \
3, /* ldc_w */ \
3, /* ldc2_w */ \
2, /* iload */ \
2, /* lload */ \
2, /* fload */ \
2, /* dload */ \
2, /* aload */ \
1, /* iload_0 */ \
1, /* iload_1 */ \
1, /* iload_2 */ \
1, /* iload_3 */ \
1, /* lload_0 */ \
1, /* lload_1 */ \
1, /* lload_2 */ \
1, /* lload_3 */ \
1, /* fload_0 */ \
1, /* fload_1 */ \
1, /* fload_2 */ \
1, /* fload_3 */ \
1, /* dload_0 */ \
1, /* dload_1 */ \
1, /* dload_2 */ \
1, /* dload_3 */ \
1, /* aload_0 */ \
1, /* aload_1 */ \
1, /* aload_2 */ \
1, /* aload_3 */ \
1, /* iaload */ \
1, /* laload */ \
1, /* faload */ \
1, /* daload */ \
1, /* aaload */ \
1, /* baload */ \
1, /* caload */ \
1, /* saload */ \
2, /* istore */ \
2, /* lstore */ \
2, /* fstore */ \
2, /* dstore */ \
2, /* astore */ \
1, /* istore_0 */ \
1, /* istore_1 */ \
1, /* istore_2 */ \
1, /* istore_3 */ \
1, /* lstore_0 */ \
1, /* lstore_1 */ \
1, /* lstore_2 */ \
1, /* lstore_3 */ \
1, /* fstore_0 */ \
1, /* fstore_1 */ \
1, /* fstore_2 */ \
1, /* fstore_3 */ \
1, /* dstore_0 */ \
1, /* dstore_1 */ \
1, /* dstore_2 */ \
1, /* dstore_3 */ \
1, /* astore_0 */ \
1, /* astore_1 */ \
1, /* astore_2 */ \
1, /* astore_3 */ \
1, /* iastore */ \
1, /* lastore */ \
1, /* fastore */ \
1, /* dastore */ \
1, /* aastore */ \
1, /* bastore */ \
1, /* castore */ \
1, /* sastore */ \
1, /* pop */ \
1, /* pop2 */ \
1, /* dup */ \
1, /* dup_x1 */ \
1, /* dup_x2 */ \
1, /* dup2 */ \
1, /* dup2_x1 */ \
1, /* dup2_x2 */ \
1, /* swap */ \
1, /* iadd */ \
1, /* ladd */ \
1, /* fadd */ \
1, /* dadd */ \
1, /* isub */ \
1, /* lsub */ \
1, /* fsub */ \
1, /* dsub */ \
1, /* imul */ \
1, /* lmul */ \
1, /* fmul */ \
1, /* dmul */ \
1, /* idiv */ \
1, /* ldiv */ \
1, /* fdiv */ \
1, /* ddiv */ \
1, /* irem */ \
1, /* lrem */ \
1, /* frem */ \
1, /* drem */ \
1, /* ineg */ \
1, /* lneg */ \
1, /* fneg */ \
1, /* dneg */ \
1, /* ishl */ \
1, /* lshl */ \
1, /* ishr */ \
1, /* lshr */ \
1, /* iushr */ \
1, /* lushr */ \
1, /* iand */ \
1, /* land */ \
1, /* ior */ \
1, /* lor */ \
1, /* ixor */ \
1, /* lxor */ \
3, /* iinc */ \
1, /* i2l */ \
1, /* i2f */ \
1, /* i2d */ \
1, /* l2i */ \
1, /* l2f */ \
1, /* l2d */ \
1, /* f2i */ \
1, /* f2l */ \
1, /* f2d */ \
1, /* d2i */ \
1, /* d2l */ \
1, /* d2f */ \
1, /* i2b */ \
1, /* i2c */ \
1, /* i2s */ \
1, /* lcmp */ \
1, /* fcmpl */ \
1, /* fcmpg */ \
1, /* dcmpl */ \
1, /* dcmpg */ \
3, /* ifeq */ \
3, /* ifne */ \
3, /* iflt */ \
3, /* ifge */ \
3, /* ifgt */ \
3, /* ifle */ \
3, /* if_icmpeq */ \
3, /* if_icmpne */ \
3, /* if_icmplt */ \
3, /* if_icmpge */ \
3, /* if_icmpgt */ \
3, /* if_icmple */ \
3, /* if_acmpeq */ \
3, /* if_acmpne */ \
3, /* goto */ \
3, /* jsr */ \
2, /* ret */ \
99, /* tableswitch */ \
99, /* lookupswitch */ \
1, /* ireturn */ \
1, /* lreturn */ \
1, /* freturn */ \
1, /* dreturn */ \
1, /* areturn */ \
1, /* return */ \
3, /* getstatic */ \
3, /* putstatic */ \
3, /* getfield */ \
3, /* putfield */ \
3, /* invokevirtual */ \
3, /* invokespecial */ \
3, /* invokestatic */ \
5, /* invokeinterface */ \
0, /* xxxunusedxxx */ \
3, /* new */ \
2, /* newarray */ \
3, /* anewarray */ \
1, /* arraylength */ \
1, /* athrow */ \
3, /* checkcast */ \
3, /* instanceof */ \
1, /* monitorenter */ \
1, /* monitorexit */ \
0, /* wide */ \
4, /* multianewarray */ \
3, /* ifnull */ \
3, /* ifnonnull */ \
5, /* goto_w */ \
5 /* jsr_w */ \
}
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* CLASSFILE_CONSTANTS */

View File

@@ -0,0 +1,278 @@
/*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef _JAVASOFT_JAWT_H_
#define _JAVASOFT_JAWT_H_
#include "jni.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* AWT native interface (new in JDK 1.3)
*
* The AWT native interface allows a native C or C++ application a means
* by which to access native structures in AWT. This is to facilitate moving
* legacy C and C++ applications to Java and to target the needs of the
* community who, at present, wish to do their own native rendering to canvases
* for performance reasons. Standard extensions such as Java3D also require a
* means to access the underlying native data structures of AWT.
*
* There may be future extensions to this API depending on demand.
*
* A VM does not have to implement this API in order to pass the JCK.
* It is recommended, however, that this API is implemented on VMs that support
* standard extensions, such as Java3D.
*
* Since this is a native API, any program which uses it cannot be considered
* 100% pure java.
*/
/*
* AWT Native Drawing Surface (JAWT_DrawingSurface).
*
* For each platform, there is a native drawing surface structure. This
* platform-specific structure can be found in jawt_md.h. It is recommended
* that additional platforms follow the same model. It is also recommended
* that VMs on Win32 and Solaris support the existing structures in jawt_md.h.
*
*******************
* EXAMPLE OF USAGE:
*******************
*
* In Win32, a programmer wishes to access the HWND of a canvas to perform
* native rendering into it. The programmer has declared the paint() method
* for their canvas subclass to be native:
*
*
* MyCanvas.java:
*
* import java.awt.*;
*
* public class MyCanvas extends Canvas {
*
* static {
* System.loadLibrary("mylib");
* }
*
* public native void paint(Graphics g);
* }
*
*
* myfile.c:
*
* #include "jawt_md.h"
* #include <assert.h>
*
* JNIEXPORT void JNICALL
* Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics)
* {
* JAWT awt;
* JAWT_DrawingSurface* ds;
* JAWT_DrawingSurfaceInfo* dsi;
* JAWT_Win32DrawingSurfaceInfo* dsi_win;
* jboolean result;
* jint lock;
*
* // Get the AWT
* awt.version = JAWT_VERSION_1_3;
* result = JAWT_GetAWT(env, &awt);
* assert(result != JNI_FALSE);
*
* // Get the drawing surface
* ds = awt.GetDrawingSurface(env, canvas);
* assert(ds != NULL);
*
* // Lock the drawing surface
* lock = ds->Lock(ds);
* assert((lock & JAWT_LOCK_ERROR) == 0);
*
* // Get the drawing surface info
* dsi = ds->GetDrawingSurfaceInfo(ds);
*
* // Get the platform-specific drawing info
* dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
*
* //////////////////////////////
* // !!! DO PAINTING HERE !!! //
* //////////////////////////////
*
* // Free the drawing surface info
* ds->FreeDrawingSurfaceInfo(dsi);
*
* // Unlock the drawing surface
* ds->Unlock(ds);
*
* // Free the drawing surface
* awt.FreeDrawingSurface(ds);
* }
*
*/
/*
* JAWT_Rectangle
* Structure for a native rectangle.
*/
typedef struct jawt_Rectangle {
jint x;
jint y;
jint width;
jint height;
} JAWT_Rectangle;
struct jawt_DrawingSurface;
/*
* JAWT_DrawingSurfaceInfo
* Structure for containing the underlying drawing information of a component.
*/
typedef struct jawt_DrawingSurfaceInfo {
/*
* Pointer to the platform-specific information. This can be safely
* cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
* JAWT_X11DrawingSurfaceInfo on Solaris. See jawt_md.h for details.
*/
void* platformInfo;
/* Cached pointer to the underlying drawing surface */
struct jawt_DrawingSurface* ds;
/* Bounding rectangle of the drawing surface */
JAWT_Rectangle bounds;
/* Number of rectangles in the clip */
jint clipSize;
/* Clip rectangle array */
JAWT_Rectangle* clip;
} JAWT_DrawingSurfaceInfo;
#define JAWT_LOCK_ERROR 0x00000001
#define JAWT_LOCK_CLIP_CHANGED 0x00000002
#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004
#define JAWT_LOCK_SURFACE_CHANGED 0x00000008
/*
* JAWT_DrawingSurface
* Structure for containing the underlying drawing information of a component.
* All operations on a JAWT_DrawingSurface MUST be performed from the same
* thread as the call to GetDrawingSurface.
*/
typedef struct jawt_DrawingSurface {
/*
* Cached reference to the Java environment of the calling thread.
* If Lock(), Unlock(), GetDrawingSurfaceInfo() or
* FreeDrawingSurfaceInfo() are called from a different thread,
* this data member should be set before calling those functions.
*/
JNIEnv* env;
/* Cached reference to the target object */
jobject target;
/*
* Lock the surface of the target component for native rendering.
* When finished drawing, the surface must be unlocked with
* Unlock(). This function returns a bitmask with one or more of the
* following values:
*
* JAWT_LOCK_ERROR - When an error has occurred and the surface could not
* be locked.
*
* JAWT_LOCK_CLIP_CHANGED - When the clip region has changed.
*
* JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed.
*
* JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed
*/
jint (JNICALL *Lock)
(struct jawt_DrawingSurface* ds);
/*
* Get the drawing surface info.
* The value returned may be cached, but the values may change if
* additional calls to Lock() or Unlock() are made.
* Lock() must be called before this can return a valid value.
* Returns NULL if an error has occurred.
* When finished with the returned value, FreeDrawingSurfaceInfo must be
* called.
*/
JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo)
(struct jawt_DrawingSurface* ds);
/*
* Free the drawing surface info.
*/
void (JNICALL *FreeDrawingSurfaceInfo)
(JAWT_DrawingSurfaceInfo* dsi);
/*
* Unlock the drawing surface of the target component for native rendering.
*/
void (JNICALL *Unlock)
(struct jawt_DrawingSurface* ds);
} JAWT_DrawingSurface;
/*
* JAWT
* Structure for containing native AWT functions.
*/
typedef struct jawt {
/*
* Version of this structure. This must always be set before
* calling JAWT_GetAWT()
*/
jint version;
/*
* Return a drawing surface from a target jobject. This value
* may be cached.
* Returns NULL if an error has occurred.
* Target must be a java.awt.Component (should be a Canvas
* or Window for native rendering).
* FreeDrawingSurface() must be called when finished with the
* returned JAWT_DrawingSurface.
*/
JAWT_DrawingSurface* (JNICALL *GetDrawingSurface)
(JNIEnv* env, jobject target);
/*
* Free the drawing surface allocated in GetDrawingSurface.
*/
void (JNICALL *FreeDrawingSurface)
(JAWT_DrawingSurface* ds);
/*
* Since 1.4
* Locks the entire AWT for synchronization purposes
*/
void (JNICALL *Lock)(JNIEnv* env);
/*
* Since 1.4
* Unlocks the entire AWT for synchronization purposes
*/
void (JNICALL *Unlock)(JNIEnv* env);
/*
* Since 1.4
* Returns a reference to a java.awt.Component from a native
* platform handle. On Windows, this corresponds to an HWND;
* on Solaris and Linux, this is a Drawable. For other platforms,
* see the appropriate machine-dependent header file for a description.
* The reference returned by this function is a local
* reference that is only valid in this environment.
* This function returns a NULL reference if no component could be
* found with matching platform information.
*/
jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo);
} JAWT;
/*
* Get the AWT native structure. This function returns JNI_FALSE if
* an error occurs.
*/
_JNI_IMPORT_OR_EXPORT_
jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt);
#define JAWT_VERSION_1_3 0x00010003
#define JAWT_VERSION_1_4 0x00010004
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* !_JAVASOFT_JAWT_H_ */

View File

@@ -0,0 +1,237 @@
/*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Java Debug Wire Protocol Transport Service Provider Interface.
*/
#ifndef JDWPTRANSPORT_H
#define JDWPTRANSPORT_H
#include "jni.h"
enum {
JDWPTRANSPORT_VERSION_1_0 = 0x00010000
};
#ifdef __cplusplus
extern "C" {
#endif
struct jdwpTransportNativeInterface_;
struct _jdwpTransportEnv;
#ifdef __cplusplus
typedef _jdwpTransportEnv jdwpTransportEnv;
#else
typedef const struct jdwpTransportNativeInterface_ *jdwpTransportEnv;
#endif /* __cplusplus */
/*
* Errors. Universal errors with JVMTI/JVMDI equivalents keep the
* values the same.
*/
typedef enum {
JDWPTRANSPORT_ERROR_NONE = 0,
JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT = 103,
JDWPTRANSPORT_ERROR_OUT_OF_MEMORY = 110,
JDWPTRANSPORT_ERROR_INTERNAL = 113,
JDWPTRANSPORT_ERROR_ILLEGAL_STATE = 201,
JDWPTRANSPORT_ERROR_IO_ERROR = 202,
JDWPTRANSPORT_ERROR_TIMEOUT = 203,
JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE = 204
} jdwpTransportError;
/*
* Structure to define capabilities
*/
typedef struct {
unsigned int can_timeout_attach :1;
unsigned int can_timeout_accept :1;
unsigned int can_timeout_handshake :1;
unsigned int reserved3 :1;
unsigned int reserved4 :1;
unsigned int reserved5 :1;
unsigned int reserved6 :1;
unsigned int reserved7 :1;
unsigned int reserved8 :1;
unsigned int reserved9 :1;
unsigned int reserved10 :1;
unsigned int reserved11 :1;
unsigned int reserved12 :1;
unsigned int reserved13 :1;
unsigned int reserved14 :1;
unsigned int reserved15 :1;
} JDWPTransportCapabilities;
/*
* Structures to define packet layout.
*
* See: http://java.sun.com/j2se/1.5/docs/guide/jpda/jdwp-spec.html
*/
enum {
JDWPTRANSPORT_FLAGS_NONE = 0x0,
JDWPTRANSPORT_FLAGS_REPLY = 0x80
};
typedef struct {
jint len;
jint id;
jbyte flags;
jbyte cmdSet;
jbyte cmd;
jbyte *data;
} jdwpCmdPacket;
typedef struct {
jint len;
jint id;
jbyte flags;
jshort errorCode;
jbyte *data;
} jdwpReplyPacket;
typedef struct {
union {
jdwpCmdPacket cmd;
jdwpReplyPacket reply;
} type;
} jdwpPacket;
/*
* JDWP functions called by the transport.
*/
typedef struct jdwpTransportCallback {
void *(*alloc)(jint numBytes); /* Call this for all allocations */
void (*free)(void *buffer); /* Call this for all deallocations */
} jdwpTransportCallback;
typedef jint (JNICALL *jdwpTransport_OnLoad_t)(JavaVM *jvm,
jdwpTransportCallback *callback,
jint version,
jdwpTransportEnv** env);
/* Function Interface */
struct jdwpTransportNativeInterface_ {
/* 1 : RESERVED */
void *reserved1;
/* 2 : Get Capabilities */
jdwpTransportError (JNICALL *GetCapabilities)(jdwpTransportEnv* env,
JDWPTransportCapabilities *capabilities_ptr);
/* 3 : Attach */
jdwpTransportError (JNICALL *Attach)(jdwpTransportEnv* env,
const char* address,
jlong attach_timeout,
jlong handshake_timeout);
/* 4: StartListening */
jdwpTransportError (JNICALL *StartListening)(jdwpTransportEnv* env,
const char* address,
char** actual_address);
/* 5: StopListening */
jdwpTransportError (JNICALL *StopListening)(jdwpTransportEnv* env);
/* 6: Accept */
jdwpTransportError (JNICALL *Accept)(jdwpTransportEnv* env,
jlong accept_timeout,
jlong handshake_timeout);
/* 7: IsOpen */
jboolean (JNICALL *IsOpen)(jdwpTransportEnv* env);
/* 8: Close */
jdwpTransportError (JNICALL *Close)(jdwpTransportEnv* env);
/* 9: ReadPacket */
jdwpTransportError (JNICALL *ReadPacket)(jdwpTransportEnv* env,
jdwpPacket *pkt);
/* 10: Write Packet */
jdwpTransportError (JNICALL *WritePacket)(jdwpTransportEnv* env,
const jdwpPacket* pkt);
/* 11: GetLastError */
jdwpTransportError (JNICALL *GetLastError)(jdwpTransportEnv* env,
char** error);
};
/*
* Use inlined functions so that C++ code can use syntax such as
* env->Attach("mymachine:5000", 10*1000, 0);
*
* rather than using C's :-
*
* (*env)->Attach(env, "mymachine:5000", 10*1000, 0);
*/
struct _jdwpTransportEnv {
const struct jdwpTransportNativeInterface_ *functions;
#ifdef __cplusplus
jdwpTransportError GetCapabilities(JDWPTransportCapabilities *capabilities_ptr) {
return functions->GetCapabilities(this, capabilities_ptr);
}
jdwpTransportError Attach(const char* address, jlong attach_timeout,
jlong handshake_timeout) {
return functions->Attach(this, address, attach_timeout, handshake_timeout);
}
jdwpTransportError StartListening(const char* address,
char** actual_address) {
return functions->StartListening(this, address, actual_address);
}
jdwpTransportError StopListening(void) {
return functions->StopListening(this);
}
jdwpTransportError Accept(jlong accept_timeout, jlong handshake_timeout) {
return functions->Accept(this, accept_timeout, handshake_timeout);
}
jboolean IsOpen(void) {
return functions->IsOpen(this);
}
jdwpTransportError Close(void) {
return functions->Close(this);
}
jdwpTransportError ReadPacket(jdwpPacket *pkt) {
return functions->ReadPacket(this, pkt);
}
jdwpTransportError WritePacket(const jdwpPacket* pkt) {
return functions->WritePacket(this, pkt);
}
jdwpTransportError GetLastError(char** error) {
return functions->GetLastError(this, error);
}
#endif /* __cplusplus */
};
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* JDWPTRANSPORT_H */

1944
cpp/nativecall/include/jni.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
/*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include <windows.h>
#include "jawt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Win32-specific declarations for AWT native interface.
* See notes in jawt.h for an example of use.
*/
typedef struct jawt_Win32DrawingSurfaceInfo {
/* Native window, DDB, or DIB handle */
union {
HWND hwnd;
HBITMAP hbitmap;
void* pbits;
};
/*
* This HDC should always be used instead of the HDC returned from
* BeginPaint() or any calls to GetDC().
*/
HDC hdc;
HPALETTE hpalette;
} JAWT_Win32DrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif /* !_JAVASOFT_JAWT_MD_H_ */

View File

@@ -0,0 +1,19 @@
/*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)
#define JNICALL __stdcall
typedef long jint;
typedef __int64 jlong;
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */

View File

@@ -0,0 +1 @@
copy Release\nativecall.dll ..\..\..\java\native

View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nativecall", "nativecall.vcxproj", "{64CA530A-A10E-4AF5-A940-E0034CEC10E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{64CA530A-A10E-4AF5-A940-E0034CEC10E7}.Debug|Win32.ActiveCfg = Debug|Win32
{64CA530A-A10E-4AF5-A940-E0034CEC10E7}.Debug|Win32.Build.0 = Debug|Win32
{64CA530A-A10E-4AF5-A940-E0034CEC10E7}.Release|Win32.ActiveCfg = Release|Win32
{64CA530A-A10E-4AF5-A940-E0034CEC10E7}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{64CA530A-A10E-4AF5-A940-E0034CEC10E7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>nativecall</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>..\include;..\include\win32;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>..\include;..\include\win32;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECALL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy.bat</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECALL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy.bat</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\com_eaio_nativecall_IntCall.h" />
<ClInclude Include="..\com_eaio_nativecall_NativeCall.h" />
<ClInclude Include="..\com_eaio_nativecall_VoidCall.h" />
<ClInclude Include="..\resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\IntCall.cpp" />
<ClCompile Include="..\NativeCall.cpp" />
<ClCompile Include="..\VoidCall.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\com_eaio_nativecall_NativeCall.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\com_eaio_nativecall_VoidCall.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\com_eaio_nativecall_IntCall.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\IntCall.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\NativeCall.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\VoidCall.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,25 +0,0 @@
# $Id: readme.txt,v 1.1 2006/01/05 19:55:58 grnull Exp $
Hi,
this is the readme file for people who want to build the native libraries for
NativeCall themselves.
Compiling the native libraries requires some header files (after all, it's
just C++).
Search for
jni.h
which is required. You will most likey also need jni_md.h and
jniproto_md.h. Copy these files to this directory.
The library has been compiled and is set up for libctiny.lib to make the
binaries even smaller. You can download libctiny.lib from
<http://msdn.microsoft.com/msdnmag/issues/01/01/hood/default.aspx>
After you downloaded it, extract libctiny.lib to this folder. You also might
have to change the paths for the compiler and the linker.

View File

@@ -1,4 +1,4 @@
//{{NO_DEPENDENCIES}}
/{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by version.rc
//

View File

@@ -1,104 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Deutsch (Deutschland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,4,1,0
PRODUCTVERSION 0,4,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040704b0"
BEGIN
VALUE "CompanyName", "eaio\0"
VALUE "FileDescription", "NativeCall native library\0"
VALUE "FileVersion", "0, 4, 1, 0\0"
VALUE "LegalCopyright", "2003-2006 Johann Burkard\0"
VALUE "OriginalFilename", "NativeCall.dll\0"
VALUE "ProductName", "NativeCall\0"
VALUE "ProductVersion", "0, 4, 1, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x407, 1200
END
END
#endif // !_MAC
#endif // Deutsch (Deutschland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,5 +1,4 @@
copy ..\wiiuse.h ..\..\WiiUseJ\
copy ..\speaker.h ..\..\WiiUseJ\
copy Release\wiiuse.lib ..\..\WiiUseJ\lib\
copy Release\wiiuse.dll ..\..\..\java\
pause
copy Release\wiiuse.dll ..\..\..\java\

BIN
java/native/nativecall.dll Normal file

Binary file not shown.