private void HandleAllowDupHandlePermission(int myPid)
 {
     if (OSEnvironmentHelper.IsVistaOrGreater || !this.listenerUserSid.Equals(new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null)))
     {
         SecurityIdentifier userSidForPid;
         try
         {
             userSidForPid = System.ServiceModel.Activation.Utility.GetUserSidForPid(myPid);
         }
         catch (Win32Exception exception)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SharedManagerBase", new object[] { this.serviceName, System.ServiceModel.SR.GetString("SharedManagerCurrentUserSidLookupFailure", new object[] { exception.NativeErrorCode }) }), exception));
         }
         if (OSEnvironmentHelper.IsVistaOrGreater || !userSidForPid.Equals(this.listenerUserSid))
         {
             try
             {
                 this.allowContext = AllowHelper.TryAllow(this.listenerUniqueSid.Value);
             }
             catch (Win32Exception exception2)
             {
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SharedManagerBase", new object[] { this.serviceName, System.ServiceModel.SR.GetString("SharedManagerAllowDupHandleFailed", new object[] { this.listenerUniqueSid.Value }) }), exception2));
             }
             if (DiagnosticUtility.ShouldTraceInformation)
             {
                 TraceUtility.TraceEvent(TraceEventType.Information, 0xa0003, System.ServiceModel.SR.GetString("TraceCodePortSharingDupHandleGranted", new object[] { this.serviceName, this.listenerUniqueSid.Value }));
             }
         }
     }
 }