Commit 8e7ca0a9 authored by Brickner_cp's avatar Brickner_cp

Code Analysis

parent 03f5e460
......@@ -16,6 +16,7 @@
<Word>datakit</Word>
<Word>ccitt</Word>
<Word>iclfxbm</Word>
<Word>enqueueing</Word>
</Recognized>
<Deprecated>
<!--Term PreferredAlternate="EnterpriseServices">complus</Term-->
......@@ -29,7 +30,6 @@
</Words>
<Acronyms>
<CasingExceptions>
<!-->Acronym>Eof</Acronym-->
<Acronym>Ip</Acronym>
<Acronym>Ms</Acronym>
</CasingExceptions>
......
......@@ -5,7 +5,7 @@ using namespace PcapDotNet::Core;
PacketTotalStatistics^ OfflinePacketCommunicator::TotalStatistics::get()
{
throw gcnew InvalidOperationException("Can't get TotalStatistics for offline devices");
throw gcnew InvalidOperationException("Can't get " + PacketTotalStatistics::typeid->Name + " for offline devices");
}
void OfflinePacketCommunicator::Transmit(PacketSendBuffer^, bool)
......
......@@ -27,7 +27,7 @@ void PacketCommunicator::DataLink::set(PcapDataLink value)
ReadOnlyCollection<PcapDataLink>^ PacketCommunicator::SupportedDataLinks::get()
{
throw gcnew NotSupportedException("Supported DataLinks is unsupported to avoid winpcap memory leak");
throw gcnew NotSupportedException("Unsupported property to avoid WinPcap memory leak");
// pcap_free_datalinks(NULL);
/*
int* dataLinks;
......
......@@ -21,7 +21,7 @@ void PacketSendBuffer::Enqueue(Packet^ packet)
PacketHeader::GetPcapHeader(pcapHeader, packet);
pin_ptr<Byte> unmanagedPacketBytes = &packet->Buffer[0];
if (pcap_sendqueue_queue(_pcapSendQueue, &pcapHeader, unmanagedPacketBytes) != 0)
throw gcnew InvalidOperationException("Failed enqueueing to SendQueue");
throw gcnew InvalidOperationException("Failed enqueueing to queue");
}
PacketSendBuffer::~PacketSendBuffer()
......
......@@ -37,7 +37,7 @@ DataLinkKind PcapDataLink::Kind::get()
case 1:
return DataLinkKind::Ethernet;
default:
throw gcnew NotSupportedException("PcapDataLink " + Value.ToString(CultureInfo::InvariantCulture) + " - " + ToString() + " is unsupported");
throw gcnew NotSupportedException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " - " + ToString() + " is unsupported");
}
}
......@@ -51,7 +51,7 @@ String^ PcapDataLink::Name::get()
{
const char* name = pcap_datalink_val_to_name(Value);
if (name == NULL)
throw gcnew InvalidOperationException("datalink " + Value.ToString(CultureInfo::InvariantCulture) + " has no name");
throw gcnew InvalidOperationException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " has no name");
return gcnew String(name);
}
......@@ -60,7 +60,7 @@ String^ PcapDataLink::Description::get()
{
const char* description = pcap_datalink_val_to_description(Value);
if (description == NULL)
throw gcnew InvalidOperationException("datalink " + Value.ToString(CultureInfo::InvariantCulture) + " has no description");
throw gcnew InvalidOperationException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " has no description");
return gcnew String(description);
}
......@@ -110,6 +110,6 @@ int PcapDataLink::KindToValue(DataLinkKind kind)
case DataLinkKind::Ethernet:
return 1;
default:
throw gcnew NotSupportedException("PcapDataLink kind " + kind.ToString() + " is unsupported");
throw gcnew NotSupportedException(PcapDataLink::typeid->Name + " kind " + kind.ToString() + " is unsupported");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment