Skip to content

Commit

Permalink
More code cleanup: unused vars, add annotation, correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Jun 1, 2021
1 parent 01ba22d commit 5031c46
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions packetWin7/npf/npf/Openclos.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,9 @@ NTSTATUS NPF_EnableOps(_In_ PNPCAP_FILTER_MODULE pFiltMod, _In_ PDEVICE_OBJECT p
{
NTSTATUS Status = STATUS_PENDING;
NDIS_EVENT Event;
#ifndef HAVE_WFP_LOOPBACK_SUPPORT
UNREFERENCED_PARAMETER(pDevObj);
#endif

if (pFiltMod == NULL)
{
Expand Down
9 changes: 4 additions & 5 deletions packetWin7/npf/npf/Packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@ NPF_GetRegistryOption_Integer(
{
if (valueInfoP->Type == REG_DWORD && valueInfoP->DataLength == 4)
{
returnValue = *((DWORD *) valueInfoP->Data);
IF_LOUD(DbgPrint("\"%ws\" Key = %08X\n", RegValueName->Buffer, *((DWORD *)valueInfoP->Data));)
returnValue = *((ULONG *) valueInfoP->Data);
IF_LOUD(DbgPrint("\"%ws\" Key = %08X\n", RegValueName->Buffer, *((ULONG *)valueInfoP->Data));)
}
else
{
Expand Down Expand Up @@ -1046,8 +1046,8 @@ Return Value:
// NdisFDeregisterFilterDriver ought to have called FilterDetach, but something is leaking. Let's force a wait:
NdisAcquireSpinLock(&g_FilterArrayLock);
while (g_arrFiltMod.Next != NULL) {
PNPCAP_FILTER_MODULE pFiltMod = CONTAINING_RECORD(g_arrFiltMod.Next, NPCAP_FILTER_MODULE, FilterModulesEntry);
#ifdef HAVE_WFP_LOOPBACK_SUPPORT
PNPCAP_FILTER_MODULE pFiltMod = CONTAINING_RECORD(g_arrFiltMod.Next, NPCAP_FILTER_MODULE, FilterModulesEntry);
if (pFiltMod->Loopback) {
// NDIS doesn't manage this, so we "detach" it ourselves.
NdisReleaseSpinLock(&g_FilterArrayLock);
Expand Down Expand Up @@ -1126,7 +1126,6 @@ NPF_IoControl(
PUINT pStats;
ULONG StatsLength;
PULONG pCombinedPacketFilter;
PNDIS_LINK_STATE pLinkState;

HANDLE hUserEvent;
PKEVENT pKernelEvent;
Expand Down Expand Up @@ -1768,7 +1767,7 @@ NPF_IoControl(
}
else
{
pLinkState = (PNDIS_LINK_STATE) OidData->Data;
PNDIS_LINK_STATE pLinkState = (PNDIS_LINK_STATE) OidData->Data;
pLinkState->MediaConnectState = MediaConnectStateConnected;
pLinkState->MediaDuplexState = MediaDuplexStateFull;
pLinkState->XmitLinkSpeed = NDIS_LINK_SPEED_UNKNOWN;
Expand Down
2 changes: 1 addition & 1 deletion packetWin7/npf/npf/Write.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ NPF_LoopbackSendNetBufferLists(
NTSTATUS
NPF_AllocateNBL(
_In_ PNPCAP_FILTER_MODULE pFiltMod,
_In_ PMDL pMdl,
_In_ __drv_aliasesMem PMDL pMdl,
_In_ SIZE_T uDataLen,
_Outptr_result_nullonfailure_ PNET_BUFFER_LIST *ppNBL
)
Expand Down

0 comments on commit 5031c46

Please sign in to comment.