FILE: IOCTL.exe: How to Use Various Types of IOCTL

Last reviewed: December 30, 1997
Article ID: Q178317
The information in this article applies to:
  • Microsoft Win32 Device Development Kit (DDK) for Windows NT, versions 3.51, 4.00

SUMMARY

Demonstrates how to use various types of IOCTL and how the I/O manager handles the user I/O buffer in each case. This sample also helps you understand how to use some of the memory manager functions.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ IOCTL.exe (size: 25308 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

Generic Sample IOCTL Driver

The following are included with this file:

  • A Windows NT device driver to demonstrate how to use 4 different types of ioctls and some of the memory manager functions.
  • A simple test program that makes all 4 types of ioctl calls to the driver.

This driver is an example of a minimal driver. Neither it nor the sample programs are intended to be used in a production environment. Rather, they are intended for educational purposes and as a skeleton driver.

Building the Driver and Examples

To compile the device driver:

  1. Invoke the checked or free build environment dos box.

  2. Run "BUILD". This invokes the Microsoft make routines. They produce log files called BUILD.WRN, and BUILD.LOG. The WRN file will contain warnings that no components have been extracted from certain libraries, even if the build succeeds. If it does succeed the driver can be found in %basedir%\lib\i386\free or %basedir%\lib\i386\checked directory.

  3. Copy the sys file to the %SystemRoot%\system32\drivers directory on your test machine.

To install the Sample IOCTL driver (Sioctl) use the Regini utility to create the entries listed in the sioctl.ini file.

Testing

  1. Reboot your computer.

  2. Start the driver with "net start sioctl".

  3. Run Sioctl.exe.
Keywords          : DdkMisc
Version           : WINNT:3.51,4.00
Platform          : winnt
Issue type        : kbfile


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.