Skip to content

Commit

Permalink
Avoid checking BytesRead for OID Set ops. See #628
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Apr 6, 2023
1 parent 75784c0 commit f2d1379
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packetWin7/npf/npf/Openclos.c
Original file line number Diff line number Diff line change
Expand Up @@ -3135,13 +3135,11 @@ NPF_SetPacketFilter(
0,
&BytesProcessed
);
// Some drivers do not set BytesRead for Set requests
UNREFERENCED_PARAMETER(BytesProcessed);

ExFreePoolWithTag(pBuffer, NPF_INTERNAL_OID_TAG);

if (Status == NDIS_STATUS_SUCCESS)
{
NT_ASSERT(BytesProcessed == sizeof(PacketFilter));
}
TRACE_EXIT();
return Status;
}
Expand Down Expand Up @@ -3204,10 +3202,8 @@ NPF_SetLookaheadSize(

ExFreePoolWithTag(pBuffer, NPF_INTERNAL_OID_TAG);

if (Status == STATUS_SUCCESS)
{
NT_ASSERT(BytesProcessed != sizeof(ULONG));
}
// Some drivers do not set BytesRead for Set requests
UNREFERENCED_PARAMETER(BytesProcessed);
TRACE_EXIT();
return Status;
}
Expand Down Expand Up @@ -3335,7 +3331,7 @@ NDIS_STATUS NPF_DoInternalRequest(
{
ExFreeToLookasideListEx(&g_pDriverExtension->InternalRequestPool, pInternalRequest);
}
INFO_DBG("pFiltMod(%p) OID %s %#x: Status = %#x\n", pFiltMod, RequestType == NdisRequestQueryInformation ? "GET" : "SET", Oid, Status);
INFO_DBG("pFiltMod(%p) OID %s %#x: Status = %#x; Bytes = %lu\n", pFiltMod, RequestType == NdisRequestQueryInformation ? "GET" : "SET", Oid, Status, *pBytesProcessed);
TRACE_EXIT();
return Status;
}

0 comments on commit f2d1379

Please sign in to comment.