The function description in the Packet32 package:
No.3. Packetsethwfilter (Set Filter)
Sets a hardware filter. For example, the filter parameter passes ndis_packet_type_promiscuous, you can set the NIC to promiscuous mode.
BOOLEAN PacketSetHwFilter(
LPADAPTER AdapterObject,
ULONG Filter
);
Parameters:
Adapterobject:
[in] A pointer to a _adapter structure.
Filter:
ID of the [in] filter.
Return Values:
Returns a value other than 0 if the execution succeeds.
Usage:
C + + Usage Sample
Lpadapter = Packetopenadapter (adapterlist[open-1]);
Packetsethwfilter (lpadapter,ndis_packet_type_promiscuous);
Remarks:
The filter is defined in Ntddndis.h. Here are some of the most common:
Ndis_packet_type_promiscuous: Set promiscuous mode. The NIC receives each packet;
ndis_packet_type_directed;
Ndis_packet_type_broadcast: Only receive broadcast packets;
Ndis_packet_type_multicast: Only receive the multicast packets, and the native NIC is a member of the receiving group;
Ndis_packet_type_all_multicast: All multicast packets are received;
Ndis_packet_type_all_local: all local packets.