Skip to content

Commit

Permalink
Remove checks for unused INFO_FLAG_DONT_EXPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Mar 31, 2022
1 parent 6e89a43 commit cf82755
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions packetWin7/Dll/Packet32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ BOOL PacketStartService()
error = GetLastError();
if (error != ERROR_SERVICE_ALREADY_RUNNING && error != ERROR_ALREADY_EXISTS)
{
TRACE_PRINT1("PacketOpenAdapterNPF: StartService failed, LastError=%8.8x", error);
TRACE_PRINT1("StartService failed, LastError=%8.8x", error);
Result = FALSE;
}
}
Expand Down Expand Up @@ -1863,18 +1863,6 @@ LPADAPTER PacketOpenAdapter(PCCH AdapterNameWA)
}
#endif // HAVE_AIRPCAP_API

if(TAdInfo->Flags == INFO_FLAG_DONT_EXPORT)
{
//
// The adapter is flagged as not exported, probably because it's broken
// or incompatible with WinPcap. We end here with an error.
//
TRACE_PRINT1("Trying to open the adapter %hs which is flagged as not exported. Failing (BAD_UNIT)", AdapterNameWA);
dwLastError = ERROR_BAD_UNIT;

break;
}

if (TAdInfo->Flags != INFO_FLAG_NDIS_ADAPTER)
{
TRACE_PRINT1("Trying to open the adapter with an unknown flag type %u", TAdInfo->Flags);
Expand Down Expand Up @@ -3358,12 +3346,9 @@ BOOLEAN PacketGetAdapterNames(PCHAR pStr, PULONG BufferSize)
//
for(TAdInfo = g_AdaptersInfoList; TAdInfo != NULL; TAdInfo = TAdInfo->Next)
{
if(TAdInfo->Flags != INFO_FLAG_DONT_EXPORT)
{
// Update the size variables
SizeNeeded += (ULONG)strlen(TAdInfo->Name) + (ULONG)strlen(TAdInfo->Description) + 2;
SizeNames += (ULONG)strlen(TAdInfo->Name) + 1;
}
}

// Check that we don't overflow the buffer.
Expand All @@ -3388,8 +3373,6 @@ BOOLEAN PacketGetAdapterNames(PCHAR pStr, PULONG BufferSize)
//
for(TAdInfo = g_AdaptersInfoList, SizeNames = 0, SizeDesc = 0; TAdInfo != NULL; TAdInfo = TAdInfo->Next)
{
if(TAdInfo->Flags != INFO_FLAG_DONT_EXPORT)
{
// Copy the data
StringCchCopyA(
((PCHAR)pStr) + SizeNames,
Expand All @@ -3403,7 +3386,6 @@ BOOLEAN PacketGetAdapterNames(PCHAR pStr, PULONG BufferSize)
// Update the size variables
SizeNames += (ULONG)strlen(TAdInfo->Name) + 1;
SizeDesc += (ULONG)strlen(TAdInfo->Description) + 1;
}
}

// Separate the two lists
Expand Down

0 comments on commit cf82755

Please sign in to comment.