public override string GenerateDescription(NktParam aParameter, string functionName) { if (aParameter.PointerVal == IntPtr.Zero) return "0x0"; var pointedParameter = aParameter.Evaluate(); return pointedParameter.FieldsCount == 0 ? DescriptionForNonStructurePointee(aParameter) : DescriptionForStructurePointee(pointedParameter, functionName); }
private bool Inspect(NktParam parameter) { if (IsMaxAllowedDepthReached) return false; parameter.Accept(this); return true; }
public override string GenerateDescription(NktParam aParameter, string functionName) { var nonStructureFields = NonStructureFieldsFrom(aParameter); if (nonStructureFields.Length == 0) return EmptyStructureDescription; var stringDescriptor = new StringDescriptor(); if (!nonStructureFields.Any(parameter => stringDescriptor.CanHandle(parameter, functionName))) return FormatAsStructure(Describe(nonStructureFields.First(), functionName)); var aField = nonStructureFields.First(aParameter1 => stringDescriptor.CanHandle(aParameter1, functionName)); var fieldDescription = stringDescriptor.GenerateDescription(aField, functionName); return FormatAsStructure(fieldDescription); }
private static ParameterDescriptor For(NktParam aParameter, string functionName) { var generators = new ParameterDescriptor[] { new NullPointerDescriptor(), new MessageDescriptor(), new ResourceStringDescriptor(), new GuidDescriptor(), new StringDescriptor(), new StructureDescriptor(), new PointerDescriptor(), new BasicTypeDescriptor() }; return generators.First(generator => generator.CanHandle(aParameter, functionName)); }
public void VisitSignedDoubleWordParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
public void VisitFloatParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
public void VisitResourceStringParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private string ByteDescription(NktParam aParameter) { return(FormatAsHex(aParameter.ByteVal)); }
private static NktParam[] NonStructureFieldsFrom(NktParam aParameter) { return FieldsFrom(aParameter).Where(param => param.FieldsCount == 0).ToArray(); }
public override bool CanHandle(NktParam aParameter, string functionName) { return IsMessageFunction(functionName) && IsMessageParameter(aParameter.Name); }
private InspectedParameter RegisterInspectorFor(NktParam aParameter) { var inspectedParameter = InspectedParameter.From(aParameter, _functionName); InspectedParameters.Add(inspectedParameter); return inspectedParameter; }
private string DescriptionForNonStructurePointee(NktParam aParameter) { return(FormatAsPointer(aParameter.PointerVal)); }
private string DescriptionForStructurePointee(NktParam pointedParameter, string functionName) { return(Describe(pointedParameter, functionName)); }
public static InspectedParameter From(NktParam aParameter, string functionName) { var description = ParameterDescriptor.Describe(aParameter, functionName); return(From(description, aParameter.Name, aParameter.Type())); }
public override string GenerateDescription(NktParam aParameter, string functionName) { return(aParameter.ReadString()); }
public override bool CanHandle(NktParam aParameter, string functionName) { return(aParameter.IsWideString || aParameter.IsAnsiString); }
public override string GenerateDescription(NktParam aParameter, string functionName) { return("NULL"); }
public void VisitNullPointerParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
public void VisitStructureParameter(NktParam aParameter) { var inspectedStructure = RegisterInspectorFor(aParameter); foreach (var field in aParameter.Fields().CollectAllInspectables()) { IncreaseInspectingDepth(); if (Inspect(field)) RemoveLastCreatedParameterAndAddItAsChildOf(inspectedStructure); DecreaseInspectingDepth(); } }
public override bool CanHandle(NktParam aParameter, string functionName) { return(aParameter.IsPointer); }
public override bool CanHandle(NktParam aParameter, string functionName) { var handledBasicTypes = _basicTypesHandlers.Keys; return(handledBasicTypes.Contains(aParameter.BasicType)); }
public static string Describe(NktParam aParameter, string functionName) { return(For(aParameter, functionName).GenerateDescription(aParameter, functionName)); }
public override bool CanHandle(NktParam aParameter, string functionName) { return aParameter.FieldsCount > 0; }
public abstract bool CanHandle(NktParam aParameter, string functionName);
public override bool CanHandle(NktParam aParameter, string functionName) { return aParameter.IsPointer && aParameter.IsNullPointer; }
public abstract string GenerateDescription(NktParam aParameter, string functionName);
public override bool CanHandle(NktParam aParameter, string functionName) { var handledBasicTypes = _basicTypesHandlers.Keys; return handledBasicTypes.Contains(aParameter.BasicType); }
public override bool CanHandle(NktParam aParameter, string functionName) { return(aParameter.FieldsCount > 0); }
public void VisitWideCharParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private static NktParam[] NonStructureFieldsFrom(NktParam aParameter) { return(FieldsFrom(aParameter).Where(param => param.FieldsCount == 0).ToArray()); }
public void VisitUnsignedByteParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private static NktParam[] FieldsFrom(NktParam aParameter) { return(aParameter.Fields().CollectAll()); }
public void VisitUnsignedQuadWordParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private string WordDescription(NktParam aParameter) { return(FormatAsHex(aParameter.ShortVal)); }
public void VisitNonNullPointerParameter(NktParam aParameter) { var pointee = aParameter.Evaluate(); Inspect(pointee); // Parameter Name and Type information is provided by the pointer parameter, and not by the pointee UpdateLastAddedParameterInfo(aParameter.Name, aParameter.Type()); }
public override bool CanHandle(NktParam aParameter, string functionName) { return !string.IsNullOrEmpty(aParameter.GuidString); }
public void VisitGuidStringParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
public override string GenerateDescription(NktParam aParameter, string functionName) { var description = DescriptionFor(aParameter); var formattedDescription = string.IsNullOrEmpty(description) ? string.Empty : " " + description; return string.Format("0x{0:X}{1}", (uint)aParameter.Value, formattedDescription); }
private string QuadWordDescription(NktParam aParameter) { return(FormatAsHex(aParameter.LongLongVal)); }
public override string GenerateDescription(NktParam aParameter, string functionName) { return aParameter.GuidString; }
public void VisitStringParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private static string DescriptionFor(NktParam aParameter) { var messageCode = (uint)aParameter.Value; var descriptionNode = _knownParameterDescriptions.SelectSingleNode(DescriptionQueryFor(messageCode)); if (descriptionNode == null) return string.Empty; if (string.IsNullOrEmpty(descriptionNode.InnerText)) { return IsUserMessageCode(messageCode) ? DescriptionForUserMessage(messageCode) : string.Empty; } return DescriptionForMessage(descriptionNode); }
public static InspectedParameter From(NktParam aParameter, string functionName) { var description = ParameterDescriptor.Describe(aParameter, functionName); return From(description, aParameter.Name, aParameter.Type()); }
public void VisitSignedByteParameter(NktParam aParameter) { RegisterInspectorFor(aParameter); }
private string ByteDescription(NktParam aParameter) { return FormatAsHex(aParameter.ByteVal); }
private string WordDescription(NktParam aParameter) { return FormatAsHex(aParameter.ShortVal); }
private static NktParam[] FieldsFrom(NktParam aParameter) { return aParameter.Fields().CollectAll(); }
private string QuadWordDescription(NktParam aParameter) { return FormatAsHex(aParameter.LongLongVal); }
public override string GenerateDescription(NktParam aParameter, string functionName) { return "NULL"; }
public override string GenerateDescription(NktParam aParameter, string functionName) { var generateDescriptionFor = _basicTypesHandlers[aParameter.BasicType]; return(generateDescriptionFor(aParameter)); }