Esempio n. 1
0
        private static IntPtr NativeCall()
        {
            if (returnedValue == IntPtr.Zero)
            {
                throw new Exception("AsiInterface is not initialized.");
            }

            NativeArgument[] args = argsBuffer[argumentsIndex];

            for (int i = 0; i < argumentsIndex; i++)
            {
                args[i] = new NativeArgument(arguments[i]);
            }

            argumentsIndex = 0;

            try
            {
                *(NativeRetVal *)returnedValue = (NativeRetVal)NativeFunction.Call(nativeHash, typeof(NativeRetVal), args);
            }
            catch (Exception e)
            {
                if (Support.Instance.Config.IgnoreUnknownNatives)
                {
                    *(NativeRetVal *)returnedValue = new NativeRetVal();                    //== 0
                }
                else
                {
                    throw e;
                }
            }
            return(returnedValue);
        }