WinPcap: the Free Packet Capture Architecture for Windows


Last modified: Monday, March 26, 2001 10.48

Compiling the Packet Driver

The Packet Driver is platform dependent, therefore it MUST be compiled on the system where you intend to use it.

 

Compiling on Windows NT 4.0 and Windows 2000

Software requirements:

  • Microsoft Windows NT 4.0 or Windows 2000 operating system
  • Microsoft Driver Developer Kit (DDK) for NT 4.0 or for Windows 2000
  • Microsoft Software Development Kit (SDK)
  • Microsoft Visual C++ 6.0

Important note: Windowd NT and 2000 share the common set of code. However the code must be compiled under the correct platform in order to obtain the correct driver. In other words, if you compile the driver with the DDK for Windows NT 4, it will not work properly in Windows 2000 and vice versa. 

If your system satisfies the requirements, follow these steps:

  1. From the Window NT Start menu, select the folder Programs and then Windows NT DDK. From here select the voice Checked Build Environment if you want to build a debug version, or Free Build Environment if you want to build a release version.
  2. A DOS shell will be opened. Move to the directory whit the driver's source code and type the command

    compile

    This command will generate the driver (packet.sys). The debug version of the files will be generated in the directory \i386\checked. The release version in \i386\free.
  3. To compile the sources of PACKET.DLL, load the project contained in the directory packetNT\dll\project in the Visual C++ 6.0 IDE. Build the project to obtain the PACKET.DLL and packet.lib files. The debug version of these files will be generated in the directory packetNT\dll\project\debug, the release version in packetNT\dll\project\release.

Warning: usually, during the first compilation of the driver, a lot of 'last line incomplete' errors are generated. Ignore these errors and let the compilation process continue. These errors usually disappear from the second compilation.

Compiling on Windows 95/98/ME

To compile the driver there are the following software requirements:

  • Windows 95/98 operating system
  • Driver Developer Kit (DDK) for Windows 95
  • Software Development Kit (SDK)
  • Visual C++ 6.0

If your system satisfies the requirements, follow these steps:

  1. Open a dos shell
  2. Go in the VisualC++ BIN directory (for example C:\DEVSTUDIO\VC\BIN) and execute the command

    Vcvars32
  3. Go in the SDK directory (for example C:\MSSDK) and execute the command

    Setenv sdk_path

    where sdk_path is the directory of SDK (for example Setenv C:\MSSDK)
  4. Go in the DDK directory (for example C:\DDK) and execute the command

    Ddkenv 32 net
  5. Move to the directory whit the driver's source code and type the command

    nmake rtl

    to obtain a release version, or

    nmake

    to obtain a debug version.
    The release version of packet.vxd will be placed in the retail directory, the debug version in the debug directory.

Warning: we often encountered problems compiling the driver for Windows 95. In particular on some systems the NMAKE utility was not able to launch ADRC2VXD (the driver is generated without the copyright information), and on other systems the debug version of the driver was not compiled correctly. We don't know the cause of these problems.