MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07/Microsoft/InfoCards/WSIdentityFaultException.cs

99 lines
3.3 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.WSIdentityFaultException
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 516D8B44-4448-4D2C-8B8E-FFBB3FFE472B
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07.exe
using Microsoft.InfoCards.Diagnostics;
using System;
using System.Globalization;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Xml;
namespace Microsoft.InfoCards
{
internal class WSIdentityFaultException : InfoCardBaseException
{
private const int HRESULT = -1073413871;
public static void ThrowIfFaultMessage(Message message, CultureInfo displayCulture)
{
if (message.IsFault)
{
MessageFault fault1 = MessageFault.CreateFault(message, 2000000);
FaultException fault2 = FaultException.CreateFault(fault1);
string message1 = fault2.Message;
string extendedMessage = string.Empty;
if (fault1.Reason != null)
{
FaultReasonText matchingTranslation = fault1.Reason.GetMatchingTranslation(displayCulture);
if (matchingTranslation != null)
extendedMessage = matchingTranslation.Text;
}
if (fault1.HasDetail)
{
using (XmlReader atDetailContents = (XmlReader) fault1.GetReaderAtDetailContents())
{
if (atDetailContents.Read())
message1 = string.Format((IFormatProvider) CultureInfo.CurrentUICulture, SR.GetString("FaultMessageFormat"), new object[2]
{
(object) fault2.Message,
(object) atDetailContents.ReadOuterXml()
});
}
}
throw InfoCardTrace.ThrowHelperErrorWithNoLogging((Exception) new WSIdentityFaultException(message1, extendedMessage, (Exception) fault2));
}
}
public WSIdentityFaultException()
: base(-1073413871)
{
}
public WSIdentityFaultException(string message)
: base(-1073413871, message)
{
}
public WSIdentityFaultException(string message, string extendedMessage, Exception inner)
: base(-1073413871, message, extendedMessage)
{
if (!(inner is FaultException))
return;
this.MapFaultException(inner as FaultException);
}
protected WSIdentityFaultException(SerializationInfo si, StreamingContext sc)
: base(-1073413871, si, sc)
{
}
private void MapFaultException(FaultException fe)
{
if (fe == null || fe.Code == null || fe.Code.SubCode == null || !(fe.Code.SubCode.Namespace == "http://schemas.xmlsoap.org/ws/2005/05/identity/fault"))
return;
switch (fe.Code.SubCode.Name)
{
case "InformationCardRefreshRequired":
this.HResult = -1073413760;
break;
case "MissingAppliesTo":
this.HResult = -1073413759;
break;
case "InvalidProofKey":
this.HResult = -1073413758;
break;
case "UnknownInformationCardReference":
this.HResult = -1073413757;
break;
case "FailedRequiredClaims":
this.HResult = -1073413756;
break;
}
}
}
}