private unsafe static void InvokeInternal(ContextType *cxt, ulong nativeIdentifier, IScriptHost scriptHost) { cxt->nativeIdentifier = nativeIdentifier; unsafe { #if !USE_HYPERDRIVE scriptHost.InvokeNative(new IntPtr(cxt)); #else if (!ms_invokers.TryGetValue(nativeIdentifier, out CallFunc invoker)) { invoker = BuildFunction(nativeIdentifier, GetNative(nativeIdentifier)); ms_invokers.Add(nativeIdentifier, invoker); } cxt->functionDataPtr = &cxt->functionData[0]; cxt->retDataPtr = &cxt->functionData[0]; if (!invoker(cxt)) { throw new Exception("Native invocation failed."); } CopyReferencedParametersOut(cxt); #endif } }
private void InvokeNativeInternal(ref fxScriptContext context) { unsafe { fixed(fxScriptContext *cxt = &context) { m_host.InvokeNative(new IntPtr(cxt)); } } }
private void InvokeInternal(ulong nativeIdentifier, IScriptHost scriptHost) { m_context.nativeIdentifier = nativeIdentifier; unsafe { fixed(fxScriptContext *cxt = &m_context) { scriptHost.InvokeNative(new IntPtr(cxt)); } } }
private unsafe static void InvokeInternal(ContextType *cxt, ulong nativeIdentifier, IScriptHost scriptHost) { cxt->nativeIdentifier = nativeIdentifier; unsafe { #if !USE_HYPERDRIVE try { scriptHost.InvokeNative(new IntPtr(cxt)); } catch (ArgumentException e) { IntPtr errorString = scriptHost.GetLastErrorText(); byte * error = (byte *)errorString.ToPointer(); throw new InvalidOperationException(ErrorHandler(error)); } #else if (!ms_invokers.TryGetValue(nativeIdentifier, out CallFunc invoker)) { invoker = BuildFunction(nativeIdentifier, GetNative(nativeIdentifier)); ms_invokers.Add(nativeIdentifier, invoker); } cxt->functionDataPtr = &cxt->functionData[0]; cxt->retDataPtr = &cxt->functionData[0]; byte *error = null; if (!invoker(cxt, (void **)&error)) { throw new InvalidOperationException(ErrorHandler(error)); } CopyReferencedParametersOut(cxt); #endif } }
private unsafe static void InvokeInternal(ContextType *cxt, ulong nativeIdentifier, IScriptHost scriptHost) { cxt->nativeIdentifier = nativeIdentifier; unsafe { #if !USE_HYPERDRIVE scriptHost.InvokeNative(new IntPtr(cxt)); #else if (!ms_invokers.TryGetValue(nativeIdentifier, out CallFunc invoker)) { invoker = BuildFunction(GetNative(nativeIdentifier)); ms_invokers.Add(nativeIdentifier, invoker); } cxt->functionDataPtr = &cxt->functionData[0]; cxt->retDataPtr = &cxt->functionData[0]; invoker(cxt); #endif } }
public void InvokeNative(ref fxScriptContext context) { m_host.InvokeNative(context); }
public void InvokeNative([MarshalAs(UnmanagedType.Struct)] IntPtr context) { m_realHost.InvokeNative(context); }
public void InvokeNative([MarshalAs(UnmanagedType.Struct)] ref fxScriptContext context) { m_realHost.InvokeNative(ref context); }
private unsafe void InvokeInternal(ulong nativeIdentifier, IScriptHost scriptHost) { m_context.nativeIdentifier = nativeIdentifier; scriptHost.InvokeNative(ref m_context); }