Briefly:
Listening to all the data on the network is a more interesting topic. A wide range of listening programs, all using a more famous development package Packet32. For example, Ntsniff, Ethernetspy, Ntpacket, and so on, there are famous WinPcap. It allows the application to set the operating mode of the network card, read and write data directly on the network card, and so on.
General use of the Packet32 version of the implementation, is Microsoft's packet32.c and Packet32.h. This version is relatively simple to write.
The Packet32 in the WinPcap development package is Politecnico di Torino rewrite, adding a lot of error handling, and the annotations are informative and worth reading.
In http://winpcap.polito.it/default.htm, the WinPcap development package is described as: WinPcap is a architecture for packet capture and network Analysis for the WIN32 platforms. It includes a Kernel-level packet filter, a low-level dynamic link library (Packet.dll), and a high-level and SYSTEM-INDEP Endent Library (Wpcap.dll, based on libpcap version 0.6.2).
Here is a description of the implementation version of Packet32, modeled after the Microsft SDK style.
The contents are in sequence:
Contents of Packet32 Package
Functions in the Packet32 package
Packetgetadapternames
Packetopenadapter, etc.
Data structure in the Packet32 package
Example 1: Use Packet32 to set the NIC to promiscuous mode and monitor all packets.
Contents of Packet32 Package
Packet Driver: Oemsetup.inf installation information files, Packet.sys system files, the use of PACKET32 package to develop network monitoring procedures, the need to use these two files to install Packet driver. Packet32 Program Development Library: Packet32.lib static link library, Packet32.dll dynamic link library, users can operate the network card directly by calling functions in the library.
The function description in the Packet32 package:
No.1. Packetgetadapternames (read the network card name from the registry)
Get a list of existing network adapters and their descriptions.
BOOLEAN Packetgetadapternames (
Ptstr Pstr,
Pulong buffersize
);
Parameters: