예제 #1
0
        public static ILibrary load()
        {
            System.IntPtr libraryAsIInterfaceIntermediate;
            getLibraryInterface(System.IntPtr.Zero, out libraryAsIInterfaceIntermediate);
            AntilatencyInterfaceContract.IInterface libraryAsIInterface = new AntilatencyInterfaceContract.Details.IInterfaceWrapper(libraryAsIInterfaceIntermediate);
            var library = libraryAsIInterface.QueryInterface <ILibrary>();

            libraryAsIInterface.Dispose();
            return(library);
        }
예제 #2
0
        public T createFactory()
        {
            var        unloaderInterface = this.QueryInterface <ILibraryUnloader>();
            var        entry             = getEntryPoint();
            IInterface result;
            IntPtr     resultIntermediate;

            entry((unloaderInterface as AntilatencyInterfaceContract.Details.ILibraryUnloaderWrapper).NewNativePointer, out resultIntermediate);
            result = new AntilatencyInterfaceContract.Details.IInterfaceWrapper(resultIntermediate);
            unloaderInterface.Dispose();

            var factory = result.QueryInterface <T>();

            result.Dispose();
            return(factory);
        }