internal ClusterCallbackLookupTableEntry(ClusapiMethods.CLUSTER_SETUP_PHASE eSetupPhase, ClusapiMethods.CLUSTER_SETUP_PHASE_TYPE ePhaseType, ClusapiMethods.CLUSTER_SETUP_PHASE_SEVERITY ePhaseSeverity, HaTaskCallbackHelper.ClusterCallbackLookupTableEntry.ExceptionFactory exceptionFactory)
 {
     this.m_ESetupPhase      = eSetupPhase;
     this.m_EPhaseType       = ePhaseType;
     this.m_EPhaseSeverity   = ePhaseSeverity;
     this.m_ExceptionFactory = exceptionFactory;
 }
Esempio n. 2
0
        public int ClusterSetupProgressCallback(IntPtr pvCallbackArg, ClusapiMethods.CLUSTER_SETUP_PHASE eSetupPhase, ClusapiMethods.CLUSTER_SETUP_PHASE_TYPE ePhaseType, ClusapiMethods.CLUSTER_SETUP_PHASE_SEVERITY ePhaseSeverity, uint dwPercentComplete, string lpszObjectName, uint dwStatus)
        {
            this.AppendLogMessage("ClusterSetupProgressCallback( eSetupPhase = {0}, ePhaseType = {1}, ePhaseSeverity = {2}, dwPercentComplete = {3}, szObjectName = {4}, dwStatus = 0x{5:x} )", new object[]
            {
                eSetupPhase,
                ePhaseType,
                ePhaseSeverity,
                dwPercentComplete,
                lpszObjectName,
                dwStatus
            });
            this.m_maxPercentageDuringCallback = Math.Max(this.m_maxPercentageDuringCallback, (int)dwPercentComplete);
            Exception ex = HaTaskCallbackHelper.LookUpStatus(eSetupPhase, ePhaseType, ePhaseSeverity, dwPercentComplete, lpszObjectName, dwStatus);

            if (ex != null)
            {
                this.m_lastException = ex;
                this.AppendLogMessage("Found a matching exception: {0}", new object[]
                {
                    ex
                });
            }
            return(1);
        }
 internal static Exception LookUpStatus(ClusapiMethods.CLUSTER_SETUP_PHASE eSetupPhase, ClusapiMethods.CLUSTER_SETUP_PHASE_TYPE ePhaseType, ClusapiMethods.CLUSTER_SETUP_PHASE_SEVERITY ePhaseSeverity, uint dwPercentComplete, string objectName, uint status)
 {
     foreach (HaTaskCallbackHelper.ClusterCallbackLookupTableEntry clusterCallbackLookupTableEntry in HaTaskCallbackHelper.m_lookupTable)
     {
         if (eSetupPhase == clusterCallbackLookupTableEntry.m_ESetupPhase && ePhaseType == clusterCallbackLookupTableEntry.m_EPhaseType && ePhaseSeverity == clusterCallbackLookupTableEntry.m_EPhaseSeverity)
         {
             Exception ex = clusterCallbackLookupTableEntry.m_ExceptionFactory(objectName, status);
             if (ex != null)
             {
                 return(ex);
             }
         }
     }
     return(null);
 }