internal IntPtr NonConstPointer()
        {
            if (m_ptr_attributes != IntPtr.Zero)
            {
                return(m_ptr_attributes);
            }

            // Check pipeline_parent first since this is typically time critical
            // code when this is used.
            DisplayPipeline pipeline_parent = m_parent as DisplayPipeline;

            if (pipeline_parent != null)
            {
                // We can cheat and use a const pointer for the non-const version. This is
                // because when a pipeline is associated with attributes, it typically
                // happens when conduits are involved. When conduits are being called, the
                // attributes are exposed as a non const pointer.
                return(pipeline_parent.DisplayAttributeConstPointer());
            }

            DisplayModeDescription parent = m_parent as DisplayModeDescription;

            if (parent != null)
            {
                return(parent.DisplayAttributeNonConstPointer());
            }
            return(IntPtr.Zero);
        }
        internal IntPtr ConstPointer()
        {
            if (m_ptr_attributes != IntPtr.Zero)
            {
                return(m_ptr_attributes);
            }

            // Check pipeline_parent first since this is typically time critical
            // code when this is used.
            DisplayPipeline pipeline_parent = m_parent as DisplayPipeline;

            if (pipeline_parent != null)
            {
                return(pipeline_parent.DisplayAttributeConstPointer());
            }

            DisplayModeDescription parent = m_parent as DisplayModeDescription;

            if (parent != null)
            {
                return(parent.DisplayAttributeConstPointer());
            }
            return(IntPtr.Zero);
        }