public static IntPtr GetProcAddress(string functionName) { if (ADLLibrary == IntPtr.Zero) { return(IntPtr.Zero); } return(ADLImport.ADL_Main_Control_GetProcAddress(ADLLibrary, functionName)); }
public static bool IsFunctionValid(string functionName) { if (ADLLibrary == IntPtr.Zero) { return(false); } return(ADLImport.ADL_Main_Control_IsFunctionValid(ADLLibrary, functionName) == 1); }
/// <summary> Constructor</summary> private ADLCheckLibrary() { try { if (1 == ADLImport.ADL_Main_Control_IsFunctionValid(IntPtr.Zero, "ADL_Main_Control_Create")) { ADLLibrary = ADLImport.GetModuleHandle(ADLImport.Atiadlxx_FileName); } } catch (DllNotFoundException) { } catch (EntryPointNotFoundException) { } catch (Exception) { } }
/// <summary> Get the unmanaged function pointer </summary> /// <param name="functionName"> function name</param> /// <returns>return function pointer, if function exists</returns> internal static IntPtr GetProcAddress(string functionName) { IntPtr result = System.IntPtr.Zero; if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary) { result = ADLImport.ADL_Main_Control_GetProcAddress(ADLCheckLibrary_.ADLLibrary, functionName); } return(result); }
/// <summary> Get the unmanaged function pointer </summary> /// <param name="functionName"> function name</param> /// <returns>return function pointer, if function exists</returns> internal static FARPROC GetProcAddress(string functionName) { var result = IntPtr.Zero; if (IntPtr.Zero != ADLCheckLibrary_.ADLLibrary) { result = ADLImport.ADL_Main_Control_GetProcAddress(ADLCheckLibrary_.ADLLibrary, functionName); } return(result); }
/// <summary> Check the import function to see it exists or not</summary> /// <param name="functionName"> function name</param> /// <returns>return true, if function exists</returns> internal static bool IsFunctionValid(string functionName) { bool result = false; if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary) { if (1 == ADLImport.ADL_Main_Control_IsFunctionValid(ADLCheckLibrary_.ADLLibrary, functionName)) { result = true; } } return(result); }