Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Beginning of my virtual smart card reader driver development Win 10.

minhptaminhpta Member Posts: 8
edited October 10 in NTDEV

Hello guys,
I've just started developing Window driver and my first task is develop a virtual smart card reader driver.
I've read several related threads including

But I still not get my virtual reader visible to user applications.
I've tried to built and install an smart card reader driver sample is Windows-driver-samples/smartcrd to my target Windows 10 host but the OS cannot load it like bellow picture.

I've tried to create a new KDMF project and use the same source code from the sample(because I think the sample project's configuration is out of date) but the problem is same.
I think the driver depend on smart card library(smclib.sys), and may be it is the cause of the OS cannot load the driver.

I know in this forum many of you guys can make your own smart card reader driver work.
Can you help me find out the issue here or give me a sample source code of virtual smart card reader driver that is able to run on Windows 10.

My IDE: Visual Studio 2019
My OS: Window 10 pro, 1903, build 18362.30

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,102

    smclib.sys is part of the operating system. It's always available.

    Are you running a 64-bit or a 32-bit system? Did you build the driver to match that? They must match.

    Did you sign your driver? How? If you self-signed, is your system in "test" mode?

    How, exactly, did you install your driver? I'm guessing you don't actually have a PCMCIA SCM-488C card reader. Did you change the INF to make it virtual?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • minhptaminhpta Member Posts: 8
    edited October 11

    Are you running a 64-bit or a 32-bit system? Did you build the driver to match that? They must match.

    My target system is Window 10 pro, 1903, build 18362.30, 64 bit system. And my Window Driver Kit is 10.0.18362.1, it is match with os version 1903.
    I got it from https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk.
    I have also installed some other sample driver successfully. So, I think this is not a cause of problem.

    Did you sign your driver? How? If you self-signed, is your system in "test" mode?

    My target system is in test mode and I've installed the driver via deploy feature of Visual Studio or use 'devcon install ...' but the phenomenon is the same.

    How, exactly, did you install your driver? I'm guessing you don't actually have a PCMCIA SCM-488C card reader. Did you change the INF to make it virtual?

    For manual install, I used 'devcon install pscr.inf PCMCIA\PSCR-Smart_Card_Reader-488C'.
    Yes, I don't have PCMCIA SCM-488C card reader. I also don't know that I need to change INF to make my driver virtual.

    Post edited by minhpta on
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,102

    And my Window Driver Kit is 10.0.18362.1, it is match with os version 1903.

    That's not what I asked. It doesn't matter whether your WDK version matches your Windows version. What I asked is if you built your driver as 64-bit. It's common error to build a 32-bit driver and try to install it on a 64-bit system.

    For manual install, I used 'devcon install pscr.inf PCMCIA\PSCR-Smart_Card_Reader-488C'.

    What led you to do that? You shouldn't be installing drivers without understanding what's going on. What that does is create a FAKE device called PCMCIA\PSCR-Smart_Card_Reader-488C, and loads your driver for that fake device. The problem is that your fake device will not be connected to any hardware, so you won't get any PCMCIA resources, which that driver expects. You need to do some work in that sample to turn it into a virtual driver with no hardware connection, and you need to change the INF file to create a hardware ID that doesn't look like a real device.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • minhptaminhpta Member Posts: 8
    edited October 11

    @Tim_Roberts said:

    And my Window Driver Kit is 10.0.18362.1, it is match with os version 1903.

    That's not what I asked. It doesn't matter whether your WDK version matches your Windows version. What I asked is if you built your driver as 64-bit. It's common error to build a 32-bit driver and try to install it on a 64-bit system.

    Yes, I missed that in my descriptions but I just want to describe my situation in details and my system and my driver are the same 64-bit platform.

    I am trying to make a new driver, write the code line by line and now my virtual smart card reader can be loaded and my driver's routines can be traveled by the system.
    I think, it is good starting point to do further steps.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,102

    Yes, I agree, but you have to do some work in that sample first. You have to remove everything that talks to hardware, and you need to change the INF file to use a hardware ID that doesn't mimic an actual hardware bus. You could use a hardware ID like SW/virtual-smart-card, or even use a GUID like SW/{12345678-1234-1234...}.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE