This sample demonstrates a software only Windows® 2000 Device Driver. This driver creates a RAM disk drive of the specified size. This Ramdisk can be used like any other disk, but the contents of the disk will be lost when the machine is shutdown. Generally the Windows® 2000 cache manager does a much better job of optimizing memory usage than using a Ramdisk.
The driver building and
installation instructions given here apply only to Windows® 2000.
Note: This sample provides an example
of a minimal driver. Neither the driver nor the sample programs are intended
for use in a production environment. Rather, they are intended for educational
purposes and as a skeleton driver.
Click the Free Build
Environment or Checked Build Environment icon under your Development Kits program
group to set basic environment variables needed by the build utility.
Change to the directory
containing the device source code, such as CD C:\Drivers\Ramdisk
Run build -ceZ, or
use the macro BLD. This behavior invokes the Microsoft make routines
that produce log files called Buildxxx.log, and also Buildxxx.wrn and
Buildxxx.err if there are any warnings or errors. Where xxx stands for fre
or chk depending on the environment chosen. If the build succeeds, the
driver Ramdisk.sys will be placed in a platform specific subdirectory of your %TargetPath%
directory specified in the Sources file.
To install the driver:
The system copies the
Ramdisk.sys file to %systemroot%\system32\drivers directory and loads the
driver.
File Description
Ramdisk.c Source file for the Ramdisk sample driver
Pnp.c Source file that handles the PnP IRPs
Ramdisk.h Include file that contains the Ramdisk structures
Debug.h Include file that contains the debug print definition
Sources Generic file for building the code sample.
Ramdisk.inf Installation file for installing the driver.
Ramdisk.htm Sample Tour documentation for this sample (this file).