mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 19:36:11 +00:00
f2ac1ece55
add
99 lines
3.3 KiB
C#
99 lines
3.3 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Microsoft.InfoCards.WSIdentityFaultException
|
|
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
|
|
// MVID: 1D4D5564-A025-490C-AF1D-DF4FBB709D1F
|
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed.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;
|
|
}
|
|
}
|
|
}
|
|
}
|