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

📄 sharedstubs.java

📁 java 调用windows的api
💻 JAVA
字号:
/*
 * SharedStubs.java -
 *
 * This file is part of the Jawin Project: http://jawinproject.sourceforge.net/
 * 
 * Please consult the LICENSE file in the project root directory,
 * or at the project site before using this software.
 */

/* $Id: SharedStubs.java,v 1.3 2004/06/14 19:47:19 arosii_moa Exp $ */

package org.jawin.marshal;

import org.jawin.Bootstrap;
import org.jawin.COMException;

/**
 * Shared stubs for native DLL entry points with common signatures - these should
 * usually NOT be called directly, instead use the invoke_*-methods in
 * {@link org.jawin.FuncPtr FuncPtr}.
 * <br><br>
 * The method names imitates the signature of the native method, on the form
 * <code>[XXXX][_Y]</code> where <code>X</code> is the native method parameters 
 * ([in]/[out]) input type(s) and <code>_Y</code> is the return ([retval]) type (if any).
 * <br><br> 
 * Guide to type codes and their usage ([in]/[out]/[retval]):
 * <ul>
 * 	<li><code>I</code> [in]/[retval] int</li>
 * 	<li><code>G</code> [in]/[retval] string</li>
 * 	<li><code>P</code> [in] pointer to a byte array</li>
 * 	<li><code>O</code> [out] out parameter with sizeof(int), ie. 4 bytes</li>
 *  <li><code>S</code> [retval] return byte array value with the size of a specified return size</li>
 * </ul>
 * The native implementations of the methods in this class are in SharedStubs.cpp.
 * 
 * @see org.jawin.FuncPtr FuncPtr
 *
 * @version     $Revision: 1.3 $
 * @author      Stuart Halloway, http://www.relevancellc.com/halloway/weblog/
 */
public class SharedStubs {

	static {
		Bootstrap.init();
	}

	/**
	 * private constructor to avoid instantiation, as this class only contains
	 * static methods.
	 */
	private SharedStubs() {
		// never called
	}

	// "simple" methods with only I or G [in] args and I as [retval]

	/**
	 * @see org.jawin.FuncPtr#invoke_I(int, String, String, int, ReturnFlags)
	 */ 
	public static native int invokeIGGI_I(int arg0, String arg1, String arg2, int arg3, int func, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(int, String, ReturnFlags)
	 */ 
	public static native int invokeIG_I(int arg0, String arg1, int peer, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(int, int, int, int, ReturnFlags)
	 */ 
	public static native int invokeIIII_I(int arg0, int arg1, int arg2, int arg3, int func, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(int, int, ReturnFlags)
	 */ 
	public static native int invokeII_I(int arg0, int arg1, int func, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(int, ReturnFlags)
	 */ 
	public static native int invokeI_I(int arg0, int func, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(ReturnFlags)
	 */ 
	public static native int invoke_I(int func, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(String, ReturnFlags)
	 */ 
	public static native int invokeG_I(String arg0, int peer, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(String, String, ReturnFlags)
	 */ 
	public static native int invokeGG_I(String arg0, String arg1, int peer, int flags) throws COMException;
	
	/**
	 * @see org.jawin.FuncPtr#invoke_I(byte[], ReturnFlags)
	 */ 
	public static native int invokeP_I(byte[] arg0, int func, int flags) throws COMException;
	

	// methods with a single [out] int (must be the last param in the native method)

	/**
	 * @see org.jawin.FuncPtr#invoke_OI(int, int, int, int, ReturnFlags)
	 */ 
	public static native int invokeIIIIO(int arg0, int arg1, int arg2, int arg3, int func, int flags) throws COMException;

	/**
	 * @see org.jawin.FuncPtr#invoke_OI(int, ReturnFlags)
	 */ 
	public static native int invokeIO(int arg0, int peer, int flags) throws COMException;

	/**
	 * @see org.jawin.FuncPtr#invoke_OI(int, String, ReturnFlags)
	 */ 
	public static native int invokeIGO(int arg0, String arg1, int peer, int flags) throws COMException;
	

	// methods which return a byte array value with the size of a specified return size

	/**
	 * @see org.jawin.FuncPtr#invoke_S(int, int, ReturnFlags)
	 */ 
	public static native byte[] invokeI_S(int arg0, int returnSize, int func, int flags) throws COMException;

	/**
	 * @see org.jawin.FuncPtr#invoke_S(byte[], int, ReturnFlags)
	 */ 
	public static native byte[] invokeP_S(byte[] arg0, int returnSize, int func, int flags) throws COMException;

	/**
	 * @see org.jawin.FuncPtr#invoke_S(byte[], int, int, ReturnFlags)
	 */ 
	public static native byte[] invokePI_S(byte[] arg0, int arg1, int returnSize, int func, int flags) throws COMException;

}

⌨️ 快捷键说明

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