private static CheckEntryPoint ( string library, string method ) : bool | ||
library | string | The library. |
method | string | The method. |
return | bool |
private static bool CheckEntryPoint(string library, string method)
{
var libPtr = NativeMethods.LoadLibrary(library);
if (libPtr.Equals(IntPtr.Zero))
{
return false;
}
if (!NativeMethods.GetProcAddress(libPtr, method).Equals(IntPtr.Zero))
{
NativeMethods.FreeLibrary(libPtr);
return true;
}
NativeMethods.FreeLibrary(libPtr);
return false;
}