Microsoft KB Archive/178320

From BetaArchive Wiki

NMPipe.exe Sample Opens a Named Pipe Created in User- Mode

Q178320



The information in this article applies to:


  • Microsoft Win32 Device Driver Kit (DDK) for Windows NT, versions 3.51, 4.0





SUMMARY

This sample demonstrates how to open a named pipe created in the user-mode, how to read or write to the pipe, and how to create system thread.



MORE INFORMATION

NMPipe.exe

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

Q119591 How to Obtain Microsoft Support Files from Online Services

Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.



Generic Sample NMPIPE Driver

This sample demonstrates how to open a named pipe created in the user-mode and read/write to the pipe.

The following are included with this file:


  • A Windows NT device driver.
  • A simple test program that can be run either as a server or as a client. As a server it creates a named pipe and waits on the pipe for the driver to connect. Then it goes into a loop where it reads the data from the pipe and prints it. As a client it sends an ioctl down to the driver to start or stop the client thread.

This driver provides an example of a minimal driver. Neither it, nor the sample program is 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 %systemroot%\SYSTEM32\DRIVERS directory where all the Windows NT device drivers are stored.

To install the Sample NMPIPE driver use the REGINI utility to create the entries listed in the nmpipe.ini file.

Testing

  1. Reboot your computer.
  2. Start the driver with "net start nmpipe".
  3. Run nmpipe.exe /s - as a server.
  4. Run nmpipe.exe /c 1 - to start the thread.
  5. Run nmpipe.exe /c 0 - to stop the thread.

Additional query words:

Keywords : kbfile kbnokeyword kbDDK
Issue type :
Technology : kbAudDeveloper kbWinDDKSearch kbWin32sSearch kbWin32DDKSearch kbWin32DDKNT351 kbWin32DDKNT400 kbWin32DDKNTSearch


Last Reviewed: December 2, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.