Beispiel #1
0
        public unsafe IntPtr LoadSymbol(IntPtr library, string symbolName)
        {
            var sym = IntPtr.Zero;

            try
            {
                sym = PlatformLoaderBase.PlatformLoader.LoadSymbol(library, symbolName);
            }
            catch
            {
                // do nothing
            }

            if (sym != IntPtr.Zero)
            {
                return(sym);
            }

            if (_alc is null)
            {
                sym = _al.GetProcAddress(symbolName);

                if (sym != IntPtr.Zero)
                {
                    return(sym);
                }
            }
            else
            {
                sym = _al.GetProcAddress(_alc.GetContextsDevice(_alc.GetCurrentContext()), symbolName);

                if (sym != IntPtr.Zero)
                {
                    return(sym);
                }
            }

            throw new EntryPointNotFoundException();
        }
Beispiel #2
0
        protected override unsafe IntPtr CoreLoadFunctionPointer(IntPtr library, string symbolName)
        {
            var sym = IntPtr.Zero;

            try
            {
                sym = UnderlyingLoader.LoadFunctionPointer(library, symbolName);
            }
            catch
            {
                // do nothing
            }

            if (sym != IntPtr.Zero)
            {
                return(sym);
            }

            if (_alc is null)
            {
                sym = _al.GetProcAddress(symbolName);

                if (sym != IntPtr.Zero)
                {
                    return(sym);
                }
            }
            else
            {
                sym = _al.GetProcAddress(_alc.GetContextsDevice(_alc.GetCurrentContext()), symbolName);

                if (sym != IntPtr.Zero)
                {
                    return(sym);
                }
            }

            throw new EntryPointNotFoundException();
        }