Curvostella

Programming Interaction
with Devices (Examples)

Folder: DriverPrograms

Curvostella

SergCODE source code package (Freeware) SergCODE source code package (Freeware)

In the following, we offer two sample kernel-mode WDF drivers (C, KMDF) with the corresponding user-mode applications (C++/CLI, C#, .NET, Win32). Both examples are developed using the static KernelUtils library (general-purpose utilities for kernel mode).

The kernel-mode modules were compiled using the Windows Driver Kit 1.0.
The SYS file is installed into the system using WdfCoInstaller.dll (version 1.5) in addition to the the INF file.
The sample drivers were tested under Windows 2K/XP x86.
The user-mode applications are .NET 2.0-based (developed using Visual Studio 2008).


KernelUtils Static Library (WDF, KMDF):

The KernelUtils library provides the following types of helpers:

The KernelUtils library folders:

Folder Contents
Include User-mode and kernel-mode header files (H, RC)
Include\KernelUtils Kernel-mode header files (H)
KernelUtils Source files of the KernelUtils static library (C, H, ...)
Lib Library files for various architectures and configurations (KernelUtils.lib)

See header files and source code.


XDevice Demo Project (Software Only Device):

This example demonstrates a simple applicationdriver interaction:

See contents of the projects (folder: DriverPrograms\XDevice).

This example can be run.
This example can be recompiled.

The original compiled variant contains a debug driver module (XDevice.sys) and a release version of the device test application (XDeviceTest.exe) (subfolder: XDevice\Ready\x86).

See an example with figures:
Test of the XDevice device (software only device)



Software for the ShaperDevice Device (Support for a Simple PCI Device):

Support for the ShaperDevice device include the following projects:

The software being demonstrated was used to operate/manage an experimental laser shaper device designed for creating profiles of light impulse signal. By reducing impulse length, a custom-tailored signal profile allows manyfold increasing the momentary radiation power.

See contents of the projects (folder: DriverPrograms\ShaperDevice).

The ShaperTerminal application is based on a special library, ElementaryExtensions (Freeware), used in the project in a DLL version. This library is an ancestor of the XHelpers library (Freeware) (the main section of the SergCODE package).

This example can be run in DummyMode
This example may be recompiled.

The original compiled set is in the Export\ShaperDevice_vXXXX.XX.XX.XX_x86 subfolder.
All the user-mode modules are in release version; the ShaperDevice.sys driver is in debug version; the INF and REG files have the DummyMode parameter set on.

See an example with figures:
ShaperTerminal (terminal for operating/managing laser shaper device)



The initial installation of the drivers into the system is done using the new software installation wizard. You must indicate the corresponding INF file (manual installation mode). Later on you may use the upload_driver.cmd auxiliary batch (copies the SYS и PDB into the System32\Drivers folder). Use the device manager to stop, start, and remove the driver service (useful when debugging). You will see the "XDevice" Device (Software Only) device in the list of system devices in the XDevices group, while Shaper Device (PCI) will be under the CoProcessors node.

The examples can be compiled using the auxiliary CMD batches based on the $WdkBuild utility, which in turn is based on build.exe и setenv.bat). (See: Command Line Utilitites)

For viewing debugger output, you should use the well-known DebugView service utility (from the Windows Sysinternals site).
It is advisable to set a small fixed-width font (e.g., Lucida Console Regular 8).

System devices in Device Manager:

Compilation of the ShaperDevice.sys driver using $WdkBuild:

Debug output when starting the XDevice device (switching on in the device manager):



Top

© Sergei Kitaev (Китаев С.Ю.)