Esempio n. 1
0
        public SevenZipHandle(string sevenZipLibPath)
        {
            this.sevenZipSafeHandle = Kernel32Dll.LoadLibrary(sevenZipLibPath);

            if (this.sevenZipSafeHandle.IsInvalid)
            {
                throw new Win32Exception();
            }

            IntPtr functionPtr = Kernel32Dll.GetProcAddress(this.sevenZipSafeHandle, "GetHandlerProperty");

            // Not valid dll
            if (functionPtr == IntPtr.Zero)
            {
                this.sevenZipSafeHandle.Close();
                throw new ArgumentException();
            }
        }
Esempio n. 2
0
 internal static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);