本文整理了Java中com.sun.jna.Function.getFunction()
方法的一些代码示例,展示了Function.getFunction()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.getFunction()
方法的具体详情如下:
包路径:com.sun.jna.Function
类名称:Function
方法名:getFunction
[英]Obtain a Function
representing a native function pointer. In general, this function should be used by dynamic languages; Java code should allow JNA to bind to a specific Callback interface instead by defining a return type or Structure field type.
The allocated instance represents a pointer to the native function pointer.
[中]获取表示本机函数指针的Function
。一般来说,动态语言应该使用这个函数;Java代码应该允许JNA通过定义返回类型或结构字段类型绑定到特定的回调接口。
分配的实例表示指向本机函数指针的指针。
代码示例来源:origin: net.java.dev.jna/jna
/**
* Obtain a <code>Function</code> representing a native
* function pointer. In general, this function should be used by dynamic
* languages; Java code should allow JNA to bind to a specific Callback
* interface instead by defining a return type or Structure field type.
*
* <p>The allocated instance represents a pointer to the native
* function pointer.
*
* @param p Native function pointer
*/
public static Function getFunction(Pointer p) {
return getFunction(p, 0, null);
}
代码示例来源:origin: net.java.dev.jna/jna
/**
* Obtain a <code>Function</code> representing a native
* function pointer. In general, this function should be used by dynamic
* languages; Java code should allow JNA to bind to a specific Callback
* interface instead by defining a return type or Structure field type.
*
* <p>The allocated instance represents a pointer to the native
* function pointer.
*
* @param p
* Native function pointer
* @param callFlags
* Function <a href="#callflags">call flags</a>
*/
public static Function getFunction(Pointer p, int callFlags) {
return getFunction(p, callFlags, null);
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public int AddRef() {
Function f = Function.getFunction(vTable[1], Function.ALT_CONVENTION);
return f.invokeInt(new Object[]{interfacePointer});
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public WinNT.HRESULT QueryInterface(REFIID byValue, PointerByReference pointerByReference) {
Function f = Function.getFunction(vTable[0], Function.ALT_CONVENTION);
return new WinNT.HRESULT(f.invokeInt(new Object[]{interfacePointer, byValue, pointerByReference}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public WinNT.HRESULT QueryInterface(REFIID byValue, PointerByReference pointerByReference) {
Function f = Function.getFunction(vTable[0], Function.ALT_CONVENTION);
return new WinNT.HRESULT(f.invokeInt(new Object[]{interfacePointer, byValue, pointerByReference}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT GetUIObjectOf(WinDef.HWND hwndOwner, int cidl, Pointer apidl, REFIID riid, IntByReference rgfReserved, PointerByReference ppv) {
Function f = Function.getFunction(vTable[10], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, hwndOwner, cidl, apidl, riid, rgfReserved, ppv}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT Clone(PointerByReference ppenum) {
Function f = Function.getFunction(vTable[6], Function.ALT_CONVENTION);
return new HRESULT(f.invokeInt(new Object[]{interfacePointer, ppenum}));
}
};
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public WinNT.HRESULT ParseDisplayName(WinDef.HWND hwnd, Pointer pbc, String pszDisplayName, IntByReference pchEaten, PointerByReference ppidl, IntByReference pdwAttributes) {
Function f = Function.getFunction(vTable[3], Function.ALT_CONVENTION);
return new WinNT.HRESULT(f.invokeInt(new Object[]{interfacePointer, hwnd, pbc, pszDisplayName, pchEaten, ppidl, pdwAttributes}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT BindToStorage(Pointer pidl, Pointer pbc, REFIID riid, PointerByReference ppv) {
Function f = Function.getFunction(vTable[6], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, pidl, pbc, riid, ppv}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT CompareIDs(WinDef.LPARAM lParam, Pointer pidl1, Pointer pidl2) {
Function f = Function.getFunction(vTable[7], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, lParam, pidl1, pidl2}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT CreateViewObject(WinDef.HWND hwndOwner, REFIID riid, PointerByReference ppv) {
Function f = Function.getFunction(vTable[8], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, hwndOwner, riid, ppv}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT GetAttributesOf(int cidl, Pointer apidl, IntByReference rgfInOut) {
Function f = Function.getFunction(vTable[9], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, cidl, apidl, rgfInOut}));
}
代码示例来源:origin: net.java.dev.jna/jna-platform
@Override
public HRESULT SetNameOf(WinDef.HWND hwnd, Pointer pidl, String pszName, int uFlags, PointerByReference ppidlOut) {
Function f = Function.getFunction(vTable[12], Function.ALT_CONVENTION);
return new WinNT.HRESULT( f.invokeInt(new Object[]{interfacePointer, hwnd, pidl, pszName, uFlags, ppidlOut}));
}
};
代码示例来源:origin: net.java.dev.jna/jna-platform
protected int _invokeNativeInt(int vtableId, Object[] args) {
Pointer vptr = this.getPointer().getPointer(0);
// we take the vtable id and multiply with the pointer size (4 bytes on
// 32bit OS)
Function func = Function.getFunction(vptr.getPointer(vtableId
* Native.POINTER_SIZE));
return func.invokeInt(args);
}
代码示例来源:origin: net.java.dev.jna/jna-platform
protected void _invokeNativeVoid(int vtableId, Object[] args) {
Pointer vptr = this.getPointer().getPointer(0);
// we take the vtable id and multiply with the pointer size (4 bytes on
// 32bit OS)
Function func = Function.getFunction(vptr.getPointer(vtableId
* Native.POINTER_SIZE));
func.invokeVoid(args);
}
代码示例来源:origin: net.java.dev.jna/platform
public/* [local] */void ReleaseVarDesc(
/* [in] */VARDESC pVarDesc) {
Pointer vptr = this.getPointer().getPointer(0);
Function func = Function.getFunction(vptr.getPointer(84));
func.invokeInt(new Object[] { this.getPointer(), pVarDesc });
}
}
代码示例来源:origin: net.java.dev.jna/platform
public HRESULT IsName(
/* [annotation][out][in] */
WString szNameBuf,
/* [in] */ULONG lHashVal,
/* [out] */BOOLbyReference pfName) {
Pointer vptr = this.getPointer().getPointer(0);
Function func = Function.getFunction(vptr.getPointer(40));
int hr = func.invokeInt(new Object[] { this.getPointer(), szNameBuf,
lHashVal, pfName });
return new HRESULT(hr);
}
代码示例来源:origin: net.java.dev.jna/platform
public/* [local] */HRESULT GetFuncDesc(
/* [in] */UINT index,
/* [out] */FUNCDESC.ByReference pFuncDesc) {
Pointer vptr = this.getPointer().getPointer(0);
Function func = Function.getFunction(vptr.getPointer(20));
int hr = func.invokeInt(new Object[] { this.getPointer(), index,
pFuncDesc });
return new HRESULT(hr);
}
代码示例来源:origin: net.java.dev.jna/platform
public/* [local] */HRESULT GetNames(
/* [in] */MEMBERID memid,
/* [length_is][size_is][out] */BSTR[] rgBstrNames,
/* [in] */UINT cMaxNames,
/* [out] */UINTbyReference pcNames) {
Pointer vptr = this.getPointer().getPointer(0);
Function func = Function.getFunction(vptr.getPointer(28));
int hr = func.invokeInt(new Object[] { this.getPointer(), memid,
rgBstrNames, cMaxNames, pcNames });
return new HRESULT(hr);
}
代码示例来源:origin: net.java.dev.jna/platform
public HRESULT GetTypeAttr(
/* [out] */TYPEATTR.ByReference pTypeAttr) {
Pointer vptr = this.getPointer().getPointer(0);
Function func = Function.getFunction(vptr.getPointer(12));
int hr = func.invokeInt(new Object[] { this.getPointer(), pTypeAttr });
pTypeAttr.read();
return new HRESULT(hr);
}
内容来源于网络,如有侵权,请联系作者删除!