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

ID: Q178320


The information in this article applies to:


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

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

~ NMPipe.exe

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

Q119591 How to Obtain Microsoft Support Files from Online Services

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:

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.



Keywords          : kbnokeyword kbDDK 
Version           : WINNT:3.51,4.00
Platform          : winnt 
Issue type        : 

Last Reviewed: March 6, 1999