Inheritance: Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
コード例 #1
0
ファイル: LibPl.cs プロジェクト: segmond/swicli
        public static void UnLoadUnmanagedLibrary()
        {
#if USESAFELIB
            if (m_hLibrary != null && !m_hLibrary.IsClosed)
            {
                m_hLibrary.Close();
                m_hLibrary.UnLoad();
                m_hLibrary.Dispose();
                m_hLibrary = null;
            }
#endif
        }
コード例 #2
0
ファイル: LibPl.cs プロジェクト: sandhaka/contrib-swiplcs
 private static void UnLoadUnmanagedLibrary()
 {
     if (!_hLibrary.IsClosed)
     {
         _hLibrary.Close();
         do
         {
             // be sure to unload swipl.sll
         } while (_hLibrary.UnLoad());
         // m_hLibrary.UnLoad();
         _hLibrary.Dispose();
         _hLibrary = null;
     }
 }
コード例 #3
0
 internal static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, String procname);
コード例 #4
0
 internal static extern IntPtr dlsym(SafeLibraryHandle hModule, String procname);
コード例 #5
0
ファイル: LibPl.cs プロジェクト: swi-to-yap/swicli
        public static void UnLoadUnmanagedLibrary()
        {
#if USESAFELIB
            if (m_hLibrary != null && !m_hLibrary.IsClosed)
            {
                m_hLibrary.Close();
                m_hLibrary.UnLoad();
                m_hLibrary.Dispose();
                m_hLibrary = null;
            }
#endif
        }
コード例 #6
0
ファイル: LibPl.cs プロジェクト: segmond/swicli
        public static void LoadUnmanagedLibrary(string fileName)
        {
#if USESAFELIB
            if (m_hLibrary == null)
            {
                if (PrologCLR.IsLinux)
                {
					return;
                    m_hLibrary = NativeMethodsLinux.LoadLibrary("/lib64/pl-6.0.3/lib/x86_64/libswipl.so");
                    if (m_hLibrary.IsInvalid)
                    {
                        PrologCLR.ConsoleTrace("IsInvalid LoadUnmanagedLibrary " + fileName);
                       // int hr = Marshal.GetHRForLastWin32Error();
                       // Marshal.ThrowExceptionForHR(hr);
                    }
                }
                else 
                {
                    m_hLibrary = NativeMethodsWindows.LoadLibrary(fileName);
                    if (m_hLibrary.IsInvalid)
                    {
                        int hr = Marshal.GetHRForLastWin32Error();
                        Marshal.ThrowExceptionForHR(hr);
                    }
                }
            }
#endif
        }