Microsoft.Protocols.TestSuites.MS_OXORULE.AdapterHelper.AllocPropertyTagArray_r C# (CSharp) Method

AllocPropertyTagArray_r() public static method

Allocate memory for the specific property values.
public static AllocPropertyTagArray_r ( PropertyTagArray_r pta_r ) : IntPtr
pta_r PropertyTagArray_r PropertyTagArray_r instance.
return System.IntPtr
        public static IntPtr AllocPropertyTagArray_r(PropertyTagArray_r pta_r)
        {
            int offset = 0;
            int cb = (int)(sizeof(uint) + (pta_r.Values * sizeof(uint)));

            IntPtr ptr = Marshal.AllocHGlobal(cb);

            Marshal.WriteInt32(ptr, offset, (int)pta_r.Values);
            offset += sizeof(uint);

            for (int i = 0; i < pta_r.Values; i++)
            {
                Marshal.WriteInt32(ptr, offset, (int)pta_r.AulPropTag[i]);
                offset += sizeof(uint);
            }

            return ptr;
        }