Develop a Windows NT Internet Service

Access information about Internet users or sites with Finger.

Edward B. Toupin

May 31, 1997

3 Min Read
ITPro Today logo


Learn how an Internet protocol, such as Finger, can run as a Windows NT service

Millions of users access the Internet through systems running Windows or Windows NT. When youuse NT to access Internet services such as Finger, Gopher, or Archie, you ordinarily start themindividually at the command line (i.e., outside NT). Instead of starting these programsindividually, try running them as NT services so that you can access them from within NT wheneveryou want.

In this article, I explain Finger (an Internet service that lets you query forinformation about Internet users or sites) and an NT Finger service I developed. In a longer versionof this article, available on the Web at http://www.winntmag.com, I explain in detail how the NTFinger service works and provide the code for it.

What Is Finger?
Finger is a daemon that lets Internet users (Finger clients) query a Finger server forinformation about other Internet users or sites and returns responses to queries. With Finger, youcan find out a user's (account owner's) full name, the last time that user logged on, and whichusers are currently logged on. A Finger operation can also return a plan, or finger, file--a textfile that contains detailed information about an account owner, such as the user's degree, officehours (for a professor), resumés, or even Pretty Good Privacy (PGP) keys for digitalsignatures.

How to Finger an Account
Many operating systems, including NT, provide a small application that lets you Finger forremote users from the operating system's prompt. To use Finger with NT, from the command prompt, yousimply enter

finger accountname

to resolve a remote address and query the remote host for the specified user.

Screen 1 shows an example of using Finger with a remote UNIX host. In Screen 1, I firstaccessed a remote UNIX host via Telnet. Then at the prompt, I entered finger

[email protected]

to query a Finger daemon in the csn.net domain (Colorado Supernet Internet ServiceProvider--ISP) for user etoupin. The Finger client waits until it receives a response or a timeoutoccurs, and displays the returned information as shown.

The NT Finger Service: How It Works
The NT Finger service is a standard, event-driven service that resides in the Service ControlManager (SCM) database. You control this service through the SCM. This service monitors the FingerTCP port (79) for requests and is transparent to the user of the system on which it resides.

A Finger service must have access to a database of users and user information. From thisdatabase, the Finger service formats and submits information to remote requesting client systems.The NT Finger service obtains this information from the Security Accounts Manager (SAM) database.

The Finger service provides a simple executable module that the SCM manages. At NT startuptime, when SCM starts the Finger service, the service creates a socket and then awaits incomingconnect requests from remote clients.

The NT Finger Service: Take It from Here
Finger is an easy protocol to implement as a service. You can take the service code, enhance it,extend the protocol's functionality, or even create a new service to support another Internetprotocol.

Note that many other Internet protocols--such as Simple Mail Transfer Protocol (SMTP), PostOffice Protocol (POP), HTTP, and FTP--are more complex than Finger. Thus, NT services for theseprotocols require you to write additional code, such as worker threads, or use the Visual C++ (VC++)C Thread class to handle simultaneous requests and concurrent operations as the protocol requires.The online Finger service code is a basic template that you can use for many other Internet protocolservices.

For a more detailed explanation and complete code, visit http://www.winntmag.com.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like