The driver-building and installation instructions in this article apply only to Windows(r) 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 skeletal version of a driver.
Release Date: April 6, 2000
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
The Ramdisk.exe file contains the following files:
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
Makefile Standard Windows 2000 makefile
Ramdisk.inf Installation file for installing the driver
Ramdisk.htm Sample Tour documentation for this sample
Ramdisk.sys Windows 2000 driver file (free build)
Build the SampleClick the Free Build Environment or Checked Build Environment icon under your Development Kits program group to set basic environment variables that are needed by the build utility.
Change to the directory that contains the device source code, with a command such as CD C:\Drivers\Ramdisk.
Run build -ceZ, or use the macro BLD. This 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 file is placed in a platform specific subfolder of your %TargetPath% folder, which is specified in the Sources file.
Install the SampleTo install the driver:
- In Control Panel, double-click to start the Add/Remove Hardware utility.
- Select Add/Troubleshoot a device.
- Select Add a new device.
- Select No, I want to select the hardware from a list.
- Select Other devices, and then click Next.
- Click the Have Disk button and point to the folder that contains the Ramdisk.inf file.
Configure the Ramdisk DriveImportant This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
You can use the registry to configure Ramdisk. The Ramdisk.inf file contains the default values for all the configurable parameters. A brief description of each parameter follows:
BreakOnEntry REG_DWORD 0
Installing the Ramdisk sample driver in a NTFS only machine might make it unusable. To resolve this problem make the following change:
While you call the IoCreateDevice function (RamdiskAddDevice function in pnp.c), change the device type from FILE_DEVICE_VIRTUAL_DISK to FILE_DEVICE_DISK and recompile the driver. After you install the driver, restart the system in order to access the Ramdisk through Explorer.
Warning Installing Ramdisk in Windows XP may render the System Restore feature useless.
รหัสบทความ: 257405 - การตรวจสอบครั้งสุดท้าย: 16 ธ.ค. 2009 - ฉบับแก้ไข: 1