BOOL CNdisApi::ReadPackets ( PETH_M_REQUEST pPacket ) const;
Return Value:TRUE if call was successful, FALSE otherwise
Parameters:pPacket
Pointer to the user allocated and initialized ETH_M_REQUEST structure.
Remarks:
The following fields of ETH_M_REQUEST must be initialized:
ETH_M_REQUEST::hAdapterHandlemust be set to the interface handle (obtained via call to CNdisApi::GetTcpipBoundAdaptersInfo). The packets will be extracted from the network interface associated packet queue. Remember that packets queued only when network interface is in the filter mode.ETH_M_REQUEST::dwPacketsNumbermust be set to a number of entries inEthPacketarrayETH_M_REQUEST::EthPacket[i].Buffermust point to the user allocated INTERMEDIATE_BUFFER structure
The following fields of the ETH_M_REQUEST and INTERMEDIATE_BUFFER are initialized by helper driver in case of success:
ETH_M_REQUEST::dwPacketsSuccesscontains number of packets returned by driverINTERMEDIATE_BUFFER::m_IBuffercontains Ethernet packetINTERMEDIATE_BUFFER::m_Lengthcontains the actual length of the packetINTERMEDIATE_BUFFER::m_Flagsis a combination ofNDIS_FLAGS_XXX(defined in ndis.h). These flags are copied from theNDIS_PACKET.Private.Flags.INTERMEDIATE_BUFFER::m_dwDeviceFlagsisPACKET_FLAG_ON_SENDif packet goes from MSTCP to network interface, orPACKET_FLAG_ON_RECEIVEotherwise.
This member calls the filter driver with IOCTL_NDISRD_READ_PACKETS control code (see details below).
IOCTL_NDISRD_READ_PACKETS
| Input Buffer | _ETH_M_REQUEST |
| Input Buffer Size | sizeof(ETH_M_REQUEST) + sizeof(NDISRD_ETH_Packet) * (dwPacketsNumber - 1) |
| Output Buffer | _ETH_M_REQUEST |
| Output Buffer Size | sizeof(ETH_M_REQUEST) + sizeof(NDISRD_ETH_Packet) * (dwPacketsNumber - 1) |
For a WOW64 caller, the library constructs the corresponding ETH_M_REQUEST_WOW64 and NDISRD_ETH_Packet_WOW64 payloads and converts adapter handles and packet buffers.