When using WinDriver's Kernel PlugIn feature you are creating your own driver
file, which is used in addition to the WinDriver kernel driver
(windrvr6.sys/.dll/.o/.ko / WinDriver.kext in the current versions), which implements WinDriver's
kernel module.
Please be sure to diligently follow the instructions in the
WinDriver User's Manual
for building and installing your Kernel PlugIn driver.
You should specifically pay attention to the following points:
- If you have used WinDriver's Kernel PlugIn sample driver
(KP_PCI / KPTEST in v6.2.3-) as the basis for your
Kernel PlugIn application, be sure to replace the
driver name ("KP_PCI" / "KPTEST") in all locations in the sample
files with your chosen driver name.
The driver name should be indicated in the code in Capital Letters and
without the sys/vxd/kext/o/ko extension.
In v7.0.0+ of WinDriver, verify specifically that you have
specified the driver name correctly in the definition of KP_PCI_DRIVER_NAME in the
equivalent of the sample's pci_lib.h file.
For earlier versions of WinDriver (v6.2.3-), modify the
equivalent of the following line in
KP_Init():
strcpy(kpInit->cDriverName, "KPTEST");
and change the assignment to the
pcDriverName member of the
WD_KERNEL_PLUGIN structure, which
is passed to WD_KernelPlugInOpen()
in the user-mode project.
- When developing a SYS driver for
Windows 7 / Vista / Server 2008 / Server 2003 / XP / 2000 / NT / Me
/ 98, remember to install Microsoft's driver development kit
for your OS (WDK / DDK) and set the BASEDIR environment variable to the location of
your WDK/DDK directory before attempting to build your
Kernel PlugIn SYS driver (as explained in the manual).
(For version 5.0.5 of WinDriver and earlier, it is recommended to build
your code with the Windows NT DDK. For Windows NT 4.0 — in
WinDriver versions that support this OS — you also need to
install the NT SDK.)
For earlier versions of WinDriver (v6.0x-), which supported development
of VxD drivers on Windows 95/98/Me, when developing a VxD
driver you do not need to install the WDK/DDK (unless you added your
own DDK function calls to the Kernel PlugIn code). When
using the compile.bat file from the KPTEST sample to compile
your VxD driver, comment-out or remove the following line:
nmake %1 /f kptest.mak
leaving only the line:
nmake %1 /f kptest.mak WIN95=1
Beginning with v5.2.0 of WinDriver, the DriverWizard can also be used
to generate Kernel PlugIn code and a compatible
user-mode application for your device, including the required project
or makefiles for building the code (depending on the target OS).
For Windows, you can build the generated MS Visual Studio
(Visual C++) project into a SYS driver on a Windows 7 / Vista / Server
2008 / Server 2003 / XP / 2000 / NT machine by simply opening the
generated workspace/solution file — xxx.dsw/sln —
and building the code, after setting the
Active Build Configuration
according to the OS for which you are developing. (SYS drivers for
Windows 98/Me should be built on a Windows 7 / Vista / Server 2008 /
Server 2003 / XP / 2000 / NT machine).
Note: When building a Kernel project with MS Visual Studio, the project path must not contain any spaces.
- Verify that the WinDriver kernel module (windrvr6.sys/.dll/.o/.ko / WinDriver.kext in
the current WinDriver versions) is installed, before installing
your Kernel PlugIn driver, since the
Kernel PlugIn module depends on the WinDriver module for
its successful operation. (You can run the
Debug Monitor to verify WinDriver
is loaded).
- Install your Kernel PlugIn driver:
- Remember to copy your Kernel PlugIn driver
(my_kp/.sys/.vxd/.kext/.o/.ko) to the operating system's
drivers/modules directory before attempting to install the
driver. On Linux, beginning with v6.2.3 of WinDriver you
do not need to copy the driver file, since the driver
installation
(make install) will
handle this for you.
- Don't forget to install your Kernel PlugIn driver
before running your application:
On Windows: Use the wdreg installation utility (or
wdreg_gui/wdreg16 — depending on the WinDriver
version and OS that you are using) to install the driver:
To install a my_kp.sys driver, run:
wdreg -name MY_KP install
To install a my_kp.vxd driver (in the WinDriver versions
that support this driver type), use the -vxd flag:
wdreg -name -vxd MY_KP install
On Linux: For v6.2.3+ of WinDriver, from the
kermode/ Kernel PlugIn directory run:
make install
For earlier versions of WinDriver, use
insmod to install the
driver module.
On Solaris: Use add_drv to install the driver.
NOTE
The Kernel PlugIn is not backwards compatible. Therefore, when switching to a
different version of WinDriver, you need to rebuild your
Kernel PlugIn driver using the new version.
|