This section explains how to compile WinPcap, both the kernel
level and the user-level portion, on the various Win32 platforms.
Compiling the driver
Two main NPF sources are available for compilation: the Windows
NTx one and the Windows 9x one. Note that, since the NPF Driver is
platform dependent, we STRONGLY suggest to compiled it on the OS
where it will be used, in order to link the correct DDK libraries.
For example, 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, although the code is the same.
Compiling the driver on Windows NTx
Software requirements:
- Microsoft Windows NT or Windows 2000 or Windows XP operating system
- Microsoft Driver Developer Kit (DDK) for NT 4.0 or Windows
2000 or Windows XP
- Microsoft Software Development Kit (SDK)
- Microsoft Visual C++ 6.0
If your system satisfies these requirements, follow these steps:
- From the Window NT Start menu, select the folder Programs
and then Development Kits, then Windows XXX DDK,
where XXX is the target system. 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.
- A DOS shell will be opened. Move to the directory PacketNTx
inside the WinPcap source folder and type the command
CompileNT4, to build the driver for Windows NT 4
or
Compile2k, to build the driver for Windows NT 5 OSes, (like
Windows 2000 or Windows XP)
This commands will generate the driver (packet.sys), that will
be put in the DDK output directory (usually \i386).
Warning: sometimes, during the compilation of the driver,
a lot of 'last line incomplete' errors are generated. Ignore these
errors and let the compilation process continue, they are due to
bugs in some DDK versions.
Compiling the driver on Windows 9x
To compile the driver there are the following software
requirements:
- Windows 95/98/ME operating system
- Driver Developer Kit (DDK) for Windows 95/98/ME
- Software Development Kit (SDK)
- Visual C++ 6.0
If your system satisfies the requirements, follow the following
steps:
- Open a dos shell
- Go in the VisualC++ BIN directory (for example C:\DEVSTUDIO\VC\BIN)
and execute the command
Vcvars32
- 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)
- Go in the DDK directory (for example C:\DDK) and execute the
command
Ddkenv 32 net
- 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: On some systems the NMAKE utility is
not able to launch ADRC2VXD, this means that the driver binary is
generated correctly, but without the copyright information. We don't
know the cause of this problem.
Compiling packet.dll
Like for NPF, two sources are available for compilation: the
Windows NTx one and the Windows 9x one. They are located in
PacketNTx\dll\ and in Packet9x\dll\.
Software requirements:
- Microsoft Software Development Kit (SDK)
- Microsoft Visual C++ 6.0
To compile the PACKET.DLL, load the project contained in the
directory PacketNTx\dll\project (or Packet9x\dll\project) in the
Visual C++ IDE. Build the project to obtain the PACKET.DLL and packet.lib
files. The first one is the actual library, the second one is the
file that applications need to link in order to use the it. The
debug version of these files will be generated in the directory dll\project\debug,
the release version in dll\project\release.
Compiling wpcap.dll
A single project is available for wpcap.dll. It can be compiled
on any Win32 platform and the generated dll is system independent.
System Requirement:
- Microsoft Visual C++ 6.0 compiler.
Project files are in the directory winpcap\wpcap\prj of
the WinPcap source code distribution. Load the project from the Visual
C++ 6.0 IDE and build the program. The output file wpcap.lib
will be generated in winpcap\wpcap\lib\. The
output dll wpcap.dll will be generated in winpcap\wpcap\prj\release
or winpcap\wpcap\prj\debug depending on the
type of binary that is being generated.
|