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); }
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); }