Delphi 6 呼叫 JVM.dll 的問題 |
缺席
|
northpenguin
一般會員 發表:4 回覆:5 積分:1 註冊:2003-10-13 發送簡訊給我 |
[code cpp]
/* ========================================================================= * The following defines a private JVM interface that the JDK can query * for the JVM version and capabilities. sun.misc.Version defines * the methods for getting the VM version and its capabilities. * * When a new bit is added, the following should be updated to provide * access to the new capability: * HS: JVM_GetVersionInfo and Abstract_VM_Version class * SDK: Version class * * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for * JVM to query for the JDK version and capabilities. * * When a new bit is added, the following should be updated to provide * access to the new capability: * HS: JDK_Version class * SDK: JDK_GetVersionInfo0 * * ========================================================================== */ typedef struct { /* Naming convention of RE build version string: n.n.n[_uu[c]][- unsigned int jvm_version; /* Consists of major, minor, micro (n.n.n) */ /* and build number (xx) */ unsigned int update_version : 8; /* Update release version (uu) */ unsigned int special_update_version : 8; /* Special update release version (c) */ unsigned int reserved1 : 16; unsigned int reserved2; /* The following bits represents JVM supports that JDK has dependency on. * JDK can use these bits to determine which JVM version * and support it has to maintain runtime compatibility. * * When a new bit is added in a minor or update release, make sure * the new bit is also added in the main/baseline. */ unsigned int is_attachable : 1; unsigned int : 31; unsigned int : 32; unsigned int : 32; } jvm_version_info; #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) #define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) #define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) /* Build number is available only for RE builds. * It will be zero for internal builds. */ #define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) JNIEXPORT void JNICALL JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); typedef struct { // Naming convention of RE build version string: n.n.n[_uu[c]][- unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */ /* and build number (xx) */ unsigned int update_version : 8; /* Update release version (uu) */ unsigned int special_update_version : 8; /* Special update release version (c)*/ unsigned int reserved1 : 16; unsigned int reserved2; /* The following bits represents new JDK supports that VM has dependency on. * VM implementation can use these bits to determine which JDK version * and support it has to maintain runtime compatibility. * * When a new bit is added in a minor or update release, make sure * the new bit is also added in the main/baseline. */ unsigned int thread_park_blocker : 1; unsigned int : 31; unsigned int : 32; unsigned int : 32; } jdk_version_info; #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) #define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) #define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) /* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN) * It will be zero for internal builds. */ #define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) /* * This is the function JDK_GetVersionInfo0 defined in libjava.so * that is dynamically looked up by JVM. */ typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); [/code] 以上的程式碼 是節錄於 http://12.101.252.19/hotspot/xref/src/share/vm/prims/jvm.h 其中有關 unsigned int : 31; 在DELPHI 要如何轉換成為PASCAL的格式 或是有哪位大大可以幫忙指導一下 DELPHI底下 要取得JVM的版本編號 要如何取得 抱歉小弟我還沒有用過發表文章的功能 上面的功能不會用 編輯記錄
northpenguin 重新編輯於 2008-04-15 00:50:12, 註解 Delphi 6 呼叫 JVM.dll 的問題‧
Coffee 重新編輯於 2008-04-15 11:21:03, 註解 無‧ Coffee 重新編輯於 2008-04-15 11:33:17, 註解 無‧ Coffee 重新編輯於 2008-04-15 11:34:20, 註解 無‧ Coffee 重新編輯於 2008-04-15 11:35:29, 註解 無‧ |
jow
尊榮會員 發表:66 回覆:751 積分:1253 註冊:2002-03-13 發送簡訊給我 |
如果這些是用來表示 bit field的話, 則
1536 unsigned int thread_park_blocker : 1; 1537 unsigned int : 31; 1538 unsigned int : 32; 1539 unsigned int : 32; 其中1536與1537應該合在一起, 宣告成一個 unsigned int 如 unsigned int A 使用時再使用位元運算解開來用, thread_park_blocker := A and $1; 個人看法, 謹供參考......
編輯記錄
jow 重新編輯於 2008-04-15 01:27:05, 註解 無‧
|
northpenguin
一般會員 發表:4 回覆:5 積分:1 註冊:2003-10-13 發送簡訊給我 |
|
Coffee
版主 發表:31 回覆:878 積分:561 註冊:2006-11-15 發送簡訊給我 |
|
northpenguin
一般會員 發表:4 回覆:5 積分:1 註冊:2003-10-13 發送簡訊給我 |
|
Coffee
版主 發表:31 回覆:878 積分:561 註冊:2006-11-15 發送簡訊給我 |
|
northpenguin
一般會員 發表:4 回覆:5 積分:1 註冊:2003-10-13 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |