Esempio n. 1
0
 private unsafe void SubmitBoundaryInternal(FastMethod <Action <IntPtr, IntPtr, int> > method, byte[] boundaryData, int boundarySize)
 {
     fixed(byte *p = boundaryData)
     {
         method.method(hostPtr, new IntPtr(p), boundarySize);
     }
 }
Esempio n. 2
0
            public DirectScriptHost(IntPtr hostPtr)
            {
                this.hostPtr = hostPtr;

                invokeNativeMethod    = new FastMethod <Func <IntPtr, IntPtr, int> >(nameof(invokeNativeMethod), hostPtr, 0);
                openSystemFileMethod  = new FastMethod <Func <IntPtr, IntPtr, IntPtr, int> >(nameof(openSystemFileMethod), hostPtr, 1);
                openHostFileMethod    = new FastMethod <Func <IntPtr, IntPtr, IntPtr, int> >(nameof(openHostFileMethod), hostPtr, 2);
                canonicalizeRefMethod = new FastMethod <Func <IntPtr, int, int, IntPtr, int> >(nameof(canonicalizeRefMethod), hostPtr, 3);
                scriptTraceMethod     = new FastMethod <Action <IntPtr, IntPtr> >(nameof(scriptTraceMethod), hostPtr, 4);
            }
Esempio n. 3
0
        static PushRuntime()
        {
            ms_runtimeHandler = InternalManager.CreateInstance <IScriptRuntimeHandler>(new Guid(0xc41e7194, 0x7556, 0x4c02, 0xba, 0x45, 0xa9, 0xc8, 0x4d, 0x18, 0xad, 0x43));

#if !IS_FXSERVER || OS_WIN
            ms_pushMethod = new FastMethod <Action <IntPtr, IntPtr> >("PushRuntime", ms_runtimeHandler, typeof(IScriptRuntimeHandler), 0);
            ms_popMethod  = new FastMethod <Action <IntPtr, IntPtr> >("PopRuntime", ms_runtimeHandler, typeof(IScriptRuntimeHandler), 2);

            ms_runtimeHandlerIface = Marshal.GetComInterfaceForObject(ms_runtimeHandler, typeof(IScriptRuntimeHandler));
#endif
        }
Esempio n. 4
0
            public DirectScriptHost(IntPtr hostPtr)
            {
                this.hostPtr = hostPtr;

                invokeNativeMethod        = new FastMethod <Func <IntPtr, IntPtr, int> >(nameof(invokeNativeMethod), hostPtr, 0);
                openSystemFileMethod      = new FastMethod <Func <IntPtr, IntPtr, IntPtr, int> >(nameof(openSystemFileMethod), hostPtr, 1);
                openHostFileMethod        = new FastMethod <Func <IntPtr, IntPtr, IntPtr, int> >(nameof(openHostFileMethod), hostPtr, 2);
                canonicalizeRefMethod     = new FastMethod <Func <IntPtr, int, int, IntPtr, int> >(nameof(canonicalizeRefMethod), hostPtr, 3);
                scriptTraceMethod         = new FastMethod <Action <IntPtr, IntPtr> >(nameof(scriptTraceMethod), hostPtr, 4);
                submitBoundaryStartMethod = new FastMethod <Action <IntPtr, IntPtr, int> >(nameof(submitBoundaryStartMethod), hostPtr, 5);
                submitBoundaryEndMethod   = new FastMethod <Action <IntPtr, IntPtr, int> >(nameof(submitBoundaryEndMethod), hostPtr, 6);
                getLastErrorTextMethod    = new FastMethod <Func <IntPtr, IntPtr, int> >(nameof(getLastErrorTextMethod), hostPtr, 7);
            }
Esempio n. 5
0
            public DirectVisitor(IScriptStackWalkVisitor visitor)
            {
                this.visitor = Marshal.GetIUnknownForObject(visitor);

                submitFrameMethod = new FastMethod <Func <IntPtr, IntPtr, int, int> >(nameof(submitFrameMethod), this.visitor, 0);
            }