⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootstrap.java

📁 用于Java 组件和通过Windows COM 对象或Windows DLL 来公开的组件之间的互操作
💻 JAVA
字号:
//******************************************************************
// Released under the DevelopMentor OpenSource Software License.
// Please consult the LICENSE file in the project root directory,
// or at http://www.develop.com for details before using this
// software.
//******************************************************************

package com.develop.jawin;

import com.develop.util.*;

/**
 * Native entry points used to bootstrap Jawin. All native functions are 
 * package scoped to prevent outsiders calling them
 */
public class Bootstrap {

  static {
    String hardLib = System.getProperty("com.develop.jawin.hardlib");
    if (hardLib != null) {
      String userDir = System.getProperty("user.dir");
      String fullPath = userDir + java.io.File.separator + hardLib;
      System.err.println("Loading jawin from hardcoded path " + fullPath);
      Runtime.getRuntime().load(fullPath);
    } else {
      String libName = System.getProperty("com.develop.jawin.lib");
      if (libName == null) {
	libName = "Jawin";
      }
      System.loadLibrary(libName);
    }
    com.develop.jawin.DispatchPtr.init();
    com.develop.jawin.IEnumVariant.init();
  }
  /** 
   * call to initialize Jawin (work actually done in static initializer)
   */
  public static void init() {}

  static native int loadLibrary(String lib) throws COMException;
  static native int loadFunction(int lib, String function) throws COMException;
  static native void freeLibrary(int lib);

  /**
   * Revokes a GIT entry. Called only by {@link com.develop.jawin.IdentityManager} 
   */
  static native void revokeGIT(int peer);
  /** 
   * Jawin caches guids under an integer token, to avoid the overhead
   * of marshalling GUIDs back and forth
   */
  static native int registerGUID(byte[] guid);
  static native int queryInterface(int guidToken, int unknown);

  static native int unmarshalFromGIT(int peer, int guidToken);
  static native int marshalToGIT(int unknown, int guidToken);

  /**
   * vtable call with no args, used for AddRef and Release
   */
  static native int directCOM(int unknown, int vtableOffset);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -