Windows 2000 Smart Card PnP Driver Installation
This article explains how Microsoft Windows 2000 manages the
installation of smart card reader drivers through its Plug and Play
(PnP) architecture. It details the interaction between the PnP
subsystem, INF setup files, the Smart Card Driver Library
(smclib.sys), and the Smart Card Resource Manager
(SCardSvr) to enable seamless device detection and
communication.
The Role of Plug and Play in Windows 2000
Windows 2000 relies on its unified Plug and Play manager and the Windows Driver Model (WDM) to identify and configure smart card readers. When a smart card reader is connected via a supported interface—such as USB, PCMCIA, or a serial COM port—the corresponding bus driver detects the new hardware and extracts its device identification strings, including Hardware IDs and Compatible IDs.
The Driver Matching and Installation Process
Once the bus enumerator reports the device IDs to the PnP manager, the installation process follows these steps:
- INF Matching: The PnP manager searches the
%SystemRoot%\Infdirectory for an INF file containing a matching Hardware ID. Smart card reader drivers belong to theSmartCardReadersetup class, defined by the Class GUID{50DD5230-BA8A-11D1-BF5D-0000F805F530}. - Driver Staging: If a matching certified driver is
present in the driver cache (
Driver.cab) or pre-installed INF repository, Windows 2000 installs the driver silently. If no match is found, the Found New Hardware Wizard prompts the user for vendor-supplied media. - Driver Loading: The system loads the
vendor-supplied reader-specific driver along with the system-supplied
Smart Card Driver Library,
smclib.sys.
Driver Architecture: Miniport and Library Integration
Smart card reader drivers in Windows 2000 follow a split architecture to simplify driver development:
- Smart Card Driver Library
(
smclib.sys): Developed by Microsoft, this library handles standard PC/SC (Personal Computer/Smart Card) protocol conversions, manages I/O request packets (IRPs) from upper-layer services, and handles generic buffering and validation. - Reader Driver (Vendor Function Driver): The vendor
only writes a lightweight driver that implements hardware-specific
communication routines (e.g., transmitting raw bytes across the physical
bus). The vendor driver registers callbacks with
smclib.sys.
When the driver stack initializes, smclib.sys exposes
the standard device interface for smart card readers so user-mode
subsystems can discover the peripheral.
Integration with the Smart Card Resource Manager
Driver installation alone does not allow applications to communicate with a card. Windows 2000 completes the integration through the Smart Card Subsystem:
- Interface Notification: Upon successful driver
initialization, the driver registers its device interface using
IoRegisterDeviceInterfacewith theGUID_DEVINTERFACE_SMARTCARD_READERclass. - Service Notification: The Smart Card Resource
Manager service (
SCardSvr, hosted insvchost.exe) monitors PnP device interface events. When the reader appears,SCardSvrcreates a logical reader entry in its tracking table. - Registry Registration: The reader details are
registered under the system's "Calais" database in the Windows Registry
(
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\Readers).
Reader vs. Card Plug and Play
In Windows 2000, true PnP applies exclusively to the reader hardware, not the smart card itself. When a physical card is inserted into the reader:
- The reader driver detects the state change and signals an event to
smclib.sys. - The card's Answer to Reset (ATR) string is retrieved by the driver and sent to the Smart Card Resource Manager.
- The system matches the ATR against known card profiles stored under the Calais registry key to determine which cryptographic service provider (CSP) to use, rather than invoking the PnP subsystem to install a card-specific driver.