protected Native.Core.Field getField(int size, LpProcName lpProcName) { return(provider .Svc .native(lpProcName) .t(size) .Raw.Type.FirstField); }
/// <typeparam name="T">The return type for new Delegate should be as T type.</typeparam> /// <param name="lpProcName"></param> /// <param name="ret">The type of return value.</param> /// <param name="args">The type of arguments.</param> /// <returns>Delegate of exported function.</returns> protected Method <T, object> bind <T>(LpProcName lpProcName, Type ret, params Type[] args) { MethodInfo mi = Dynamic.GetMethodInfo((string)lpProcName, ret, args); TDyn dyn = wire(mi, lpProcName, Convention); return(delegate(object[] _args) { return (T)dyn.dynamic.Invoke(null, _args); }); }
/// <param name="lpProcName">The name of exported function.</param> /// <returns>The address of the exported function.</returns> protected IntPtr getProcAddress(LpProcName lpProcName) { if (!Library.IsActive && !load()) { throw new LoaderException($"The handle of library is zero. Last loaded library: '{Library.LibName}'"); } return(getProcAddress( Library.Handle, tryAlias(lpProcName), Mangling )); }
private string tryAlias(LpProcName lpProcName) { return((aliasDict == null) ? (string)lpProcName : aliasDict.use(lpProcName)); }
protected TDyn wire(MethodInfo mi, LpProcName lpProcName, CallingConvention conv) { return(wire(mi, getProcAddress(lpProcName), conv)); }
protected TDyn wire(MethodInfo mi, LpProcName lpProcName) { return(wire(mi, lpProcName, Convention)); }
protected T getDelegate <T>(LpProcName lpProcName) where T : class { return(getDelegate <T>(getProcAddress(lpProcName))); }
public NativeData native(LpProcName lpProcName) { return(getProcAddr(lpProcName).Native()); }
public IntPtr getProcAddr(LpProcName lpProcName) { return(provider.getProcAddress(lpProcName)); }