## LocalMon: Sample Port Monitor Server DLL

[This is preliminary documentation and subject to change.]

### SUMMARY

A port monitor DLL is a user-mode DLL that is responsible for providing a communications path between the user-mode print spooler and the kernel-mode port drivers that access I/O port hardware.

Please refer to the Windows® DDK documentation for further information about print monitors.

This sample works on both x86 and Alpha platforms and the code is 64-bit compliant.

### BUILDING THE SAMPLE

The code must be built using the build environment shipped with the DDK. Microsoft® Visual C® must be present on the machine for the sample to build properly, as build will use some header files. Also, the SDK and the DDK must be installed.

To build the sample, run build from the src\print\monitors\localmon directory. The DLL will be placed in the appropriate platform directory (either i386 or Alpha).

To install a port monitor, an INF file called Monitor.inf is needed. This INF file is based on Printmon.inf, the default INF file for installing port monitors. A functional Monitor.inf file is provided. However, in order to adapt it to the user's needs, it will be necessary to make changes in certain designated places tagged "User Changes." Examples of these changes are: changing the source media description or adding a help file to the monitor.

Once built, the sample will produce four binaries: DDKLocalmon.dll, DDKLocalmon.lib (an export lib), DDKLocalmon.exp, and, if the sample is built in a checked environment, DDKLocalmon.pdb.

Before installing this sample monitor, the user needs to build src\print\localui, because DDKLocalui.dll provides the UI for DDKLocalmon and they are installed together.

### CODE TOUR

#### File Manifest

    File		Description

Config.c Handles spooler entry points for adding, deleting, and configuring localmon ports Dialogs.c Source module that implements dialog boxes Dialogs.h Header for DIALOGS.C Lmon.h Header that declares PORT_INFO_FF structure Irda.c IRDA printing support in localmon Irda.h Header for IRDA Local.h Header that declares debug functions Localmon.c Source module that contains the DLL entry point Localmon.def File that lists the exported functions Localmon.prf Resource file for the dialogs Localmon.h Header for global declarations and function prototypes Localmon.rc Resource file for the module Makefile Generic file for building the code sample Precomp.h Generic header Localmon.htm Documentation for this sample (this file) Resource.rcv Resource version file Resource.h Resource include file Setlink.c Utility to display or change the value of a symbolic link Sources Generic file for building the code sample Spltypes.h Header for Winspool.c Util.c Source module for support routines Winspool.c Implements the spooler supported APIs for printing Xcv.c Interface for calling print spooler's XcvData (transceive data) functions. This is the means by which a port monitor UI DLL communicates with its associated port monitor server DLL.

Top of page

© 1999 Microsoft Corporation