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 NonConstPointer() { if (m_pAttrs != IntPtr.Zero) { return(m_pAttrs); } // 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) { // Can't change the attributes in a pipeline, so create a copy // under the hood IntPtr pConstAttributes = ConstPointer(); if (pConstAttributes != IntPtr.Zero) { m_pAttrs = UnsafeNativeMethods.CDisplayPipelineAttributes_New2(pConstAttributes); m_parent = null; return(m_pAttrs); } } DisplayModeDescription parent = m_parent as DisplayModeDescription; if (parent != null) { return(parent.DisplayAttributeNonConstPointer()); } return(IntPtr.Zero); }