Пример #1
0
        /// <summary>
        /// Initializes the specified descriptor.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        protected void Initialize(AxisDescriptor descriptor)
        {
            Initialize(descriptor.Base);

            _abs = descriptor.Abs;
            _rel = descriptor.Rel;
            _absOnly = descriptor.AbsOnly;
        }
 public static extern uint c4dbobs_getChanges(C4DatabaseObserver *observer, [Out] C4DatabaseChange[] outChanges, uint maxChanges, bool *outExternal);
Пример #3
0
        private static unsafe string EncodeObject(ref object data, EventData dataDescriptor, byte *dataBuffer)
        {
            dataDescriptor.Reserved = 0;
            string str = data as string;

            if (str != null)
            {
                dataDescriptor.Size = (uint)((str.Length + 1) * 2);
                return(str);
            }
            if (data == null)
            {
                dataDescriptor.Size        = 0;
                dataDescriptor.DataPointer = 0L;
            }
            else if (data is IntPtr)
            {
                dataDescriptor.Size = (uint)sizeof(IntPtr);
                IntPtr *ptrPtr = (IntPtr *)dataBuffer;
                ptrPtr[0] = (IntPtr)data;
                dataDescriptor.DataPointer = (ulong)ptrPtr;
            }
            else if (data is int)
            {
                dataDescriptor.Size = 4;
                int *numPtr = (int *)dataBuffer;
                numPtr[0] = (int)data;
                dataDescriptor.DataPointer = (ulong)numPtr;
            }
            else if (data is long)
            {
                dataDescriptor.Size = 8;
                long *numPtr2 = (long *)dataBuffer;
                numPtr2[0] = (long)data;
                dataDescriptor.DataPointer = (ulong)numPtr2;
            }
            else if (data is uint)
            {
                dataDescriptor.Size = 4;
                uint *numPtr3 = (uint *)dataBuffer;
                numPtr3[0] = (uint)data;
                dataDescriptor.DataPointer = (ulong)numPtr3;
            }
            else if (data is ulong)
            {
                dataDescriptor.Size = 8;
                ulong *numPtr4 = (ulong *)dataBuffer;
                numPtr4[0] = (ulong)data;
                dataDescriptor.DataPointer = (ulong)numPtr4;
            }
            else if (data is char)
            {
                dataDescriptor.Size = 2;
                char *chPtr = (char *)dataBuffer;
                chPtr[0] = (char)data;
                dataDescriptor.DataPointer = (ulong)chPtr;
            }
            else if (data is byte)
            {
                dataDescriptor.Size = 1;
                byte *numPtr5 = dataBuffer;
                numPtr5[0] = (byte)data;
                dataDescriptor.DataPointer = (ulong)numPtr5;
            }
            else if (data is short)
            {
                dataDescriptor.Size = 2;
                short *numPtr6 = (short *)dataBuffer;
                numPtr6[0] = (short)data;
                dataDescriptor.DataPointer = (ulong)numPtr6;
            }
            else if (data is sbyte)
            {
                dataDescriptor.Size = 1;
                sbyte *numPtr7 = (sbyte *)dataBuffer;
                numPtr7[0] = (sbyte)data;
                dataDescriptor.DataPointer = (ulong)numPtr7;
            }
            else if (data is ushort)
            {
                dataDescriptor.Size = 2;
                ushort *numPtr8 = (ushort *)dataBuffer;
                numPtr8[0] = (ushort)data;
                dataDescriptor.DataPointer = (ulong)numPtr8;
            }
            else if (data is float)
            {
                dataDescriptor.Size = 4;
                float *numPtr9 = (float *)dataBuffer;
                numPtr9[0] = (float)data;
                dataDescriptor.DataPointer = (ulong)numPtr9;
            }
            else if (data is double)
            {
                dataDescriptor.Size = 8;
                double *numPtr10 = (double *)dataBuffer;
                numPtr10[0] = (double)data;
                dataDescriptor.DataPointer = (ulong)numPtr10;
            }
            else if (data is bool)
            {
                dataDescriptor.Size = 1;
                bool *flagPtr = (bool *)dataBuffer;
                *((bool *)flagPtr)         = (bool)data;
                dataDescriptor.DataPointer = (ulong)flagPtr;
            }
            else if (data is Guid)
            {
                dataDescriptor.Size = (uint)sizeof(Guid);
                Guid *guidPtr = (Guid *)dataBuffer;
                guidPtr[0] = (Guid)data;
                dataDescriptor.DataPointer = (ulong)guidPtr;
            }
            else if (data is decimal)
            {
                dataDescriptor.Size = 0x10;
                decimal *numPtr11 = (decimal *)dataBuffer;
                numPtr11[0] = (decimal)data;
                dataDescriptor.DataPointer = (ulong)numPtr11;
            }
            else if (data is bool)
            {
                dataDescriptor.Size = 1;
                bool *flagPtr2 = (bool *)dataBuffer;
                *((bool *)flagPtr2)        = (bool)data;
                dataDescriptor.DataPointer = (ulong)flagPtr2;
            }
            else
            {
                str = data.ToString();
                dataDescriptor.Size = (uint)((str.Length + 1) * 2);
                return(str);
            }
            return(null);
        }
Пример #4
0
        private void Render(PipelineCamera pipelineCam, ref ScriptableRenderContext context, Camera cam, bool *pipelineChecked)
        {
            PipelineResources.CameraRenderingPath path = pipelineCam.renderingPath;
            currentPath     = path;
            pipelineCam.cam = cam;
            pipelineCam.EnableThis(resources);
            context.SetupCameraProperties(cam);
            //Set Global Data
            var allEvents = resources.allEvents;
            var collect   = allEvents[(int)path];

#if UNITY_EDITOR
            //Need only check for Unity Editor's bug!
            if (!pipelineChecked[(int)path])
            {
                pipelineChecked[(int)path] = true;
                foreach (var e in collect)
                {
                    if (!e.CheckProperty())
                    {
                        e.CheckInit(resources);
                    }
                }
            }
#endif
            foreach (var e in collect)
            {
                if (e.Enabled)
                {
                    e.PreRenderFrame(pipelineCam, ref data);
                }
            }
            JobHandle.ScheduleBatchedJobs();
            foreach (var e in collect)
            {
                if (e.Enabled)
                {
                    e.FrameUpdate(pipelineCam, ref data);
                }
            }
            foreach (var i in waitReleaseRT)
            {
                data.buffer.ReleaseTemporaryRT(i);
            }
            waitReleaseRT.Clear();
        }
Пример #5
0
 public static unsafe extern void Ray(float px, float py, double angle, bool *map, int Width, [MarshalAs(UnmanagedType.LPArray, SizeConst = 2), Out()] float[] result);
Пример #6
0
 protected static extern unsafe IntPtr TypedColumnWriter_WriteBatchSpaced_Bool(
     IntPtr columnWriter, long numValues, short *defLevels, short *repLevels, byte *validBits, long validBitsOffset, bool *values);
Пример #7
0
 internal static extern bool CheckForChanges(global::System.IntPtr __instance, bool *updateAvailable, uint method);
 internal extern static unsafe bool glAreTexturesResidentEXT(Int32 n, UInt32 *textures, bool *residences);
Пример #9
0
 public unsafe partial void GetBooleanIndexed([Flow(FlowDirection.In)] BufferTargetARB target, [Flow(FlowDirection.In)] uint index, [Count(Computed = "target"), Flow(FlowDirection.Out)] bool *data);
Пример #10
0
 public static extern bool glAreTexturesResident(int num, uint *textures, bool *residences);
Пример #11
0
        /*public static object GetType(ILContext ctx, object instance, object[] param, IType[] genericArguments)
         * {
         *  var t = ctx.AppDomain.GetType((string)param[0]);
         *  if (t != null)
         *      return t.ReflectionType;
         *  else
         *      return null;
         * }*/

        public unsafe static StackObject *InitializeArray(ILIntepreter intp, StackObject *esp, List <object> mStack, CLRMethod method, bool isNewObj)
        {
            var       ret    = esp - 1 - 1;
            AppDomain domain = intp.AppDomain;
            var       param  = esp - 1;

            byte[] data = StackObject.ToObject(param, domain, mStack) as byte[];
            intp.Free(param);
            param = esp - 1 - 1;
            object array = StackObject.ToObject(param, domain, mStack);

            intp.Free(param);

            if (data == null)
            {
                return(ret);

                fixed(byte *p = data)
                {
                    if (array is int[])
                    {
                        int[] arr = array as int[];
                        int * ptr = (int *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is byte[])
                    {
                        byte[] arr = array as byte[];
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = p[i];
                        }
                    }
                    else if (array is sbyte[])
                    {
                        sbyte[] arr = array as sbyte[];
                        sbyte * ptr = (sbyte *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is short[])
                    {
                        short[] arr = array as short[];
                        short * ptr = (short *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is ushort[])
                    {
                        ushort[] arr = array as ushort[];
                        ushort * ptr = (ushort *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is char[])
                    {
                        char[] arr = array as char[];
                        char * ptr = (char *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is uint[])
                    {
                        uint[] arr = array as uint[];
                        uint * ptr = (uint *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is Int64[])
                    {
                        long[] arr = array as long[];
                        long * ptr = (long *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is UInt64[])
                    {
                        ulong[] arr = array as ulong[];
                        ulong * ptr = (ulong *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is float[])
                    {
                        float[] arr = array as float[];
                        float * ptr = (float *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is double[])
                    {
                        double[] arr = array as double[];
                        double * ptr = (double *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else if (array is bool[])
                    {
                        bool[] arr = array as bool[];
                        bool * ptr = (bool *)p;
                        for (int i = 0; i < arr.Length; i++)
                        {
                            arr[i] = ptr[i];
                        }
                    }
                    else
                    {
                        throw new NotImplementedException("array=" + array.GetType());
                    }
                }

                return(ret);
        }
Пример #12
0
 public static extern void glGetBooleanv(GLGetMode pname, bool *param);
Пример #13
0
 public static extern void glEdgeFlagv(bool *flag);
Пример #14
0
 public static extern void glEdgeFlagPointer(int stride, bool *pointer);
 public unsafe CheckBoxValueChanger()
 {
     m_pbValue = null;
     InitializeComponent();
 }
Пример #16
0
        private int refcount = 0x00; // 引用计数

        public void Enter(bool *localTaken)
        {
            Enter(localTaken, MAXITERATIONCOUNT);
        }
Пример #17
0
 public static void GetBooleani_v(uint pname, uint index, bool *data)
 {
     glGetBooleani_v(pname, index, (IntPtr)data);
 }
Пример #18
0
 public void Enter(bool *localTaken, long iterations)
 {
     Enter(localTaken, &iterations, null);
 }
Пример #19
0
 protected static extern unsafe IntPtr TypedColumnWriter_WriteBatch_Bool(
     IntPtr columnWriter, long numValues, short *defLevels, short *repLevels, bool *values);
Пример #20
0
 public void Enter(bool *localTaken, int timeval)
 {
     Enter(localTaken, null, &timeval);
 }
Пример #21
0
        protected override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
        {
            bool *propertyCheckedFlags = stackalloc bool[resources.allEvents.Length];
            bool  needSubmit           = false;

            CustomDrawRequest.Initialize();
            UnsafeUtility.MemClear(propertyCheckedFlags, resources.allEvents.Length);
            GraphicsSettings.useScriptableRenderPipelineBatching = resources.useSRPBatcher;
            SceneController.SetState();
            data.context   = renderContext;
            data.resources = resources;
            if (motionVectorMatricesBuffer == null || !motionVectorMatricesBuffer.IsValid())
            {
                motionVectorMatricesBuffer = new ComputeBuffer(MotionVectorDrawer.Capacity, sizeof(float3x4));
            }
            else if (motionVectorMatricesBuffer.count < MotionVectorDrawer.Capacity)
            {
                motionVectorMatricesBuffer.Dispose();
                motionVectorMatricesBuffer = new ComputeBuffer(MotionVectorDrawer.Capacity, sizeof(float3x4));
            }
            MotionVectorDrawer.ExecuteBeforeFrame(motionVectorMatricesBuffer);
            data.buffer.SetGlobalBuffer(ShaderIDs._LastFrameModel, motionVectorMatricesBuffer);

#if UNITY_EDITOR
            int tempID = Shader.PropertyToID("_TempRT");

            foreach (var pair in bakeList)
            {
                PipelineCamera pipelineCam = pair.pipelineCamera;
                for (int i = 0; i < pair.worldToCamera.Length; ++i)
                {
                    pipelineCam.cam.worldToCameraMatrix = pair.worldToCamera[i];
                    pipelineCam.cam.projectionMatrix    = pair.projection[i];
                    pipelineCam.cameraTarget            = tempID;
                    data.buffer.GetTemporaryRT(tempID, pair.texArray.width, pair.texArray.height, pair.texArray.depth, FilterMode.Point, pair.texArray.format, RenderTextureReadWrite.Linear);
                    Render(pipelineCam, ref renderContext, pipelineCam.cam, propertyCheckedFlags);
                    data.buffer.CopyTexture(tempID, 0, 0, pair.texArray, i, 0);
                    data.buffer.ReleaseTemporaryRT(tempID);
                    data.ExecuteCommandBuffer();
                    renderContext.Submit();
                    needSubmit = false;
                }
                pair.worldToCamera.Dispose();
                pair.projection.Dispose();
                renderContext.ExecuteCommandBuffer(pair.buffer);
                pair.buffer.Clear();
                renderContext.Submit();
                needSubmit = false;
            }
            bakeList.Clear();
#endif
            foreach (var cam in preFrameRenderCamera)
            {
                Render(cam, ref renderContext, cam.cam, propertyCheckedFlags);
                data.ExecuteCommandBuffer();
                renderContext.Submit();
                needSubmit = false;
            }
            preFrameRenderCamera.Clear();

            if (CustomDrawRequest.allEvents.Count > 0 || JobProcessEvent.allEvents.Count > 0)
            {
                foreach (var i in CustomDrawRequest.allEvents)
                {
                    i.PrepareJob(resources);
                }
                foreach (var i in JobProcessEvent.allEvents)
                {
                    i.PrepareJob();
                }
                JobHandle.ScheduleBatchedJobs();
                foreach (var i in CustomDrawRequest.allEvents)
                {
                    i.FinishJob();
                }
                foreach (var i in JobProcessEvent.allEvents)
                {
                    i.FinishJob();
                }
            }
            if (useBeforeFrameBuffer)
            {
                renderContext.ExecuteCommandBuffer(m_beforeFrameBuffer);
                m_beforeFrameBuffer.Clear();
                needSubmit           = true;
                useBeforeFrameBuffer = false;
            }
            foreach (var cam in cameras)
            {
                PipelineCamera pipelineCam = cam.GetComponent <PipelineCamera>();
                if (!pipelineCam)
                {
#if UNITY_EDITOR
                    if (cam.cameraType == CameraType.SceneView)
                    {
                        renderingEditor = true;
                        var pos = cam.transform.eulerAngles;
                        pos.z = 0;
                        cam.transform.eulerAngles = pos;
                        if (!Camera.main || !(pipelineCam = Camera.main.GetComponent <PipelineCamera>()))
                        {
                            continue;
                        }
                    }
                    else if (cam.cameraType == CameraType.Game)
                    {
                        renderingEditor = false;
                        pipelineCam     = cam.gameObject.AddComponent <PipelineCamera>();
                    }
                    else
                    {
                        continue;
                    }
#else
                    renderingEditor = false;
                    pipelineCam     = cam.gameObject.AddComponent <PipelineCamera>();
#endif
                }
                else
                {
                    renderingEditor = false;
                }
                Render(pipelineCam, ref renderContext, cam, propertyCheckedFlags);
                data.ExecuteCommandBuffer();
#if UNITY_EDITOR
                if (renderingEditor)
                {
                    renderContext.DrawGizmos(cam, GizmoSubset.PostImageEffects);
                }
#endif
                renderContext.Submit();
                needSubmit = false;
            }

            if (useAfterFrameBuffer)
            {
                renderContext.ExecuteCommandBuffer(m_afterFrameBuffer);
                m_afterFrameBuffer.Clear();
                needSubmit          = true;
                useAfterFrameBuffer = false;
            }
            if (needSubmit)
            {
                renderContext.Submit();
            }
            MotionVectorDrawer.ExecuteAfterFrame();
        }
Пример #22
0
 internal static extern unsafe bool RhpSfiNext(ref StackFrameIterator pThis, uint *uExCollideClauseIdx, bool *fUnwoundReversePInvoke);
Пример #23
0
 public unsafe partial bool AreTexturesResident([Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.In)] uint *textures, [Count(Parameter = "n"), Flow(FlowDirection.Out)] bool *residences);
 internal static extern bool ATJSONParserGetBoolValue(IntPtr parser, bool *val);
Пример #25
0
 public abstract unsafe void GetInvariantBoolean([Flow(FlowDirection.In)] uint id, [Flow(FlowDirection.In)] EXT value, [Count(Computed = "id"), Flow(FlowDirection.Out)] bool *data);
Пример #26
0
        private static unsafe string EncodeObject(ref object data, EventData *dataDescriptor, byte *dataBuffer)

        /*++
         *
         * Routine Description:
         *
         * This routine is used by WriteEvent to unbox the object type and
         * to fill the passed in ETW data descriptor.
         *
         * Arguments:
         *
         * data - argument to be decoded
         *
         * dataDescriptor - pointer to the descriptor to be filled
         *
         * dataBuffer - storage buffer for storing user data, needed because cant get the address of the object
         *
         * Return Value:
         *
         * null if the object is a basic type other than string. String otherwise
         *
         * --*/
        {
            dataDescriptor->Reserved = 0;

            string sRet = data as string;

            if (sRet != null)
            {
                dataDescriptor->Size = (uint)((sRet.Length + 1) * 2);
                return(sRet);
            }

            if (data == null)
            {
                dataDescriptor->Size        = 0;
                dataDescriptor->DataPointer = 0;
            }
            else if (data is IntPtr)
            {
                dataDescriptor->Size = (uint)sizeof(IntPtr);
                IntPtr *intptrPtr = (IntPtr *)dataBuffer;
                *       intptrPtr = (IntPtr)data;
                dataDescriptor->DataPointer = (ulong)intptrPtr;
            }
            else if (data is int)
            {
                dataDescriptor->Size = (uint)sizeof(int);
                int *intptrPtr = (int *)dataBuffer;
                *    intptrPtr = (int)data;
                dataDescriptor->DataPointer = (ulong)intptrPtr;
            }
            else if (data is long)
            {
                dataDescriptor->Size = (uint)sizeof(long);
                long *longptr = (long *)dataBuffer;
                *     longptr = (long)data;
                dataDescriptor->DataPointer = (ulong)longptr;
            }
            else if (data is uint)
            {
                dataDescriptor->Size = (uint)sizeof(uint);
                uint *uintptr = (uint *)dataBuffer;
                *     uintptr = (uint)data;
                dataDescriptor->DataPointer = (ulong)uintptr;
            }
            else if (data is UInt64)
            {
                dataDescriptor->Size = (uint)sizeof(ulong);
                UInt64 *ulongptr = (ulong *)dataBuffer;
                *       ulongptr = (ulong)data;
                dataDescriptor->DataPointer = (ulong)ulongptr;
            }
            else if (data is char)
            {
                dataDescriptor->Size = (uint)sizeof(char);
                char *charptr = (char *)dataBuffer;
                *     charptr = (char)data;
                dataDescriptor->DataPointer = (ulong)charptr;
            }
            else if (data is byte)
            {
                dataDescriptor->Size = (uint)sizeof(byte);
                byte *byteptr = (byte *)dataBuffer;
                *     byteptr = (byte)data;
                dataDescriptor->DataPointer = (ulong)byteptr;
            }
            else if (data is short)
            {
                dataDescriptor->Size = (uint)sizeof(short);
                short *shortptr = (short *)dataBuffer;
                *      shortptr = (short)data;
                dataDescriptor->DataPointer = (ulong)shortptr;
            }
            else if (data is sbyte)
            {
                dataDescriptor->Size = (uint)sizeof(sbyte);
                sbyte *sbyteptr = (sbyte *)dataBuffer;
                *      sbyteptr = (sbyte)data;
                dataDescriptor->DataPointer = (ulong)sbyteptr;
            }
            else if (data is ushort)
            {
                dataDescriptor->Size = (uint)sizeof(ushort);
                ushort *ushortptr = (ushort *)dataBuffer;
                *       ushortptr = (ushort)data;
                dataDescriptor->DataPointer = (ulong)ushortptr;
            }
            else if (data is float)
            {
                dataDescriptor->Size = (uint)sizeof(float);
                float *floatptr = (float *)dataBuffer;
                *      floatptr = (float)data;
                dataDescriptor->DataPointer = (ulong)floatptr;
            }
            else if (data is double)
            {
                dataDescriptor->Size = (uint)sizeof(double);
                double *doubleptr = (double *)dataBuffer;
                *       doubleptr = (double)data;
                dataDescriptor->DataPointer = (ulong)doubleptr;
            }
            else if (data is bool)
            {
                dataDescriptor->Size = (uint)sizeof(bool);
                bool *boolptr = (bool *)dataBuffer;
                *     boolptr = (bool)data;
                dataDescriptor->DataPointer = (ulong)boolptr;
            }
            else if (data is Guid)
            {
                dataDescriptor->Size = (uint)sizeof(Guid);
                Guid *guidptr = (Guid *)dataBuffer;
                *     guidptr = (Guid)data;
                dataDescriptor->DataPointer = (ulong)guidptr;
            }
            else if (data is decimal)
            {
                dataDescriptor->Size = (uint)sizeof(decimal);
                decimal *decimalptr = (decimal *)dataBuffer;
                *        decimalptr = (decimal)data;
                dataDescriptor->DataPointer = (ulong)decimalptr;
            }
            else if (data is Boolean)
            {
                dataDescriptor->Size = (uint)sizeof(Boolean);
                Boolean *booleanptr = (Boolean *)dataBuffer;
                *        booleanptr = (Boolean)data;
                dataDescriptor->DataPointer = (ulong)booleanptr;
            }
            else
            {
                //To our eyes, everything else is a just a string
                sRet = data.ToString();
                dataDescriptor->Size = (uint)((sRet.Length + 1) * 2);
                return(sRet);
            }

            return(null);
        }
        static unsafe string EncodeObject(ref object data, UnsafeNativeMethods.EventData *dataDescriptor, byte *dataBuffer)
        {
            dataDescriptor->Reserved = 0;

            string sRet = data as string;

            if (sRet != null)
            {
                dataDescriptor->Size = (uint)((sRet.Length + 1) * 2);
                return(sRet);
            }

            if (data is IntPtr)
            {
                dataDescriptor->Size = (uint)sizeof(IntPtr);
                IntPtr *intptrPtr = (IntPtr *)dataBuffer;
                *       intptrPtr = (IntPtr)data;
                dataDescriptor->DataPointer = (ulong)intptrPtr;
            }
            else if (data is int)
            {
                dataDescriptor->Size = (uint)sizeof(int);
                int *intptrPtr = (int *)dataBuffer;
                *    intptrPtr = (int)data;
                dataDescriptor->DataPointer = (ulong)intptrPtr;
            }
            else if (data is long)
            {
                dataDescriptor->Size = (uint)sizeof(long);
                long *longptr = (long *)dataBuffer;
                *     longptr = (long)data;
                dataDescriptor->DataPointer = (ulong)longptr;
            }
            else if (data is uint)
            {
                dataDescriptor->Size = (uint)sizeof(uint);
                uint *uintptr = (uint *)dataBuffer;
                *     uintptr = (uint)data;
                dataDescriptor->DataPointer = (ulong)uintptr;
            }
            else if (data is UInt64)
            {
                dataDescriptor->Size = (uint)sizeof(ulong);
                UInt64 *ulongptr = (ulong *)dataBuffer;
                *       ulongptr = (ulong)data;
                dataDescriptor->DataPointer = (ulong)ulongptr;
            }
            else if (data is char)
            {
                dataDescriptor->Size = (uint)sizeof(char);
                char *charptr = (char *)dataBuffer;
                *     charptr = (char)data;
                dataDescriptor->DataPointer = (ulong)charptr;
            }
            else if (data is byte)
            {
                dataDescriptor->Size = (uint)sizeof(byte);
                byte *byteptr = (byte *)dataBuffer;
                *     byteptr = (byte)data;
                dataDescriptor->DataPointer = (ulong)byteptr;
            }
            else if (data is short)
            {
                dataDescriptor->Size = (uint)sizeof(short);
                short *shortptr = (short *)dataBuffer;
                *      shortptr = (short)data;
                dataDescriptor->DataPointer = (ulong)shortptr;
            }
            else if (data is sbyte)
            {
                dataDescriptor->Size = (uint)sizeof(sbyte);
                sbyte *sbyteptr = (sbyte *)dataBuffer;
                *      sbyteptr = (sbyte)data;
                dataDescriptor->DataPointer = (ulong)sbyteptr;
            }
            else if (data is ushort)
            {
                dataDescriptor->Size = (uint)sizeof(ushort);
                ushort *ushortptr = (ushort *)dataBuffer;
                *       ushortptr = (ushort)data;
                dataDescriptor->DataPointer = (ulong)ushortptr;
            }
            else if (data is float)
            {
                dataDescriptor->Size = (uint)sizeof(float);
                float *floatptr = (float *)dataBuffer;
                *      floatptr = (float)data;
                dataDescriptor->DataPointer = (ulong)floatptr;
            }
            else if (data is double)
            {
                dataDescriptor->Size = (uint)sizeof(double);
                double *doubleptr = (double *)dataBuffer;
                *       doubleptr = (double)data;
                dataDescriptor->DataPointer = (ulong)doubleptr;
            }
            else if (data is bool)
            {
                dataDescriptor->Size = (uint)sizeof(bool);
                bool *boolptr = (bool *)dataBuffer;
                *     boolptr = (bool)data;
                dataDescriptor->DataPointer = (ulong)boolptr;
            }
            else if (data is Guid)
            {
                dataDescriptor->Size = (uint)sizeof(Guid);
                Guid *guidptr = (Guid *)dataBuffer;
                *     guidptr = (Guid)data;
                dataDescriptor->DataPointer = (ulong)guidptr;
            }
            else if (data is decimal)
            {
                dataDescriptor->Size = (uint)sizeof(decimal);
                decimal *decimalptr = (decimal *)dataBuffer;
                *        decimalptr = (decimal)data;
                dataDescriptor->DataPointer = (ulong)decimalptr;
            }
            else if (data is Boolean)
            {
                dataDescriptor->Size = (uint)sizeof(Boolean);
                Boolean *booleanptr = (Boolean *)dataBuffer;
                *        booleanptr = (Boolean)data;
                dataDescriptor->DataPointer = (ulong)booleanptr;
            }
            else
            {
                // Everything else is a just a string
                sRet = data.ToString();
                dataDescriptor->Size = (uint)((sRet.Length + 1) * 2);
                return(sRet);
            }

            return(null);
        }
Пример #28
0
 private unsafe static extern bool _EASharpBinding_508(void *_ThisPtr, float *duration, bool *isLearned);
 public static unsafe bool AreTexturesResident(this ExtTextureObject thisApi, [Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.In)] ReadOnlySpan <uint> textures, [Count(Parameter = "n"), Flow(FlowDirection.Out)] bool *residences)
 {
     // SpanOverloader
     return(thisApi.AreTexturesResident(n, in textures.GetPinnableReference(), residences));
 }
Пример #30
0
 // Token: 0x06000519 RID: 1305 RVA: 0x000073E0 File Offset: 0x000063E0
 public unsafe bool TryPerfectLaunch(float *duration, bool *isLearned)
 {
     return(Vehicle._EASharpBinding_508(this.mSelf, duration, isLearned));
 }
Пример #31
0
        /// <summary>
        /// Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _abs = null;
                _rel = null;
                _absOnly = null;
            }
        }
Пример #32
0
        private unsafe string EncodeObject(object data, TraceProvider.MofField *mofField, char *ptr, ref uint offSet, byte *ptrArgInfo)
        {
            if (data == null)
            {
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)0;
                    *(short *)(ptrArgInfo + 1) = (short)0;
                }
                mofField->DataLength  = 0U;
                mofField->DataPointer = (void *)null;
                return((string)null);
            }
            string str1 = data as string;

            if (str1 != null)
            {
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)2;
                    *(short *)(ptrArgInfo + 1) = str1.Length < (int)ushort.MaxValue ? (short)(ushort)str1.Length : (short)-1;
                }
                else
                {
                    mofField->DataLength = 2U;
                    ushort *numPtr = (ushort *)ptr;
                    *       numPtr = str1.Length * 2 < (int)ushort.MaxValue ? (ushort)(str1.Length * 2) : ushort.MaxValue;
                    mofField->DataPointer = (void *)numPtr;
                    offSet += 2U;
                }
                return(str1);
            }
            if (data is sbyte)
            {
                mofField->DataLength = 1U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)3;
                }
                sbyte *numPtr = (sbyte *)ptr;
                *      numPtr = (sbyte)data;
                mofField->DataPointer = (void *)numPtr;
                ++offSet;
            }
            else if (data is byte)
            {
                mofField->DataLength = 1U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)4;
                }
                byte *numPtr = (byte *)ptr;
                *     numPtr = (byte)data;
                mofField->DataPointer = (void *)numPtr;
                ++offSet;
            }
            else if (data is short)
            {
                mofField->DataLength = 2U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)5;
                }
                short *numPtr = (short *)ptr;
                *      numPtr = (short)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 2U;
            }
            else if (data is ushort)
            {
                mofField->DataLength = 2U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)6;
                }
                ushort *numPtr = (ushort *)ptr;
                *       numPtr = (ushort)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 2U;
            }
            else if (data is int)
            {
                mofField->DataLength = 4U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)7;
                }
                int *numPtr = (int *)ptr;
                *    numPtr = (int)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 4U;
            }
            else if (data is uint)
            {
                mofField->DataLength = 4U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)8;
                }
                uint *numPtr = (uint *)ptr;
                *     numPtr = (uint)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 4U;
            }
            else if (data is long)
            {
                mofField->DataLength = 8U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)9;
                }
                long *numPtr = (long *)ptr;
                *     numPtr = (long)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 8U;
            }
            else if (data is ulong)
            {
                mofField->DataLength = 8U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)10;
                }
                ulong *numPtr = (ulong *)ptr;
                *      numPtr = (ulong)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 8U;
            }
            else if (data is char)
            {
                mofField->DataLength = 2U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)11;
                }
                char *chPtr = ptr;
                *     chPtr = (char)data;
                mofField->DataPointer = (void *)chPtr;
                offSet += 2U;
            }
            else if (data is float)
            {
                mofField->DataLength = 4U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)12;
                }
                float *numPtr = (float *)ptr;
                *      numPtr = (float)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 4U;
            }
            else if (data is double)
            {
                mofField->DataLength = 8U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)13;
                }
                double *numPtr = (double *)ptr;
                *       numPtr = (double)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 8U;
            }
            else if (data is bool)
            {
                mofField->DataLength = 1U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)14;
                }
                bool *flagPtr = (bool *)ptr;
                *     flagPtr = (bool)data;
                mofField->DataPointer = (void *)flagPtr;
                ++offSet;
            }
            else if (data is Decimal)
            {
                mofField->DataLength = 16U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)15;
                }
                Decimal *numPtr = (Decimal *)ptr;
                *        numPtr = (Decimal)data;
                mofField->DataPointer = (void *)numPtr;
                offSet += 16U;
            }
            else if (data.GetType().IsEnum)
            {
                mofField->DataLength = 8U;
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)9;
                }
                long *numPtr = (long *)ptr;
                *     numPtr = Convert.ToInt64(data);
                mofField->DataPointer = (void *)numPtr;
                offSet += 8U;
            }
            else
            {
                string str2 = data.ToString();
                if ((IntPtr)ptrArgInfo != IntPtr.Zero)
                {
                    *ptrArgInfo = (byte)2;
                    *(short *)(ptrArgInfo + 1) = str2.Length < (int)ushort.MaxValue ? (short)(ushort)str2.Length : (short)-1;
                }
                else
                {
                    mofField->DataLength = 2U;
                    ushort *numPtr = (ushort *)ptr;
                    *       numPtr = str2.Length * 2 < (int)ushort.MaxValue ? (ushort)(str2.Length * 2) : ushort.MaxValue;
                    mofField->DataPointer = (void *)numPtr;
                    offSet += 2U;
                }
                return(str2);
            }
            if ((IntPtr)ptrArgInfo != IntPtr.Zero)
            {
                *(short *)(ptrArgInfo + 1) = (short)(ushort)mofField->DataLength;
            }
            return(str1);
        }
Пример #33
0
			public FastReplacer(string input, string oldValue)
			{
				var inputLength = input.Length;
				_oldValueLength = oldValue.Length;

				_oldValue = (char*) Marshal.AllocHGlobal((_oldValueLength + 1)*sizeof (char));
				_input = (char*) Marshal.AllocHGlobal((inputLength + 1)*sizeof (char));
				_fastTable = (bool*) Marshal.AllocHGlobal((inputLength)*sizeof (bool));

				fixed (char* inputSrc = input, oldValueSrc = oldValue)
				{
					Copy(inputSrc, _input);
					Copy(oldValueSrc, _oldValue);
				}

				BuildMatchedIndexes();
			}
Пример #34
0
 internal extern static unsafe bool wglIsEnabledGenlockI3D(IntPtr hDC, bool *pFlag);