Code sample that shows how to filter IOCTLs that retrieve ATRs from a smart card reader driver by using the Windows 7 WDK

Article translations Article translations
Article ID: 981665 - View products that this article applies to.
Expand all | Collapse all

On This Page

INTRODUCTION

This code sample shows how to filter smart card reader Input/Output Controls (IOCTL) that retrieve the answer to reset (ATR) from a smart card reader driver by using the Windows 7 Windows Development Kit (WDK). This sample can be used to make sure that the warm reset ATR matches the cold reset ATR so that the warm reset ATR is in compliance with the WinSCard discovery mechanism in the following Smart Card Minidriver Specification:
http://www.microsoft.com/whdc/device/input/smartcard/sc-minidriver.mspx

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:


Collapse this imageExpand this image
Download
Download the AtrFilter.exe package now.

Release Date: March 3, 2010

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

The AtrFilter.exe self-extracting file contains the following files.
Collapse this tableExpand this table
DescriptionFiles
Source and Header filesatrfilter.c, atrfilter.h, atrfilter.rc
Build filessources, makefile, makefile.inc
INF filesatrfilter.inx
Readme filesReadme.txt
Microsoft Software License TermsLicense.txt, License.rtf

Build the code sample

  1. Download and run AtrFilter.exe to extract the files.
  2. Select the desired build environment from the Windows 7 WDK. The build environment can be free, or you can specify a 32-bit or 64-bit environment.
  3. Run the build from the directory to which you extracted the files in step 1.
Note This filter is based on Kernel Mode Driver Framework (KMDF). You must include the KMDF co-installer in your driver setup package.

Install the code sample

Note This code sample was tested only on Windows 7.

Note A valid digital signature may be required to load this sample filter driver.
For more information about how to create an installation application that adds this service as an upper filter for all smart card readers, read the MSDN article, "Installing a Filter Driver." To do this, visit the following Web site:
http://msdn.microsoft.com/en-us/library/ms791322.aspx
To manually add the driver service, you can run a command from an elevated command prompt. To do this, follow these steps:
  1. Click Start
    Collapse this imageExpand this image
    start button
    , and then type cmd in the Search programs and files box.
  2. Right-click cmd.exe in the Programs list, and then click Run as administrator.
    Collapse this imageExpand this image
    UAC
    If you are prompted for an administrator password or for confirmation, type the password, or provide confirmation.
  3. At the command prompt, copy or type the following command, and then press ENTER:
    sc create atrfiltr binPath= system32\drivers\atrfiltr.sys type= kernel start= demand error= normal
  4. Click Start, click Run, type regedit, and then click OK.
    Collapse this imageExpand this image
    UAC
    If you are prompted for an administrator password or for confirmation, type the password, or provide confirmation.
  5. Locate and then click the following key in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{50DD5230-BA8A-11D1-BF5D-0000F805F530}\UpperFilters
  6. On the Edit menu, click Modify.
  7. Add atrfiltr to the existing list of upper filters, and then press ENTER.
  8. Exit Registry Editor.

Properties

Article ID: 981665 - Last Review: March 16, 2010 - Revision: 1.0
APPLIES TO
  • Windows 7 Enterprise
  • Windows 7 Professional
Keywords: 
kbcodesnippet atdownload kbexpertiseadvanced kbsurveynew kbinfo KB981665

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com